Skip to content

Commit

Permalink
[PATCH] xen: x86: add macro for debugreg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vincent Hanquez authored and Linus Torvalds committed Jun 23, 2005
1 parent 701067c commit f501231
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions include/asm-i386/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f501231

Please sign in to comment.