diff --git a/build/jam/board/beagle/BoardSetup b/build/jam/board/beagle/BoardSetup index c4fe60536a..27eeea7bf2 100644 --- a/build/jam/board/beagle/BoardSetup +++ b/build/jam/board/beagle/BoardSetup @@ -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) ; diff --git a/build/jam/board/neo_freerunner/BoardSetup b/build/jam/board/neo_freerunner/BoardSetup index 918cf53d7c..f1f92ac696 100644 --- a/build/jam/board/neo_freerunner/BoardSetup +++ b/build/jam/board/neo_freerunner/BoardSetup @@ -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 # diff --git a/build/jam/board/overo/BoardSetup b/build/jam/board/overo/BoardSetup index 5097afb56b..ae5b342469 100644 --- a/build/jam/board/overo/BoardSetup +++ b/build/jam/board/overo/BoardSetup @@ -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 # diff --git a/build/jam/board/sam460ex/BoardSetup b/build/jam/board/sam460ex/BoardSetup index 1ab1d3e3d8..81423453a8 100644 --- a/build/jam/board/sam460ex/BoardSetup +++ b/build/jam/board/sam460ex/BoardSetup @@ -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 # diff --git a/build/jam/board/verdex/BoardSetup b/build/jam/board/verdex/BoardSetup index 90269f9cd5..fb95faff6a 100644 --- a/build/jam/board/verdex/BoardSetup +++ b/build/jam/board/verdex/BoardSetup @@ -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 # diff --git a/src/system/boot/arch/arm/arch_mmu.cpp b/src/system/boot/arch/arm/arch_mmu.cpp index f44873e3cb..81c75de5bc 100644 --- a/src/system/boot/arch/arm/arch_mmu.cpp +++ b/src/system/boot/arch/arm/arch_mmu.cpp @@ -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, diff --git a/src/system/boot/platform/u-boot/arch/arm/shell.S b/src/system/boot/platform/u-boot/arch/arm/shell.S index ca945c9441..aad2a96a15 100644 --- a/src/system/boot/platform/u-boot/arch/arm/shell.S +++ b/src/system/boot/platform/u-boot/arch/arm/shell.S @@ -2,8 +2,6 @@ #include -#include - .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 diff --git a/src/system/boot/platform/u-boot/start.cpp b/src/system/boot/platform/u-boot/start.cpp index 0a2fb10597..d2e4203704 100644 --- a/src/system/boot/platform/u-boot/start.cpp +++ b/src/system/boot/platform/u-boot/start.cpp @@ -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); } diff --git a/src/system/ldscripts/arm/boot_loader_u-boot.ld b/src/system/ldscripts/arm/boot_loader_u-boot.ld index 055c104148..577ee75245 100644 --- a/src/system/ldscripts/arm/boot_loader_u-boot.ld +++ b/src/system/ldscripts/arm/boot_loader_u-boot.ld @@ -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 = . ;