summaryrefslogtreecommitdiff
path: root/lib/thread/fsbase+freebsd.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread/fsbase+freebsd.myr')
-rw-r--r--lib/thread/fsbase+freebsd.myr28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/thread/fsbase+freebsd.myr b/lib/thread/fsbase+freebsd.myr
new file mode 100644
index 0000000..e648aba
--- /dev/null
+++ b/lib/thread/fsbase+freebsd.myr
@@ -0,0 +1,28 @@
+use std
+use sys
+
+use "types"
+
+pkg thread =
+ pkglocal const setfsbase : (h : tlshdr# -> void)
+ pkglocal const getfsbase : (-> tlshdr#)
+;;
+
+const setfsbase = {h
+ match sys.sysarch(sys.Archamd64setfs, &(h : void#))
+ | 0:
+ | err:
+ std.fput(std.Err, "error: sysarch returned {}\n", err)
+ std.suicide()
+ ;;
+}
+
+const getfsbase = {
+ var h
+ match sys.sysarch(sys.Archamd64getfs, &h)
+ | 0: -> (h : tlshdr#)
+ | err:
+ std.fput(std.Err, "error: sysarch returned {}\n", err)
+ std.suicide()
+ ;;
+}