Skip to content

Commit

Permalink
x86: get_desc_base
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland McGrath authored and Ingo Molnar committed Jan 30, 2008
1 parent cadd516 commit 859c0a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/asm-x86/desc_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 859c0a5

Please sign in to comment.