x86: Add symbolic constant for exceptions with error code
authorH. Peter Anvin <hpa@zytor.com>
Thu, 19 Apr 2012 00:16:47 +0000 (17:16 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 19 Apr 2012 22:07:49 +0000 (15:07 -0700)
Add a symbolic constant for the bitmask which states which exceptions
carry an error code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1334794610-5546-3-git-send-email-hpa@zytor.com
arch/x86/include/asm/segment.h
arch/x86/kernel/head_64.S

index 165466233ab0376192d94b6cd6a8d327a4c22d00..58c1e6cd91b6b7e9711350b1fec852bf52c6ccbb 100644 (file)
 
 #define IDT_ENTRIES 256
 #define NUM_EXCEPTION_VECTORS 32
+/* Bitmask of exception vectors which push an error code on the stack */
+#define EXCEPTION_ERRCODE_MASK  0x00027d00
 #define GDT_SIZE (GDT_ENTRIES * 8)
 #define GDT_ENTRY_TLS_ENTRIES 3
 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
index 40f4eb3766d1d2a669790d36d3c6e28eff42b87b..adf52e85d551abed3de356b9acde7e2e4c7e3643 100644 (file)
@@ -295,7 +295,7 @@ ENTRY(early_idt_handler)
        ja 0f
        movl $1,%eax
        salq %cl,%rax
-       testl $0x27d00,%eax
+       testl $EXCEPTION_ERRCODE_MASK,%eax
        je 0f
        popq %r8                # get error code
 0:     movq 0(%rsp),%rcx       # get ip