memset(&info, 0, sizeof(struct user_desc));
info.entry_number = idx;
- info.base_addr = get_desc_base((void *)desc);
+ info.base_addr = get_desc_base((struct desc_struct *)desc);
info.limit = GET_LIMIT(desc);
info.seg_32bit = GET_32BIT(desc);
info.contents = GET_CONTENTS(desc);
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base((struct desc_struct *)desc);
if (seg & (1<<2)) {
mutex_unlock(¤t->mm->context.lock);
preempt_enable();
}
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+ return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
+}
+
#else
/*
* GET_DESC_BASE reads the descriptor base of the specified segment.
#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
-static inline unsigned long get_desc_base(unsigned long *desc)
-{
- unsigned long base;
- base = ((desc[0] >> 16) & 0x0000ffff) |
- ((desc[1] << 16) & 0x00ff0000) |
- (desc[1] & 0xff000000);
- return base;
-}
#endif /* !__ASSEMBLY__ */
#endif
gdt[i] = t->tls_array[i];
}
-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