From 25ddd1fb0a2281b182529afbc8fda5de2dc16d96 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 26 Oct 2010 14:34:52 +0200 Subject: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value CONFIG_SYS_GBL_DATA_SIZE has always been just a bad workarond for not being able to use "sizeof(struct global_data)" in assembler files. Recent experience has shown that manual synchronization is not reliable enough. This patch renames CONFIG_SYS_GBL_DATA_SIZE into GENERATED_GBL_DATA_SIZE which gets automatically generated by the asm-offsets tool. In the result, all definitions of this value can be deleted from the board config files. We have to make sure that all files that reference such data include the new file. No other changes have been done yet, but it is obvious that similar changes / simplifications can be done for other, related macro definitions as well. Signed-off-by: Wolfgang Denk Acked-by: Kumar Gala --- arch/sh/cpu/sh2/start.S | 5 +++-- arch/sh/cpu/sh3/start.S | 5 +++-- arch/sh/cpu/sh4/start.S | 5 +++-- arch/sh/lib/board.c | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'arch/sh') diff --git a/arch/sh/cpu/sh2/start.S b/arch/sh/cpu/sh2/start.S index 0ab867d54d..77043f686a 100644 --- a/arch/sh/cpu/sh2/start.S +++ b/arch/sh/cpu/sh2/start.S @@ -18,6 +18,7 @@ * MA 02111-1307 USA */ +#include #include #include @@ -73,6 +74,6 @@ loop: ._reloc_dst_end: .long reloc_dst_end ._bss_start: .long bss_start ._bss_end: .long bss_end -._gd_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE) -._stack_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) +._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE) +._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) ._sh_generic_init: .long sh_generic_init diff --git a/arch/sh/cpu/sh3/start.S b/arch/sh/cpu/sh3/start.S index c0f83261d1..9dd2303265 100644 --- a/arch/sh/cpu/sh3/start.S +++ b/arch/sh/cpu/sh3/start.S @@ -21,6 +21,7 @@ * MA 02111-1307 USA */ +#include #include #include @@ -72,6 +73,6 @@ loop: ._reloc_dst_end: .long reloc_dst_end ._bss_start: .long bss_start ._bss_end: .long bss_end -._gd_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE) -._stack_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) +._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE) +._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) ._sh_generic_init: .long sh_generic_init diff --git a/arch/sh/cpu/sh4/start.S b/arch/sh/cpu/sh4/start.S index 711ae668d5..4b5f606fff 100644 --- a/arch/sh/cpu/sh4/start.S +++ b/arch/sh/cpu/sh4/start.S @@ -18,6 +18,7 @@ * MA 02111-1307 USA */ +#include #include #include @@ -69,6 +70,6 @@ loop: ._reloc_dst_end: .long reloc_dst_end ._bss_start: .long bss_start ._bss_end: .long bss_end -._gd_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE) -._stack_init: .long (_start - CONFIG_SYS_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) +._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE) +._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) ._sh_generic_init: .long sh_generic_init diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index a302fc2e65..fe53ab4de9 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -89,7 +89,7 @@ static int sh_pci_init(void) static int sh_mem_env_init(void) { - mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_GBL_DATA_SIZE - + mem_malloc_init(CONFIG_SYS_TEXT_BASE - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN, CONFIG_SYS_MALLOC_LEN - 16); env_relocate(); jumptable_init(); @@ -144,7 +144,7 @@ void sh_generic_init(void) bd_t *bd; init_fnc_t **init_fnc_ptr; - memset(gd, 0, CONFIG_SYS_GBL_DATA_SIZE); + memset(gd, 0, GENERATED_GBL_DATA_SIZE); gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ -- cgit v1.2.1