riscv64: chase musl ab3eb89a8b83353cdaab12ed017a67a7730f90e9 changes
parent
02470ccdd8
commit
34472b8884
|
@ -36,17 +36,17 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
|||
sp = (greg_t *) (((uintptr_t) sp & -16L));
|
||||
|
||||
/* set up the ucontext structure */
|
||||
ucp->uc_mcontext.gregs[REG_PC] = (greg_t) __start_context;
|
||||
ucp->uc_mcontext.gregs[REG_S0] = 0;
|
||||
ucp->uc_mcontext.gregs[REG_S1] = (greg_t) func;
|
||||
ucp->uc_mcontext.gregs[REG_S2] = (greg_t) ucp->uc_link;
|
||||
ucp->uc_mcontext.gregs[REG_SP] = (greg_t) sp;
|
||||
ucp->uc_mcontext.gregs[REG_PC_SAVE] = 0;
|
||||
ucp->uc_mcontext.__gregs[REG_PC] = (greg_t) __start_context;
|
||||
ucp->uc_mcontext.__gregs[REG_S0] = 0;
|
||||
ucp->uc_mcontext.__gregs[REG_S1] = (greg_t) func;
|
||||
ucp->uc_mcontext.__gregs[REG_S2] = (greg_t) ucp->uc_link;
|
||||
ucp->uc_mcontext.__gregs[REG_SP] = (greg_t) sp;
|
||||
ucp->uc_mcontext.__gregs[REG_PC_SAVE] = 0;
|
||||
|
||||
va_start(va, argc);
|
||||
|
||||
/* first 8 args go in $a0 through $a7. */
|
||||
regp = &(ucp->uc_mcontext.gregs[REG_A0]);
|
||||
regp = &(ucp->uc_mcontext.__gregs[REG_A0]);
|
||||
|
||||
for (i = 0; (i < argc && i < 8); i++)
|
||||
*regp++ = va_arg (va, greg_t);
|
||||
|
|
Loading…
Reference in New Issue