1c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
2c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * ldt.h
3c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru *
4c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * Definitions of structures used with the modify_ldt system call.
5c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
6c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#ifndef _ASM_X86_LDT_H
7c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define _ASM_X86_LDT_H
8c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
9c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* Maximum number of LDT entries supported. */
10c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define LDT_ENTRIES	8192
11c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/* The size of each LDT entry. */
12c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define LDT_ENTRY_SIZE	8
13c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
14c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#ifndef __ASSEMBLY__
15c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru/*
16c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
17c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * not to the default values if you still want to do syscalls. This
18c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru * call is more for 32bit mode therefore.
19c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru */
20c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Querustruct user_desc {
21c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  entry_number;
22c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  base_addr;
23c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  limit;
24c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  seg_32bit:1;
25c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  contents:2;
26c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  read_exec_only:1;
27c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  limit_in_pages:1;
28c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  seg_not_present:1;
29c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  useable:1;
30c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#ifdef __x86_64__
31c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru	unsigned int  lm:1;
32c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#endif
33c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru};
34c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
35c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define MODIFY_LDT_CONTENTS_DATA	0
36c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define MODIFY_LDT_CONTENTS_STACK	1
37c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#define MODIFY_LDT_CONTENTS_CODE	2
38c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru
39c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#endif /* !__ASSEMBLY__ */
40c559cd81139f97cecad1ad91a0b2e25a5936d53Jean-Baptiste Queru#endif
41