All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Adding is_console_quiet() to support runtime changes in console output
@ 2003-10-15  0:27 Jon Diekema
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Diekema @ 2003-10-15  0:27 UTC (permalink / raw)
  To: u-boot


Product:
 
- u-boot
 
Version:
 
- 1.0.0-pre
 
CHANGELOG:
 
- Adding is_console_quiet() to support runtime changes in console output
 
CVS Comments:
 
- Adding the CFG_CONSOLE_IS_QUIET option to support runtime changes in
  console output.  The is_console_quiet() function is used to
  determine the status of quiet mode.  Quiet mode is based on the
  value of the "quiet" environment variable.  Non-zero values indicate
  that quiet mode is active.
 
Patched files:
 
- README
- include/console.h
- common/console.c
- common/cmd_nvedit.c

-- 
------------------\\----------------------\\----------------------------
Jon Diekema        |                       | Smiths Aerospace
(616) 241-8310     |                       | 3290 Patterson Avenue, SE
 jon.diekema at smiths-aerospace.com          \\  Grand Rapids, MI 49512

******************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
******************************************
-------------- next part --------------
Product:

- u-boot

Version:

- 1.0.0-pre

CHANGELOG:

- Adding is_console_quiet() to support runtime changes in console output

CVS Comments:

- Adding the CFG_CONSOLE_IS_QUIET option to support runtime changes in
  console output.  The is_console_quiet() function is used to
  determine the status of quiet mode.  Quiet mode is based on the
  value of the "quiet" environment variable.  Non-zero values indicate
  that quiet mode is active.

Patched files:

- README
- include/console.h
- common/console.c
- common/cmd_nvedit.c


--- README    2003-10-14 20:13:16.000000000 -0400
+++ README    2003-10-14 20:17:08.000000000 -0400
@@ -1765,6 +1765,13 @@ use the "saveenv" command to store a val
 - CFG_FAULT_MII_ADDR:
                MII address of the PHY to check for the Ethernet link state.
  
+- CFG_CONSOLE_IS_QUIET:
+               To support runtime changes in console output,
+               is_console_quiet() is used to determine the status of
+               quiet mode.  Quiet mode is based on the value of the
+               "quiet" environment variable.  Non-zero values
+               indicate that quiet mode is active.
+
 Low Level (hardware related) configuration options:
 ---------------------------------------------------
  

--- include/console.h       2000-11-12 18:38:42.000000000 -0500
+++ include/console.h    2003-09-19 07:11:59.000000000 -0400
@@ -33,6 +33,16 @@
 extern device_t        *stdio_devices[] ;
 extern char *stdio_names[MAX_FILES] ;
                                                                                                                           
+/*
+** ROUTINES
+*/
+
 int console_realloc(int top);
                                                                                                                           
-#endif
+#ifdef CFG_CONSOLE_IS_QUIET
+
+extern void updated_quiet_in_env(int quiet);
+extern int  is_console_quiet(void);
+
+#endif /* CFG_CONSOLE_IS_QUIET */
+#endif /* _CONSOLE_H_ */


--- common/console.c	2003-10-14 07:12:10.000000000 -0400
+++ common/console.c	2003-10-14 07:10:41.000000000 -0400
@@ -573,3 +573,52 @@ int console_init_r (void)
 }
 
 #endif /* CFG_CONSOLE_IS_IN_ENV */
+
+#ifdef CFG_CONSOLE_IS_QUIET
+
+#define QUIET_LEVEL_OFF 1
+#define QUIET_LEVEL_ON  2
+
+static int quiet_level = 0;
+
+void updated_quiet_in_env(int quiet)
+
+{
+    if (quiet) {
+        quiet_level = QUIET_LEVEL_ON;
+    }
+    else {
+        quiet_level = QUIET_LEVEL_OFF;
+    }
+}
+
+int is_console_quiet(void)
+
+{
+    int  quiet;        /* Quiet or minimal output mode */
+    char *ep;          /* Environment pointer */
+
+    if ((quiet_level != QUIET_LEVEL_OFF) && (quiet_level != QUIET_LEVEL_ON)) {
+        /*
+	 * The quiet_level isn't defined yet.  Read the quiet environment
+	 * variable to determine what is should be set to.
+	 */
+        quiet = 0;
+	if ((ep = getenv("quiet")) != NULL) {
+	    quiet = simple_strtol(ep, NULL, 10);
+	}
+	else {
+	    setenv("quiet", "0");
+	}
+	updated_quiet_in_env(quiet);
+    }
+
+    if (quiet_level == QUIET_LEVEL_ON) {
+        return (1);
+    }
+    else {
+        return (0);
+    }
+}
+
+#endif /* CFG_CONSOLE_IS_QUIET */


