mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tab@snarc.org (Vincent Hanquez)
To: "1/6][XEN]"@snarc.org, "[x86]"@snarc.org, <akpm@osdl.org>, ",
	<ian.pratt@cl.cam.ac.uk>,,
	<vincent.hanquez@cl.cam.ac.uk>"@snarc.org, add@snarc.org,
	Andrew@snarc.org, debugreg@snarc.org, ",
	for, Hanquez, linux-kernel@vger.kernel.org, macro, Morton, Pratt,
	Vincent"@snarc.org
Cc: Ian@snarc.org
Subject: "[PATCH
Date: Tue, 26 Apr 2005 12:38:02 +0200 (CEST)	[thread overview]
Message-ID: <20050426103802.E7DC94BE12@darwin.snarc.org> (raw)

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;

             reply	other threads:[~2005-04-26 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26 10:38 Vincent Hanquez [this message]
2005-04-26 10:55 ` [PATCH 1/6][XEN][x86] add macro for debugreg Vincent Hanquez
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 10:38 "[PATCH Vincent Hanquez
2005-04-26 10:38 "[PATCH Vincent Hanquez
2023-10-08  2:10 [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:10 ` [PATCH Pavan Bobba
2023-10-08  2:13 ` [PATCH opensource india

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050426103802.E7DC94BE12@darwin.snarc.org \
    --to=tab@snarc.org \
    --cc=", <ian.pratt@cl.cam.ac.uk>,, <vincent.hanquez@cl.cam.ac.uk>"@snarc.org \
    --cc=", for, Hanquez, linux-kernel@vger.kernel.org, macro, Morton, Pratt, Vincent"@snarc.org \
    --cc="1/6][XEN]"@snarc.org \
    --cc="[x86]"@snarc.org \
    --cc=Andrew@snarc.org \
    --cc=Ian@snarc.org \
    --cc=add@snarc.org \
    --cc=akpm@osdl.org \
    --cc=debugreg@snarc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®