tree 06660dbabc1df1a5c6ee23d48bb07e09e2960a88
parent b0a70b57f909647d79e0cc30772a0664fbf9830a
author Roland McGrath <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:46 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:46 -0700
[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]>
i386/kernel/process.c | 7 -------
i386/kernel/signal.c | 2 +-
asm-i386/processor.h | 8 ++++++++
asm-i386/suspend.h | 5 -----
4 files changed, 9 insertions(+), 13 deletions(-)
Index: arch/i386/kernel/process.c
===================================================================
--- 8d05d70be6e83429efc6729890669881437efd13/arch/i386/kernel/process.c
(mode:100644 sha1:36145efc61b5e7aeb6da9360942152b08f449c0d)
+++ 06660dbabc1df1a5c6ee23d48bb07e09e2960a88/arch/i386/kernel/process.c
(mode:100644 sha1:b2203e21acb3844c597f770c8cef894f805a38b6)
@@ -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
===================================================================
--- 8d05d70be6e83429efc6729890669881437efd13/arch/i386/kernel/signal.c
(mode:100644 sha1:ef3602e1c05222449c2d20eefa91e82023e3d4e1)
+++ 06660dbabc1df1a5c6ee23d48bb07e09e2960a88/arch/i386/kernel/signal.c
(mode:100644 sha1:ea46d028af0872f5df65188503fcd9f71f3004e1)
@@ -618,7 +618,7 @@
* inside the kernel.
*/
if (unlikely(current->thread.debugreg[7])) {
- __asm__("movl %0,%%db7" : : "r"
(current->thread.debugreg[7]));
+ loaddebug(¤t->thread, 7);
}
/* Whee! Actually deliver the signal. */
Index: include/asm-i386/processor.h
===================================================================
--- 8d05d70be6e83429efc6729890669881437efd13/include/asm-i386/processor.h
(mode:100644 sha1:be258b0e5a5fb65e64da508e7a84fbc5eaa6cd45)
+++ 06660dbabc1df1a5c6ee23d48bb07e09e2960a88/include/asm-i386/processor.h
(mode:100644 sha1:7149784ed40bbde077e6ff0dbc68fc8cabead1b6)
@@ -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
===================================================================
--- 8d05d70be6e83429efc6729890669881437efd13/include/asm-i386/suspend.h
(mode:100644 sha1:dfc1114c1b6f86f5d4b596cc9fef14336fbe332b)
+++ 06660dbabc1df1a5c6ee23d48bb07e09e2960a88/include/asm-i386/suspend.h
(mode:100644 sha1:08be1e5009d4d773dbb77078674450ceb117f6ba)
@@ -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