summaryrefslogtreecommitdiff
path: root/arch/x86/mm/kmemcheck/opcode.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2009-02-26 12:23:52 +0300
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 14:39:59 +0400
commit6d9609c13250631c1d0c55a29a64d5687fd91293 (patch)
treef925b5dfb2c250e6de98b3e1f880149324bb99a1 /arch/x86/mm/kmemcheck/opcode.c
parent0c33cacd8672ef034ba414510f71ea2bd9370111 (diff)
downloadlinux-6d9609c13250631c1d0c55a29a64d5687fd91293.tar.xz
kmemcheck: move 64-bit ifdef out of kmemcheck_opcode_decode()
This patch moves the CONFIG_X86_64 ifdef out of kmemcheck_opcode_decode() by introducing a version of the function that always returns false for CONFIG_X86_32. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'arch/x86/mm/kmemcheck/opcode.c')
-rw-r--r--arch/x86/mm/kmemcheck/opcode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/mm/kmemcheck/opcode.c b/arch/x86/mm/kmemcheck/opcode.c
index a4100b6e783a..63c19e27aa6f 100644
--- a/arch/x86/mm/kmemcheck/opcode.c
+++ b/arch/x86/mm/kmemcheck/opcode.c
@@ -16,10 +16,17 @@ static bool opcode_is_prefix(uint8_t b)
|| b == 0x67;
}
+#ifdef CONFIG_X86_64
static bool opcode_is_rex_prefix(uint8_t b)
{
return (b & 0xf0) == 0x40;
}
+#else
+static bool opcode_is_rex_prefix(uint8_t b)
+{
+ return false;
+}
+#endif
#define REX_W (1 << 3)
@@ -40,7 +47,6 @@ void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size)
operand_size_override = 2;
}
-#ifdef CONFIG_X86_64
/* REX prefix */
if (opcode_is_rex_prefix(*op)) {
uint8_t rex = *op;
@@ -72,7 +78,6 @@ void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size)
return;
}
}
-#endif
/* escape opcode */
if (*op == 0x0f) {