diff options
Diffstat (limited to 'plat/common')
-rw-r--r-- | plat/common/aarch64/platform_mp_stack.S | 30 | ||||
-rw-r--r-- | plat/common/aarch64/platform_up_stack.S | 14 |
2 files changed, 39 insertions, 5 deletions
diff --git a/plat/common/aarch64/platform_mp_stack.S b/plat/common/aarch64/platform_mp_stack.S index 7a98d290..0cea9ac3 100644 --- a/plat/common/aarch64/platform_mp_stack.S +++ b/plat/common/aarch64/platform_mp_stack.S @@ -36,7 +36,8 @@ .local platform_normal_stacks .weak platform_set_stack .weak platform_get_stack - + .weak plat_get_my_stack + .weak plat_set_my_stack /* ----------------------------------------------------- * unsigned long platform_get_stack (unsigned long mpidr) @@ -66,6 +67,33 @@ func platform_set_stack endfunc platform_set_stack /* ----------------------------------------------------- + * unsigned long plat_get_my_stack () + * + * For the current CPU, this function returns the stack + * pointer for a stack allocated in device memory. + * ----------------------------------------------------- + */ +func plat_get_my_stack + mov x10, x30 // lr + get_my_mp_stack platform_normal_stacks, PLATFORM_STACK_SIZE + ret x10 +endfunc plat_get_my_stack + + /* ----------------------------------------------------- + * void plat_set_my_stack () + * + * For the current CPU, this function sets the stack + * pointer to a stack allocated in normal memory. + * ----------------------------------------------------- + */ +func plat_set_my_stack + mov x9, x30 // lr + bl plat_get_my_stack + mov sp, x0 + ret x9 +endfunc plat_set_my_stack + + /* ----------------------------------------------------- * Per-cpu stacks in normal memory. Each cpu gets a * stack of PLATFORM_STACK_SIZE bytes. * ----------------------------------------------------- diff --git a/plat/common/aarch64/platform_up_stack.S b/plat/common/aarch64/platform_up_stack.S index ea6641a7..d6d6c6e2 100644 --- a/plat/common/aarch64/platform_up_stack.S +++ b/plat/common/aarch64/platform_up_stack.S @@ -34,10 +34,13 @@ .local platform_normal_stacks + .globl plat_set_my_stack + .globl plat_get_my_stack .globl platform_set_stack .globl platform_get_stack /* ----------------------------------------------------- + * unsigned long plat_get_my_stack () * unsigned long platform_get_stack (unsigned long) * * For cold-boot BL images, only the primary CPU needs a @@ -45,12 +48,14 @@ * stack allocated in device memory. * ----------------------------------------------------- */ -func platform_get_stack +func plat_get_my_stack +platform_get_stack: get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE ret -endfunc platform_get_stack +endfunc plat_get_my_stack /* ----------------------------------------------------- + * void plat_set_my_stack () * void platform_set_stack (unsigned long) * * For cold-boot BL images, only the primary CPU needs a @@ -58,11 +63,12 @@ endfunc platform_get_stack * allocated in normal memory. * ----------------------------------------------------- */ -func platform_set_stack +func plat_set_my_stack +platform_set_stack: get_up_stack platform_normal_stacks, PLATFORM_STACK_SIZE mov sp, x0 ret -endfunc platform_set_stack +endfunc plat_set_my_stack /* ----------------------------------------------------- * Single cpu stack in normal memory. |