segment.h 464 B

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