ARM: define bootloader stack in linker script

This removes the need for the whole HAIKU_BOARD_LOADER_STACK_BASE
sing and dance, since it is always included in the bootloader binary
itself.
This commit is contained in:
Ithamar R. Adema 2014-09-06 21:14:42 +02:00
parent 6fb65b9dfe
commit 0a163b65c7
9 changed files with 14 additions and 26 deletions

View File

@ -20,8 +20,6 @@ HAIKU_BOARD_LOADER_FAKE_OS = netbsd ;
# (must be different than real load address)
HAIKU_BOARD_LOADER_UIBASE = 0x82800000 ;
HAIKU_BOARD_LOADER_STACK_BASE = 0x81a00000 ;
#
# Flash image
#
@ -64,7 +62,6 @@ HAIKU_BOARD_SDIMAGE_FILES =
# gcc flags for the specific cpu
local flags = -mcpu=cortex-a8 -mfpu=vfpv3 -mfloat-abi=hard
-DHAIKU_BOARD_LOADER_STACK_BASE=$(HAIKU_BOARD_LOADER_STACK_BASE)
-DHAIKU_BOARD_LOADER_UIBASE=$(HAIKU_BOARD_LOADER_UIBASE) ;
HAIKU_ASFLAGS_$(HAIKU_PACKAGING_ARCH) += $(flags) ;

View File

@ -19,8 +19,6 @@ HAIKU_BOARD_LOADER_FAKE_OS = netbsd ;
# (must be different than real load address)
HAIKU_BOARD_LOADER_UIBASE = 0x34000000 ;
HAIKU_BOARD_LOADER_STACK_BASE = 0x34000000 ;
#
# Flash image
#

View File

@ -20,9 +20,6 @@ HAIKU_BOARD_LOADER_FAKE_OS = netbsd ;
# (must be different than real load address)
HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ;
HAIKU_BOARD_LOADER_STACK_BASE = 0x84000000 ;
#
# mmc/SD image
#

View File

@ -24,8 +24,6 @@ HAIKU_BOARD_LOADER_FAKE_OS = linux ;
# (must be different than real load address)
HAIKU_BOARD_LOADER_UIBASE = 0x02000000 ;
HAIKU_BOARD_LOADER_STACK_BASE = 0x02000000 ;
#
# gcc flags for the specific cpu
#

View File

@ -19,8 +19,6 @@ HAIKU_BOARD_LOADER_FAKE_OS = netbsd ;
# (must be different than real load address)
HAIKU_BOARD_LOADER_UIBASE = 0xa4000000 ;
HAIKU_BOARD_LOADER_STACK_BASE = 0xa4000000 ;
#
# Flash image
#

View File

@ -110,12 +110,6 @@ static struct memblock LOADER_MEMORYMAP[] = {
kLoaderBaseAddress + 0x11FFFFF,
ARM_MMU_L2_FLAG_C,
},
{
"RAM_stack", // stack
HAIKU_BOARD_LOADER_STACK_BASE,
HAIKU_BOARD_LOADER_STACK_BASE + 0xe00000,
ARM_MMU_L2_FLAG_C,
},
{
"RAM_initrd", // initrd
HAIKU_BOARD_LOADER_UIBASE,

View File

@ -2,8 +2,6 @@
#include <asm_defs.h>
#include <board_config.h>
.text
/*
@ -59,10 +57,7 @@ SYMBOL(_start_common):
mov r4, r4
mov r4, r4
ldr sp,=SDRAM_BASE + KSTACK_TOP
ldr sp,=__stack_top
ldrb r4,gUBootOS
cmp r4,#0
beq start_raw
@ -75,6 +70,7 @@ SYMBOL_END(_start_common)
//XXX: doesn't seem to work
//.data
.global __stack_end, __stack_start
SYMBOL(gUBootGlobalData):
.long 0

View File

@ -50,7 +50,7 @@ typedef struct uboot_gd {
// GCC defined globals
extern void (*__ctor_list)(void);
extern void (*__ctor_end)(void);
extern uint8 __bss_start;
extern uint8 __bss_start, __bss_end;
extern uint8 _end;
extern "C" int main(stage2_args *args);
@ -72,7 +72,7 @@ static uint32 sBootOptions;
static void
clear_bss(void)
{
memset(&__bss_start, 0, &_end - &__bss_start);
memset(&__bss_start, 0, &__bss_end - &__bss_start);
}

View File

@ -1,6 +1,8 @@
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
STACK_SIZE = 16384;
ENTRY(_start)
SECTIONS
{
@ -29,6 +31,14 @@ SECTIONS
/* uninitialized data (in same segment as writable data) */
__bss_start = .;
.bss : { *(.bss) }
__bss_end = .;
.stack : {
__stack_start = .;
. += STACK_SIZE;
. = ALIGN(0x8);
__stack_top = .;
}
. = ALIGN(0x1000);
_end = . ;