From: Heiko Schocher Date: Fri, 17 Sep 2010 11:10:34 +0000 (+0200) Subject: common: move TOTAL_MALLOC_LEN to include/common.h X-Git-Tag: v2010.12-rc1~174^2~54 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3fbeeea63334f7a69406be7c05185f4bf45da8d8;p=karo-tx-uboot.git common: move TOTAL_MALLOC_LEN to include/common.h Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: Heiko Schocher --- diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c index acbdc58582..ae9478a11e 100644 --- a/arch/m68k/lib/board.c +++ b/arch/m68k/lib/board.c @@ -79,14 +79,6 @@ extern flash_info_t flash_info[]; #include -#if ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \ - (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \ - defined(CONFIG_ENV_IS_IN_NVRAM) -#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) -#else -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#endif - extern ulong __init_end; extern ulong _end; diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index 2f259cb5be..0044b19450 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -39,14 +39,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \ - (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \ - defined(CONFIG_ENV_IS_IN_NVRAM) -#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) -#else -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#endif - #undef DEBUG extern int timer_init(void); diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index 80c1efc311..94348e678e 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -118,16 +118,6 @@ extern int board_start_ide(void); DECLARE_GLOBAL_DATA_PTR; -#if defined(CONFIG_ENV_IS_EMBEDDED) -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \ - (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \ - defined(CONFIG_ENV_IS_IN_NVRAM) -#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) -#else -#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN -#endif - #if !defined(CONFIG_SYS_MEM_TOP_HIDE) #define CONFIG_SYS_MEM_TOP_HIDE 0 #endif diff --git a/include/common.h b/include/common.h index 7e647e64a7..cc966722ea 100644 --- a/include/common.h +++ b/include/common.h @@ -189,6 +189,15 @@ typedef void (interrupt_handler_t)(void *); #define MIN(x, y) min(x, y) #define MAX(x, y) max(x, y) +#if defined(CONFIG_ENV_IS_EMBEDDED) +#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN +#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \ + (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \ + defined(CONFIG_ENV_IS_IN_NVRAM) +#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) +#else +#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN +#endif /** * container_of - cast a member of a structure out to the containing structure