mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:

committed by
Ben Warren

parent
ad2d16393e
commit
2f70c49e5b
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user