]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blob - libc/kernel/arch-x86/asm/segment_32.h
auto import from //depot/cupcake/@135843
[android-sdk/platform-bionic.git] / libc / kernel / arch-x86 / asm / segment_32.h
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _ASM_SEGMENT_H
13 #define _ASM_SEGMENT_H
15 #define GDT_ENTRY_TLS_ENTRIES 3
16 #define GDT_ENTRY_TLS_MIN 6
17 #define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
19 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
21 #define GDT_ENTRY_DEFAULT_USER_CS 14
22 #define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS * 8 + 3)
24 #define GDT_ENTRY_DEFAULT_USER_DS 15
25 #define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS * 8 + 3)
27 #define GDT_ENTRY_KERNEL_BASE 12
29 #define GDT_ENTRY_KERNEL_CS (GDT_ENTRY_KERNEL_BASE + 0)
30 #define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8)
32 #define GDT_ENTRY_KERNEL_DS (GDT_ENTRY_KERNEL_BASE + 1)
33 #define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
35 #define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE + 4)
36 #define GDT_ENTRY_LDT (GDT_ENTRY_KERNEL_BASE + 5)
38 #define GDT_ENTRY_PNPBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 6)
39 #define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 11)
41 #define GDT_ENTRY_ESPFIX_SS (GDT_ENTRY_KERNEL_BASE + 14)
42 #define __ESPFIX_SS (GDT_ENTRY_ESPFIX_SS * 8)
44 #define GDT_ENTRY_PERCPU (GDT_ENTRY_KERNEL_BASE + 15)
45 #define __KERNEL_PERCPU 0
47 #define GDT_ENTRY_DOUBLEFAULT_TSS 31
49 #define GDT_ENTRIES 32
50 #define GDT_SIZE (GDT_ENTRIES * 8)
52 #define GDT_ENTRY_BOOT_CS 2
53 #define __BOOT_CS (GDT_ENTRY_BOOT_CS * 8)
55 #define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1)
56 #define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8)
58 #define GDT_ENTRY_PNPBIOS_CS32 (GDT_ENTRY_PNPBIOS_BASE + 0)
59 #define GDT_ENTRY_PNPBIOS_CS16 (GDT_ENTRY_PNPBIOS_BASE + 1)
60 #define GDT_ENTRY_PNPBIOS_DS (GDT_ENTRY_PNPBIOS_BASE + 2)
61 #define GDT_ENTRY_PNPBIOS_TS1 (GDT_ENTRY_PNPBIOS_BASE + 3)
62 #define GDT_ENTRY_PNPBIOS_TS2 (GDT_ENTRY_PNPBIOS_BASE + 4)
64 #define PNP_CS32 (GDT_ENTRY_PNPBIOS_CS32 * 8)  
65 #define PNP_CS16 (GDT_ENTRY_PNPBIOS_CS16 * 8)  
66 #define PNP_DS (GDT_ENTRY_PNPBIOS_DS * 8)  
67 #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8)  
68 #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8)  
70 #define IDT_ENTRIES 256
72 #define SEGMENT_RPL_MASK 0x3
74 #define SEGMENT_TI_MASK 0x4
76 #define USER_RPL 0x3
78 #define SEGMENT_LDT 0x4
79 #define SEGMENT_GDT 0x0
81 #define get_kernel_rpl() 0
83 #define SEGMENT_IS_KERNEL_CODE(x) (((x) & 0xfc) == GDT_ENTRY_KERNEL_CS * 8)
85 #define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8)
87 #define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8)
89 #endif