From: Vincent Hanquez <[email-masked]>

Add 2 macros to set and get debugreg on x86.  This is useful for Xen because
it will need only to redefine each macro to a hypervisor call.

Signed-off-by: Vincent Hanquez <[email-masked]>
Cc: Ian Pratt <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 include/asm-i386/processor.h |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -puN include/asm-i386/processor.h~xen-x86-add-macro-for-debugreg include/asm-i386/processor.h
--- 25/include/asm-i386/processor.h~xen-x86-add-macro-for-debugreg	2005-04-26 20:56:11.768134320 -0700
+++ 25-akpm/include/asm-i386/processor.h	2005-04-26 20:56:11.772133712 -0700
@@ -501,12 +501,16 @@ static inline void load_esp0(struct tss_
 } while (0)
 
 /*
- * This special macro can be used to load a debugging register
+ * These special macros can be used to get or set a debugging register
  */
-#define loaddebug(thread,register) \
-               __asm__("movl %0,%%db" #register  \
-                       : /* no output */ \
-                       :"r" ((thread)->debugreg[register]))
+#define get_debugreg(var, register)				\
+		__asm__("movl %%db" #register ", %0"		\
+			:"=r" (var))
+#define set_debugreg(value, register)			\
+		__asm__("movl %0,%%db" #register		\
+			: /* no output */			\
+			:"r" (value))
+
 
 /* Forward declaration, a strange C thing */
 struct task_struct;
_