arm64: add indirection to C entry point
To allow setting the entry point for the secondary CPUs provide a pointer, c_entry, which contains the location to branc to after setting up the stack. BUG=chrome-os-partner:31545 BRANCH=None TEST=Built and booted to the kernel on ryu. Change-Id: Ic2f6c79cde708b24c379345aed1e2cc0760ccad8 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/214771 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
parent
f478cfe175
commit
f692c5814e
2 changed files with 15 additions and 1 deletions
|
|
@ -20,6 +20,14 @@
|
|||
#include <arch/stages.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
|
||||
/*
|
||||
* This variable holds entry point for CPUs starting up. Before the other
|
||||
* CPUs are brought up this value will change to provide the secondary
|
||||
* code path.
|
||||
*/
|
||||
void (*c_entry)(void) = &arm64_init;
|
||||
|
||||
void __attribute__((weak)) arm64_soc_init(void)
|
||||
{
|
||||
/* Default weak implementation does nothing. */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,13 @@ ENTRY(arm64_c_environment)
|
|||
bl cpu_get_stack
|
||||
mov sp, x0
|
||||
|
||||
b arm64_init
|
||||
/* Get entry point by dereferencing c_entry. */
|
||||
ldr x0, 1f
|
||||
ldr x0, [x0]
|
||||
br x0
|
||||
.align 3
|
||||
1:
|
||||
.quad c_entry
|
||||
ENDPROC(arm64_c_environment)
|
||||
|
||||
CPU_RESET_ENTRY(arm64_cpu_startup)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue