222 |
|
#define SIGSEGV_FAULT_HANDLER_ARGLIST_1 siginfo_t *sip, void *scp |
223 |
|
#define SIGSEGV_FAULT_HANDLER_ARGS sip, scp |
224 |
|
#define SIGSEGV_FAULT_ADDRESS sip->si_addr |
225 |
+ |
#if (defined(sgi) || defined(__sgi)) |
226 |
+ |
#include <ucontext.h> |
227 |
+ |
#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.gregs) |
228 |
+ |
#define SIGSEGV_FAULT_INSTRUCTION (unsigned long)SIGSEGV_CONTEXT_REGS[CTX_EPC] |
229 |
+ |
#endif |
230 |
|
#if defined(__sun__) |
231 |
|
#if (defined(sparc) || defined(__sparc__)) |
232 |
|
#include <sys/ucontext.h> |
308 |
|
#endif |
309 |
|
|
310 |
|
// Irix 5 or 6 on MIPS |
311 |
< |
#if (defined(sgi) || defined(__sgi)) && (defined(SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4)) |
311 |
> |
#if (defined(sgi) || defined(__sgi)) && (defined(SYSTYPE_SVR4) || defined(_SYSTYPE_SVR4)) |
312 |
|
#include <ucontext.h> |
313 |
|
#define SIGSEGV_FAULT_HANDLER_ARGLIST int sig, int code, struct sigcontext *scp |
314 |
|
#define SIGSEGV_FAULT_HANDLER_ARGS sig, code, scp |
315 |
< |
#define SIGSEGV_FAULT_ADDRESS scp->sc_badvaddr |
315 |
> |
#define SIGSEGV_FAULT_ADDRESS (unsigned long)scp->sc_badvaddr |
316 |
> |
#define SIGSEGV_FAULT_INSTRUCTION (unsigned long)scp->sc_pc |
317 |
|
#define SIGSEGV_ALL_SIGNALS FAULT_HANDLER(SIGSEGV) |
318 |
|
#endif |
319 |
|
|
819 |
|
int rloc = x86_reg_map[reg]; |
820 |
|
switch (transfer_size) { |
821 |
|
case SIZE_BYTE: |
822 |
< |
if (!has_rex && reg >= 4) |
823 |
< |
regs[rloc - 4] = (regs[rloc - 4] & ~0xff00L); |
824 |
< |
else |
825 |
< |
regs[rloc] = (regs[rloc] & ~0xffL); |
822 |
> |
if (has_rex || reg < 4) |
823 |
> |
regs[rloc] = (regs[rloc] & ~0x00ffL); |
824 |
> |
else { |
825 |
> |
rloc = x86_reg_map[reg - 4]; |
826 |
> |
regs[rloc] = (regs[rloc] & ~0xff00L); |
827 |
> |
} |
828 |
|
break; |
829 |
|
case SIZE_WORD: |
830 |
|
regs[rloc] = (regs[rloc] & ~0xffffL); |