diff options
author | Avi Kivity <avi@qumranet.com> | 2008-03-30 16:30:36 +0300 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-03-30 16:30:36 +0300 |
commit | 5ef6cd806d5c8dd3ad2d1dfe01752103702fc34f (patch) | |
tree | 64744ecb104c9ffffa918f79a247dbf0a8db7261 /kernel | |
parent | 7956e22f0d91721b47fb560fd6135407f2c27097 (diff) |
kvm: external module: backwart compatibility for debugreg[]
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/preempt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/preempt.c b/kernel/preempt.c index 0ae69d7a..f2992c5b 100644 --- a/kernel/preempt.c +++ b/kernel/preempt.c @@ -13,11 +13,15 @@ static LIST_HEAD(pn_list); current->pid, raw_smp_processor_id()); \ } while (0) +#if !defined(CONFIG_X86_64) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) +#define COMPAT_DEBUGREG +#endif + static void preempt_enable_sched_out_notifiers(void) { asm volatile ("mov %0, %%db0" : : "r"(schedule)); asm volatile ("mov %0, %%db7" : : "r"(0x701ul)); -#ifdef CONFIG_X86_64 +#ifndef COMPAT_DEBUGREG current->thread.debugreg7 = 0ul; #else current->thread.debugreg[7] = 0ul; @@ -31,7 +35,7 @@ static void preempt_enable_sched_in_notifiers(void * addr) { asm volatile ("mov %0, %%db0" : : "r"(addr)); asm volatile ("mov %0, %%db7" : : "r"(0x701ul)); -#ifdef CONFIG_X86_64 +#ifndef COMPAT_DEBUGREG current->thread.debugreg0 = (unsigned long) addr; current->thread.debugreg7 = 0x701ul; #else @@ -57,7 +61,7 @@ static void __preempt_disable_notifiers(void) static void preempt_disable_notifiers(void) { __preempt_disable_notifiers(); -#ifdef CONFIG_X86_64 +#ifndef COMPAT_DEBUGREG current->thread.debugreg7 = 0ul; #else current->thread.debugreg[7] = 0ul; @@ -243,7 +247,7 @@ static void do_disable(void *blah) #ifdef TIF_DEBUG if (!test_tsk_thread_flag(current, TIF_DEBUG)) #else -#ifdef CONFIG_X86_64 +#ifndef COMPAT_DEBUGREG if (!current->thread.debugreg7) #else if (!current->thread.debugreg[7]) |