diff options
author | David Boddie <david@boddie.org.uk> | 2021-02-03 13:22:12 +0000 |
---|---|---|
committer | Charles Forsyth <charles.forsyth@gmail.com> | 2021-02-03 13:22:12 +0000 |
commit | 7bb791f115f350b3d65936061110ef08f6a5434f (patch) | |
tree | 72c24a577de5faf8b9d16ca4333d5e554070e8f6 | |
parent | 206fe115321515fd30686e46f830e26205053831 (diff) | |
parent | c6b7177527d6244e733dd51c900028140d0dc947 (diff) |
Merged in Linux/spim (pull request #11)
Fixes for spim architecture running on a Linux host
Approved-by: Charles Forsyth
-rw-r--r-- | lib9/setfcr-Linux-spim.S | 27 | ||||
-rwxr-xr-x | makemk.sh | 4 | ||||
-rw-r--r-- | mkfiles/mkfile-Linux-spim | 13 | ||||
-rw-r--r-- | utils/libmach/executable.c | 22 |
4 files changed, 46 insertions, 20 deletions
diff --git a/lib9/setfcr-Linux-spim.S b/lib9/setfcr-Linux-spim.S new file mode 100644 index 00000000..9031f628 --- /dev/null +++ b/lib9/setfcr-Linux-spim.S @@ -0,0 +1,27 @@ +#include <sys/regdef.h> +#include <sys/asm.h> + +#define FN(x) .type x,%function; .global x; x +#define ENT +#define RET jr ra + + .file "setfcr-Linux-spim.S" +FN(setfcr): + ENT + mtc1 a0, $31 + RET + +FN(getfcr): + ENT + mfc1 v0, $31 + RET + +FN(getfsr): + ENT + mfc1 v0, $31 + RET + +FN(setfsr): + ENT + mtc1 a0, $31 + RET @@ -19,8 +19,8 @@ grep -s 'SYSTARG=Plan9' mkconfig || . ./mkconfig PLAT=$ROOT/$SYSTARG/$OBJTYPE # you might need to adjust the CC, LD, AR, and RANLIB definitions after this point -CC="p gcc -m32 -c -I$PLAT/include -I$ROOT/include -I$ROOT/utils/include" -LD="p gcc -m32" +CC="p gcc -c -I$PLAT/include -I$ROOT/include -I$ROOT/utils/include" +LD="p gcc" AR="p ar crvs" RANLIB=":" # some systems still require `ranlib' diff --git a/mkfiles/mkfile-Linux-spim b/mkfiles/mkfile-Linux-spim index c68c798b..9fa842cd 100644 --- a/mkfiles/mkfile-Linux-spim +++ b/mkfiles/mkfile-Linux-spim @@ -5,23 +5,22 @@ CPUS= spim O= o OS= o -AR= mipsel-linux-uclibc-ar +AR= mipsel-linux-gnu-ar ARFLAGS= crvs -AS= mipsel-linux-uclibc-gcc -c -mips32 +AS= mipsel-linux-gnu-gcc -c -mips32 ASFLAGS= -CC= mipsel-linux-uclibc-gcc -c -mips32 +CC= mipsel-linux-gnu-gcc -c -mips32 CFLAGS= -g\ -Os\ -I$ROOT/Linux/spim/include\ -I$ROOT/include\ - -I/usr/X11R6/include + -I/usr/include/X11 ANSICPP= -LD= mipsel-linux-uclibc-gcc -LDFLAGS= -L/usr/openwin/lib\ - -L/usr/X11R6/lib\ +LD= mipsel-linux-gnu-gcc +LDFLAGS= -L/usr/lib/X11 SYSLIBS= diff --git a/utils/libmach/executable.c b/utils/libmach/executable.c index 2734cf44..ce12ca83 100644 --- a/utils/libmach/executable.c +++ b/utils/libmach/executable.c @@ -17,7 +17,7 @@ typedef struct { uvlong hdr[1]; } exechdr64; Ehdr elfhdr32; /* elf.h */ - struct mipsexec mips; /* bootexec.h */ + struct mipsexec mips32; /* bootexec.h */ struct mips4kexec mips4k; /* bootexec.h */ struct sparcexec sparc; /* bootexec.h */ struct nextexec next; /* bootexec.h */ @@ -451,22 +451,22 @@ mipsboot(int fd, Fhdr *fp, ExecHdr *hp) { USED(fd); fp->type = FMIPSB; - switch(hp->e.mips.amagic) { + switch(hp->e.mips32.amagic) { default: case 0407: /* some kind of mips */ - settext(fp, (u32int)hp->e.mips.mentry, (u32int)hp->e.mips.text_start, - hp->e.mips.tsize, sizeof(struct mipsexec)+4); - setdata(fp, (u32int)hp->e.mips.data_start, hp->e.mips.dsize, - fp->txtoff+hp->e.mips.tsize, hp->e.mips.bsize); + settext(fp, (u32int)hp->e.mips32.mentry, (u32int)hp->e.mips32.text_start, + hp->e.mips32.tsize, sizeof(struct mipsexec)+4); + setdata(fp, (u32int)hp->e.mips32.data_start, hp->e.mips32.dsize, + fp->txtoff+hp->e.mips32.tsize, hp->e.mips32.bsize); break; case 0413: /* some kind of mips */ - settext(fp, (u32int)hp->e.mips.mentry, (u32int)hp->e.mips.text_start, - hp->e.mips.tsize, 0); - setdata(fp, (u32int)hp->e.mips.data_start, hp->e.mips.dsize, - hp->e.mips.tsize, hp->e.mips.bsize); + settext(fp, (u32int)hp->e.mips32.mentry, (u32int)hp->e.mips32.text_start, + hp->e.mips32.tsize, 0); + setdata(fp, (u32int)hp->e.mips32.data_start, hp->e.mips32.dsize, + hp->e.mips32.tsize, hp->e.mips32.bsize); break; } - setsym(fp, hp->e.mips.nsyms, 0, hp->e.mips.pcsize, hp->e.mips.symptr); + setsym(fp, hp->e.mips32.nsyms, 0, hp->e.mips32.pcsize, hp->e.mips32.symptr); fp->hdrsz = 0; /* header stripped */ return 1; } |