--- common/cmd_nvedit.c	2003-07-11 04:03:18.000000000 -0400
+++ common/cmd_nvedit.c	2003-09-19 07:14:45.000000000 -0400
@@ -48,6 +48,7 @@
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 #include <net.h>
 #endif
+#include <console.h>
 
 #if !defined(CFG_ENV_IS_IN_NVRAM) && !defined(CFG_ENV_IS_IN_EEPROM) && !defined(CFG_ENV_IS_IN_FLASH) && !defined(CFG_ENV_IS_NOWHERE)
 # error Define one of CFG_ENV_IS_IN_NVRAM, CFG_ENV_IS_IN_EEPROM, CFG_ENV_IS_IN_FLASH, CFG_ENV_IS_NOWHERE
@@ -369,6 +370,13 @@ int _do_setenv (int flag, int argc, char
 	}
 #endif	/* CONFIG_AMIGAONEG3SE */
 
+#ifdef CFG_CONSOLE_IS_QUIET
+	if (strcmp(argv[1], "quiet") == 0 ) {
+	        updated_quiet_in_env(simple_strtoul(argv[2], NULL, 16));
+		return 0;
+	}
+#endif /* CFG_CONSOLE_IS_QUIET */
+
 	return 0;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Adding is_console_quiet() to support runtime changes in console output
  2004-02-24 22:49 Jon Diekema
@ 2004-02-24 23:03 ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2004-02-24 23:03 UTC (permalink / raw)
  To: u-boot

In message <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAlCKSiL+GB0uT9xr++jxiXsKAAAAQAAAAZcRP1LMsb0WNgS8FwBxRrQEAAAAA@cideas.com> you wrote:
> 
> * Patch by Jon Diekema, 24 Jeb 2004:
>   - Adding is_console_quiet() to support runtime changes in console output
> 
> CVS Comments:
> 
> - Adding the CFG_CONSOLE_IS_QUIET option to support runtime changes in
>   console output.  The is_console_quiet() function is used to
>   determine the status of quiet mode.  Quiet mode is based on the
>   value of the "quiet" environment variable.  Non-zero values indicate
>   that quiet mode is active.

Can you please explain what you are actually trying to do? From  your
description  it  sounds as if a simple "if (getenv("quiet") != 0)" is
all what's needed, but your code looks muchm ore complicated,  and  I
cannot  make  head or tails of it. What is all this "quiet_level" and
QUIET_LEVEL_* stuff?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Marriage is the sole cause of divorce.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] Adding is_console_quiet() to support runtime changes in console output
@ 2004-02-24 22:49 Jon Diekema
  2004-02-24 23:03 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Diekema @ 2004-02-24 22:49 UTC (permalink / raw)
  To: u-boot

Product:

- u-boot

Version:

- 1.0.2

CHANGELOG:

* Patch by Jon Diekema, 24 Jeb 2004:
  - Adding is_console_quiet() to support runtime changes in console output

CVS Comments:

- Adding the CFG_CONSOLE_IS_QUIET option to support runtime changes in
  console output.  The is_console_quiet() function is used to
  determine the status of quiet mode.  Quiet mode is based on the
  value of the "quiet" environment variable.  Non-zero values indicate
  that quiet mode is active.

Patched files:

- README
- include/console.h
- common/console.c
- common/cmd_nvedit.c
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p12.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20040224/2be19c59/attachment.txt 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-24 23:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15  0:27 [U-Boot-Users] Adding is_console_quiet() to support runtime changes in console output Jon Diekema
2004-02-24 22:49 Jon Diekema
2004-02-24 23:03 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.