diff options
author | Aaron Durbin <adurbin@chromium.org> | 2014-08-27 15:30:56 -0500 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-27 08:04:07 +0100 |
commit | 30f08ff094a6d36ade1cdeb53ce6062852bed910 (patch) | |
tree | d76454fa0b98f72ffc9a1f55ba3d1cf6d568387f /src/arch/arm64/c_entry.c | |
parent | a5c7f6681074788e0a7bc1cb202162ceec67f36e (diff) |
arm64: move seeding stack to C
Move the stack seeding out of assembly and into C so the
code in stage_entry.S can more easily be used. The seeding
of the stack doesn't touch at least 256 bytes to account
for current usage at time fo the call.
BUG=chrome-os-partner:31545
BRANCH=None
TEST=Built and booted into kernel on ryu.
Change-Id: Ib9659ec4265652461bde746140567f21533cc265
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f478cfe175aa674cdfdbbd890663eeaad9d82b1f
Original-Change-Id: I44004220a02b1ff06d27a0555eb4e96d9e213544
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/214770
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9014
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
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(); } |