diff options
Diffstat (limited to 'src/arch/arm64/c_entry.c')
-rw-r--r-- | src/arch/arm64/c_entry.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c index a4d4b0c24f..f08a5853f4 100644 --- a/src/arch/arm64/c_entry.c +++ b/src/arch/arm64/c_entry.c @@ -18,14 +18,34 @@ */ #include <arch/stages.h> +#include <arch/cpu.h> void __attribute__((weak)) arm64_soc_init(void) { /* Default weak implementation does nothing. */ } +static void seed_stack(void) +{ + char *stack_begin; + uint64_t *slot; + int i; + int size; + + stack_begin = cpu_get_stack(smp_processor_id()); + stack_begin -= CONFIG_STACK_SIZE; + slot = (void *)stack_begin; + + /* Pad out 256 bytes for current usage. */ + size = CONFIG_STACK_SIZE - 256; + size /= sizeof(*slot); + for (i = 0; i < size; i++) + *slot++ = 0xdeadbeefdeadbeefULL; +} + void arm64_init(void) { + seed_stack(); arm64_soc_init(); main(); } |