summaryrefslogtreecommitdiff
path: root/lib/thread/fsbase+netbsd.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread/fsbase+netbsd.myr')
-rw-r--r--lib/thread/fsbase+netbsd.myr28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/thread/fsbase+netbsd.myr b/lib/thread/fsbase+netbsd.myr
new file mode 100644
index 0000000..3c470cf
--- /dev/null
+++ b/lib/thread/fsbase+netbsd.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.X8664setfsbase, &(h : void#))
+ | 0:
+ | err:
+ std.fput(std.Err, "error: sysarch returned: {}\n", err)
+ std.suicide()
+ ;;
+}
+
+const getfsbase = {
+ var h
+ match sys.sysarch(sys.X8664getfsbase, &h)
+ | 0: -> (h : tlshdr#)
+ | err:
+ std.fput(std.Err, "error: sysarch returned: {}\n", err)
+ std.suicide()
+ ;;
+}