[PATCH] xen: x86: Use new macro for debugreg
authorVincent Hanquez <vincent.hanquez@cl.cam.ac.uk>
Thu, 23 Jun 2005 07:08:43 +0000 (00:08 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 23 Jun 2005 16:45:13 +0000 (09:45 -0700)
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>
arch/i386/kernel/cpu/common.c
arch/i386/kernel/process.c
arch/i386/kernel/signal.c
arch/i386/kernel/traps.c
arch/i386/power/cpu.c

index d199e525680aeabb7e6d5fc88ce895a217d92a1e..b9954248d0aaf13f8861a87c7b55e1ab9314e8a6 100644 (file)
@@ -635,7 +635,7 @@ void __init cpu_init (void)
 
        /* Clear all 6 debug registers: */
 
-#define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) );
+#define CD(register) set_debugreg(0, register)
 
        CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7);
 
index 3c3f245cca53a33fe8415e7772be1dc1fa727da1..2468ab70c386e148cf3423fa38677337d7198ca1 100644 (file)
@@ -633,13 +633,13 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
         * Now maybe reload the debug registers
         */
        if (unlikely(next->debugreg[7])) {
-               loaddebug(next, 0);
-               loaddebug(next, 1);
-               loaddebug(next, 2);
-               loaddebug(next, 3);
+               set_debugreg(current->thread.debugreg[0], 0);
+               set_debugreg(current->thread.debugreg[1], 1);
+               set_debugreg(current->thread.debugreg[2], 2);
+               set_debugreg(current->thread.debugreg[3], 3);
                /* no 4 and 5 */
-               loaddebug(next, 6);
-               loaddebug(next, 7);
+               set_debugreg(current->thread.debugreg[6], 6);
+               set_debugreg(current->thread.debugreg[7], 7);
        }
 
        if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
index 344400787c399a1a04ccc232c9a8d308ea9080d5..839d4dc88cd42858b4a244fd88cd513f6aa99d22 100644 (file)
@@ -624,7 +624,7 @@ int fastcall do_signal(struct pt_regs *regs, sigset_t *oldset)
                 * inside the kernel.
                 */
                if (unlikely(current->thread.debugreg[7])) {
-                       loaddebug(&current->thread, 7);
+                       set_debugreg(current->thread.debugreg[7], 7);
                }
 
                /* Whee!  Actually deliver the signal.  */
index 7f729665d292b9d79d48a8e2ace85cd5205fd6be..c01d7ba6d7e8ab025483b53446c52b313d3a2f5b 100644 (file)
@@ -685,7 +685,7 @@ fastcall void do_debug(struct pt_regs * regs, long error_code)
        unsigned int condition;
        struct task_struct *tsk = current;
 
-       __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
+       get_debugreg(condition, 6);
 
        if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
                                        SIGTRAP) == NOTIFY_STOP)
@@ -727,9 +727,7 @@ fastcall void do_debug(struct pt_regs * regs, long error_code)
         * the signal is delivered.
         */
 clear_dr7:
-       __asm__("movl %0,%%db7"
-               : /* no output */
-               : "r" (0));
+       set_debugreg(0, 7);
        return;
 
 debug_vm86:
index cf337c673d92a23d2d3ed339ec6e3065998a0a5e..6f521cf19a133924b026b13bb3695218fd2a2e6b 100644 (file)
@@ -94,13 +94,13 @@ static void fix_processor_context(void)
         * Now maybe reload the debug registers
         */
        if (current->thread.debugreg[7]){
-                loaddebug(&current->thread, 0);
-                loaddebug(&current->thread, 1);
-                loaddebug(&current->thread, 2);
-                loaddebug(&current->thread, 3);
-                /* no 4 and 5 */
-                loaddebug(&current->thread, 6);
-                loaddebug(&current->thread, 7);
+               set_debugreg(current->thread.debugreg[0], 0);
+               set_debugreg(current->thread.debugreg[1], 1);
+               set_debugreg(current->thread.debugreg[2], 2);
+               set_debugreg(current->thread.debugreg[3], 3);
+               /* no 4 and 5 */
+               set_debugreg(current->thread.debugreg[6], 6);
+               set_debugreg(current->thread.debugreg[7], 7);
        }
 
 }