Changeset 11888


Ignore:
Timestamp:
Apr 4, 2009, 9:29:45 AM (10 years ago)
Author:
gb
Message:

Try to define IS_MAYBE_INT_TRAP more rigorously, at least on Unix
platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-exceptions.h

    r11866 r11888  
    169169#ifdef LINUX
    170170#define SIGNUM_FOR_INTN_TRAP SIGSEGV
    171 #define IS_MAYBE_INT_TRAP(info,xp) (((info->si_code) &0x7f) == 0)
     171#define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)==0xd)&&((xpGPR(xp,REG_ERR)&7)==2))
    172172#define SIGRETURN(context)
    173173#endif
     
    176176extern void freebsd_sigreturn(ExceptionInformation *);
    177177#define SIGNUM_FOR_INTN_TRAP SIGBUS
    178 #define IS_MAYBE_INT_TRAP(info,xp) (xp->uc_mcontext.mc_trapno == T_PROTFLT)
     178#define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno == T_PROTFLT) && ((xp->uc_mcontext.mc_err & 7) == 2))
    179179#define SIGRETURN(context) freebsd_sigreturn(context)
    180180#endif
     
    182182#ifdef DARWIN
    183183#define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler fakes that */
    184 #define IS_MAYBE_INT_TRAP(info,xp) (info->si_code == EXC_I386_GPFLT)
     184#define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->es.trapno == 0xd) && (((UC_MCONTEXT(xp)->es.err)&7)==2))
    185185/* The x86 version of sigreturn just needs the context argument; the
    186186   hidden, magic "flavor" argument that sigtramp uses is ignored. */
Note: See TracChangeset for help on using the changeset viewer.