From cdb749778aa3a8f8d2a41dd4ad811ef822aecfe6 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sat, 24 Jul 2010 21:55:43 +0200 Subject: Rename getenv_r() into getenv_f() While running from flash, i. e. before relocation, we have only a limited C runtime environment without writable data segment. In this phase, some configurations (for example with environment in EEPROM) must not use the normal getenv(), but a special function. This function had been called getenv_r(), with the idea that the "_r" suffix would mean the same as in the _r_eentrant versions of some of the C library functions (for example getdate vs. getdate_r, getgrent vs. getgrent_r, etc.). Unfortunately this was a misleading name, as in U-Boot the "_r" generally means "running from RAM", i. e. _after_ relocation. To avoid confusion, rename into getenv_f() [as "running from flash"] Signed-off-by: Wolfgang Denk Acked-by: Detlev Zundel --- arch/arm/lib/board.c | 2 +- arch/avr32/lib/board.c | 2 +- arch/blackfin/lib/board.c | 2 +- arch/blackfin/lib/post.c | 2 +- arch/i386/lib/board.c | 2 +- arch/m68k/lib/board.c | 6 +++--- arch/mips/cpu/incaip_clock.c | 2 +- arch/mips/lib/board.c | 2 +- arch/powerpc/cpu/mpc8xx/speed.c | 2 +- arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c | 2 +- arch/powerpc/lib/board.c | 6 +++--- arch/sparc/lib/board.c | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) (limited to 'arch') diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index f5660a9..54519b0 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -125,7 +125,7 @@ void blue_LED_off(void) __attribute__((weak, alias("__blue_LED_off"))); static int init_baudrate (void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r ("baudrate", tmp, sizeof (tmp)); + int i = getenv_f("baudrate", tmp, sizeof (tmp)); gd->bd->bi_baudrate = gd->baudrate = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) : CONFIG_BAUDRATE; diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 254aecf..9e741d2 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -102,7 +102,7 @@ static int init_baudrate(void) char tmp[64]; int i; - i = getenv_r("baudrate", tmp, sizeof(tmp)); + i = getenv_f("baudrate", tmp, sizeof(tmp)); if (i > 0) { gd->baudrate = simple_strtoul(tmp, NULL, 10); } else { diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c index 4e9bb19..2d3230c 100644 --- a/arch/blackfin/lib/board.c +++ b/arch/blackfin/lib/board.c @@ -64,7 +64,7 @@ static int display_banner(void) static int init_baudrate(void) { char baudrate[15]; - int i = getenv_r("baudrate", baudrate, sizeof(baudrate)); + int i = getenv_f("baudrate", baudrate, sizeof(baudrate)); gd->bd->bi_baudrate = gd->baudrate = (i > 0) ? simple_strtoul(baudrate, NULL, 10) : CONFIG_BAUDRATE; diff --git a/arch/blackfin/lib/post.c b/arch/blackfin/lib/post.c index faf6b96..bd6aaf5 100644 --- a/arch/blackfin/lib/post.c +++ b/arch/blackfin/lib/post.c @@ -168,7 +168,7 @@ static void post_get_flags(int *test_flags) } for (i = 0; i < varnum; i++) { - if (getenv_r(var[i], list, sizeof(list)) <= 0) + if (getenv_f(var[i], list, sizeof(list)) <= 0) continue; for (j = 0; j < post_list_size; j++) { diff --git a/arch/i386/lib/board.c b/arch/i386/lib/board.c index 0adc664..684cdb8 100644 --- a/arch/i386/lib/board.c +++ b/arch/i386/lib/board.c @@ -69,7 +69,7 @@ const char version_string[] = static int init_baudrate (void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r("baudrate", tmp, 64); + int i = getenv_f("baudrate", tmp, 64); gd->baudrate = (i != 0) ? (int) simple_strtoul (tmp, NULL, 10) diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index 732023d..b254079 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -134,7 +134,7 @@ typedef int (init_fnc_t) (void); static int init_baudrate (void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r ("baudrate", tmp, sizeof (tmp)); + int i = getenv_f("baudrate", tmp, sizeof (tmp)); gd->baudrate = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) @@ -278,7 +278,7 @@ board_init_f (ulong bootflag) /* * reserve protected RAM */ - i = getenv_r ("pram", tmp, sizeof (tmp)); + i = getenv_f("pram", tmp, sizeof (tmp)); reg = (i > 0) ? simple_strtoul (tmp, NULL, 10) : CONFIG_PRAM; addr -= (reg << 10); /* size is in kB */ debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr); @@ -549,7 +549,7 @@ void board_init_r (gd_t *id, ulong dest_addr) * Fill in missing fields of bd_info. * We do this here, where we have "normal" access to the * environment; we used to do this still running from ROM, - * where had to use getenv_r(), which can be pretty slow when + * where had to use getenv_f(), which can be pretty slow when * the environment is in EEPROM. */ bd->bi_ip_addr = getenv_IPaddr ("ipaddr"); diff --git a/arch/mips/cpu/incaip_clock.c b/arch/mips/cpu/incaip_clock.c index fc2c621..b65dfe0 100644 --- a/arch/mips/cpu/incaip_clock.c +++ b/arch/mips/cpu/incaip_clock.c @@ -105,7 +105,7 @@ int incaip_set_cpuclk (void) char tmp[64]; ulong cpuclk; - if (getenv_r ("cpuclk", tmp, sizeof (tmp)) > 0) { + if (getenv_f("cpuclk", tmp, sizeof (tmp)) > 0) { cpuclk = simple_strtoul (tmp, NULL, 10) * 1000000; cgu_init (cpuclk); ebu_init (cpuclk); diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index b2d113e..ab4a17c 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -114,7 +114,7 @@ static void display_flash_config(ulong size) static int init_baudrate (void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r ("baudrate", tmp, sizeof (tmp)); + int i = getenv_f("baudrate", tmp, sizeof (tmp)); gd->baudrate = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c index f309f29..6e13e5d 100644 --- a/arch/powerpc/cpu/mpc8xx/speed.c +++ b/arch/powerpc/cpu/mpc8xx/speed.c @@ -266,7 +266,7 @@ int get_clocks_866 (void) long cpuclk = 0; long sccr_reg; - if (getenv_r ("cpuclk", tmp, sizeof (tmp)) > 0) + if (getenv_f("cpuclk", tmp, sizeof (tmp)) > 0) cpuclk = simple_strtoul (tmp, NULL, 10) * 1000000; if ((CONFIG_SYS_8xx_CPUCLK_MIN > cpuclk) || (CONFIG_SYS_8xx_CPUCLK_MAX < cpuclk)) diff --git a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c index 2fee995..2cfc37f 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c @@ -985,7 +985,7 @@ u32 DQS_autocalibration(void) puts(str); #if defined(DEBUG_PPC4xx_DDR_AUTOCALIBRATION) - i = getenv_r("autocalib", tmp, sizeof(tmp)); + i = getenv_f("autocalib", tmp, sizeof(tmp)); if (i < 0) strcpy(tmp, CONFIG_AUTOCALIB); diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 7b09fb5..0e00d86 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -169,7 +169,7 @@ typedef int (init_fnc_t) (void); static int init_baudrate (void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r ("baudrate", tmp, sizeof (tmp)); + int i = getenv_f("baudrate", tmp, sizeof (tmp)); gd->baudrate = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) @@ -442,7 +442,7 @@ void board_init_f (ulong bootflag) /* * reserve protected RAM */ - i = getenv_r ("pram", (char *)tmp, sizeof (tmp)); + i = getenv_f("pram", (char *)tmp, sizeof (tmp)); reg = (i > 0) ? simple_strtoul ((const char *)tmp, NULL, 10) : CONFIG_PRAM; addr -= (reg << 10); /* size is in kB */ debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr); @@ -790,7 +790,7 @@ void board_init_r (gd_t *id, ulong dest_addr) * Fill in missing fields of bd_info. * We do this here, where we have "normal" access to the * environment; we used to do this still running from ROM, - * where had to use getenv_r(), which can be pretty slow when + * where had to use getenv_f(), which can be pretty slow when * the environment is in EEPROM. */ diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c index b776c21..4f69709 100644 --- a/arch/sparc/lib/board.c +++ b/arch/sparc/lib/board.c @@ -88,7 +88,7 @@ ulong monitor_flash_len; static int init_baudrate(void) { char tmp[64]; /* long enough for environment variables */ - int i = getenv_r("baudrate", tmp, sizeof(tmp)); + int i = getenv_f("baudrate", tmp, sizeof(tmp)); gd->baudrate = (i > 0) ? (int)simple_strtoul(tmp, NULL, 10) -- cgit v1.1