sh: makecontext: set up stack pointer in r15
parent
da3c8d170f
commit
82f734ab47
|
@ -4,6 +4,7 @@
|
|||
#define REG_SZ (4)
|
||||
#define MCONTEXT_GREGS (24)
|
||||
|
||||
#define REG_SP (15)
|
||||
#define REG_PC (16)
|
||||
#define REG_PR (17)
|
||||
#define REG_SR (18)
|
||||
|
|
|
@ -34,7 +34,7 @@ libucontext_makecontext(libucontext_ucontext_t *ucp, void (*func)(void), int arg
|
|||
sp -= argc > 4 ? argc - 4 : 0;
|
||||
|
||||
/* set up the context */
|
||||
ucp->uc_mcontext.sr = (libucontext_greg_t) sp;
|
||||
ucp->uc_mcontext.gregs[REG_SP] = (libucontext_greg_t) sp;
|
||||
ucp->uc_mcontext.pr = (libucontext_greg_t) libucontext_trampoline;
|
||||
ucp->uc_mcontext.pc = (libucontext_greg_t) func;
|
||||
ucp->uc_mcontext.gregs[8] = (libucontext_greg_t) ucp->uc_link;
|
||||
|
|
Loading…
Reference in New Issue