xref: /haiku/headers/private/kernel/arch/x86/descriptors.h (revision e688bf23d48bfd1216a0cacbdbda5e35a1bcd779)
1 /*
2  * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef _KERNEL_ARCH_x86_DESCRIPTORS_H
9 #define _KERNEL_ARCH_x86_DESCRIPTORS_H
10 
11 
12 #ifndef _ASSEMBLER
13 
14 
15 enum descriptor_privilege_levels {
16 	DPL_KERNEL = 0,
17 	DPL_USER = 3,
18 };
19 
20 enum descriptor_types {
21 	// segment types
22 	DT_CODE_EXECUTE_ONLY = 0x8,
23 	DT_CODE_ACCESSED = 0x9,
24 	DT_CODE_READABLE = 0xa,
25 	DT_CODE_CONFORM = 0xc,
26 	DT_DATA_READ_ONLY = 0x0,
27 	DT_DATA_ACCESSED = 0x1,
28 	DT_DATA_WRITEABLE = 0x2,
29 	DT_DATA_EXPANSION_DOWN = 0x4,
30 
31 	DT_TSS = 9,
32 		/* non busy, 32 bit */
33 
34 	// descriptor types
35 	DT_SYSTEM_SEGMENT = 0,
36 	DT_CODE_DATA_SEGMENT = 1,
37 };
38 
39 enum gate_types {
40 	GATE_INTERRUPT = 14,
41 	GATE_TRAP = 15,
42 };
43 
44 
45 #endif	// !_ASSEMBLER
46 
47 
48 #ifdef __x86_64__
49 #	include <arch/x86/64/descriptors.h>
50 #else
51 #	include <arch/x86/32/descriptors.h>
52 #endif
53 
54 
55 #endif	/* _KERNEL_ARCH_x86_DESCRIPTORS_H */
56