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:
parent
392b3b5aa6
commit
60fd06830e
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue