mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zach@vmware.com
To: akpm@osdl.org, chrisl@vmware.com, chrisw@osdl.org, hpa@zytor.com,
	Keir.Fraser@cl.cam.ac.uk, linux-kernel@vger.kernel.org,
	m+Ian.Pratt@cl.cam.ac.uk, mbligh@mbligh.org, pratap@vmware.com,
	virtualization@lists.osdl.org, zach@vmware.com,
	zwane@arm.linux.org.uk
Subject: [PATCH 10/14] i386 / Move descriptor accessors into desc h
Date: Wed, 10 Aug 2005 21:57:20 -0700	[thread overview]
Message-ID: <200508110457.j7B4vKFb019603@zach-dev.vmware.com> (raw)

Move base / limit accessors into desc.h, where they properly belong.

Patch-base: 2.6.13-rc5-mm1
Patch-keys: i386 desc cleanup
Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.13/include/asm-i386/system.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/system.h	2005-08-09 20:17:26.000000000 -0700
+++ linux-2.6.13/include/asm-i386/system.h	2005-08-09 20:17:27.000000000 -0700
@@ -29,40 +29,6 @@
 		      "2" (prev), "d" (next));				\
 } while (0)
 
-#define _set_base(desc,base) do {					\
-	unsigned long __tmp;						\
-	typecheck(struct desc_struct *, desc);				\
-	asm volatile("movw %w5,%2\n\t"					\
-		     "rorl $16,%5\n\t"					\
-		     "movb %b5,%3\n\t"					\
-		     "movb %h5,%4"					\
-		     :"=m"(*(desc)),					\
-		      "=&q" (__tmp)					\
-		     :"m" (*((char *)(desc)+2)),			\
-		      "m" (*((char *)(desc)+4)),			\
-		      "m" (*((char *)(desc)+7)),			\
-		      "1" (base));					\
-} while(0)
-
-#define _set_limit(desc,limit) do {					\
-	unsigned long __tmp;						\
-	typecheck(struct desc_struct *, desc);				\
-	asm volatile("movw %w4,%2\n\t"					\
-		     "rorl $16,%4\n\t"					\
-		     "movb %3,%h4\n\t"					\
-		     "andb $0xf0,%h4\n\t"				\
-		     "orb %h4,%b4\n\t"					\
-		     "movb %b4,%3"					\
-		     :"=m"(*(desc)),					\
-		      "=&q" (__tmp)					\
-		     :"m" (*(desc)),					\
-		      "m" (*((char *)(desc)+6)),			\
-		      "1" (limit));					\
-} while(0)
-
-#define set_base(desc,base) _set_base((desc), (base))
-#define set_limit(desc,limit) _set_limit((desc), ((limit)-1)>>12)
-
 /*
  * Load a segment. Fall back on loading the zero
  * segment if something goes wrong..
Index: linux-2.6.13/include/asm-i386/desc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/desc.h	2005-08-09 20:17:26.000000000 -0700
+++ linux-2.6.13/include/asm-i386/desc.h	2005-08-10 20:40:51.000000000 -0700
@@ -73,6 +73,40 @@
 		      : "1" (addr), "r"(desc), "ir"(limit), "i"(type)); \
 } while (0)
   
+#define _set_base(desc,base) do {					\
+	unsigned long __tmp;						\
+	typecheck(struct desc_struct *, desc);				\
+	asm volatile("movw %w5,%2\n\t"					\
+		     "rorl $16,%5\n\t"					\
+		     "movb %b5,%3\n\t"					\
+		     "movb %h5,%4"					\
+		     :"=m"(*(desc)),					\
+		      "=&q" (__tmp)					\
+		     :"m" (*((char *)(desc)+2)),			\
+		      "m" (*((char *)(desc)+4)),			\
+ 		      "m" (*((char *)(desc)+7)),			\
+		      "1" (base));					\
+} while(0)
+
+#define _set_limit(desc,limit) do {					\
+	unsigned long __tmp;						\
+	typecheck(struct desc_struct *, desc);				\
+	asm volatile("movw %w4,%2\n\t"					\
+		     "rorl $16,%4\n\t"					\
+		     "movb %3,%h4\n\t"					\
+		     "andb $0xf0,%h4\n\t"				\
+		     "orb %h4,%b4\n\t"					\
+		     "movb %b4,%3"					\
+		     :"=m"(*(desc)),					\
+		      "=&q" (__tmp)					\
+		     :"m" (*(desc)),					\
+		      "m" (*((char *)(desc)+6)),			\
+		      "1" (limit));					\
+} while(0)
+
+#define set_base(desc,base) _set_base((desc), (base))
+#define set_limit(desc,limit) _set_limit((desc), ((limit)-1)>>12)
+
 #include <mach_desc.h>
 
 #define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)

                 reply	other threads:[~2005-08-11  4:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200508110457.j7B4vKFb019603@zach-dev.vmware.com \
    --to=zach@vmware.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=chrisl@vmware.com \
    --cc=chrisw@osdl.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=mbligh@mbligh.org \
    --cc=pratap@vmware.com \
    --cc=virtualization@lists.osdl.org \
    --cc=zwane@arm.linux.org.uk \
    /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®