public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 02/31] environment, netconsole: reducing packages when printing environment variables
@ 2009-01-28  9:38 Heiko Schocher
  2009-01-28 10:05 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Schocher @ 2009-01-28  9:38 UTC (permalink / raw)
  To: u-boot

Actual, do_printenv () uses putc () to print the Environment-
variables. If using netconsole, this will result in a lot of
packages with single characters in it. With the new config
option CONFIG_ENV_BUFFER_PRINT do_printenv () uses now puts ()
to print a complete Environmentvariable, so the number of
packages when using netconsole are reduced.

Signed-off-by: Heiko Schocher <hs@denx.de>
---
 common/cmd_nvedit.c      |    8 ++++++++
 include/configs/mgcoge.h |    1 +
 include/configs/mgsuvd.h |    1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 85025da..8f6310a 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -89,8 +89,12 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		for (i=0; env_get_char(i) != '\0'; i=nxt+1) {
 			for (nxt=i; env_get_char(nxt) != '\0'; ++nxt)
 				;
+#if defined(CONFIG_ENV_BUFFER_PRINT)
+			puts ((char *)( env_get_addr(nxt) + 1));
+#else
 			for (k=i; k<nxt; ++k)
 				putc(env_get_char(k));
+#endif
 			putc  ('\n');

 			if (ctrlc()) {
@@ -118,11 +122,15 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			if (k < 0) {
 				continue;
 			}
+#if defined(CONFIG_ENV_BUFFER_PRINT)
+			printf ("%s=%s\n", name, (char *)( env_get_addr(k)));
+#else
 			puts (name);
 			putc ('=');
 			while (k < nxt)
 				putc(env_get_char(k++));
 			putc ('\n');
+#endif
 			break;
 		}
 		if (k < 0) {
diff --git a/include/configs/mgcoge.h b/include/configs/mgcoge.h
index 233bee0..9416a03 100644
--- a/include/configs/mgcoge.h
+++ b/include/configs/mgcoge.h
@@ -139,6 +139,7 @@
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE_REDUND		(CONFIG_ENV_SIZE)
 #endif /* CONFIG_ENV_IS_IN_FLASH */
+#define CONFIG_ENV_BUFFER_PRINT		1

 /* enable I2C and select the hardware/software driver */
 #undef	CONFIG_HARD_I2C			/* I2C with hardware support	*/
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 8f82751..698f0e7 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -143,6 +143,7 @@
 /* Address and size of Redundant Environment Sector	*/
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET+CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE_REDUND	(CONFIG_ENV_SIZE)
+#define CONFIG_ENV_BUFFER_PRINT		1

 /*-----------------------------------------------------------------------
  * Cache Configuration
-- 
1.6.0.6

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

end of thread, other threads:[~2009-01-28 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28  9:38 [U-Boot] [PATCH 02/31] environment, netconsole: reducing packages when printing environment variables Heiko Schocher
2009-01-28 10:05 ` Stefan Roese
2009-01-28 10:27   ` Heiko Schocher
2009-01-28 11:31     ` Wolfgang Denk
2009-01-28 11:56       ` Stefan Roese
2009-01-28 12:13         ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox