tree 597c7fbe362c431c40cb8ff4820ce8d6e77c4cdb
parent 65f698b8e041ca3a96b68d82402921fd819b47c0
author Roland McGrath <[EMAIL PROTECTED]> Tue Apr 12 08:25:20 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:25:20 2005

[PATCH] i386: Use loaddebug macro consistently

This moves the macro loaddebug from asm-i386/suspend.h to
asm-i386/processor.h, which is the place that makes sense for it to be
defined, removes the extra copy of the same macro in
arch/i386/kernel/process.c, and makes arch/i386/kernel/signal.c use the
macro in place of its expansion.

This is a purely cosmetic cleanup for the normal i386 kernel.  However, it
is handy for Xen to be able to just redefine the loaddebug macro once
instead of also changing the signal.c code.

Signed-off-by: Roland McGrath <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 arch/i386/kernel/process.c   |    7 -------
 arch/i386/kernel/signal.c    |    2 +-
 include/asm-i386/processor.h |    8 ++++++++
 include/asm-i386/suspend.h   |    5 -----
 4 files changed, 9 insertions(+), 13 deletions(-)

Index: arch/i386/kernel/process.c
===================================================================
--- 5f72b81349d5405842d94267f108bfc65d1e4b7e/arch/i386/kernel/process.c  
(mode:100644 sha1:bc6a4e2f812fff1c64e9aa906090ecf499ea6674)
+++ 597c7fbe362c431c40cb8ff4820ce8d6e77c4cdb/arch/i386/kernel/process.c  
(mode:100644 sha1:68c3aebe7c3449eefd51305cbbb4ef9a3740146e)
@@ -558,13 +558,6 @@
         */
        tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
 }
-/*
- * This special macro can be used to load a debugging register
- */
-#define loaddebug(thread,register) \
-               __asm__("movl %0,%%db" #register  \
-                       : /* no output */ \
-                       :"r" (thread->debugreg[register]))
 
 /*
  *     switch_to(x,yn) should switch tasks from x to y.
Index: arch/i386/kernel/signal.c
===================================================================
--- 5f72b81349d5405842d94267f108bfc65d1e4b7e/arch/i386/kernel/signal.c  
(mode:100644 sha1:1c1c5616c6b96e621bb1d03d65d1a2178b9bd0b4)
+++ 597c7fbe362c431c40cb8ff4820ce8d6e77c4cdb/arch/i386/kernel/signal.c  
(mode:100644 sha1:c3919498379b02b02b4b30154934dca16514a1a6)
@@ -618,7 +618,7 @@
                 * inside the kernel.
                 */
                if (unlikely(current->thread.debugreg[7])) {
-                       __asm__("movl %0,%%db7" : : "r" 
(current->thread.debugreg[7]));
+                       loaddebug(&current->thread, 7);
                }
 
                /* Whee!  Actually deliver the signal.  */
Index: include/asm-i386/processor.h
===================================================================
--- 5f72b81349d5405842d94267f108bfc65d1e4b7e/include/asm-i386/processor.h  
(mode:100644 sha1:39ab10567b3edf4a4bfcdceb6f8e25fbfd1a2e81)
+++ 597c7fbe362c431c40cb8ff4820ce8d6e77c4cdb/include/asm-i386/processor.h  
(mode:100644 sha1:84bba5efecb89ba86ed1881114d75f5e26b9c4ad)
@@ -499,6 +499,14 @@
        regs->esp = new_esp;                                    \
 } while (0)
 
+/*
+ * This special macro can be used to load a debugging register
+ */
+#define loaddebug(thread,register) \
+               __asm__("movl %0,%%db" #register  \
+                       : /* no output */ \
+                       :"r" ((thread)->debugreg[register]))
+
 /* Forward declaration, a strange C thing */
 struct task_struct;
 struct mm_struct;
Index: include/asm-i386/suspend.h
===================================================================
--- 5f72b81349d5405842d94267f108bfc65d1e4b7e/include/asm-i386/suspend.h  
(mode:100644 sha1:c2b49d18b2fcef5ad471312d3cc2cea64e551c41)
+++ 597c7fbe362c431c40cb8ff4820ce8d6e77c4cdb/include/asm-i386/suspend.h  
(mode:100644 sha1:0a4558b2976334e31eb59728a411c624410f718a)
@@ -36,11 +36,6 @@
        unsigned long return_address;
 } __attribute__((packed));
 
-#define loaddebug(thread,register) \
-               __asm__("movl %0,%%db" #register  \
-                       : /* no output */ \
-                       :"r" ((thread)->debugreg[register]))
-
 #ifdef CONFIG_ACPI_SLEEP
 extern unsigned long saved_eip;
 extern unsigned long saved_esp;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to