From db2a6e5b58495cf0ea2c0431dc5ac5c3fd3f134b Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Tue, 24 Sep 2019 12:15:15 +0200 Subject: [PATCH] arch: xtensa: add macros to store values Adds additional macros to store register values under the selected structures per core. Signed-off-by: Tomasz Lauda --- src/arch/xtensa/xtos/xtos-internal.h | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/arch/xtensa/xtos/xtos-internal.h b/src/arch/xtensa/xtos/xtos-internal.h index 095237f95..a72f21e65 100644 --- a/src/arch/xtensa/xtos/xtos-internal.h +++ b/src/arch/xtensa/xtos/xtos-internal.h @@ -419,6 +419,25 @@ exit: l32i \ax, \ax, XTOS_PTR_TO_\structure_name .endm + // xtos_store_percore ax, ay, structure_name + // Stores register value under the selected structure per core. + .macro xtos_store_percore ax, ay, structure_name +#if XCHAL_HAVE_THREADPTR + rur.threadptr \ay +#else + j 1f + .align 4 + .literal_position +2: + .word SOF_VIRTUAL_THREAD_BASE +1: + .align 4 + l32r \ay, 2b + l32i \ay, \ay, 0 +#endif + s32i \ax, \ay, XTOS_PTR_TO_\structure_name + .endm + // xtos_int_stack_addr_percore ax, int_level, stack_name // Pointer to dedicated interrupt stack. .macro xtos_int_stack_addr_percore ax, int_level, stack_name @@ -457,6 +476,25 @@ exit: l32i \ax, \ax, XTOS_TASK_CONTEXT_OFFSET .endm + // xtos_task_ctx_store_percore ax, ay + // Changes task context to point to the selected address. + .macro xtos_task_ctx_store_percore ax, ay +#if XCHAL_HAVE_THREADPTR + rur.threadptr \ay +#else + j 1f + .align 4 + .literal_position +2: + .word SOF_VIRTUAL_THREAD_BASE +1: + .align 4 + l32r \ay, 2b + l32i \ay, \ay, 0 +#endif + s32i \ax, \ay, XTOS_TASK_CONTEXT_OFFSET + .endm + #else /* !_ASMLANGUAGE && !__ASSEMBLER__ */ /*