summaryrefslogtreecommitdiff
path: root/lib9/setfcr-OpenBSD-386.S
diff options
context:
space:
mode:
authorValery Ushakov <uwe@stderr.spb.ru>2019-03-10 03:44:16 +0200
committerValery Ushakov <uwe@stderr.spb.ru>2019-03-10 03:44:16 +0200
commit594bd56378a3a707845dd8813881c427a3a8d16e (patch)
tree5f18116b77d615f40c50d449a332dafd21347c05 /lib9/setfcr-OpenBSD-386.S
parent9b7850d511c2c910abfb42ece20650b97fba5a72 (diff)
parent55520626f59983d296c98c008af92f7c5c27bf5f (diff)
Merged default into NetBSD/pthreads
Diffstat (limited to 'lib9/setfcr-OpenBSD-386.S')
-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