]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/asm-i386/processor.h
[PATCH] xen: x86: add macro for debugreg
[linux-2.6.git] / include / asm-i386 / processor.h
index 359bb0151742b6c2c36becf4c4da74f03af9f222..c76c50e9622533caaeaf44f5e9ba35b9ff972a19 100644 (file)
@@ -501,12 +501,16 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
 } 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;