host_ldt.h 876 B

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