diff options
| -rw-r--r-- | emu/Linux/emu-wrt | 108 | ||||
| -rwxr-xr-x | emu/Linux/mk-wrt | 8 | ||||
| -rw-r--r-- | emu/Linux/os.c | 8 | ||||
| -rw-r--r-- | lib/proto/Linux | 5 | ||||
| -rw-r--r-- | lib/proto/inferno | 8 | ||||
| -rw-r--r-- | lib/proto/os | 16 | ||||
| -rw-r--r-- | lib/proto/src | 1 | ||||
| -rw-r--r-- | lib/proto/utils | 1 | ||||
| -rw-r--r-- | libmath/dtoa.c | 5 |
9 files changed, 152 insertions, 8 deletions
diff --git a/emu/Linux/emu-wrt b/emu/Linux/emu-wrt new file mode 100644 index 00000000..c89ffedc --- /dev/null +++ b/emu/Linux/emu-wrt @@ -0,0 +1,108 @@ +dev + root + cons + env + mnt + pipe + prog + prof + srv + dup + ssl + cap + fs + cmd cmd + indir + +# draw +# pointer +# snarf + + ip ipif-posix ipaux +# eia +# audio audio + mem + +lib + interp +# tk +# freetype + math +# draw + +# memlayer +# memdraw + keyring + sec + mp + + 9 + +link + +mod + sys +# draw + +# tk + math + srv srv + keyring + loader +# freetype + +port + alloc + cache + chan + dev + dial + dis + discall + env + error + errstr + exception + exportfs + inferno + latin1 + main + parse + pgrp + print + proc + qio + random + sysfile + uqid + +code + int dontcompile = 1; + unsigned long strtochan(char *s) {return 0;} + +init + emuinit + +root + /dev / + /fd / + /prog / + /net / + /net.alt / + /chan / + /nvfs / + /env / +# /chan +# /dev +# /dis +# /env +# /n +# /net +# /nvfs / +# /prog +# /icons +# /osinit.dis +# /dis/emuinit.dis +# /dis/lib/auth.dis +# /dis/lib/ssl.dis +# /n/local / diff --git a/emu/Linux/mk-wrt b/emu/Linux/mk-wrt new file mode 100755 index 00000000..f301ddea --- /dev/null +++ b/emu/Linux/mk-wrt @@ -0,0 +1,8 @@ +#!/bin/sh + +OPENWRT=$HOME/OpenWrt-SDK-Linux-i686-1 +INFERNO=/usr/inferno + +PATH=$OPENWRT/staging_dir_mipsel/bin:$INFERNO/Linux/386/bin:$PATH + +mk OBJTYPE=spim CONF=emu-wrt CONFLIST=emu-wrt SYSLIBS=-lm WIN= $* diff --git a/emu/Linux/os.c b/emu/Linux/os.c index 49aec7e5..b11ec83a 100644 --- a/emu/Linux/os.c +++ b/emu/Linux/os.c @@ -128,7 +128,7 @@ kproc(char *name, void (*func)(void*), void *arg, int flags) if(flags & KPX11){ p->kstack = nil; /* never freed; also up not defined */ - tos = (char*)mallocz(X11STACK, 0) + X11STACK - sizeof(void*); + tos = (char*)mallocz(X11STACK, 0) + X11STACK - sizeof(vlong); }else p->kstack = stackalloc(p, &tos); @@ -291,6 +291,10 @@ cleanexit(int x) void osreboot(char *file, char **argv) { + if(dflag == 0) + termrestore(); + execvp(file, argv); + error("reboot failure"); } void @@ -517,7 +521,7 @@ stackalloc(Proc *p, void **tos) rv = stacklist.free; stacklist.free = *(void **)rv; unlock(&stacklist.l); - *tos = rv + KSTACK - sizeof(void *); + *tos = rv + KSTACK - sizeof(vlong); *(Proc **)rv = p; return rv; } diff --git a/lib/proto/Linux b/lib/proto/Linux index 368ed85a..f6c7e47c 100644 --- a/lib/proto/Linux +++ b/lib/proto/Linux @@ -21,3 +21,8 @@ Linux include + lib + spim + bin + include + + + lib diff --git a/lib/proto/inferno b/lib/proto/inferno index d25b59e1..7f64fdf9 100644 --- a/lib/proto/inferno +++ b/lib/proto/inferno @@ -21,6 +21,14 @@ Linux bin include lib + arm + bin + include + lib + spim + bin + include + lib MacOSX 386 bin diff --git a/lib/proto/os b/lib/proto/os index c6ddebee..50350437 100644 --- a/lib/proto/os +++ b/lib/proto/os @@ -24,6 +24,11 @@ Inferno include * lib + spim + bin + include + * + lib thumb bin include @@ -70,6 +75,7 @@ libkern frexp-mips.c frexp-power.c frexp-sparc.c + frexp-spim.c frexp-thumb.c getfcr-386.s getfcr-68000.s @@ -77,6 +83,7 @@ libkern getfcr-mips.s getfcr-power.s getfcr-sparc.s + getfcr-spim.s getfcr-thumb.s getfields.c log.c @@ -85,15 +92,13 @@ libkern memchr.c memcmp-power.s memcmp.c - memcpy-386.s - memcpy-arm.c - memcpy-thumb.c memmove.c memmove-386.s memmove-68000.s memmove-arm.s memmove-mips.s memmove-power.s + memmove-spim.s memmove-sparc.s memmove-thumb.s memset-386.s @@ -102,6 +107,7 @@ libkern memset-mips.s memset-power.s memset-sparc.s + memset-spim.s memset-thumb.s memset.c mkfile @@ -119,6 +125,7 @@ libkern nan-arm.c nan-mips.c nan-power.c + nan-spim.c nan-sparc.c nan-thumb.c netmkaddr.c @@ -140,6 +147,7 @@ libkern strchr-mips.s strchr-power.s strchr-sparc.s + strchr-spim.c strchr-thumb.s strchr.c strcmp-power.s @@ -173,6 +181,7 @@ libkern vlop-mips.s vlop-power.s vlop-sparc.s + vlop-spim.s vlop-thumb.s vlrt-386.c vlrt-68000.c @@ -180,6 +189,7 @@ libkern vlrt-mips.c vlrt-power.c vlrt-sparc.c + vlrt-spim.c vlrt-thumb.c vseprint.c vsmprint.c diff --git a/lib/proto/src b/lib/proto/src index 3289e753..9de7c85d 100644 --- a/lib/proto/src +++ b/lib/proto/src @@ -97,6 +97,7 @@ libdynld dynld-mips.c dynld-power.c dynld-sparc.c + dynld-spim.c dynld.c dynloadfd.c mkfile diff --git a/lib/proto/utils b/lib/proto/utils index 18f17984..3b5bf20a 100644 --- a/lib/proto/utils +++ b/lib/proto/utils @@ -40,6 +40,7 @@ lib9 getcallerpc-Irix-mips.s getcallerpc-Linux-386.S getcallerpc-Linux-arm.S + getcallerpc-Linux-spim.S getcallerpc-MacOSX-power.s getcallerpc-MacOSX-386.s getcallerpc-Solaris-386.s diff --git a/libmath/dtoa.c b/libmath/dtoa.c index ac4ecee1..0a73ef5a 100644 --- a/libmath/dtoa.c +++ b/libmath/dtoa.c @@ -1372,9 +1372,8 @@ dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve) #else if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask >> Exp_shift1))) { #endif - d2 = d; - word0(d2) &= Frac_mask1; - word0(d2) |= Exp_11; + word0(d2) = (word0(d) & Frac_mask1) | Exp_11; + word1(d2) = word1(d); /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 * log10(x) = log(x) / log(10) |
