aboutsummaryrefslogtreecommitdiff
path: root/kernel/tss.dats
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-07-14 12:28:07 +0200
committerXander <xander@biltopia.org>2023-07-14 12:28:07 +0200
commit059b5ba286b3fef4d01c3ced9cd829ace5dd6340 (patch)
treea90a4310462fab9588ea04d830775a0de3e9727b /kernel/tss.dats
parent947331444708d2dc622ad6d8d3eb069e29a1898f (diff)
downloadats-os-059b5ba286b3fef4d01c3ced9cd829ace5dd6340.tar.xz
ats-os-059b5ba286b3fef4d01c3ced9cd829ace5dd6340.zip
Task state segment structs
Diffstat (limited to 'kernel/tss.dats')
-rw-r--r--kernel/tss.dats20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/tss.dats b/kernel/tss.dats
new file mode 100644
index 0000000..e4569d6
--- /dev/null
+++ b/kernel/tss.dats
@@ -0,0 +1,20 @@
+#include "kernel/prelude/kernel_prelude.hats"
+
+#define ATS_DYNLOADFLAG 0
+
+staload "./tss.sats"
+
+staload UN = "prelude/SATS/unsafe.sats"
+
+var tss : tss_t // Task State Segment
+var stack1 : stack // Double fault stack
+
+implement tss_init() : void = let
+ extern praxi __assert{l:addr} (ptr: ptr (l)): vtakeout0 (tss_t@l)
+ prval (pf, fpf) = __assert (addr@(tss)) // takeout proof UNSAFE:
+ val sp1 = @{a = ptr_add<uint8>(addr@(stack1),STACK_SIZE)}
+in
+ tss.ist.IS1 := sp1;
+ let prval () = fpf(pf) in end
+end
+