tss.h 618 B

1234567891011121314151617181920212223
  1. /* TSS + flat GDT (kernel/user segments + TSS descriptor). */
  2. #ifndef TSS_H
  3. #define TSS_H
  4. struct tss {
  5. unsigned int prev_tss;
  6. unsigned int esp0;
  7. unsigned int ss0;
  8. unsigned int esp1, ss1, esp2, ss2;
  9. unsigned int cr3;
  10. unsigned int eip, eflags, eax, ecx, edx, ebx, esp, ebp, esi, edi;
  11. unsigned int es, cs, ss, ds, fs, gs;
  12. unsigned int ldt;
  13. unsigned short trap, iomap_base;
  14. } __attribute__((packed));
  15. extern struct tss tss;
  16. /* Build the 6-entry GDT (null / kernel code / kernel data / user code / user
  17. * data / TSS), load it, and load the TSS. Call once from kernel_main. */
  18. void gdt_tss_init(void);
  19. #endif