Skip to content

Commit

Permalink
Yet another adjustment to getcontext / setcontext wrapped functons
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Nov 8, 2024
1 parent 69a0214 commit d6b7692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libtools/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ EXPORT int my_getcontext(x86emu_t* emu, void* ucp)
u->uc_mcontext.gregs[REG_SS] = R_SS;
// get FloatPoint status
u->uc_mcontext.fpregs = ucp + 236; // magic offset of fpregs in an actual i386 u_context
fpu_savenv(emu, (void*)u->uc_mcontext.fpregs, 0); // it seems getcontext only save fpu env, not fpu regs
fpu_savenv(emu, (void*)u->uc_mcontext.fpregs, 1); // it seems getcontext only save fpu env, not fpu regs
// get signal mask
sigprocmask(SIG_SETMASK, NULL, (sigset_t*)&u->uc_sigmask);
// ensure uc_link is properly initialized
Expand Down Expand Up @@ -1416,7 +1416,7 @@ EXPORT int my_setcontext(x86emu_t* emu, void* ucp)
R_SS = u->uc_mcontext.gregs[REG_SS];
// set FloatPoint status
if(u->uc_mcontext.fpregs)
fpu_loadenv(emu, (void*)u->uc_mcontext.fpregs, 0);
fpu_loadenv(emu, (void*)u->uc_mcontext.fpregs, 1);
// set signal mask
sigprocmask(SIG_SETMASK, (sigset_t*)&u->uc_sigmask, NULL);
// set uc_link
Expand Down

0 comments on commit d6b7692

Please sign in to comment.