aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386
diff options
context:
space:
mode:
authorVincent Hanquez <vincent.hanquez@cl.cam.ac.uk>2005-06-23 03:08:42 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:13 -0400
commitf5012310e35bd62fd39fce338ee44422c975ff3c (patch)
treec50cb94b050947c41f285f5b40896ad0a977777b /include/asm-i386
parent701067c4661ebcdc155cc8f696acb24c016c058b (diff)
[PATCH] xen: x86: add macro for debugreg
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 <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>
Diffstat (limited to 'include/asm-i386')
-rw-r--r--include/asm-i386/processor.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 359bb0151742..c76c50e96225 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -501,12 +501,16 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
501} while (0) 501} while (0)
502 502
503/* 503/*
504 * This special macro can be used to load a debugging register 504 * These special macros can be used to get or set a debugging register
505 */ 505 */
506#define loaddebug(thread,register) \ 506#define get_debugreg(var, register) \
507 __asm__("movl %0,%%db" #register \ 507 __asm__("movl %%db" #register ", %0" \
508 : /* no output */ \ 508 :"=r" (var))
509 :"r" ((thread)->debugreg[register])) 509#define set_debugreg(value, register) \
510 __asm__("movl %0,%%db" #register \
511 : /* no output */ \
512 :"r" (value))
513
510 514
511/* Forward declaration, a strange C thing */ 515/* Forward declaration, a strange C thing */
512struct task_struct; 516struct task_struct;