Carsten Otte | 5fb76f9 | 2007-10-29 16:08:51 +0100 | [diff] [blame] | 1 | #ifndef __SEGMENT_DESCRIPTOR_H |
| 2 | #define __SEGMENT_DESCRIPTOR_H |
| 3 | |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 4 | struct segment_descriptor { |
| 5 | u16 limit_low; |
| 6 | u16 base_low; |
| 7 | u8 base_mid; |
| 8 | u8 type : 4; |
| 9 | u8 system : 1; |
| 10 | u8 dpl : 2; |
| 11 | u8 present : 1; |
| 12 | u8 limit_high : 4; |
| 13 | u8 avl : 1; |
| 14 | u8 long_mode : 1; |
| 15 | u8 default_op : 1; |
| 16 | u8 granularity : 1; |
| 17 | u8 base_high; |
| 18 | } __attribute__((packed)); |
| 19 | |
Carsten Otte | 5fb76f9 | 2007-10-29 16:08:51 +0100 | [diff] [blame] | 20 | #ifdef CONFIG_X86_64 |
| 21 | /* LDT or TSS descriptor in the GDT. 16 bytes. */ |
| 22 | struct segment_descriptor_64 { |
| 23 | struct segment_descriptor s; |
| 24 | u32 base_higher; |
| 25 | u32 pad_zero; |
| 26 | }; |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 27 | |
Carsten Otte | 5fb76f9 | 2007-10-29 16:08:51 +0100 | [diff] [blame] | 28 | #endif |
| 29 | #endif |