Only call addrspace_destroy() if USERPROG.
[pintos-anon] / src / threads / gdt.h
1 #ifndef HEADER_GDT_H
2 #define HEADER_GDT_H 1
3
4 /* Segment selectors. */
5 #define SEL_NULL        0x00    /* Null selector. */
6 #define SEL_KCSEG       0x08    /* Kernel code selector. */
7 #define SEL_KDSEG       0x10    /* Kernel data selector. */
8 #define SEL_UCSEG       0x1B    /* User code selector. */
9 #define SEL_UDSEG       0x23    /* User data selector. */
10 #define SEL_TSS         0x28    /* Task-state segment. */
11 #define SEL_CNT         6       /* Number of segments. */
12
13 #ifndef __ASSEMBLER__
14 #include <stdint.h>
15
16 static inline uint64_t
17 make_dtr_operand (uint16_t limit, void *base)
18 {
19   return limit | ((uint64_t) (uint32_t) base << 16);
20 }
21
22 void gdt_init (void);
23 #endif
24
25 #endif /* gdt.h */