diff options
| author | charles forsyth <charles.forsyth@gmail.com> | 2014-03-05 14:08:57 +0000 |
|---|---|---|
| committer | charles forsyth <charles.forsyth@gmail.com> | 2014-03-05 14:08:57 +0000 |
| commit | 8328c5aad8a58079915a020acf43737918fd69d8 (patch) | |
| tree | 2c786965e609ff01cc6fbd8f4959a8472bf15a18 /lib9/setfcr-Linux-386.S | |
| parent | 8eb013de88b69d0256e7d37913ab46510908b510 (diff) | |
20140305-1408
Diffstat (limited to 'lib9/setfcr-Linux-386.S')
| -rw-r--r-- | lib9/setfcr-Linux-386.S | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib9/setfcr-Linux-386.S b/lib9/setfcr-Linux-386.S new file mode 100644 index 00000000..d981f36a --- /dev/null +++ b/lib9/setfcr-Linux-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 |
