/* author: mik
* project: pm_simulation (一个保护模式行为模拟器)
*
* tss.h 这个文件描述TSS块
*/
#ifndef __TSS__
#define __TSS__
/* 定义 TSS */
typedef struct TASK_STATE_SEG {
typedef struct TASK_STATE_SEG {
unsigned link : 16; /* TSS selector link */
unsigned : 16; /* reserved */
unsigned : 16; /* reserved */
unsigned esp0; /* 0 privilege-level stack pointer */
unsigned ss0 : 16; /* 0 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned ss0 : 16; /* 0 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned esp1; /* 1 privilege-level stack pointer */
unsigned ss1 : 16; /* 1 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned ss1 : 16; /* 1 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned esp2; /* 2 privilege-level stack pointer */
unsigned ss2 : 16; /* 2 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned ss2 : 16; /* 2 privilege-level stack ss register */
unsigned : 16; /* reserved */
unsigned cr3; /* CR3 register */
unsigned eip; /* EIP register */
unsigned eflags; /* EFLAGS register */
unsinged eax; /* EAX register */
unsigned ecx; /* ECX register */
unsinged edx; /* EDX register */
unsigned ebx; /* EBX register */
unsigned esp; /* ESP register */
unsigned ebp; /* EBP register */
unsigned esi; /* ESI register */
unsigned edi; /* EDI register */
unsigned eip; /* EIP register */
unsigned eflags; /* EFLAGS register */
unsinged eax; /* EAX register */
unsigned ecx; /* ECX register */
unsinged edx; /* EDX register */
unsigned ebx; /* EBX register */
unsigned esp; /* ESP register */
unsigned ebp; /* EBP register */
unsigned esi; /* ESI register */
unsigned edi; /* EDI register */
unsigned es : 16; /* ES segment register */
unsigned : 16; /* reserved */
unsigned cs : 16; /* CS segment register */
unsigned : 16; /* reserved */
unsigned ss : 16; /* SS segment register */
unsigned : 16; /* reserved */
unsigned ds : 16; /* DS segment register */
unsigned : 16; /* reserved */
unsigned fs : 16; /* FS segment register */
unsigned : 16; /* reserved */
unsigned gs : 16; /* GS segment register */
unsigned : 16; /* reserved */
unsigned : 16; /* reserved */
unsigned cs : 16; /* CS segment register */
unsigned : 16; /* reserved */
unsigned ss : 16; /* SS segment register */
unsigned : 16; /* reserved */
unsigned ds : 16; /* DS segment register */
unsigned : 16; /* reserved */
unsigned fs : 16; /* FS segment register */
unsigned : 16; /* reserved */
unsigned gs : 16; /* GS segment register */
unsigned : 16; /* reserved */
unsigned t : 1; /* T filed */
unsigned : 15; /* reserved */
unsigned iomap_base : 16; /* i/o bitmap base address */
} __attribute__((packed)) TSS;
#endif