mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] x86: get_desc_base
@ 2007-11-21 10:19 Roland McGrath
  2007-11-21 10:20 ` [PATCH 2/5] x86: use get_desc_base Roland McGrath
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Roland McGrath @ 2007-11-21 10:19 UTC (permalink / raw)
  To: Andrew Morton, Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: linux-kernel


This defines the get_desc_base function in asm-x86/desc_64.h to match the
one in desc_32.h.  If these two files ever get merged together, this
function could be the same in both.

Signed-off-by: Roland McGrath <roland@redhat.com>

diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h
index 7d9c938..70bd72f 100644
--- a/include/asm-x86/desc_64.h
+++ b/include/asm-x86/desc_64.h
@@ -199,6 +199,16 @@ static inline void load_LDT(mm_context_t *pc)
 
 extern struct desc_ptr idt_descr;
 
+static inline unsigned long get_desc_base(const void *ptr)
+{
+	const u32 *desc = ptr;
+	unsigned long base;
+	base = ((desc[0] >> 16)  & 0x0000ffff) |
+		((desc[1] << 16) & 0x00ff0000) |
+		(desc[1] & 0xff000000);
+	return base;
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif

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

end of thread, other threads:[~2007-11-22  9:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21 10:19 [PATCH 1/5] x86: get_desc_base Roland McGrath
2007-11-21 10:20 ` [PATCH 2/5] x86: use get_desc_base Roland McGrath
2007-11-21 18:30   ` Zachary Amsden
2007-11-21 10:21 ` [PATCH 3/5] x86: ptrace fs/gs_base Roland McGrath
2007-11-21 10:23 ` [PATCH 4/5] x86: desc_empty Roland McGrath
2007-11-21 10:25 ` [PATCH 5/5] x86: TLS cleanup Roland McGrath
2007-11-21 11:58   ` Thomas Gleixner
2007-11-21 18:34   ` Zachary Amsden
2007-11-21 22:37     ` Roland McGrath
2007-11-21 22:38     ` [replacement PATCH 5/6] x86: tls32 moved Roland McGrath
2007-11-21 22:39     ` [replacement PATCH 6/6] x86: TLS cleanup Roland McGrath
2007-11-22  9:10       ` Thomas Gleixner

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®