[Openmcl-cvs-notifications] r11892 - /trunk/source/lisp-kernel/x86-exceptions.h

gb at clozure.com gb at clozure.com
Sat Apr 4 16:04:58 EDT 2009


Author: gb
Date: Sat Apr  4 16:04:58 2009
New Revision: 11892

Log:
Define IS_PAGE_FAULT, which can be used to distinguish between page
faults (which provide more context info, like the fault address and
write-p flag) from x86 protection faults, which generally indicate
a failure at an earlier stage of address transation and don't provide
this information.

Modified:
    trunk/source/lisp-kernel/x86-exceptions.h

Modified: trunk/source/lisp-kernel/x86-exceptions.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-exceptions.h (original)
+++ trunk/source/lisp-kernel/x86-exceptions.h Sat Apr  4 16:04:58 2009
@@ -169,6 +169,7 @@
 #ifdef LINUX
 #define SIGNUM_FOR_INTN_TRAP SIGSEGV
 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)=3D=3D0xd)&&((xpG=
PR(xp,REG_ERR)&7)=3D=3D2))
+#define IS_PAGE_FAULT(info,xp) (xpGPR(xp,REG_TRAPNO)=3D=3D0xe)
 #define SIGRETURN(context)
 #endif
 =

@@ -176,12 +177,14 @@
 extern void freebsd_sigreturn(ExceptionInformation *);
 #define SIGNUM_FOR_INTN_TRAP SIGBUS
 #define IS_MAYBE_INT_TRAP(info,xp) ((xp->uc_mcontext.mc_trapno =3D=3D T_PR=
OTFLT) && ((xp->uc_mcontext.mc_err & 7) =3D=3D 2))
+#define IS_PAGE_FAULT(info,xp) (xp->uc_mcontext.mc_trapno =3D=3D T_PAGEFLT)
 #define SIGRETURN(context) freebsd_sigreturn(context)
 #endif
 =

 #ifdef DARWIN
 #define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler f=
akes that */
-#define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->es.trapno =3D=3D 0xd=
) && (((UC_MCONTEXT(xp)->es.err)&7)=3D=3D2))
+#define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->__es.trapno =3D=3D 0=
xd) && (((UC_MCONTEXT(xp)->__es.err)&7)=3D=3D2))
+#define IS_PAGE_FAULT(info,xp) (UC_MCONTEXT(xp)->__es.trapno =3D=3D 0xe)
 /* The x86 version of sigreturn just needs the context argument; the
    hidden, magic "flavor" argument that sigtramp uses is ignored. */
 #define SIGRETURN(context) DarwinSigReturn(context)
@@ -191,8 +194,10 @@
 #define SIGNUM_FOR_INTN_TRAP SIGSEGV
 #ifdef X8664
 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,REG_TRAPNO)=3D=3D0xd)&&((xpG=
PR(xp,REG_ERR)&7)=3D=3D2))
+#define IS_MAYBE_INT_TRAP(info,xp) (xpGPR(xp,REG_TRAPNO)=3D=3D0xe)
 #else
 #define IS_MAYBE_INT_TRAP(info,xp) ((xpGPR(xp,TRAPNO)=3D=3D0xd)&&((xpGPR(x=
p,ERR)&7)=3D=3D2))
+#define IS_PAGE_FAULT(info,xp) (xpGPR(xp,TRAPNO)=3D=3D0xe)
 #endif
 #define SIGRETURN(context) setcontext(context)
 #endif
@@ -203,6 +208,7 @@
   ((info->ExceptionCode =3D=3D EXCEPTION_ACCESS_VIOLATION) &&       \
    (info->ExceptionInformation[0]=3D=3D0) &&                       \
    (info->ExceptionInformation[1]=3D=3D(ULONG_PTR)(-1L)))
+#define IS_PAGE_FAULT(info,xp) (1)
 #define SIGRETURN(context)      /* for now */
 #endif
 =




More information about the Openmcl-cvs-notifications mailing list