summaryrefslogtreecommitdiff
path: root/lib9
diff options
context:
space:
mode:
authorScott Francis <scott@kurokoproject.com>2017-07-09 17:01:09 -0700
committerScott Francis <scott@kurokoproject.com>2017-07-09 17:01:09 -0700
commit9615754de500d96213e295cb80e41cb24e4a75ac (patch)
treeccc95e8df88c633508a9fd542b591fd84e263868 /lib9
parent8823998c509302a526d8711095f664dd06997234 (diff)
Use pthreads instead of rthreads on OpenBSD and add back FPU support
Diffstat (limited to 'lib9')
-rw-r--r--lib9/setfcr-OpenBSD-386.S34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib9/setfcr-OpenBSD-386.S b/lib9/setfcr-OpenBSD-386.S
new file mode 100644
index 00000000..d981f36a
--- /dev/null
+++ b/lib9/setfcr-OpenBSD-386.S
@@ -0,0 +1,34 @@
+
+#define FN(x) .type x,@function; .global x; x
+#define ENT subl $16, %esp
+#define RET addl $16, %esp; ret
+
+ .file "setfcr-Linux-386.S"
+FN(setfcr):
+ ENT
+ xorb $0x3f, %al
+ movl %eax, (%esp)
+ fwait
+ fldcw (%esp)
+ RET
+
+FN(getfcr):
+ ENT
+ fwait
+ fstcw (%esp)
+ movw (%esp), %ax
+ andl $0xffff, %eax
+ xorb $0x3f, %al
+ RET
+
+FN(getfsr):
+ ENT
+ fwait
+ fstsw (%esp)
+ movw (%esp), %ax
+ andl $0xffff, %eax
+ RET
+
+FN(setfsr):
+ fclex
+ ret