Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
segment.h File Reference
#include <linux/const.h>
#include <asm/cache.h>

Go to the source code of this file.

Macros

#define GDT_ENTRY(flags, base, limit)
 
#define GDT_ENTRY_BOOT_CS   2
 
#define __BOOT_CS   (GDT_ENTRY_BOOT_CS * 8)
 
#define GDT_ENTRY_BOOT_DS   (GDT_ENTRY_BOOT_CS + 1)
 
#define __BOOT_DS   (GDT_ENTRY_BOOT_DS * 8)
 
#define GDT_ENTRY_BOOT_TSS   (GDT_ENTRY_BOOT_CS + 2)
 
#define __BOOT_TSS   (GDT_ENTRY_BOOT_TSS * 8)
 
#define GDT_ENTRY_KERNEL32_CS   1
 
#define GDT_ENTRY_KERNEL_CS   2
 
#define GDT_ENTRY_KERNEL_DS   3
 
#define __KERNEL32_CS   (GDT_ENTRY_KERNEL32_CS * 8)
 
#define GDT_ENTRY_DEFAULT_USER32_CS   4
 
#define GDT_ENTRY_DEFAULT_USER_DS   5
 
#define GDT_ENTRY_DEFAULT_USER_CS   6
 
#define __USER32_CS   (GDT_ENTRY_DEFAULT_USER32_CS*8+3)
 
#define __USER32_DS   __USER_DS
 
#define GDT_ENTRY_TSS   8 /* needs two entries */
 
#define GDT_ENTRY_LDT   10 /* needs two entries */
 
#define GDT_ENTRY_TLS_MIN   12
 
#define GDT_ENTRY_TLS_MAX   14
 
#define GDT_ENTRY_PER_CPU   15 /* Abused to load per CPU data from limit */
 
#define __PER_CPU_SEG   (GDT_ENTRY_PER_CPU * 8 + 3)
 
#define FS_TLS   0
 
#define GS_TLS   1
 
#define GS_TLS_SEL   ((GDT_ENTRY_TLS_MIN+GS_TLS)*8 + 3)
 
#define FS_TLS_SEL   ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)
 
#define GDT_ENTRIES   16
 
#define __KERNEL_CS   (GDT_ENTRY_KERNEL_CS*8)
 
#define __KERNEL_DS   (GDT_ENTRY_KERNEL_DS*8)
 
#define __USER_DS   (GDT_ENTRY_DEFAULT_USER_DS*8+3)
 
#define __USER_CS   (GDT_ENTRY_DEFAULT_USER_CS*8+3)
 
#define get_kernel_rpl()   0
 
#define USER_RPL   0x3
 
#define SEGMENT_LDT   0x4
 
#define SEGMENT_GDT   0x0
 
#define SEGMENT_RPL_MASK   0x3
 
#define SEGMENT_TI_MASK   0x4
 
#define IDT_ENTRIES   256
 
#define NUM_EXCEPTION_VECTORS   32
 
#define EXCEPTION_ERRCODE_MASK   0x00027d00
 
#define GDT_SIZE   (GDT_ENTRIES * 8)
 
#define GDT_ENTRY_TLS_ENTRIES   3
 
#define TLS_SIZE   (GDT_ENTRY_TLS_ENTRIES * 8)
 

Macro Definition Documentation

#define __BOOT_CS   (GDT_ENTRY_BOOT_CS * 8)

Definition at line 18 of file segment.h.

#define __BOOT_DS   (GDT_ENTRY_BOOT_DS * 8)

Definition at line 21 of file segment.h.

#define __BOOT_TSS   (GDT_ENTRY_BOOT_TSS * 8)

Definition at line 24 of file segment.h.

#define __KERNEL32_CS   (GDT_ENTRY_KERNEL32_CS * 8)

Definition at line 154 of file segment.h.

#define __KERNEL_CS   (GDT_ENTRY_KERNEL_CS*8)

Definition at line 187 of file segment.h.

#define __KERNEL_DS   (GDT_ENTRY_KERNEL_DS*8)

Definition at line 188 of file segment.h.

#define __PER_CPU_SEG   (GDT_ENTRY_PER_CPU * 8 + 3)

Definition at line 174 of file segment.h.

