linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "[PATCH
@ 2005-04-26 10:38 Vincent Hanquez
  2005-04-26 10:55 ` [PATCH 1/6][XEN][x86] add macro for debugreg Vincent Hanquez
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Hanquez @ 2005-04-26 10:38 UTC (permalink / raw)
  To: 1/6][XEN], [x86], akpm, , <ian.pratt@cl.cam.ac.uk>,,
	<vincent.hanquez@cl.cam.ac.uk>, add, Andrew, debugreg, ,
	for, Hanquez, linux-kernel@vger.kernel.org, macro, Morton, Pratt,
	Vincent
  Cc: Ian

Hi,

The following patch 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.

I can regenerate a patch keeping loaddebug if you folks seems that is
necessary or better.

Please apply, or comments.

	Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>

diff -Naur linux-2.6.12-rc3/include/asm-i386/processor.h linux-2.6.12-rc3.1/include/asm-i386/processor.h
--- linux-2.6.12-rc3/include/asm-i386/processor.h	2005-04-21 11:46:10.000000000 +0100
+++ linux-2.6.12-rc3.1/include/asm-i386/processor.h	2005-04-22 12:09:43.000000000 +0100
@@ -501,12 +501,16 @@
 } 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 cpu_get_debugreg(var, register)				\
+		__asm__("movl %%db" #register ", %0"		\
+			:"=r" (var))
+#define cpu_set_debugreg(value, register)			\
+		__asm__("movl %0,%%db" #register		\
+			: /* no output */			\
+			:"r" (value))
+
 
 /* Forward declaration, a strange C thing */
 struct task_struct;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/6][XEN][x86] add macro for debugreg
  2005-04-26 10:38 "[PATCH Vincent Hanquez
@ 2005-04-26 10:55 ` Vincent Hanquez
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Hanquez @ 2005-04-26 10:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: ian.pratt, akpm

Hi,

The following patch 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.

I can regenerate a patch keeping loaddebug if you folks seems that is
necessary or better.

ignore my previous mail, really sorry for the noise.

Please apply, or comments.

	Signed-off-by: Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>

diff -Naur linux-2.6.12-rc3/include/asm-i386/processor.h linux-2.6.12-rc3.1/include/asm-i386/processor.h
--- linux-2.6.12-rc3/include/asm-i386/processor.h	2005-04-21 11:46:10.000000000 +0100
+++ linux-2.6.12-rc3.1/include/asm-i386/processor.h	2005-04-22 12:09:43.000000000 +0100
@@ -501,12 +501,16 @@
 } 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 cpu_get_debugreg(var, register)				\
+		__asm__("movl %%db" #register ", %0"		\
+			:"=r" (var))
+#define cpu_set_debugreg(value, register)			\
+		__asm__("movl %0,%%db" #register		\
+			: /* no output */			\
+			:"r" (value))
+
 
 /* Forward declaration, a strange C thing */
 struct task_struct;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-26 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 10:55 ` [PATCH 1/6][XEN][x86] add macro for debugreg Vincent Hanquez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).