tls.h 972 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _SYSDEP_TLS_H
  3. #define _SYSDEP_TLS_H
  4. #ifdef __UM_HOST__
  5. /* Change name to avoid conflicts with the original one from <asm/ldt.h>, which
  6. * may be named user_desc (but in 2.4 and in header matching its API was named
  7. * modify_ldt_ldt_s). */
  8. typedef struct um_dup_user_desc {
  9. unsigned int entry_number;
  10. unsigned int base_addr;
  11. unsigned int limit;
  12. unsigned int seg_32bit:1;
  13. unsigned int contents:2;
  14. unsigned int read_exec_only:1;
  15. unsigned int limit_in_pages:1;
  16. unsigned int seg_not_present:1;
  17. unsigned int useable:1;
  18. #ifdef __x86_64__
  19. unsigned int lm:1;
  20. #endif
  21. } user_desc_t;
  22. #else /* __UM_HOST__ */
  23. typedef struct user_desc user_desc_t;
  24. #endif /* __UM_HOST__ */
  25. extern int os_set_thread_area(user_desc_t *info, int pid);
  26. extern int os_get_thread_area(user_desc_t *info, int pid);
  27. #ifdef __i386__
  28. #define GDT_ENTRY_TLS_MIN_I386 6
  29. #define GDT_ENTRY_TLS_MIN_X86_64 12
  30. #endif
  31. #endif /* _SYSDEP_TLS_H */