segment.h 425 B

123456789101112131415161718
  1. #ifndef __UM_SEGMENT_H
  2. #define __UM_SEGMENT_H
  3. extern int host_gdt_entry_tls_min;
  4. #define GDT_ENTRY_TLS_ENTRIES 3
  5. #define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min
  6. #define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
  7. typedef struct {
  8. unsigned long seg;
  9. } mm_segment_t;
  10. #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
  11. #define KERNEL_DS MAKE_MM_SEG(~0UL)
  12. #define USER_DS MAKE_MM_SEG(TASK_SIZE)
  13. #endif