diff options
Diffstat (limited to 'plat/common/aarch64/platform_mp_stack.S')
-rw-r--r-- | plat/common/aarch64/platform_mp_stack.S | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/plat/common/aarch64/platform_mp_stack.S b/plat/common/aarch64/platform_mp_stack.S index 0cea9ac3..b1f7b6dc 100644 --- a/plat/common/aarch64/platform_mp_stack.S +++ b/plat/common/aarch64/platform_mp_stack.S @@ -30,16 +30,58 @@ #include <arch.h> #include <asm_macros.S> +#include <assert_macros.S> #include <platform_def.h> - .local platform_normal_stacks - .weak platform_set_stack +#if ENABLE_PLAT_COMPAT + .globl plat_get_my_stack + .globl plat_set_my_stack +#else .weak platform_get_stack + .weak platform_set_stack .weak plat_get_my_stack .weak plat_set_my_stack +#endif /*__ENABLE_PLAT_COMPAT__*/ + + +#if ENABLE_PLAT_COMPAT + /* --------------------------------------------------------------------- + * When the compatility layer is enabled, the new platform APIs + * viz plat_get_my_stack() and plat_set_my_stack() need to be + * defined using the previous APIs platform_get_stack() and + * platform_set_stack(). Also we need to provide weak definitions + * of platform_get_stack() and platform_set_stack() for the platforms + * to reuse. + * -------------------------------------------------------------------- + */ /* ----------------------------------------------------- + * 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 + mrs x0, mpidr_el1 + b platform_get_stack +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 + mrs x0, mpidr_el1 + b platform_set_stack +endfunc plat_set_my_stack + +#else + /* ----------------------------------------------------- * unsigned long platform_get_stack (unsigned long mpidr) * * For a given CPU, this function returns the stack @@ -93,6 +135,8 @@ func plat_set_my_stack ret x9 endfunc plat_set_my_stack +#endif /*__ENABLE_PLAT_COMPAT__*/ + /* ----------------------------------------------------- * Per-cpu stacks in normal memory. Each cpu gets a * stack of PLATFORM_STACK_SIZE bytes. |