segment_descriptor.h 526 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __SEGMENT_DESCRIPTOR_H
  2. #define __SEGMENT_DESCRIPTOR_H
  3. struct segment_descriptor {
  4. u16 limit_low;
  5. u16 base_low;
  6. u8 base_mid;
  7. u8 type : 4;
  8. u8 system : 1;
  9. u8 dpl : 2;
  10. u8 present : 1;
  11. u8 limit_high : 4;
  12. u8 avl : 1;
  13. u8 long_mode : 1;
  14. u8 default_op : 1;
  15. u8 granularity : 1;
  16. u8 base_high;
  17. } __attribute__((packed));
  18. #ifdef CONFIG_X86_64
  19. /* LDT or TSS descriptor in the GDT. 16 bytes. */
  20. struct segment_descriptor_64 {
  21. struct segment_descriptor s;
  22. u32 base_higher;
  23. u32 pad_zero;
  24. };
  25. #endif
  26. #endif