#define __USER32_CS   (GDT_ENTRY_DEFAULT_USER32_CS*8+3)

Definition at line 165 of file segment.h.

#define __USER32_DS   __USER_DS

Definition at line 166 of file segment.h.

#define __USER_CS   (GDT_ENTRY_DEFAULT_USER_CS*8+3)

Definition at line 190 of file segment.h.

#define __USER_DS   (GDT_ENTRY_DEFAULT_USER_DS*8+3)

Definition at line 189 of file segment.h.

#define EXCEPTION_ERRCODE_MASK   0x00027d00

Definition at line 209 of file segment.h.

#define FS_TLS   0

Definition at line 177 of file segment.h.

#define FS_TLS_SEL   ((GDT_ENTRY_TLS_MIN+FS_TLS)*8 + 3)

Definition at line 181 of file segment.h.

#define GDT_ENTRIES   16

Definition at line 183 of file segment.h.

#define GDT_ENTRY (   flags,
  base,
  limit 
)
Value:
((((base) & _AC(0xff000000,ULL)) << (56-24)) | \
(((flags) & _AC(0x0000f0ff,ULL)) << 40) | \
(((limit) & _AC(0x000f0000,ULL)) << (48-16)) | \
(((base) & _AC(0x00ffffff,ULL)) << 16) | \
(((limit) & _AC(0x0000ffff,ULL))))

Definition at line 8 of file segment.h.

#define GDT_ENTRY_BOOT_CS   2

Definition at line 17 of file segment.h.

#define GDT_ENTRY_BOOT_DS   (GDT_ENTRY_BOOT_CS + 1)

Definition at line 20 of file segment.h.

#define GDT_ENTRY_BOOT_TSS   (GDT_ENTRY_BOOT_CS + 2)

Definition at line 23 of file segment.h.

#define GDT_ENTRY_DEFAULT_USER32_CS   4

Definition at line 162 of file segment.h.

#define GDT_ENTRY_DEFAULT_USER_CS   6

Definition at line 164 of file segment.h.

#define GDT_ENTRY_DEFAULT_USER_DS   5

Definition at line 163 of file segment.h.

#define GDT_ENTRY_KERNEL32_CS   1

Definition at line 150 of file segment.h.

#define GDT_ENTRY_KERNEL_CS   2

Definition at line 151 of file segment.h.

#define GDT_ENTRY_KERNEL_DS   3

Definition at line 152 of file segment.h.

#define GDT_ENTRY_LDT   10 /* needs two entries */

Definition at line 169 of file segment.h.

#define GDT_ENTRY_PER_CPU   15 /* Abused to load per CPU data from limit */

Definition at line 173 of file segment.h.

#define GDT_ENTRY_TLS_ENTRIES   3

Definition at line 211 of file segment.h.

#define GDT_ENTRY_TLS_MAX   14

Definition at line 171 of file segment.h.

#define GDT_ENTRY_TLS_MIN   12

Definition at line 170 of file segment.h.

#define GDT_ENTRY_TSS   8 /* needs two entries */

Definition at line 168 of file segment.h.

#define GDT_SIZE   (GDT_ENTRIES * 8)

Definition at line 210 of file segment.h.

#define get_kernel_rpl ( )    0

Definition at line 192 of file segment.h.

#define GS_TLS   1

Definition at line 178 of file segment.h.

#define GS_TLS_SEL   ((GDT_ENTRY_TLS_MIN+GS_TLS)*8 + 3)

Definition at line 180 of file segment.h.

#define IDT_ENTRIES   256

Definition at line 206 of file segment.h.

#define NUM_EXCEPTION_VECTORS   32

Definition at line 207 of file segment.h.

#define SEGMENT_GDT   0x0

Definition at line 199 of file segment.h.

#define SEGMENT_LDT   0x4

Definition at line 198 of file segment.h.

#define SEGMENT_RPL_MASK   0x3

Definition at line 202 of file segment.h.

#define SEGMENT_TI_MASK   0x4

Definition at line 204 of file segment.h.

#define TLS_SIZE   (GDT_ENTRY_TLS_ENTRIES * 8)

Definition at line 212 of file segment.h.

#define USER_RPL   0x3

Definition at line 196 of file segment.h.