diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:30:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:44 -0500 |
commit | 859c0a5b9ca8eba2d65fa42f02505d76f8a712c7 (patch) | |
tree | b0956c5934213c443d8ad96394f7188368d8aa0d | |
parent | cadd516422d9382313144aa58f9e46ee7a2c0a28 (diff) |
x86: get_desc_base
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>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | include/asm-x86/desc_64.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h index 7d48df72aef2..230ac6e50a0f 100644 --- a/include/asm-x86/desc_64.h +++ b/include/asm-x86/desc_64.h | |||
@@ -215,6 +215,16 @@ static inline void load_LDT(mm_context_t *pc) | |||
215 | 215 | ||
216 | extern struct desc_ptr idt_descr; | 216 | extern struct desc_ptr idt_descr; |
217 | 217 | ||
218 | static inline unsigned long get_desc_base(const void *ptr) | ||
219 | { | ||
220 | const u32 *desc = ptr; | ||
221 | unsigned long base; | ||
222 | base = ((desc[0] >> 16) & 0x0000ffff) | | ||
223 | ((desc[1] << 16) & 0x00ff0000) | | ||
224 | (desc[1] & 0xff000000); | ||
225 | return base; | ||
226 | } | ||
227 | |||
218 | #endif /* !__ASSEMBLY__ */ | 228 | #endif /* !__ASSEMBLY__ */ |
219 | 229 | ||
220 | #endif | 230 | #endif |