diff options
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/0c/peep.c | 3 | ||||
| -rw-r--r-- | utils/0c/reg.c | 1 | ||||
| -rw-r--r-- | utils/5c/peep.c | 2 | ||||
| -rw-r--r-- | utils/5c/txt.c | 1 | ||||
| -rw-r--r-- | utils/5l/obj.c | 1 | ||||
| -rw-r--r-- | utils/acid/os-Nt.c | 1 | ||||
| -rw-r--r-- | utils/acid/os-Posix.c | 1 | ||||
| -rw-r--r-- | utils/c2l/cc.h | 1 | ||||
| -rw-r--r-- | utils/data2s/data2s.c | 5 | ||||
| -rw-r--r-- | utils/kc/peep.c | 5 | ||||
| -rw-r--r-- | utils/kc/reg.c | 1 | ||||
| -rw-r--r-- | utils/kc/txt.c | 1 | ||||
| -rw-r--r-- | utils/lib/yaccpar | 4 | ||||
| -rw-r--r-- | utils/libmach/5db.c | 6 | ||||
| -rw-r--r-- | utils/mk/graph.c | 2 | ||||
| -rw-r--r-- | utils/mk/mk.c | 2 | ||||
| -rw-r--r-- | utils/mkfile | 2 | ||||
| -rw-r--r-- | utils/qa/lex.c | 1 | ||||
| -rw-r--r-- | utils/qc/peep.c | 5 | ||||
| -rw-r--r-- | utils/ql/asm.c | 92 | ||||
| -rw-r--r-- | utils/ql/l.h | 4 | ||||
| -rw-r--r-- | utils/sqz/sqz.c | 2 | ||||
| -rw-r--r-- | utils/tc/peep.c | 2 | ||||
| -rw-r--r-- | utils/vc/peep.c | 2 | ||||
| -rw-r--r-- | utils/vc/reg.c | 1 | ||||
| -rw-r--r-- | utils/vl/obj.c | 1 | ||||
| -rw-r--r-- | utils/vl/span.c | 1 | ||||
| -rw-r--r-- | utils/yacc/yaccpar | 4 |
28 files changed, 86 insertions, 68 deletions
diff --git a/utils/0c/peep.c b/utils/0c/peep.c index a9a43da4..a7a60403 100644 --- a/utils/0c/peep.c +++ b/utils/0c/peep.c @@ -403,6 +403,7 @@ copy1(Adr *v1, Adr *v2, Reg *r, int f) * 4 if set and used * 0 otherwise (not touched) */ +int copyu(Prog *p, Adr *v, Adr *s) { @@ -410,7 +411,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; diff --git a/utils/0c/reg.c b/utils/0c/reg.c index 0ed8d696..813ace1a 100644 --- a/utils/0c/reg.c +++ b/utils/0c/reg.c @@ -1115,6 +1115,7 @@ RtoB(int r) return 1L << (r-3); } +int BtoR(long b) { diff --git a/utils/5c/peep.c b/utils/5c/peep.c index 4eded1dc..ba22e40d 100644 --- a/utils/5c/peep.c +++ b/utils/5c/peep.c @@ -884,7 +884,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; case AMOVM: diff --git a/utils/5c/txt.c b/utils/5c/txt.c index d1025e7f..af53e1de 100644 --- a/utils/5c/txt.c +++ b/utils/5c/txt.c @@ -1079,6 +1079,7 @@ gopcode(int o, Node *f1, Node *f2, Node *t) print("%P\n", p); } +int samaddr(Node *f, Node *t) { diff --git a/utils/5l/obj.c b/utils/5l/obj.c index f70f7356..af9380dc 100644 --- a/utils/5l/obj.c +++ b/utils/5l/obj.c @@ -1417,6 +1417,7 @@ nuxiinit(void) Bflush(&bso); } +int find1(long l, int c) { char *p; diff --git a/utils/acid/os-Nt.c b/utils/acid/os-Nt.c index 5966d718..89358db2 100644 --- a/utils/acid/os-Nt.c +++ b/utils/acid/os-Nt.c @@ -168,6 +168,7 @@ runcmd(char *cmd) void (*notefunc)(int); +void os_notify(void (*func)(int)) { notefunc = func; diff --git a/utils/acid/os-Posix.c b/utils/acid/os-Posix.c index 58b4b255..3729db69 100644 --- a/utils/acid/os-Posix.c +++ b/utils/acid/os-Posix.c @@ -104,6 +104,7 @@ runcmd(char *cmd) void (*notefunc)(int); +void os_notify(void (*func)(int)) { notefunc = func; diff --git a/utils/c2l/cc.h b/utils/c2l/cc.h index 3900506d..2d16efb7 100644 --- a/utils/c2l/cc.h +++ b/utils/c2l/cc.h @@ -634,6 +634,7 @@ void pdecl(int, Type*, Sym*); Decl* push(void); Decl* push1(Sym*); Node* revertdcl(void); +#undef round #define round ccround long round(long, int); int rsametype(Type*, Type*, int, int); diff --git a/utils/data2s/data2s.c b/utils/data2s/data2s.c index 97244fb1..56b2aadd 100644 --- a/utils/data2s/data2s.c +++ b/utils/data2s/data2s.c @@ -25,7 +25,10 @@ main(int argc, char *argv[]) Bprint(&bout, "\\z"); Bprint(&bout, "\"\n"); } - Bprint(&bout, "GLOBL %scode+0(SB), $%ld\n", argv[1], len); + if(len == 0) + Bprint(&bout, "GLOBL %scode+0(SB), $1\n", argv[1]); + else + Bprint(&bout, "GLOBL %scode+0(SB), $%ld\n", argv[1], len); Bprint(&bout, "GLOBL %slen+0(SB), $4\n", argv[1]); Bprint(&bout, "DATA %slen+0(SB)/4, $%ld\n", argv[1], len); exits(0); diff --git a/utils/kc/peep.c b/utils/kc/peep.c index da6c1449..541281d0 100644 --- a/utils/kc/peep.c +++ b/utils/kc/peep.c @@ -147,6 +147,7 @@ uniqs(Reg *r) return r1; } +int regzer(Adr *a) { @@ -160,6 +161,7 @@ regzer(Adr *a) return 0; } +int regtyp(Adr *a) { @@ -312,6 +314,7 @@ copyprop(Reg *r0) return copy1(v1, v2, r0->s1, 0); } +int copy1(Adr *v1, Adr *v2, Reg *r, int f) { int t; @@ -404,7 +407,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; diff --git a/utils/kc/reg.c b/utils/kc/reg.c index 35c2e7db..309827f7 100644 --- a/utils/kc/reg.c +++ b/utils/kc/reg.c @@ -1111,6 +1111,7 @@ FtoB(int f) return 1L << (f/2 + 20); } +int BtoF(long b) { diff --git a/utils/kc/txt.c b/utils/kc/txt.c index 71f804ba..d377859a 100644 --- a/utils/kc/txt.c +++ b/utils/kc/txt.c @@ -1111,6 +1111,7 @@ gopcode(int o, Node *f1, Node *f2, Node *t) print("%P\n", p); } +int samaddr(Node *f, Node *t) { diff --git a/utils/lib/yaccpar b/utils/lib/yaccpar index efc1da06..79a8d4e0 100644 --- a/utils/lib/yaccpar +++ b/utils/lib/yaccpar @@ -21,7 +21,7 @@ extern int sprint(char*, char*, ...); char* yytokname(int yyc) { - static char x[10]; + static char x[16]; if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0])) if(yytoknames[yyc-1]) @@ -33,7 +33,7 @@ yytokname(int yyc) char* yystatname(int yys) { - static char x[10]; + static char x[16]; if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0])) if(yystates[yys]) diff --git a/utils/libmach/5db.c b/utils/libmach/5db.c index 1a125042..8312487c 100644 --- a/utils/libmach/5db.c +++ b/utils/libmach/5db.c @@ -689,7 +689,7 @@ armfmov(Map *map, Rgetter rget, Instr *i, ulong pc) /* LDR */ /* BUG: Needs LDH/B, too */ - if((i->w>>26)&0x3 == 1) { + if(((i->w>>26)&0x3) == 1) { if(get4(map, armaddr(map, rget, i), (long*)&v) < 0) { werrstr("can't read instruction: %r"); return pc+4; @@ -698,9 +698,7 @@ armfmov(Map *map, Rgetter rget, Instr *i, ulong pc) } /* MOV */ - v = armshiftval(map, rget, i); - - return v; + return armshiftval(map, rget, i); } static Opcode opcodes[] = diff --git a/utils/mk/graph.c b/utils/mk/graph.c index 018e4aea..a6886d8d 100644 --- a/utils/mk/graph.c +++ b/utils/mk/graph.c @@ -132,7 +132,7 @@ togo(Node *node) } } -static +static int vacuous(Node *node) { Arc *la, *a; diff --git a/utils/mk/mk.c b/utils/mk/mk.c index 98d76623..ba257d7c 100644 --- a/utils/mk/mk.c +++ b/utils/mk/mk.c @@ -183,7 +183,7 @@ update(int fake, Node *node) /* print("----node %s time=%ld flags=0x%x\n", node->name, node->time, node->flags);/**/ } -static +static int pcmp(char *prog, char *p, char *q) { char buf[3*NAMEBLOCK]; diff --git a/utils/mkfile b/utils/mkfile index c70e52d4..cf6bdf0d 100644 --- a/utils/mkfile +++ b/utils/mkfile @@ -99,7 +99,7 @@ nuke:QV: nuke-$TARGMODEL do test -d $j || continue echo "(cd $j; mk $MKFLAGS $stem)" - (cd $j; mk $MKFLAGS $stem) + (cd $j; mk $MKFLAGS $stem) || exit 1 done %-Nt:QV: diff --git a/utils/qa/lex.c b/utils/qa/lex.c index 228ec4e1..e711a5c6 100644 --- a/utils/qa/lex.c +++ b/utils/qa/lex.c @@ -662,6 +662,7 @@ zaddr(Gen *a, int s) case D_OPT: break; + case D_DCR: case D_SPR: case D_OREG: case D_CONST: diff --git a/utils/qc/peep.c b/utils/qc/peep.c index bb9a2b4f..69d021be 100644 --- a/utils/qc/peep.c +++ b/utils/qc/peep.c @@ -309,6 +309,7 @@ uniqs(Reg *r) * if the system forces R0 to be zero, * convert references to $0 to references to R0. */ +int regzer(Adr *a) { if(R0ISZERO) { @@ -323,6 +324,7 @@ regzer(Adr *a) return 0; } +int regtyp(Adr *a) { @@ -490,6 +492,7 @@ copyprop(Reg *r0) return copy1(v1, v2, r0->s1, 0); } +int copy1(Adr *v1, Adr *v2, Reg *r, int f) { int t; @@ -582,7 +585,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; diff --git a/utils/ql/asm.c b/utils/ql/asm.c index 6887a12b..0c546ee3 100644 --- a/utils/ql/asm.c +++ b/utils/ql/asm.c @@ -167,22 +167,22 @@ asmb(void) lput(lcsize); break; case 1: - lput(0x4a6f7921); /* Joy! */ - lput(0x70656666); /* peff */ - lput(0x70777063); /* pwpc */ + lput(0x4a6f7921); /* Joy! */ + lput(0x70656666); /* peff */ + lput(0x70777063); /* pwpc */ lput(1); lput(0); lput(0); lput(0); lput(0); - lput(0x30002); /*YY*/ + lput(0x30002); /*YY*/ lput(0); lput(~0); lput(0); lput(textsize+datsize); lput(textsize+datsize); lput(textsize+datsize); - lput(0xd0); /* header size */ + lput(0xd0); /* header size */ lput(0x10400); lput(~0); lput(0); @@ -215,16 +215,16 @@ asmb(void) lput(0); lput(0); lput(0); - lput(0x3100); /* load address */ + lput(0x3100); /* load address */ lput(0); lput(0); - lput(0); /* whew! */ + lput(0); /* whew! */ break; case 2: if(dlm) lput(0x80000000 | (4*21*21+7)); /* magic */ else - lput(4*21*21+7); /* magic */ + lput(4*21*21+7); /* magic */ lput(textsize); /* sizes */ lput(datsize); lput(bsssize); @@ -242,21 +242,21 @@ asmb(void) lput(symsize); /* nsyms */ lput((0x48L<<16)|15L); /* size of optional hdr and flags */ - lput((0413<<16)|01L); /* magic and version */ + lput((0413<<16)|01L); /* magic and version */ lput(textsize); /* sizes */ lput(datsize); lput(bsssize); lput(entryvalue()); /* va of entry */ lput(INITTEXT); /* va of base of text */ lput(INITDAT); /* va of base of data */ - lput(INITDAT); /* address of TOC */ - lput((1L<<16)|1); /* sn(entry) | sn(text) */ + lput(INITDAT); /* address of TOC */ + lput((1L<<16)|1); /* sn(entry) | sn(text) */ lput((2L<<16)|1); /* sn(data) | sn(toc) */ lput((0L<<16)|3); /* sn(loader) | sn(bss) */ lput((3L<<16)|3); /* maxalign(text) | maxalign(data) */ lput(('1'<<24)|('L'<<16)|0); /* type field, and reserved */ - lput(0); /* max stack allowed */ - lput(0); /* max data allowed */ + lput(0); /* max stack allowed */ + lput(0); /* max data allowed */ lput(0); lput(0); lput(0); /* reserved */ strnput(".text", 8); /* text segment */ @@ -273,7 +273,7 @@ asmb(void) lput(INITDAT); /* address */ lput(INITDAT); lput(datsize); - lput(rnd(HEADR+textsize, 4096)); /* sizes */ + lput(rnd(HEADR+textsize, 4096));/* sizes */ lput(0L); lput(0L); lput(0L); @@ -291,46 +291,46 @@ asmb(void) break; case 5: strnput("\177ELF", 4); /* e_ident */ - CPUT(1); /* class = 32 bit */ - CPUT(2); /* data = MSB */ - CPUT(1); /* version = CURRENT */ + CPUT(1); /* class = 32 bit */ + CPUT(2); /* data = MSB */ + CPUT(1); /* version = CURRENT */ strnput("", 9); - lput((2L<<16)|20L); /* type = EXEC; machine = PowerPC */ - lput(1L); /* version = CURRENT */ + lput((2L<<16)|20L); /* type = EXEC; machine = PowerPC */ + lput(1L); /* version = CURRENT */ lput(entryvalue() & ~KMASK); /* entry vaddr */ - lput(52L); /* offset to first phdr */ - lput(0L); /* offset to first shdr */ - lput(0L); /* flags = PPC */ - lput((52L<<16)|32L); /* Ehdr & Phdr sizes*/ - lput((3L<<16)|0L); /* # Phdrs & Shdr size */ - lput((0L<<16)|0L); /* # Shdrs & shdr string size */ - - lput(1L); /* text - type = PT_LOAD */ - lput(HEADR); /* file offset */ - lput(INITTEXT & ~KMASK); /* vaddr */ - lput(INITTEXT); /* paddr */ - lput(textsize); /* file size */ - lput(textsize); /* memory size */ - lput(0x05L); /* protections = RX */ - lput(0x10000L); /* alignment code?? */ - - lput(1L); /* data - type = PT_LOAD */ + lput(52L); /* offset to first phdr */ + lput(0L); /* offset to first shdr */ + lput(0L); /* flags = PPC */ + lput((52L<<16)|32L); /* Ehdr & Phdr sizes*/ + lput((3L<<16)|0L); /* # Phdrs & Shdr size */ + lput((0L<<16)|0L); /* # Shdrs & shdr string size */ + + lput(1L); /* text - type = PT_LOAD */ + lput(HEADR); /* file offset */ + lput(INITTEXT & ~KMASK); /* vaddr */ + lput(INITTEXT); /* paddr */ + lput(textsize); /* file size */ + lput(textsize); /* memory size */ + lput(0x05L); /* protections = RX */ + lput(0x10000L); /* alignment */ + + lput(1L); /* data - type = PT_LOAD */ lput(HEADR+textsize); /* file offset */ lput(INITDAT & ~KMASK); /* vaddr */ - lput(INITDAT); /* paddr */ - lput(datsize); /* file size */ - lput(datsize); /* memory size */ - lput(0x07L); /* protections = RWX */ - lput(0x10000L); /* alignment code?? */ + lput(INITDAT); /* paddr */ + lput(datsize); /* file size */ + lput(datsize); /* memory size */ + lput(0x07L); /* protections = RWX */ + lput(0x10000L); /* alignment */ - lput(0L); /* data - type = PT_NULL */ + lput(0L); /* data - type = PT_NULL */ lput(HEADR+textsize+datsize); /* file offset */ lput(0L); lput(0L); - lput(symsize); /* symbol table size */ - lput(lcsize); /* line number size */ - lput(0x04L); /* protections = R */ - lput(0x04L); /* alignment code?? */ + lput(symsize); /* symbol table size */ + lput(lcsize); /* line number size */ + lput(0x04L); /* protections = R */ + lput(0x04L); /* alignment code?? */ break; } cflush(); diff --git a/utils/ql/l.h b/utils/ql/l.h index 7ec4aa60..34cb742f 100644 --- a/utils/ql/l.h +++ b/utils/ql/l.h @@ -49,7 +49,7 @@ struct Prog short line; short mark; short optab; /* could be uchar */ - uchar as; + ushort as; char reg; }; struct Sym @@ -74,7 +74,7 @@ struct Autom }; struct Optab { - uchar as; + ushort as; char a1; char a2; char a3; diff --git a/utils/sqz/sqz.c b/utils/sqz/sqz.c index cf399e45..d5777a26 100644 --- a/utils/sqz/sqz.c +++ b/utils/sqz/sqz.c @@ -41,12 +41,10 @@ static Word* hash2[HSIZE]; static Sqhdr sqhdr; static ulong chksum; -static int aflag; /* all: both text (squeezed) and data (not) */ static int dflag; /* squeeze data, not text */ static int tflag; /* squeeze text, leave data as-is */ static int qflag = 1; /* enable powerpc option */ static int wflag; /* write output */ -static int zflag; /* use top==0 for data segment */ static int islittle; /* object code uses little-endian byte order */ static int debug; static char* fname; diff --git a/utils/tc/peep.c b/utils/tc/peep.c index 2842b3e3..e53b0cdd 100644 --- a/utils/tc/peep.c +++ b/utils/tc/peep.c @@ -442,7 +442,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; case AMOVM: diff --git a/utils/vc/peep.c b/utils/vc/peep.c index a9a43da4..1feff699 100644 --- a/utils/vc/peep.c +++ b/utils/vc/peep.c @@ -410,7 +410,7 @@ copyu(Prog *p, Adr *v, Adr *s) default: if(debug['P']) - print(" (???)"); + print(" (?)"); return 2; diff --git a/utils/vc/reg.c b/utils/vc/reg.c index c0d294c9..bde52df0 100644 --- a/utils/vc/reg.c +++ b/utils/vc/reg.c @@ -1112,6 +1112,7 @@ RtoB(int r) return 1L << (r-3); } +int BtoR(long b) { diff --git a/utils/vl/obj.c b/utils/vl/obj.c index 26c80683..4c9cafb7 100644 --- a/utils/vl/obj.c +++ b/utils/vl/obj.c @@ -1268,6 +1268,7 @@ nuxiinit(void) Bflush(&bso); } +int find1(long l, int c) { char *p; diff --git a/utils/vl/span.c b/utils/vl/span.c index 706d8b0e..488c93d3 100644 --- a/utils/vl/span.c +++ b/utils/vl/span.c @@ -179,6 +179,7 @@ regoff(Adr *a) return instoffset; } +int aclass(Adr *a) { Sym *s; diff --git a/utils/yacc/yaccpar b/utils/yacc/yaccpar index efc1da06..79a8d4e0 100644 --- a/utils/yacc/yaccpar +++ b/utils/yacc/yaccpar @@ -21,7 +21,7 @@ extern int sprint(char*, char*, ...); char* yytokname(int yyc) { - static char x[10]; + static char x[16]; if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0])) if(yytoknames[yyc-1]) @@ -33,7 +33,7 @@ yytokname(int yyc) char* yystatname(int yys) { - static char x[10]; + static char x[16]; if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0])) if(yystates[yys]) |
