aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2009-02-10 09:38:52 +0100
committerBen Warren <biggerbadderben@gmail.com>2009-02-22 23:49:33 -0800
commit2f70c49e5b9813635ad73666aa30f304c7fdeda9 (patch)
tree57b6d6625de2648dab93e71cf74a7329c81c6adc /common
parentad2d16393e9f684e4a9255f42e8bfdd819b67a87 (diff)
netloop: speed up NetLoop
NetLoop polls every cycle with getenv some environment variables. This is horribly slow, especially when the environment is big. This patch reads only the environment variables in NetLoop, when they were changed. Also moved the init part of the NetLoop function in a seperate function. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_nvedit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 02b18ec32..68c673e7c 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -75,7 +75,12 @@ DECLARE_GLOBAL_DATA_PTR;
static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
#define N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
+static int env_id = 1;
+int get_env_id (void)
+{
+ return env_id;
+}
/************************************************************************
* Command interface: print one or all environment variables
*/
@@ -160,6 +165,7 @@ int _do_setenv (int flag, int argc, char *argv[])
return 1;
}
+ env_id++;
/*
* search if variable with this name already exists
*/