diff options
Diffstat (limited to 'i386/i386/tss.h')
-rw-r--r-- | i386/i386/tss.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/i386/i386/tss.h b/i386/i386/tss.h index ff25f217..fd7e7147 100644 --- a/i386/i386/tss.h +++ b/i386/i386/tss.h @@ -27,13 +27,33 @@ #ifndef _I386_TSS_H_ #define _I386_TSS_H_ +#include <sys/types.h> #include <mach/inline.h> #include <machine/io_perm.h> /* - * i386 Task State Segment + * x86 Task State Segment */ +#ifdef __x86_64__ +struct i386_tss { + uint32_t _reserved0; + uint64_t rsp0; + uint64_t rsp1; + uint64_t rsp2; + uint64_t _reserved1; + uint64_t ist1; + uint64_t ist2; + uint64_t ist3; + uint64_t ist4; + uint64_t ist5; + uint64_t ist6; + uint64_t ist7; + uint64_t _reserved2; + uint16_t _reserved3; + uint16_t io_bit_map_offset; +} __attribute__((__packed__)); +#else /* ! __x86_64__ */ struct i386_tss { int back_link; /* segment number of previous task, if nested */ @@ -67,7 +87,7 @@ struct i386_tss { /* offset to start of IO permission bit map */ }; - +#endif /* __x86_64__ */ /* The structure extends the above TSS structure by an I/O permission bitmap and the barrier. */ @@ -80,7 +100,7 @@ struct task_tss /* Load the current task register. */ -MACH_INLINE void +static inline void ltr(unsigned short segment) { __asm volatile("ltr %0" : : "r" (segment) : "memory"); |