2002-07-25 00:59:25 +04:00
|
|
|
/*
|
2006-01-11 01:54:36 +03:00
|
|
|
* Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-25 00:59:25 +04:00
|
|
|
#ifndef _KERNEL_ARCH_x86_DESCRIPTORS_H
|
|
|
|
#define _KERNEL_ARCH_x86_DESCRIPTORS_H
|
|
|
|
|
|
|
|
|
2003-01-06 11:02:44 +03:00
|
|
|
#ifndef _ASSEMBLER
|
|
|
|
|
|
|
|
|
|
|
|
enum descriptor_privilege_levels {
|
|
|
|
DPL_KERNEL = 0,
|
|
|
|
DPL_USER = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum descriptor_types {
|
|
|
|
// segment types
|
|
|
|
DT_CODE_EXECUTE_ONLY = 0x8,
|
|
|
|
DT_CODE_ACCESSED = 0x9,
|
|
|
|
DT_CODE_READABLE = 0xa,
|
|
|
|
DT_CODE_CONFORM = 0xc,
|
|
|
|
DT_DATA_READ_ONLY = 0x0,
|
|
|
|
DT_DATA_ACCESSED = 0x1,
|
|
|
|
DT_DATA_WRITEABLE = 0x2,
|
|
|
|
DT_DATA_EXPANSION_DOWN = 0x4,
|
|
|
|
|
|
|
|
DT_TSS = 9,
|
2004-12-14 04:46:46 +03:00
|
|
|
/* non busy, 32 bit */
|
2003-01-06 11:02:44 +03:00
|
|
|
|
|
|
|
// descriptor types
|
|
|
|
DT_SYSTEM_SEGMENT = 0,
|
|
|
|
DT_CODE_DATA_SEGMENT = 1,
|
|
|
|
};
|
|
|
|
|
2012-07-02 21:47:06 +04:00
|
|
|
enum gate_types {
|
|
|
|
GATE_INTERRUPT = 14,
|
|
|
|
GATE_TRAP = 15,
|
|
|
|
};
|
2003-01-06 11:02:44 +03:00
|
|
|
|
|
|
|
|
2012-07-02 21:47:06 +04:00
|
|
|
#endif // !_ASSEMBLER
|
2003-01-06 11:02:44 +03:00
|
|
|
|
|
|
|
|
2012-07-02 21:47:06 +04:00
|
|
|
#ifdef __x86_64__
|
|
|
|
# include <arch/x86/64/descriptors.h>
|
|
|
|
#else
|
|
|
|
# include <arch/x86/32/descriptors.h>
|
|
|
|
#endif
|
2003-01-06 11:02:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _KERNEL_ARCH_x86_DESCRIPTORS_H */
|