fix risc-v init task gp(global pointer register) bug
This commit is contained in:
@@ -101,8 +101,8 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
|
|||||||
#undef _V
|
#undef _V
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_data_t gp = regs->gp;
|
cpu_data_t gp = 0;
|
||||||
asm("mv %0, gp"::"r"(gp));
|
__ASM__ __VOLATILE__ ("mv %0, gp":"=r"(gp));
|
||||||
|
|
||||||
regs->gp = (cpu_data_t)gp; // gp: global pointer
|
regs->gp = (cpu_data_t)gp; // gp: global pointer
|
||||||
regs->a0 = (cpu_data_t)arg; // a0: argument
|
regs->a0 = (cpu_data_t)arg; // a0: argument
|
||||||
|
Reference in New Issue
Block a user