diff options
| -rw-r--r-- | CHANGES | 12 | ||||
| -rw-r--r-- | Linux/386/include/lib9.h | 27 | ||||
| -rw-r--r-- | emu/Linux/os.c | 1 | ||||
| -rw-r--r-- | emu/port/fns.h | 1 | ||||
| -rw-r--r-- | emu/port/kproc-pthreads.c | 1 | ||||
| -rw-r--r-- | lib9/setfcr-DragonFly-386.c | 56 | ||||
| -rw-r--r-- | lib9/setfcr-Linux-arm.c | 32 | ||||
| -rw-r--r-- | lib9/setfcr-Linux-power.S | 20 | ||||
| -rw-r--r-- | lib9/setfcr-MacOSX-386.c | 56 | ||||
| -rw-r--r-- | lib9/setfcr-MacOSX-power.c | 39 | ||||
| -rw-r--r-- | lib9/setfcr-NetBSD-386.c | 55 | ||||
| -rw-r--r-- | lib9/setfcr-OpenBSD-386.c | 57 | ||||
| -rw-r--r-- | lib9/setfcr-Solaris-sparc.c | 42 | ||||
| -rw-r--r-- | man/2/sh | 2 | ||||
| -rw-r--r-- | mkfiles/mkfile-Linux-386 | 1 | ||||
| -rw-r--r-- | mkfiles/mkfile-Linux-arm | 1 | ||||
| -rw-r--r-- | mkfiles/mkfile-Linux-power | 1 | ||||
| -rw-r--r-- | mkfiles/mkfile-Linux-spim | 2 | ||||
| -rw-r--r-- | mkfiles/mkfile-MacOSX-386 | 1 |
19 files changed, 2 insertions, 405 deletions
@@ -1,15 +1,3 @@ -20140518 - sh(2): exec -> run [issue 311] -20140501 - add -s option to dns in cs(8) [issue 310] - don't send nil soa to dnscache [issue 309] -20140309 - temporarily remove warnings about unused results - define NaN for lib9/charstod.c - define nrand for libmp - move fpu control to lib9 from fpuctl.h - move fpu definitions to lib9.h from fpuctl.h (should possibly add back arch-specific u.h) - define __USE_GNU for extra pthreads definitions in emu/port/kproc-pthreads.c 20140302 utils/cc/funct.c - remove out-of-bounds reference os/ipaq1110, ip/ipaux.c, os/sa1110 - add default cases to keep compiler happy diff --git a/Linux/386/include/lib9.h b/Linux/386/include/lib9.h index 24f1e528..cae240ac 100644 --- a/Linux/386/include/lib9.h +++ b/Linux/386/include/lib9.h @@ -235,7 +235,6 @@ extern ulong ntruerand(ulong); * math */ extern int isNaN(double); -extern double NaN(void); extern int isInf(double, int); /* @@ -464,29 +463,3 @@ extern char *argv0; #define setbinmode() -/* FCR */ -#define FPINEX (1<<5) -#define FPUNFL ((1<<4)|(1<<1)) -#define FPOVFL (1<<3) -#define FPZDIV (1<<2) -#define FPINVAL (1<<0) -#define FPRNR (0<<10) -#define FPRZ (3<<10) -#define FPRPINF (2<<10) -#define FPRNINF (1<<10) -#define FPRMASK (3<<10) -#define FPPEXT (3<<8) -#define FPPSGL (0<<8) -#define FPPDBL (2<<8) -#define FPPMASK (3<<8) -/* FSR */ -#define FPAINEX FPINEX -#define FPAOVFL FPOVFL -#define FPAUNFL FPUNFL -#define FPAZDIV FPZDIV -#define FPAINVAL FPINVAL - -extern void setfcr(ulong); -extern void setfsr(ulong); -extern ulong getfcr(void); -extern ulong getfsr(void); diff --git a/emu/Linux/os.c b/emu/Linux/os.c index 08b039d6..0d91518a 100644 --- a/emu/Linux/os.c +++ b/emu/Linux/os.c @@ -13,6 +13,7 @@ #include "dat.h" #include "fns.h" #include "error.h" +#include <fpuctl.h> #include <semaphore.h> diff --git a/emu/port/fns.h b/emu/port/fns.h index db08957d..be825d17 100644 --- a/emu/port/fns.h +++ b/emu/port/fns.h @@ -119,7 +119,6 @@ Pgrp* newpgrp(void); Proc* newproc(void); void nexterror(void); void notkilled(void); -int nrand(int); int openmode(ulong); void osblock(void); void* oscmd(char**, int, char*, int*); diff --git a/emu/port/kproc-pthreads.c b/emu/port/kproc-pthreads.c index 5560f737..32053794 100644 --- a/emu/port/kproc-pthreads.c +++ b/emu/port/kproc-pthreads.c @@ -7,7 +7,6 @@ #include <unistd.h> #include <signal.h> -#define __USE_GNU #include <pthread.h> #include <limits.h> #include <errno.h> diff --git a/lib9/setfcr-DragonFly-386.c b/lib9/setfcr-DragonFly-386.c deleted file mode 100644 index 3589dd80..00000000 --- a/lib9/setfcr-DragonFly-386.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Linux 386 fpu support - * Mimic Plan9 floating point support - */ - -#include "lib9.h" - -void -setfcr(ulong fcr) -{ - __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) - ); -} - -ulong -getfcr(void) -{ - ulong fcr = 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) - ); - return fcr; -} - -ulong -getfsr(void) -{ - ulong fsr = -1; - - __asm__( "fwait\n\t" - "fstsw (%%eax)\n\t" - "movl (%%eax), %%eax\n\t" - "andl $0xffff, %%eax\n\t" - : "=a" (fsr) - : "eax" (&fsr) - ); - return fsr; -} - -void -setfsr(ulong fsr) -{ - __asm__("fclex\n\t"); -} diff --git a/lib9/setfcr-Linux-arm.c b/lib9/setfcr-Linux-arm.c deleted file mode 100644 index eb77b872..00000000 --- a/lib9/setfcr-Linux-arm.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Linux arm fpu support - * Mimic Plan9 floating point support - */ - -#include "lib9.h" - -#include <fenv.h> - -void -setfcr(ulong fcr) -{ -} - -ulong -getfcr(void) -{ - ulong fcr = 0; - return fcr; -} - -ulong -getfsr(void) -{ - ulong fsr = -1; - return fsr; -} - -void -setfsr(ulong fsr) -{ -} diff --git a/lib9/setfcr-Linux-power.S b/lib9/setfcr-Linux-power.S deleted file mode 100644 index dee67528..00000000 --- a/lib9/setfcr-Linux-power.S +++ /dev/null @@ -1,20 +0,0 @@ - -#define FN(x) .type x,@function; .global x; x - -FN(getfcr): - mffs %f0 - cvtfl %r3,%f0 - blr - -FN(getfsr): - mffs %f0 - cvtfl %r3,%f0 - blr - -FN(setfsr): - mtfsf 0xff, %f0 - blr - -FN(setfcr): - mtfsf 0xff, %f0 - blr diff --git a/lib9/setfcr-MacOSX-386.c b/lib9/setfcr-MacOSX-386.c deleted file mode 100644 index 3589dd80..00000000 --- a/lib9/setfcr-MacOSX-386.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Linux 386 fpu support - * Mimic Plan9 floating point support - */ - -#include "lib9.h" - -void -setfcr(ulong fcr) -{ - __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) - ); -} - -ulong -getfcr(void) -{ - ulong fcr = 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) - ); - return fcr; -} - -ulong -getfsr(void) -{ - ulong fsr = -1; - - __asm__( "fwait\n\t" - "fstsw (%%eax)\n\t" - "movl (%%eax), %%eax\n\t" - "andl $0xffff, %%eax\n\t" - : "=a" (fsr) - : "eax" (&fsr) - ); - return fsr; -} - -void -setfsr(ulong fsr) -{ - __asm__("fclex\n\t"); -} diff --git a/lib9/setfcr-MacOSX-power.c b/lib9/setfcr-MacOSX-power.c deleted file mode 100644 index 17b76a88..00000000 --- a/lib9/setfcr-MacOSX-power.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * MacOSX/Darwin ppc fpu support - * Mimic Plan9 floating point support - */ - -#include "lib9.h" -#include <architecture/ppc/fp_regs.h> - -__inline__ ulong -getfcr(void) -{ - ppc_fp_scr_t fpscr = get_fp_scr(); - return ((ulong *)&fpscr)[1]; -} - -ulong -getfsr(void) -{ - ppc_fp_scr_t fpscr = get_fp_scr(); - return ((ulong *)&fpscr)[1]; -} - -void -setfsr(ulong fsr) -{ - ppc_fp_scr_t fpscr; - // fpscr = get_fp_scr(); - (((ulong *)&fpscr)[1]) = fsr; - set_fp_scr(fpscr); -} - -void -setfcr(ulong fcr) -{ - ppc_fp_scr_t fpscr; - // fpscr = get_fp_scr(); - (((ulong *)&fpscr)[1]) = fcr; - set_fp_scr(fpscr); -} diff --git a/lib9/setfcr-NetBSD-386.c b/lib9/setfcr-NetBSD-386.c deleted file mode 100644 index e58171a3..00000000 --- a/lib9/setfcr-NetBSD-386.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Linux 386 fpu support - * Mimic Plan9 floating point support - */ -#include "lib9.h" - -void -setfcr(ulong fcr) -{ - __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) - ); -} - -ulong -getfcr(void) -{ - ulong fcr = 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) - ); - return fcr; -} - -ulong -getfsr(void) -{ - ulong fsr = -1; - - __asm__( "fwait\n\t" - "fstsw (%%eax)\n\t" - "movl (%%eax), %%eax\n\t" - "andl $0xffff, %%eax\n\t" - : "=a" (fsr) - : "eax" (&fsr) - ); - return fsr; -} - -void -setfsr(ulong fsr) -{ - __asm__("fclex\n\t"); -} diff --git a/lib9/setfcr-OpenBSD-386.c b/lib9/setfcr-OpenBSD-386.c deleted file mode 100644 index c512f033..00000000 --- a/lib9/setfcr-OpenBSD-386.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 386 fpu support - * Mimic Plan9 floating point support - */ - -#include "lib9.h" - - -void -setfcr(ulong fcr) -{ - __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) - ); -} - -ulong -getfcr(void) -{ - ulong fcr = 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) - ); - return fcr; -} - -ulong -getfsr(void) -{ - ulong fsr = -1; - - __asm__( "fwait\n\t" - "fstsw (%%eax)\n\t" - "movl (%%eax), %%eax\n\t" - "andl $0xffff, %%eax\n\t" - : "=a" (fsr) - : "eax" (&fsr) - ); - return fsr; -} - -void -setfsr(ulong fsr) -{ - __asm__("fclex\n\t"); -} diff --git a/lib9/setfcr-Solaris-sparc.c b/lib9/setfcr-Solaris-sparc.c deleted file mode 100644 index 405e9cf2..00000000 --- a/lib9/setfcr-Solaris-sparc.c +++ /dev/null @@ -1,42 +0,0 @@ -/* This code is a little awkward. If somebody who understands Solaris - better would tell me an idiomatic way to invoke equivalent - behavior, I'd be grateful. ehg@bell-labs.com */ - -#include "lib9.h" - -ulong -getfcr(void) -{ - ulong v; - - asm(" st %fsr, [%fp-8]"); - return v; -} - -void -setfcr(ulong v) -{ - ulong vv; - - vv = (getfcr() & ~FPFCR) | (v & FPFCR); - asm(" ld [%fp-4], %fsr"); -} - -ulong -getfsr(void) -{ - ulong v; - - asm(" st %fsr, [%fp-8]"); - return v; -} - -void -setfsr(ulong v) -{ - ulong vv; - - vv = (getfsr() & ~FPFSR) | (v & FPFSR); - asm(" ld [%fp-4], %fsr"); -} - @@ -98,7 +98,7 @@ command contained in .I s and returns its result. It catches any exceptions raised by the command. Almost as simple is -.BR run , +.BR exec , which runs .I argv as a command, taking the first word as the command to be diff --git a/mkfiles/mkfile-Linux-386 b/mkfiles/mkfile-Linux-386 index 545c8571..68699989 100644 --- a/mkfiles/mkfile-Linux-386 +++ b/mkfiles/mkfile-Linux-386 @@ -15,7 +15,6 @@ CC= cc -c -m32 CFLAGS= -g\ -O\ -Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit\ - -Wno-unused-result\ -I$ROOT/Linux/386/include\ -I$ROOT/include\ -DLINUX_386 diff --git a/mkfiles/mkfile-Linux-arm b/mkfiles/mkfile-Linux-arm index 7bc23968..a0c7b17d 100644 --- a/mkfiles/mkfile-Linux-arm +++ b/mkfiles/mkfile-Linux-arm @@ -14,7 +14,6 @@ ASFLAGS= CC= arm-gcc -c CFLAGS= -O\ -Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit\ - -Wno-unused-result\ -I$ROOT/Linux/arm/include\ -I$ROOT/include\ -DLINUX_ARM diff --git a/mkfiles/mkfile-Linux-power b/mkfiles/mkfile-Linux-power index 9ac9f9d3..678af2e4 100644 --- a/mkfiles/mkfile-Linux-power +++ b/mkfiles/mkfile-Linux-power @@ -15,7 +15,6 @@ CC= cc -c -m32 CFLAGS= -g\ -O\ -Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit\ - -Wno-unused-result\ -I$ROOT/Linux/power/include\ -I$ROOT/include\ -I/usr/X11R6/include diff --git a/mkfiles/mkfile-Linux-spim b/mkfiles/mkfile-Linux-spim index d49c950c..c68c798b 100644 --- a/mkfiles/mkfile-Linux-spim +++ b/mkfiles/mkfile-Linux-spim @@ -14,8 +14,6 @@ ASFLAGS= CC= mipsel-linux-uclibc-gcc -c -mips32 CFLAGS= -g\ -Os\ - -Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit\ - -Wno-unused-result\ -I$ROOT/Linux/spim/include\ -I$ROOT/include\ -I/usr/X11R6/include diff --git a/mkfiles/mkfile-MacOSX-386 b/mkfiles/mkfile-MacOSX-386 index ea1a7a6c..5326233c 100644 --- a/mkfiles/mkfile-MacOSX-386 +++ b/mkfiles/mkfile-MacOSX-386 @@ -21,7 +21,6 @@ CTHREADFLAGS= CFLAGS= -arch i386 -m32\ -mmacosx-version-min=10.6\ -Wno-deprecated-declarations -Wuninitialized -Wunused -Wreturn-type -Wimplicit -Wno-four-char-constants -Wno-unknown-pragmas\ - -Wno-unused-result\ -pipe\ -fno-strict-aliasing\ -no-cpp-precomp\ |
