246ff7ace5e5bcd66a65666deb634f22e55224f3
[pandora-kernel.git] / arch / x86 / um / shared / sysdep / host_ldt.h
1 #ifndef __ASM_HOST_LDT_H
2 #define __ASM_HOST_LDT_H
3
4 #include <asm/ldt.h>
5
6 #define LDT_entry_a(info) \
7         ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
8
9 #define LDT_entry_b(info) \
10         (((info)->base_addr & 0xff000000) | \
11         (((info)->base_addr & 0x00ff0000) >> 16) | \
12         ((info)->limit & 0xf0000) | \
13         (((info)->read_exec_only ^ 1) << 9) | \
14         ((info)->contents << 10) | \
15         (((info)->seg_not_present ^ 1) << 15) | \
16         ((info)->seg_32bit << 22) | \
17         ((info)->limit_in_pages << 23) | \
18         ((info)->useable << 20) | \
19         0x7000)
20
21 #define _LDT_empty(info) (\
22         (info)->base_addr       == 0    && \
23         (info)->limit           == 0    && \
24         (info)->contents        == 0    && \
25         (info)->read_exec_only  == 1    && \
26         (info)->seg_32bit       == 0    && \
27         (info)->limit_in_pages  == 0    && \
28         (info)->seg_not_present == 1    && \
29         (info)->useable         == 0    )
30
31 #ifdef CONFIG_X86_64
32 #define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0))
33 #else
34 #define LDT_empty(info) (_LDT_empty(info))
35 #endif
36
37 #endif