diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bio.h | 4 | ||||
-rw-r--r-- | include/bootexec.h | 169 | ||||
-rw-r--r-- | include/link.h | 616 | ||||
-rw-r--r-- | include/mach.h | 411 | ||||
-rw-r--r-- | include/plan9/386/u.h | 2 | ||||
-rw-r--r-- | include/plan9/amd64/u.h | 2 | ||||
-rw-r--r-- | include/plan9/bio.h | 8 | ||||
-rw-r--r-- | include/plan9/errno.h (renamed from include/plan9/ureg_x86.h) | 6 | ||||
-rw-r--r-- | include/plan9/fmt.h | 64 | ||||
-rw-r--r-- | include/plan9/libc.h | 7 | ||||
-rw-r--r-- | include/plan9/link.h (renamed from include/plan9/mach.h) | 4 | ||||
-rwxr-xr-x | include/plan9/mklibc.rc | 8 | ||||
-rw-r--r-- | include/plan9/stdarg.h (renamed from include/plan9/ureg_amd64.h) | 4 | ||||
-rw-r--r-- | include/plan9/utf.h (renamed from include/plan9/ureg_arm.h) | 4 | ||||
-rw-r--r-- | include/u.h | 2 | ||||
-rw-r--r-- | include/ureg_amd64.h | 58 | ||||
-rw-r--r-- | include/ureg_arm.h | 49 | ||||
-rw-r--r-- | include/ureg_x86.h | 53 |
18 files changed, 718 insertions, 753 deletions
diff --git a/include/bio.h b/include/bio.h index 5506c7c32..f61409b8a 100644 --- a/include/bio.h +++ b/include/bio.h @@ -33,8 +33,6 @@ extern "C" { AUTOLIB(bio) #endif -#include <fcntl.h> /* for O_RDONLY, O_WRONLY */ - typedef struct Biobuf Biobuf; enum @@ -75,7 +73,7 @@ struct Biobuf * next few bytes in little-endian order. */ #define BGETC(bp)\ - ((bp)->icount?(bp)->ebuf[(bp)->icount++]:Bgetc((bp))) + ((bp)->icount?(int)((bp)->ebuf[(bp)->icount++]):Bgetc((bp))) #define BGETLE2(bp)\ ((bp)->icount<=-2?((bp)->icount+=2,((bp)->ebuf[(bp)->icount-2])|((bp)->ebuf[(bp)->icount-1]<<8)):Bgetle2((bp))) #define BGETLE4(bp)\ diff --git a/include/bootexec.h b/include/bootexec.h deleted file mode 100644 index 49721ea33..000000000 --- a/include/bootexec.h +++ /dev/null @@ -1,169 +0,0 @@ -// Inferno libmach/bootexec.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/bootexec.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. -// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). -// Portions Copyright © 1997-1999 Vita Nuova Limited. -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). -// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -struct coffsect -{ - char name[8]; - uint32 phys; - uint32 virt; - uint32 size; - uint32 fptr; - uint32 fptrreloc; - uint32 fptrlineno; - uint32 nrelocnlineno; - uint32 flags; -}; - -/* - * proprietary exec headers, needed to bootstrap various machines - */ -struct mipsexec -{ - short mmagic; /* (0x160) mips magic number */ - short nscns; /* (unused) number of sections */ - int32 timdat; /* (unused) time & date stamp */ - int32 symptr; /* offset to symbol table */ - int32 nsyms; /* size of symbol table */ - short opthdr; /* (0x38) sizeof(optional hdr) */ - short pcszs; /* flags */ - short amagic; /* see above */ - short vstamp; /* version stamp */ - int32 tsize; /* text size in bytes */ - int32 dsize; /* initialized data */ - int32 bsize; /* uninitialized data */ - int32 mentry; /* entry pt. */ - int32 text_start; /* base of text used for this file */ - int32 data_start; /* base of data used for this file */ - int32 bss_start; /* base of bss used for this file */ - int32 gprmask; /* general purpose register mask */ -union{ - int32 cprmask[4]; /* co-processor register masks */ - int32 pcsize; -}; - int32 gp_value; /* the gp value used for this object */ -}; - -struct mips4kexec -{ - struct mipsexec h; - struct coffsect itexts; - struct coffsect idatas; - struct coffsect ibsss; -}; - -struct sparcexec -{ - short sjunk; /* dynamic bit and version number */ - short smagic; /* 0407 */ - uint32 stext; - uint32 sdata; - uint32 sbss; - uint32 ssyms; - uint32 sentry; - uint32 strsize; - uint32 sdrsize; -}; - -struct nextexec -{ -/* UNUSED - struct nexthdr{ - uint32 nmagic; - uint32 ncputype; - uint32 ncpusubtype; - uint32 nfiletype; - uint32 ncmds; - uint32 nsizeofcmds; - uint32 nflags; - }; - - struct nextcmd{ - uint32 cmd; - uint32 cmdsize; - uchar segname[16]; - uint32 vmaddr; - uint32 vmsize; - uint32 fileoff; - uint32 filesize; - uint32 maxprot; - uint32 initprot; - uint32 nsects; - uint32 flags; - }textc; - struct nextsect{ - char sectname[16]; - char segname[16]; - uint32 addr; - uint32 size; - uint32 offset; - uint32 align; - uint32 reloff; - uint32 nreloc; - uint32 flags; - uint32 reserved1; - uint32 reserved2; - }texts; - struct nextcmd datac; - struct nextsect datas; - struct nextsect bsss; - struct nextsym{ - uint32 cmd; - uint32 cmdsize; - uint32 symoff; - uint32 nsyms; - uint32 spoff; - uint32 pcoff; - }symc; -*/ -}; - -struct i386exec -{ -/* UNUSED - struct i386coff{ - uint32 isectmagic; - uint32 itime; - uint32 isyms; - uint32 insyms; - uint32 iflags; - }; - struct i386hdr{ - uint32 imagic; - uint32 itextsize; - uint32 idatasize; - uint32 ibsssize; - uint32 ientry; - uint32 itextstart; - uint32 idatastart; - }; - struct coffsect itexts; - struct coffsect idatas; - struct coffsect ibsss; - struct coffsect icomments; -*/ -}; diff --git a/include/link.h b/include/link.h new file mode 100644 index 000000000..248497888 --- /dev/null +++ b/include/link.h @@ -0,0 +1,616 @@ +// Derived from Inferno utils/6l/l.h and related files. +// http://code.google.com/p/inferno-os/source/browse/utils/6l/l.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +typedef struct Addr Addr; +typedef struct Prog Prog; +typedef struct LSym LSym; +typedef struct Reloc Reloc; +typedef struct Auto Auto; +typedef struct Hist Hist; +typedef struct Link Link; +typedef struct Plist Plist; +typedef struct LinkArch LinkArch; +typedef struct Library Library; + +typedef struct Pcln Pcln; +typedef struct Pcdata Pcdata; +typedef struct Pciter Pciter; + +// prevent incompatible type signatures between liblink and 8l on Plan 9 +#pragma incomplete struct Node + +struct Addr +{ + vlong offset; + + union + { + char sval[8]; + float64 dval; + Prog* branch; // for 5g, 6g, 8g + } u; + + LSym* sym; + LSym* gotype; + short type; + uint8 index; + int8 scale; + int8 reg; // for 5l + int8 name; // for 5l + int8 class; // for 5l + uint8 etype; // for 5g, 6g, 8g + int32 offset2; // for 5l, 8l + struct Node* node; // for 5g, 6g, 8g + int64 width; // for 5g, 6g, 8g +}; + +struct Reloc +{ + int32 off; + uchar siz; + uchar done; + int32 type; + int64 add; + int64 xadd; + LSym* sym; + LSym* xsym; +}; + +struct Prog +{ + vlong pc; + int32 lineno; + Prog* link; + short as; + uchar reg; // arm only + uchar scond; // arm only + Addr from; + Addr to; + + // for 5g, 6g, 8g internal use + void* opt; + + // for 5l, 6l, 8l internal use + Prog* forwd; + Prog* pcond; + Prog* comefrom; // 6l, 8l + Prog* pcrel; // 5l + int32 spadj; + uchar mark; + uchar back; // 6l, 8l + char ft; /* 6l, 8l oclass cache */ + char tt; // 6l, 8l + uchar optab; // 5l + uchar isize; // 6l, 8l + + char width; /* fake for DATA */ + char mode; /* 16, 32, or 64 in 6l, 8l; internal use in 5g, 6g, 8g */ +}; + +// prevent incompatible type signatures between liblink and 8l on Plan 9 +#pragma incomplete struct Section + +struct LSym +{ + char* name; + char* extname; // name used in external object files + short type; + short version; + uchar dupok; + uchar external; + uchar nosplit; + uchar reachable; + uchar cgoexport; + uchar special; + uchar stkcheck; + uchar hide; + uchar leaf; // arm only + uchar fnptr; // arm only + uchar seenglobl; + uchar onlist; // on the textp or datap lists + int16 symid; // for writing .5/.6/.8 files + int32 dynid; + int32 sig; + int32 plt; + int32 got; + int32 align; // if non-zero, required alignment in bytes + int32 elfsym; + int32 args; // size of stack frame incoming arguments area + int32 locals; // size of stack frame locals area (arm only?) + vlong value; + vlong size; + LSym* hash; // in hash table + LSym* allsym; // in all symbol list + LSym* next; // in text or data list + LSym* sub; // in SSUB list + LSym* outer; // container of sub + LSym* gotype; + LSym* reachparent; + LSym* queue; + char* file; + char* dynimplib; + char* dynimpvers; + struct Section* sect; + + // STEXT + Auto* autom; + Prog* text; + Prog* etext; + Pcln* pcln; + + // SDATA, SBSS + uchar* p; + int32 np; + int32 maxp; + Reloc* r; + int32 nr; + int32 maxr; +}; + +// LSym.type +enum +{ + Sxxx, + + /* order here is order in output file */ + /* readonly, executable */ + STEXT, + SELFRXSECT, + + /* readonly, non-executable */ + STYPE, + SSTRING, + SGOSTRING, + SGOFUNC, + SRODATA, + SFUNCTAB, + STYPELINK, + SSYMTAB, // TODO: move to unmapped section + SPCLNTAB, + SELFROSECT, + + /* writable, non-executable */ + SMACHOPLT, + SELFSECT, + SMACHO, /* Mach-O __nl_symbol_ptr */ + SMACHOGOT, + SNOPTRDATA, + SINITARR, + SDATA, + SWINDOWS, + SBSS, + SNOPTRBSS, + STLSBSS, + + /* not mapped */ + SXREF, + SMACHOSYMSTR, + SMACHOSYMTAB, + SMACHOINDIRECTPLT, + SMACHOINDIRECTGOT, + SFILE, + SFILEPATH, + SCONST, + SDYNIMPORT, + SHOSTOBJ, + + SSUB = 1<<8, /* sub-symbol, linked from parent via ->sub list */ + SMASK = SSUB - 1, + SHIDDEN = 1<<9, // hidden or local symbol +}; + +// Reloc.type +enum +{ + R_ADDR = 1, + R_SIZE, + R_CALL, // relocation for direct PC-relative call + R_CALLARM, // relocation for ARM direct call + R_CALLIND, // marker for indirect call (no actual relocating necessary) + R_CONST, + R_PCREL, + R_TLS, + R_TLS_LE, // TLS local exec offset from TLS segment register + R_TLS_IE, // TLS initial exec offset from TLS base pointer + R_GOTOFF, + R_PLT0, + R_PLT1, + R_PLT2, + R_USEFIELD, +}; + +// Auto.type +enum +{ + A_AUTO = 1, + A_PARAM, +}; + +struct Auto +{ + LSym* asym; + Auto* link; + int32 aoffset; + int16 type; + LSym* gotype; +}; + +enum +{ + LINKHASH = 100003, +}; + +struct Hist +{ + Hist* link; + char* name; + int32 line; + int32 offset; +}; + +struct Plist +{ + LSym* name; + Prog* firstpc; + int recur; + Plist* link; +}; + +struct Library +{ + char *objref; // object where we found the reference + char *srcref; // src file where we found the reference + char *file; // object file + char *pkg; // import path +}; + +struct Pcdata +{ + uchar *p; + int n; + int m; +}; + +struct Pcln +{ + Pcdata pcsp; + Pcdata pcfile; + Pcdata pcline; + Pcdata *pcdata; + int npcdata; + LSym **funcdata; + int64 *funcdataoff; + int nfuncdata; + + LSym **file; + int nfile; + int mfile; + + LSym *lastfile; + int lastindex; +}; + +// Pcdata iterator. +// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) } +struct Pciter +{ + Pcdata d; + uchar *p; + uint32 pc; + uint32 nextpc; + uint32 pcscale; + int32 value; + int start; + int done; +}; + +void pciterinit(Link*, Pciter*, Pcdata*); +void pciternext(Pciter*); + +// symbol version, incremented each time a file is loaded. +// version==1 is reserved for savehist. +enum +{ + HistVersion = 1, +}; + +// Link holds the context for writing object code from a compiler +// to be linker input or for reading that input into the linker. +struct Link +{ + int32 thechar; // '5' (arm), '6' (amd64), etc. + char* thestring; // full name of architecture ("arm", "amd64", ..) + int32 goarm; // for arm only, GOARM setting + int headtype; + + LinkArch* arch; + int32 (*ignore)(char*); // do not emit names satisfying this function + int32 debugasm; // -S flag in compiler + int32 debugline; // -L flag in compiler + int32 debughist; // -O flag in linker + int32 debugread; // -W flag in linker + int32 debugvlog; // -v flag in linker + int32 debugstack; // -K flag in linker + int32 debugzerostack; // -Z flag in linker + int32 debugdivmod; // -M flag in 5l + int32 debugfloat; // -F flag in 5l + int32 debugpcln; // -O flag in linker + int32 flag_shared; // -shared flag in linker + int32 iself; + Biobuf* bso; // for -v flag + char* pathname; + int32 windows; + char* trimpath; + char* goroot; + char* goroot_final; + + // hash table of all symbols + LSym* hash[LINKHASH]; + LSym* allsym; + int32 nsymbol; + + // file-line history + Hist* hist; + Hist* ehist; + + // all programs + Plist* plist; + Plist* plast; + + // code generation + LSym* sym_div; + LSym* sym_divu; + LSym* sym_mod; + LSym* sym_modu; + LSym* symmorestack[20]; + LSym* gmsym; + LSym* plan9tos; + Prog* curp; + Prog* printp; + Prog* blitrl; + Prog* elitrl; + int rexflag; + int rep; // for nacl + int repn; // for nacl + int lock; // for nacl + int asmode; + uchar* andptr; + uchar and[100]; + int32 instoffset; + int32 autosize; + int32 armsize; + + // for reading input files (during linker) + vlong pc; + char** libdir; + int32 nlibdir; + int32 maxlibdir; + Library* library; + int libraryp; + int nlibrary; + int tlsoffset; + void (*diag)(char*, ...); + int mode; + Auto* curauto; + Auto* curhist; + LSym* cursym; + int version; + LSym* textp; + LSym* etextp; + int32 histdepth; + int32 nhistfile; + LSym* filesyms; +}; + +// LinkArch is the definition of a single architecture. +struct LinkArch +{ + char* name; // "arm", "amd64", and so on + int thechar; // '5', '6', and so on + + void (*addstacksplit)(Link*, LSym*); + void (*assemble)(Link*, LSym*); + int (*datasize)(Prog*); + void (*follow)(Link*, LSym*); + int (*iscall)(Prog*); + int (*isdata)(Prog*); + Prog* (*prg)(void); + void (*progedit)(Link*, Prog*); + void (*settextflag)(Prog*, int); + int (*symtype)(Addr*); + int (*textflag)(Prog*); + + int minlc; + int ptrsize; + int regsize; + + // TODO: Give these the same values on all systems. + int D_ADDR; + int D_AUTO; + int D_BRANCH; + int D_CONST; + int D_EXTERN; + int D_FCONST; + int D_NONE; + int D_PARAM; + int D_SCONST; + int D_STATIC; + + int ACALL; + int ADATA; + int AEND; + int AFUNCDATA; + int AGLOBL; + int AJMP; + int ANOP; + int APCDATA; + int ARET; + int ATEXT; + int ATYPE; + int AUSEFIELD; +}; + +/* executable header types */ +enum { + Hunknown = 0, + Hdarwin, + Hdragonfly, + Helf, + Hfreebsd, + Hlinux, + Hnacl, + Hnetbsd, + Hopenbsd, + Hplan9, + Hsolaris, + Hwindows, +}; + +enum +{ + LinkAuto = 0, + LinkInternal, + LinkExternal, +}; + +extern uchar fnuxi8[8]; +extern uchar fnuxi4[4]; +extern uchar inuxi1[1]; +extern uchar inuxi2[2]; +extern uchar inuxi4[4]; +extern uchar inuxi8[8]; + +// asm5.c +void span5(Link *ctxt, LSym *s); +int chipfloat5(Link *ctxt, float64 e); +int chipzero5(Link *ctxt, float64 e); + +// asm6.c +void span6(Link *ctxt, LSym *s); + +// asm8.c +void span8(Link *ctxt, LSym *s); + +// data.c +vlong addaddr(Link *ctxt, LSym *s, LSym *t); +vlong addaddrplus(Link *ctxt, LSym *s, LSym *t, vlong add); +vlong addaddrplus4(Link *ctxt, LSym *s, LSym *t, vlong add); +vlong addpcrelplus(Link *ctxt, LSym *s, LSym *t, vlong add); +Reloc* addrel(LSym *s); +vlong addsize(Link *ctxt, LSym *s, LSym *t); +vlong adduint16(Link *ctxt, LSym *s, uint16 v); +vlong adduint32(Link *ctxt, LSym *s, uint32 v); +vlong adduint64(Link *ctxt, LSym *s, uint64 v); +vlong adduint8(Link *ctxt, LSym *s, uint8 v); +vlong adduintxx(Link *ctxt, LSym *s, uint64 v, int wid); +void mangle(char *file); +void savedata(Link *ctxt, LSym *s, Prog *p, char *pn); +vlong setaddr(Link *ctxt, LSym *s, vlong off, LSym *t); +vlong setaddrplus(Link *ctxt, LSym *s, vlong off, LSym *t, vlong add); +vlong setuint16(Link *ctxt, LSym *s, vlong r, uint16 v); +vlong setuint32(Link *ctxt, LSym *s, vlong r, uint32 v); +vlong setuint64(Link *ctxt, LSym *s, vlong r, uint64 v); +vlong setuint8(Link *ctxt, LSym *s, vlong r, uint8 v); +vlong setuintxx(Link *ctxt, LSym *s, vlong off, uint64 v, vlong wid); +void symgrow(Link *ctxt, LSym *s, vlong siz); + +// go.c +void double2ieee(uint64 *ieee, double native); +void* emallocz(long n); +void* erealloc(void *p, long n); +char* estrdup(char *p); +char* expandpkg(char *t0, char *pkg); + +// ld.c +void addhist(Link *ctxt, int32 line, int type); +void addlib(Link *ctxt, char *src, char *obj, char *path); +void addlibpath(Link *ctxt, char *srcref, char *objref, char *file, char *pkg); +void collapsefrog(Link *ctxt, LSym *s); +void copyhistfrog(Link *ctxt, char *buf, int nbuf); +int find1(int32 l, int c); +void linkgetline(Link *ctxt, int32 line, LSym **f, int32 *l); +void histtoauto(Link *ctxt); +void mkfwd(LSym*); +void nuxiinit(void); +void savehist(Link *ctxt, int32 line, int32 off); +Prog* copyp(Link*, Prog*); +Prog* appendp(Link*, Prog*); +vlong atolwhex(char*); + +// list[568].c +void listinit5(void); +void listinit6(void); +void listinit8(void); + +// obj.c +int linklinefmt(Link *ctxt, Fmt *fp); +void linklinehist(Link *ctxt, int lineno, char *f, int offset); +Plist* linknewplist(Link *ctxt); +void linkprfile(Link *ctxt, int32 l); + +// objfile.c +void ldobjfile(Link *ctxt, Biobuf *b, char *pkg, int64 len, char *path); +void writeobj(Link *ctxt, Biobuf *b); + +// pass.c +Prog* brchain(Link *ctxt, Prog *p); +Prog* brloop(Link *ctxt, Prog *p); +void linkpatch(Link *ctxt, LSym *sym); + +// pcln.c +void linkpcln(Link*, LSym*); + +// sym.c +LSym* linklookup(Link *ctxt, char *name, int v); +Link* linknew(LinkArch*); +LSym* linknewsym(Link *ctxt, char *symb, int v); +LSym* linkrlookup(Link *ctxt, char *name, int v); +int linksymfmt(Fmt *f); +int headtype(char*); +char* headstr(int); + +extern char* anames5[]; +extern char* anames6[]; +extern char* anames8[]; + +extern LinkArch link386; +extern LinkArch linkamd64; +extern LinkArch linkamd64p32; +extern LinkArch linkarm; + +#pragma varargck type "A" int +#pragma varargck type "D" Addr* +#pragma varargck type "lD" Addr* +#pragma varargck type "P" Prog* +#pragma varargck type "R" int + +// TODO(ality): remove this workaround. +// It's here because Pconv in liblink/list?.c references %L. +#pragma varargck type "L" int32 diff --git a/include/mach.h b/include/mach.h deleted file mode 100644 index cf7151cfd..000000000 --- a/include/mach.h +++ /dev/null @@ -1,411 +0,0 @@ -// Inferno libmach/a.out.h and libmach/mach.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/a.out.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/mach.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. -// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). -// Portions Copyright © 1997-1999 Vita Nuova Limited. -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). -// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -/* - * Architecture-dependent application data - */ - -typedef struct Exec Exec; -struct Exec -{ - int32 magic; /* magic number */ - int32 text; /* size of text segment */ - int32 data; /* size of initialized data */ - int32 bss; /* size of uninitialized data */ - int32 syms; /* size of symbol table */ - int32 entry; /* entry point */ - int32 spsz; /* size of pc/sp offset table */ - int32 pcsz; /* size of pc/line number table */ -}; - -#define HDR_MAGIC 0x00008000 /* header expansion */ - -#define _MAGIC(f, b) ((f)|((((4*(b))+0)*(b))+7)) -#define A_MAGIC _MAGIC(0, 8) /* 68020 */ -#define I_MAGIC _MAGIC(0, 11) /* intel 386 */ -#define J_MAGIC _MAGIC(0, 12) /* intel 960 (retired) */ -#define K_MAGIC _MAGIC(0, 13) /* sparc */ -#define V_MAGIC _MAGIC(0, 16) /* mips 3000 BE */ -#define X_MAGIC _MAGIC(0, 17) /* att dsp 3210 (retired) */ -#define M_MAGIC _MAGIC(0, 18) /* mips 4000 BE */ -#define D_MAGIC _MAGIC(0, 19) /* amd 29000 (retired) */ -#define E_MAGIC _MAGIC(0, 20) /* arm */ -#define Q_MAGIC _MAGIC(0, 21) /* powerpc */ -#define N_MAGIC _MAGIC(0, 22) /* mips 4000 LE */ -#define L_MAGIC _MAGIC(0, 23) /* dec alpha */ -#define P_MAGIC _MAGIC(0, 24) /* mips 3000 LE */ -#define U_MAGIC _MAGIC(0, 25) /* sparc64 */ -#define S_MAGIC _MAGIC(HDR_MAGIC, 26) /* amd64 */ -#define T_MAGIC _MAGIC(HDR_MAGIC, 27) /* powerpc64 */ - -#define MIN_MAGIC 8 -#define MAX_MAGIC 27 /* <= 90 */ - -#define DYN_MAGIC 0x80000000 /* dlm */ - -typedef struct Sym Sym; -struct Sym -{ - vlong value; - uint sig; - char type; - char *name; - vlong gotype; - int sequence; // order in file -}; - - -/* - * Supported architectures: - * mips, - * 68020, - * i386, - * amd64, - * sparc, - * sparc64, - * mips2 (R4000) - * arm - * powerpc, - * powerpc64 - * alpha - */ -enum -{ - MMIPS, /* machine types */ - MSPARC, - M68020, - MI386, - MI960, /* retired */ - M3210, /* retired */ - MMIPS2, - NMIPS2, - M29000, /* retired */ - MARM, - MPOWER, - MALPHA, - NMIPS, - MSPARC64, - MAMD64, - MPOWER64, - /* types of executables */ - FNONE = 0, /* unidentified */ - FMIPS, /* v.out */ - FMIPSB, /* mips bootable */ - FSPARC, /* k.out */ - FSPARCB, /* Sparc bootable */ - F68020, /* 2.out */ - F68020B, /* 68020 bootable */ - FNEXTB, /* Next bootable */ - FI386, /* 8.out */ - FI386B, /* I386 bootable */ - FI960, /* retired */ - FI960B, /* retired */ - F3210, /* retired */ - FMIPS2BE, /* 4.out */ - F29000, /* retired */ - FARM, /* 5.out */ - FARMB, /* ARM bootable */ - FPOWER, /* q.out */ - FPOWERB, /* power pc bootable */ - FMIPS2LE, /* 0.out */ - FALPHA, /* 7.out */ - FALPHAB, /* DEC Alpha bootable */ - FMIPSLE, /* 3k little endian */ - FSPARC64, /* u.out */ - FAMD64, /* 6.out */ - FAMD64B, /* 6.out bootable */ - FPOWER64, /* 9.out */ - FPOWER64B, /* 9.out bootable */ - FWINPE, /* windows PE executable */ - - ANONE = 0, /* dissembler types */ - AMIPS, - AMIPSCO, /* native mips */ - ASPARC, - ASUNSPARC, /* native sun */ - A68020, - AI386, - AI8086, /* oh god */ - AI960, /* retired */ - A29000, /* retired */ - AARM, - APOWER, - AALPHA, - ASPARC64, - AAMD64, - APOWER64, - /* object file types */ - Obj68020 = 0, /* .2 */ - ObjSparc, /* .k */ - ObjMips, /* .v */ - Obj386, /* .8 */ - Obj960, /* retired */ - Obj3210, /* retired */ - ObjMips2, /* .4 */ - Obj29000, /* retired */ - ObjArm, /* .5 */ - ObjPower, /* .q */ - ObjMips2le, /* .0 */ - ObjAlpha, /* .7 */ - ObjSparc64, /* .u */ - ObjAmd64, /* .6 */ - ObjSpim, /* .0 */ - ObjPower64, /* .9 */ - Maxobjtype, - - CNONE = 0, /* symbol table classes */ - CAUTO, - CPARAM, - CSTAB, - CTEXT, - CDATA, - CANY, /* to look for any class */ -}; - -typedef struct Map Map; -typedef struct Symbol Symbol; -typedef struct Reglist Reglist; -typedef struct Mach Mach; -typedef struct Machdata Machdata; -typedef struct Seg Seg; - -typedef int Maprw(Map *m, Seg *s, uvlong addr, void *v, uint n, int isread); - -struct Seg { - char *name; /* the segment name */ - int fd; /* file descriptor */ - int inuse; /* in use - not in use */ - int cache; /* should cache reads? */ - uvlong b; /* base */ - uvlong e; /* end */ - vlong f; /* offset within file */ - Maprw *rw; /* read/write fn for seg */ -}; - -/* - * Structure to map a segment to data - */ -struct Map { - int pid; - int tid; - int nsegs; /* number of segments */ - Seg seg[1]; /* actually n of these */ -}; - -/* - * Internal structure describing a symbol table entry - */ -struct Symbol { - void *handle; /* used internally - owning func */ - struct { - char *name; - vlong value; /* address or stack offset */ - char type; /* as in a.out.h */ - char class; /* as above */ - int index; /* in findlocal, globalsym, textsym */ - }; -}; - -/* - * machine register description - */ -struct Reglist { - char *rname; /* register name */ - short roffs; /* offset in u-block */ - char rflags; /* INTEGER/FLOAT, WRITABLE */ - char rformat; /* print format: 'x', 'X', 'f', '8', '3', 'Y', 'W' */ -}; - -enum { /* bits in rflags field */ - RINT = (0<<0), - RFLT = (1<<0), - RRDONLY = (1<<1), -}; - -/* - * Machine-dependent data is stored in two structures: - * Mach - miscellaneous general parameters - * Machdata - jump vector of service functions used by debuggers - * - * Mach is defined in ?.c and set in executable.c - * - * Machdata is defined in ?db.c - * and set in the debugger startup. - */ -struct Mach{ - char *name; - int mtype; /* machine type code */ - Reglist *reglist; /* register set */ - int32 regsize; /* sizeof registers in bytes */ - int32 fpregsize; /* sizeof fp registers in bytes */ - char *pc; /* pc name */ - char *sp; /* sp name */ - char *link; /* link register name */ - char *sbreg; /* static base register name */ - uvlong sb; /* static base register value */ - int pgsize; /* page size */ - uvlong kbase; /* kernel base address */ - uvlong ktmask; /* ktzero = kbase & ~ktmask */ - uvlong utop; /* user stack top */ - int pcquant; /* quantization of pc */ - int szaddr; /* sizeof(void*) */ - int szreg; /* sizeof(register) */ - int szfloat; /* sizeof(float) */ - int szdouble; /* sizeof(double) */ -}; - -extern Mach *mach; /* Current machine */ - -typedef uvlong (*Rgetter)(Map*, char*); -typedef void (*Tracer)(Map*, uvlong, uvlong, Symbol*); - -struct Machdata { /* Machine-dependent debugger support */ - uchar bpinst[4]; /* break point instr. */ - short bpsize; /* size of break point instr. */ - - ushort (*swab)(ushort); /* ushort to local byte order */ - uint32 (*swal)(uint32); /* uint32 to local byte order */ - uvlong (*swav)(uvlong); /* uvlong to local byte order */ - int (*ctrace)(Map*, uvlong, uvlong, uvlong, Tracer); /* C traceback */ - uvlong (*findframe)(Map*, uvlong, uvlong, uvlong, uvlong);/* frame finder */ - char* (*excep)(Map*, Rgetter); /* last exception */ - uint32 (*bpfix)(uvlong); /* breakpoint fixup */ - int (*sftos)(char*, int, void*); /* single precision float */ - int (*dftos)(char*, int, void*); /* double precision float */ - int (*foll)(Map*, uvlong, Rgetter, uvlong*);/* follow set */ - int (*das)(Map*, uvlong, char, char*, int); /* symbolic disassembly */ - int (*hexinst)(Map*, uvlong, char*, int); /* hex disassembly */ - int (*instsize)(Map*, uvlong); /* instruction size */ -}; - -/* - * Common a.out header describing all architectures - */ -typedef struct Fhdr -{ - char *name; /* identifier of executable */ - uchar type; /* file type - see codes above */ - uchar hdrsz; /* header size */ - uchar _magic; /* _MAGIC() magic */ - uchar spare; - int32 magic; /* magic number */ - uvlong txtaddr; /* text address */ - vlong txtoff; /* start of text in file */ - uvlong dataddr; /* start of data segment */ - vlong datoff; /* offset to data seg in file */ - vlong symoff; /* offset of symbol table in file */ - uvlong entry; /* entry point */ - vlong sppcoff; /* offset of sp-pc table in file */ - vlong lnpcoff; /* offset of line number-pc table in file */ - int32 txtsz; /* text size */ - int32 datsz; /* size of data seg */ - int32 bsssz; /* size of bss */ - int32 symsz; /* size of symbol table */ - int32 sppcsz; /* size of sp-pc table */ - int32 lnpcsz; /* size of line number-pc table */ -} Fhdr; - -extern int asstype; /* dissembler type - machdata.c */ -extern Machdata *machdata; /* jump vector - machdata.c */ - -int beieee80ftos(char*, int, void*); -int beieeesftos(char*, int, void*); -int beieeedftos(char*, int, void*); -ushort beswab(ushort); -uint32 beswal(uint32); -uvlong beswav(uvlong); -uvlong ciscframe(Map*, uvlong, uvlong, uvlong, uvlong); -int cisctrace(Map*, uvlong, uvlong, uvlong, Tracer); -int crackhdr(int fd, Fhdr*); -uvlong file2pc(char*, int32); -int fileelem(Sym**, uchar *, char*, int); -int32 fileline(char*, int, uvlong); -int filesym(int, char*, int); -int findlocal(Symbol*, char*, Symbol*); -int findseg(Map*, char*); -int findsym(uvlong, int, Symbol *); -int fnbound(uvlong, uvlong*); -int fpformat(Map*, Reglist*, char*, int, int); -int get1(Map*, uvlong, uchar*, int); -int get2(Map*, uvlong, ushort*); -int get4(Map*, uvlong, uint32*); -int get8(Map*, uvlong, uvlong*); -int geta(Map*, uvlong, uvlong*); -int getauto(Symbol*, int, int, Symbol*); -Sym* getsym(int); -int globalsym(Symbol *, int); -char* _hexify(char*, uint32, int); -int ieeesftos(char*, int, uint32); -int ieeedftos(char*, int, uint32, uint32); -int isar(Biobuf*); -int leieee80ftos(char*, int, void*); -int leieeesftos(char*, int, void*); -int leieeedftos(char*, int, void*); -ushort leswab(ushort); -uint32 leswal(uint32); -uvlong leswav(uvlong); -uvlong line2addr(int32, uvlong, uvlong); -Map* loadmap(Map*, int, Fhdr*); -int localaddr(Map*, char*, char*, uvlong*, Rgetter); -int localsym(Symbol*, int); -int lookup(char*, char*, Symbol*); -void machbytype(int); -int machbyname(char*); -int nextar(Biobuf*, int, char*); -Map* newmap(Map*, int); -void objtraverse(void(*)(Sym*, void*), void*); -int objtype(Biobuf*, char**); -uvlong pc2sp(uvlong); -int32 pc2line(uvlong); -int put1(Map*, uvlong, uchar*, int); -int put2(Map*, uvlong, ushort); -int put4(Map*, uvlong, uint32); -int put8(Map*, uvlong, uvlong); -int puta(Map*, uvlong, uvlong); -int readar(Biobuf*, int, vlong, int); -int readobj(Biobuf*, int); -uvlong riscframe(Map*, uvlong, uvlong, uvlong, uvlong); -int risctrace(Map*, uvlong, uvlong, uvlong, Tracer); -int setmap(Map*, int, uvlong, uvlong, vlong, char*, Maprw *rw); -Sym* symbase(int32*); -int syminit(int, Fhdr*); -int symoff(char*, int, uvlong, int); -void textseg(uvlong, Fhdr*); -int textsym(Symbol*, int); -void unusemap(Map*, int); - -Map* attachproc(int pid, Fhdr *fp); -int ctlproc(int pid, char *msg); -void detachproc(Map *m); -int procnotes(int pid, char ***pnotes); -char* proctextfile(int pid); -int procthreadpids(int pid, int *tid, int ntid); -char* procstatus(int); - -Maprw fdrw; diff --git a/include/plan9/386/u.h b/include/plan9/386/u.h index 4736b8efb..1c4076b5e 100644 --- a/include/plan9/386/u.h +++ b/include/plan9/386/u.h @@ -13,3 +13,5 @@ typedef uint uint32; typedef vlong int64; typedef uvlong uint64; typedef int intptr; +typedef float float32; +typedef double float64; diff --git a/include/plan9/amd64/u.h b/include/plan9/amd64/u.h index 090b2fa5c..c2d499938 100644 --- a/include/plan9/amd64/u.h +++ b/include/plan9/amd64/u.h @@ -13,3 +13,5 @@ typedef uint uint32; typedef vlong int64; typedef uvlong uint64; typedef vlong intptr; +typedef float float32; +typedef double float64; diff --git a/include/plan9/bio.h b/include/plan9/bio.h new file mode 100644 index 000000000..13d5e0ef2 --- /dev/null +++ b/include/plan9/bio.h @@ -0,0 +1,8 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "../bio.h" + +#define fmtcharstod charstod +#define lseek seek diff --git a/include/plan9/ureg_x86.h b/include/plan9/errno.h index 7d73a4865..1ed572ace 100644 --- a/include/plan9/ureg_x86.h +++ b/include/plan9/errno.h @@ -1,5 +1,7 @@ -// Copyright 2012 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "/386/include/ureg.h" +int errno; + +#define ERANGE 1001 diff --git a/include/plan9/fmt.h b/include/plan9/fmt.h new file mode 100644 index 000000000..b4a4fe791 --- /dev/null +++ b/include/plan9/fmt.h @@ -0,0 +1,64 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "../fmt.h" + +#pragma varargck argpos fmtprint 2 +#pragma varargck argpos fprint 2 +#pragma varargck argpos print 1 +#pragma varargck argpos runeseprint 3 +#pragma varargck argpos runesmprint 1 +#pragma varargck argpos runesnprint 3 +#pragma varargck argpos runesprint 2 +#pragma varargck argpos seprint 3 +#pragma varargck argpos smprint 1 +#pragma varargck argpos snprint 3 +#pragma varargck argpos sprint 2 + +#pragma varargck type "lld" vlong +#pragma varargck type "llo" vlong +#pragma varargck type "llx" vlong +#pragma varargck type "llb" vlong +#pragma varargck type "lld" uvlong +#pragma varargck type "llo" uvlong +#pragma varargck type "llx" uvlong +#pragma varargck type "llb" uvlong +#pragma varargck type "ld" long +#pragma varargck type "lo" long +#pragma varargck type "lx" long +#pragma varargck type "lb" long +#pragma varargck type "ld" ulong +#pragma varargck type "lo" ulong +#pragma varargck type "lx" ulong +#pragma varargck type "lb" ulong +#pragma varargck type "d" int +#pragma varargck type "o" int +#pragma varargck type "x" int +#pragma varargck type "c" int +#pragma varargck type "C" int +#pragma varargck type "b" int +#pragma varargck type "d" uint +#pragma varargck type "x" uint +#pragma varargck type "c" uint +#pragma varargck type "C" uint +#pragma varargck type "b" uint +#pragma varargck type "f" double +#pragma varargck type "e" double +#pragma varargck type "g" double +#pragma varargck type "s" char* +#pragma varargck type "q" char* +#pragma varargck type "S" Rune* +#pragma varargck type "Q" Rune* +#pragma varargck type "r" void +#pragma varargck type "%" void +#pragma varargck type "n" int* +#pragma varargck type "p" uintptr +#pragma varargck type "p" void* +#pragma varargck flag ',' +#pragma varargck flag ' ' +#pragma varargck flag 'h' +#pragma varargck type "<" void* +#pragma varargck type "[" void* +#pragma varargck type "H" void* +#pragma varargck type "lH" void* diff --git a/include/plan9/libc.h b/include/plan9/libc.h index 798e47095..773edeee3 100644 --- a/include/plan9/libc.h +++ b/include/plan9/libc.h @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "/sys/include/libc.h" #include "/sys/include/ctype.h" +#include "fmt.h" +#include "utf.h" +#include "libc_plan9.h" char* getgoos(void); char* getgoarch(void); @@ -26,3 +28,6 @@ void flagprint(int); // The libraries use size_t to avoid -Wconversion warnings from GCC // when calling standard library functions like memcpy. typedef unsigned long size_t; + +// math.h +#define HUGE_VAL 1.79769313486231e+308 diff --git a/include/plan9/mach.h b/include/plan9/link.h index 636f44fe8..f65971efc 100644 --- a/include/plan9/mach.h +++ b/include/plan9/link.h @@ -1,5 +1,5 @@ -// Copyright 2012 The Go Authors. All rights reserved. +// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "../mach.h" +#include "../link.h" diff --git a/include/plan9/mklibc.rc b/include/plan9/mklibc.rc new file mode 100755 index 000000000..449e15fdf --- /dev/null +++ b/include/plan9/mklibc.rc @@ -0,0 +1,8 @@ +#!/bin/rc + +pattern='/umuldiv/d + /rune routines/,/^\/\*/d + /print routines/,/^\/\*/d + /error string for/,/^\/\*/d' + +sed -e $pattern /sys/include/libc.h | awk '/^enum/ && !n++, /^};/ {next}1' diff --git a/include/plan9/ureg_amd64.h b/include/plan9/stdarg.h index 8aaa83f52..b562a3a6e 100644 --- a/include/plan9/ureg_amd64.h +++ b/include/plan9/stdarg.h @@ -1,5 +1,3 @@ -// Copyright 2012 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - -#include "/amd64/include/ureg.h" diff --git a/include/plan9/ureg_arm.h b/include/plan9/utf.h index f83c19a2f..03c26d69d 100644 --- a/include/plan9/ureg_arm.h +++ b/include/plan9/utf.h @@ -1,5 +1,5 @@ -// Copyright 2012 The Go Authors. All rights reserved. +// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -#include "/arm/include/ureg.h" +#include "../utf.h" diff --git a/include/u.h b/include/u.h index 44bfcd63b..6b2d50cc1 100644 --- a/include/u.h +++ b/include/u.h @@ -188,6 +188,8 @@ typedef u32int uint32; typedef s64int int64; typedef u64int uint64; +typedef float float32; +typedef double float64; #undef _NEEDUCHAR #undef _NEEDUSHORT diff --git a/include/ureg_amd64.h b/include/ureg_amd64.h deleted file mode 100644 index 2c39f17ce..000000000 --- a/include/ureg_amd64.h +++ /dev/null @@ -1,58 +0,0 @@ -// Inferno utils/libmach/ureg6.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/ureg6.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. -// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). -// Portions Copyright © 1997-1999 Vita Nuova Limited. -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). -// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -struct Ureg { - u64int ax; - u64int bx; - u64int cx; - u64int dx; - u64int si; - u64int di; - u64int bp; - u64int r8; - u64int r9; - u64int r10; - u64int r11; - u64int r12; - u64int r13; - u64int r14; - u64int r15; - - u16int ds; - u16int es; - u16int fs; - u16int gs; - - u64int type; - u64int error; /* error code (or zero) */ - u64int ip; /* pc */ - u64int cs; /* old context */ - u64int flags; /* old flags */ - u64int sp; /* sp */ - u64int ss; /* old stack segment */ -}; diff --git a/include/ureg_arm.h b/include/ureg_arm.h deleted file mode 100644 index c740b0302..000000000 --- a/include/ureg_arm.h +++ /dev/null @@ -1,49 +0,0 @@ -// Inferno utils/libmach/ureg5.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/ureg5.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. -// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). -// Portions Copyright © 1997-1999 Vita Nuova Limited. -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). -// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -struct Ureg { - uint r0; - uint r1; - uint r2; - uint r3; - uint r4; - uint r5; - uint r6; - uint r7; - uint r8; - uint r9; - uint r10; - uint r11; - uint r12; - uint r13; - uint r14; - uint link; - uint type; - uint psr; - uint pc; -}; diff --git a/include/ureg_x86.h b/include/ureg_x86.h deleted file mode 100644 index c20fe4e4c..000000000 --- a/include/ureg_x86.h +++ /dev/null @@ -1,53 +0,0 @@ -// Inferno utils/libmach/ureg8.h -// http://code.google.com/p/inferno-os/source/browse/utils/libmach/ureg8.h -// -// Copyright © 1994-1999 Lucent Technologies Inc. -// Power PC support Copyright © 1995-2004 C H Forsyth (forsyth@terzarima.net). -// Portions Copyright © 1997-1999 Vita Nuova Limited. -// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). -// Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others. -// Portions Copyright © 2009 The Go Authors. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -struct Ureg -{ - uint32 di; /* general registers */ - uint32 si; /* ... */ - uint32 bp; /* ... */ - uint32 nsp; - uint32 bx; /* ... */ - uint32 dx; /* ... */ - uint32 cx; /* ... */ - uint32 ax; /* ... */ - uint32 gs; /* data segments */ - uint32 fs; /* ... */ - uint32 es; /* ... */ - uint32 ds; /* ... */ - uint32 trap; /* trap type */ - uint32 ecode; /* error code (or zero) */ - uint32 pc; /* pc */ - uint32 cs; /* old context */ - uint32 flags; /* old flags */ - union { - uint32 usp; - uint32 sp; - }; - uint32 ss; /* old stack segment */ -}; |