diff options
-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 7d48df72aef..230ac6e50a0 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) 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 |