desc_64.h 770 B

12345678910111213141516171819202122232425262728293031323334
  1. /* Written 2000 by Andi Kleen */
  2. #ifndef __ARCH_DESC_H
  3. #define __ARCH_DESC_H
  4. #include <linux/threads.h>
  5. #include <asm/ldt.h>
  6. #ifndef __ASSEMBLY__
  7. #include <linux/string.h>
  8. #include <asm/segment.h>
  9. static inline void set_tss_desc(unsigned cpu, void *addr)
  10. {
  11. struct desc_struct *d = get_cpu_gdt_table(cpu);
  12. tss_desc tss;
  13. /*
  14. * sizeof(unsigned long) coming from an extra "long" at the end
  15. * of the iobitmap. See tss_struct definition in processor.h
  16. *
  17. * -1? seg base+limit should be pointing to the address of the
  18. * last valid byte
  19. */
  20. set_tssldt_descriptor(&tss,
  21. (unsigned long)addr, DESC_TSS,
  22. IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1);
  23. write_gdt_entry(d, GDT_ENTRY_TSS, &tss, DESC_TSS);
  24. }
  25. #endif /* !__ASSEMBLY__ */
  26. #endif