RISC-V SMP: Fix Compile Error
Partially revert commit 70d1a5f792.
Can't include arch/machine.h because that will cause
a circular include dependency.
Signed-off-by: Indan Zupancic <indan@nul.nu>
This commit is contained in:
parent
70d1a5f792
commit
3ccbfc083a
1 changed files with 2 additions and 1 deletions
|
|
@ -51,7 +51,8 @@ static inline bool_t try_arch_atomic_exchange_rlx(void *ptr, void *new_val, void
|
|||
|
||||
static inline CONST cpu_id_t getCurrentCPUIndex(void)
|
||||
{
|
||||
word_t sp = read_sscratch();
|
||||
word_t sp;
|
||||
asm volatile("csrr %0, sscratch" : "=r"(sp));
|
||||
sp -= (word_t)kernel_stack_alloc;
|
||||
sp -= 8;
|
||||
return (sp >> CONFIG_KERNEL_STACK_BITS);
|
||||
|
|
|
|||
Loading…
Reference in a new issue