diff options
| author | bhgv <bhgv.empire@gmail.com> | 2020-05-12 12:50:49 +0300 |
|---|---|---|
| committer | bhgv <bhgv.empire@gmail.com> | 2020-05-12 12:50:49 +0300 |
| commit | 9b5d5f8a4640dbecdc87e5b6e7e95f71018632cf (patch) | |
| tree | d3135c3861ef93ed2523642d3c5f64c7819b7def /lib9 | |
| parent | 73c13e732072c17f3e584e11a51d1f7dc8d88e32 (diff) | |
| parent | 31b4edc67b75658ce5e2d41f2fc87331f4b26d49 (diff) | |
Merge branch 'master' of https://github.com/bhgv/Inferno-OS-bhgv
Diffstat (limited to 'lib9')
| -rw-r--r-- | lib9/getcallerpc-FreeRTOS-riscv64.c | 12 | ||||
| -rw-r--r-- | lib9/setfcr-FreeRTOS-riscv64.c | 64 |
2 files changed, 76 insertions, 0 deletions
diff --git a/lib9/getcallerpc-FreeRTOS-riscv64.c b/lib9/getcallerpc-FreeRTOS-riscv64.c new file mode 100644 index 0000000..4a4e4fb --- /dev/null +++ b/lib9/getcallerpc-FreeRTOS-riscv64.c @@ -0,0 +1,12 @@ +#include <lib9.h> + +ulong +getcallerpc(void *x) +{ +ulong *lp; + + lp = x; + + return lp[-1]; +} + diff --git a/lib9/setfcr-FreeRTOS-riscv64.c b/lib9/setfcr-FreeRTOS-riscv64.c new file mode 100644 index 0000000..0ed32c6 --- /dev/null +++ b/lib9/setfcr-FreeRTOS-riscv64.c @@ -0,0 +1,64 @@ +/* + * Linux 386 fpu support + * Mimic Plan9 floating point support + */ + +#include "lib9.h" + +void +setfcr(ulong fcr) +{ +#if 0 + __asm__( "xorb $0x3f, %%al\n\t" + "pushw %%ax\n\t" + "fwait\n\t" + "fldcw (%%esp)\n\t" + "popw %%ax\n\t" + : /* no output */ + : "al" (fcr) + ); +#endif +} + +ulong +getfcr(void) +{ + ulong fcr = 0; + +#if 0 + __asm__( "pushl %%eax\n\t" + "fwait\n\t" + "fstcw (%%esp)\n\t" + "popl %%eax\n\t" + "xorb $0x3f, %%al\n\t" + : "=a" (fcr) + : "eax" (fcr) + ); +#endif + return fcr; +} + +ulong +getfsr(void) +{ + ulong fsr = -1; + +#if 0 + __asm__( "fwait\n\t" + "fstsw (%%eax)\n\t" + "movl (%%eax), %%eax\n\t" + "andl $0xffff, %%eax\n\t" + : "=a" (fsr) + : "eax" (&fsr) + ); +#endif + return fsr; +} + +void +setfsr(ulong fsr) +{ +#if 0 + __asm__("fclex\n\t"); +#endif +} |
