[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1334794610-5546-3-git-send-email-hpa@zytor.com>
Date: Wed, 18 Apr 2012 17:16:47 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...64.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH 2/5] x86: Add symbolic constant for exceptions with error code
From: "H. Peter Anvin" <hpa@...or.com>
Add a symbolic constant for the bitmask which states which exceptions
carry an error code.
Signed-off-by: H. Peter Anvin <hpa@...or.com>
---
arch/x86/include/asm/segment.h | 2 ++
arch/x86/kernel/head_64.S | 2 +-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 1654662..58c1e6c 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -205,6 +205,8 @@
#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)
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 40f4eb3..adf52e8 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -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
--
1.7.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists