xtensa: Make _arch_curr_cpu() work outside SMP

The xtensa headers use this for simplicity when SMP is not enabled.
It should still build on older platforms that don't include the
asm2-style CPU pointer scheme.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-02-14 09:22:24 -08:00 committed by Anas Nashif
commit 60fd06830e

View file

@ -30,11 +30,15 @@ extern K_THREAD_STACK_DEFINE(_interrupt_stack, CONFIG_ISR_STACK_SIZE);
static ALWAYS_INLINE _cpu_t *_arch_curr_cpu(void) static ALWAYS_INLINE _cpu_t *_arch_curr_cpu(void)
{ {
#ifdef CONFIG_XTENSA_ASM2
void *val; void *val;
__asm__ volatile("rsr.misc0 %0" : "=r"(val)); __asm__ volatile("rsr.misc0 %0" : "=r"(val));
return val; return val;
#else
return &_kernel.cpus[0];
#endif
} }
/** /**