porting over pcboot codebase
[com32] / src / tss.h
diff --git a/src/tss.h b/src/tss.h
new file mode 100644 (file)
index 0000000..e9c6943
--- /dev/null
+++ b/src/tss.h
@@ -0,0 +1,38 @@
+/*
+pcboot - bootable PC demo/game kernel
+Copyright (C) 2018  John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY, without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
+*/
+#ifndef TSS_H_
+#define TSS_H_
+
+#include <inttypes.h>
+
+struct task_state {
+       uint32_t prev_task;
+       uint32_t esp0, ss0;     /* we only ever set these two values */
+       uint32_t esp1, ss1;
+       uint32_t esp2, ss2;
+       uint32_t cr3;
+       uint32_t eip;
+       uint32_t eflags;
+       uint32_t eax, ecx, edx, ebx;
+       uint32_t esp, ebp, esi, edi;
+       uint32_t es, cs, ss, ds, fs, gs;
+       uint32_t ldt_sel;
+       uint16_t trap, iomap_addr;
+} __attribute__((packed));
+
+#endif /* TSS_H_ */