Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5012310 authored by Vincent Hanquez's avatar Vincent Hanquez Committed by Linus Torvalds
Browse files

[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: default avatarVincent Hanquez <vincent.hanquez@cl.cam.ac.uk>
Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 701067c4
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -501,12 +501,16 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
} while (0)
} 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) \
#define get_debugreg(var, register)				\
		__asm__("movl %%db" #register ", %0"		\
			:"=r" (var))
#define set_debugreg(value, register)			\
		__asm__("movl %0,%%db" #register		\
		__asm__("movl %0,%%db" #register		\
			: /* no output */			\
			: /* no output */			\
                       :"r" ((thread)->debugreg[register]))
			:"r" (value))



/* Forward declaration, a strange C thing */
/* Forward declaration, a strange C thing */
struct task_struct;
struct task_struct;