host_ldt.h 956 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __ASM_HOST_LDT_H
  2. #define __ASM_HOST_LDT_H
  3. #include <asm/ldt.h>
  4. #define LDT_entry_a(info) \
  5. ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
  6. #define LDT_entry_b(info) \
  7. (((info)->base_addr & 0xff000000) | \
  8. (((info)->base_addr & 0x00ff0000) >> 16) | \
  9. ((info)->limit & 0xf0000) | \
  10. (((info)->read_exec_only ^ 1) << 9) | \
  11. ((info)->contents << 10) | \
  12. (((info)->seg_not_present ^ 1) << 15) | \
  13. ((info)->seg_32bit << 22) | \
  14. ((info)->limit_in_pages << 23) | \
  15. ((info)->useable << 20) | \
  16. 0x7000)
  17. #define _LDT_empty(info) (\
  18. (info)->base_addr == 0 && \
  19. (info)->limit == 0 && \
  20. (info)->contents == 0 && \
  21. (info)->read_exec_only == 1 && \
  22. (info)->seg_32bit == 0 && \
  23. (info)->limit_in_pages == 0 && \
  24. (info)->seg_not_present == 1 && \
  25. (info)->useable == 0 )
  26. #ifdef CONFIG_X86_64
  27. #define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0))
  28. #else
  29. #define LDT_empty(info) (_LDT_empty(info))
  30. #endif
  31. #endif