aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorVincent Hanquez <vincent.hanquez@cl.cam.ac.uk>2005-06-23 03:08:43 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:13 -0400
commit1cc6f12e03ebc064b74161c684f987284ce9d0cc (patch)
treefd22e53fa49ea211914ee12fb45df6c4a2d01ee3 /arch/i386
parentf5012310e35bd62fd39fce338ee44422c975ff3c (diff)
[PATCH] xen: x86: Use new macro for debugreg
Make use of the 2 new macro set_debugreg and get_debugreg. Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk> Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/cpu/common.c2
-rw-r--r--arch/i386/kernel/process.c12
-rw-r--r--arch/i386/kernel/signal.c2
-rw-r--r--arch/i386/kernel/traps.c6
-rw-r--r--arch/i386/power/cpu.c14
5 files changed, 17 insertions, 19 deletions
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index d199e525680a..b9954248d0aa 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -635,7 +635,7 @@ void __init cpu_init (void)
635 635
636 /* Clear all 6 debug registers: */ 636 /* Clear all 6 debug registers: */
637 637
638#define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) ); 638#define CD(register) set_debugreg(0, register)
639 639
640 CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7); 640 CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
641 641
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 3c3f245cca53..2468ab70c386 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -633,13 +633,13 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
633 * Now maybe reload the debug registers 633 * Now maybe reload the debug registers
634 */ 634 */
635 if (unlikely(next->debugreg[7])) { 635 if (unlikely(next->debugreg[7])) {
636 loaddebug(next, 0); 636 set_debugreg(current->thread.debugreg[0], 0);
637 loaddebug(next, 1); 637 set_debugreg(current->thread.debugreg[1], 1);
638 loaddebug(next, 2); 638 set_debugreg(current->thread.debugreg[2], 2);
639 loaddebug(next, 3); 639 set_debugreg(current->thread.debugreg[3], 3);
640 /* no 4 and 5 */ 640 /* no 4 and 5 */
641 loaddebug(next, 6); 641 set_debugreg(current->thread.debugreg[6], 6);
642 loaddebug(next, 7); 642 set_debugreg(current->thread.debugreg[7], 7);
643 } 643 }
644 644
645 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 645 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index 344400787c39..839d4dc88cd4 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -624,7 +624,7 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
624 * inside the kernel. 624 * inside the kernel.
625 */ 625 */
626 if (unlikely(current->thread.debugreg[7])) { 626 if (unlikely(current->thread.debugreg[7])) {
627 loaddebug(&current->thread, 7); 627 set_debugreg(current->thread.debugreg[7], 7);
628 } 628 }
629 629
630 /* Whee! Actually deliver the signal. */ 630 /* Whee! Actually deliver the signal. */
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 7f729665d292..c01d7ba6d7e8 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -685,7 +685,7 @@ fastcall void do_debug(struct pt_regs * regs, long error_code)
685 unsigned int condition; 685 unsigned int condition;
686 struct task_struct *tsk = current; 686 struct task_struct *tsk = current;
687 687
688 __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); 688 get_debugreg(condition, 6);
689 689
690 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, 690 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
691 SIGTRAP) == NOTIFY_STOP) 691 SIGTRAP) == NOTIFY_STOP)
@@ -727,9 +727,7 @@ fastcall void do_debug(struct pt_regs * regs, long error_code)
727 * the signal is delivered. 727 * the signal is delivered.
728 */ 728 */
729clear_dr7: 729clear_dr7:
730 __asm__("movl %0,%%db7" 730 set_debugreg(0, 7);
731 : /* no output */
732 : "r" (0));
733 return; 731 return;
734 732
735debug_vm86: 733debug_vm86:
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index cf337c673d92..6f521cf19a13 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -94,13 +94,13 @@ static void fix_processor_context(void)
94 * Now maybe reload the debug registers 94 * Now maybe reload the debug registers
95 */ 95 */
96 if (current->thread.debugreg[7]){ 96 if (current->thread.debugreg[7]){
97 loaddebug(&current->thread, 0); 97 set_debugreg(current->thread.debugreg[0], 0);
98 loaddebug(&current->thread, 1); 98 set_debugreg(current->thread.debugreg[1], 1);
99 loaddebug(&current->thread, 2); 99 set_debugreg(current->thread.debugreg[2], 2);
100 loaddebug(&current->thread, 3); 100 set_debugreg(current->thread.debugreg[3], 3);
101 /* no 4 and 5 */ 101 /* no 4 and 5 */
102 loaddebug(&current->thread, 6); 102 set_debugreg(current->thread.debugreg[6], 6);
103 loaddebug(&current->thread, 7); 103 set_debugreg(current->thread.debugreg[7], 7);
104 } 104 }
105 105
106} 106}