提交 859c0a5b 编写于 作者: R Roland McGrath 提交者: Ingo Molnar

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: NRoland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 cadd5164
...@@ -215,6 +215,16 @@ static inline void load_LDT(mm_context_t *pc) ...@@ -215,6 +215,16 @@ static inline void load_LDT(mm_context_t *pc)
extern struct desc_ptr idt_descr; 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 /* !__ASSEMBLY__ */
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册