diff options
Diffstat (limited to 'bsps/sparc/shared')
-rw-r--r-- | bsps/sparc/shared/start/bspgetworkarea.c | 6 | ||||
-rw-r--r-- | bsps/sparc/shared/start/start.S | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/bsps/sparc/shared/start/bspgetworkarea.c b/bsps/sparc/shared/start/bspgetworkarea.c index b05113d9eb..512d223211 100644 --- a/bsps/sparc/shared/start/bspgetworkarea.c +++ b/bsps/sparc/shared/start/bspgetworkarea.c @@ -27,13 +27,9 @@ extern uint32_t rdb_start; */ void bsp_work_area_initialize(void) { - /* must be identical to STACK_SIZE in start.S */ - #define STACK_SIZE (16 * 1024) - /* Early dynamic memory allocator is placed just above _end */ void *work_area_start = (void *)&end; - uintptr_t work_area_size = - (uintptr_t)rdb_start - (uintptr_t)&end - STACK_SIZE; + uintptr_t work_area_size = (uintptr_t)rdb_start - (uintptr_t)work_area_start; /* * The following may be helpful in debugging what goes wrong when diff --git a/bsps/sparc/shared/start/start.S b/bsps/sparc/shared/start/start.S index 64498c6110..5bd2937a13 100644 --- a/bsps/sparc/shared/start/start.S +++ b/bsps/sparc/shared/start/start.S @@ -265,7 +265,6 @@ SYM(CLOCK_SPEED): #define PSR_INIT 0x10c0 /* Disable traps, set s and ps */ #define WIM_INIT 2 -#define STACK_SIZE 16 * 1024 PUBLIC(hard_reset) SYM(hard_reset): @@ -317,9 +316,16 @@ SYM(hard_reset): st %o0, [%o1] #endif - set (SYM(rdb_start)), %g5 ! End of RAM + set SYM(rdb_start), %g5 ! End of RAM st %sp, [%g5] - sub %sp, 4, %sp ! stack starts at end of RAM - 4 + set SYM(_Configuration_Interrupt_stack_size), %g5 +#if defined(START_LEON3_ENABLE_SMP) + add %o0, 1, %o0 + smul %o0, %g5, %g5 +#endif + set SYM(_Configuration_Interrupt_stack_area_begin), %sp + add %sp, %g5, %sp + sub %sp, 4, %sp ! stack starts at end of area - 4 andn %sp, 0x0f, %sp ! align stack on 16-byte boundary mov %sp, %fp ! Set frame pointer nop |