Browse Source

Plan 9 from Bell Labs 2005-04-26

David du Colombier 15 years ago
parent
commit
2cd808b559

+ 71 - 0
amd64/include/u.h

@@ -0,0 +1,71 @@
+#define nil		((void*)0)
+typedef	unsigned short	ushort;
+typedef	unsigned char	uchar;
+typedef unsigned long	ulong;
+typedef unsigned int	uint;
+typedef   signed char	schar;
+typedef	long long	vlong;
+typedef	unsigned long long uvlong;
+typedef uvlong		uintptr;
+typedef	ushort		Rune;
+typedef union FPdbleword FPdbleword;
+typedef uvlong		jmp_buf[2];
+#define	JMPBUFSP	0
+#define	JMPBUFPC	1
+#define	JMPBUFDPC	0
+typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char	u8int;
+typedef unsigned short	u16int;
+typedef unsigned int	u32int;
+typedef unsigned long long u64int;
+
+/* MXCSR */
+/* fcr */
+#define	FPFTZ	(1<<15)	/* amd64 */
+#define	FPINEX	(1<<12)
+#define	FPUNFL	(1<<11)
+#define	FPOVFL	(1<<10)
+#define	FPZDIV	(1<<9)
+#define	FPDNRM	(1<<8)	/* amd64 */
+#define	FPINVAL	(1<<7)
+#define	FPDAZ	(1<<6)	/* amd64 */
+#define	FPRNR	(0<<13)
+#define	FPRZ	(3<<13)
+#define	FPRPINF	(2<<13)
+#define	FPRNINF	(1<<13)
+#define	FPRMASK	(3<<13)
+#define	FPPEXT	0
+#define	FPPSGL	0
+#define	FPPDBL	0
+#define	FPPMASK	0
+/* fsr */
+#define	FPAINEX	(1<<5)
+#define	FPAUNFL	(1<<4)
+#define	FPAOVFL	(1<<3)
+#define	FPAZDIV	(1<<2)
+#define	FPADNRM	(1<<1)	/* not in plan 9 */
+#define	FPAINVAL	(1<<0)
+union FPdbleword
+{
+	double	x;
+	struct {	/* little endian */
+		uint lo;
+		uint hi;
+	};
+};
+
+typedef	char*	va_list;
+#define va_start(list, start) list =\
+	(sizeof(start) < 8?\
+		(char*)((vlong*)&(start)+1):\
+		(char*)(&(start)+1))
+#define va_end(list)\
+	USED(list)
+#define va_arg(list, mode)\
+	((sizeof(mode) == 1)?\
+		((mode*)(list += 8))[-8]:\
+	(sizeof(mode) == 2)?\
+		((mode*)(list += 8))[-4]:\
+	(sizeof(mode) == 4)?\
+		((mode*)(list += 8))[-2]:\
+		((mode*)(list += sizeof(mode)))[-1])

+ 30 - 0
amd64/include/ureg.h

@@ -0,0 +1,30 @@
+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 */
+};

+ 6 - 0
amd64/mkfile

@@ -0,0 +1,6 @@
+</sys/src/mkfile.proto
+
+CC=6c
+LD=6l
+O=6
+AS=6a

+ 65 - 26
dist/replica/_plan9.db

@@ -147,7 +147,7 @@
 386/bin/aux/tr2post - 775 sys sys 1104121987 176578
 386/bin/aux/trampoline - 775 sys sys 1104121988 83293
 386/bin/aux/typepasswd - 775 sys sys 1104121988 69503
-386/bin/aux/vga - 775 sys sys 1109563697 301643
+386/bin/aux/vga - 775 sys sys 1114453635 309981
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
 386/bin/aux/vmware - 775 sys sys 1049428256 453
 386/bin/aux/vmwarefs - 775 sys sys 1095563640 99117
@@ -549,7 +549,7 @@
 386/lib/libhttpd.a - 664 sys sys 1108268398 99488
 386/lib/libip.a - 664 sys sys 1108268398 35602
 386/lib/libl.a - 664 sys sys 1108268398 5384
-386/lib/libmach.a - 664 sys sys 1114225969 658810
+386/lib/libmach.a - 664 sys sys 1114459829 834000
 386/lib/libmemdraw.a - 664 sys sys 1110946101 283198
 386/lib/libmemlayer.a - 664 sys sys 1108699740 47360
 386/lib/libmp.a - 664 sys sys 1108268401 79532
@@ -832,6 +832,13 @@ alpha/include/ureg.h - 664 sys sys 944946362 644
 alpha/lib - 20000000775 sys sys 947992106 0
 alpha/lib/ape - 20000000775 sys sys 947992106 0
 alpha/mkfile - 664 sys sys 948141303 46
+amd64 - 20000000775 sys sys 1114458599 0
+amd64/bin - 20000000775 sys sys 1114458475 0
+amd64/include - 20000000775 sys sys 1114458660 0
+amd64/include/u.h - 644 sys sys 1114458660 1658
+amd64/include/ureg.h - 644 sys sys 1114458660 454
+amd64/lib - 20000000775 sys sys 1114458490 0
+amd64/mkfile - 644 sys sys 1114458599 46
 arm - 20000000775 sys sys 947991045 0
 arm/bin - 20000000775 sys sys 1018321186 0
 arm/bin/ape - 20000000775 sys sys 985644327 0
@@ -870,7 +877,7 @@ dist/replica - 20000000775 sys sys 1019277119 0
 dist/replica/cd - 664 sys sys 1019527959 390
 dist/replica/kfs - 664 sys sys 1019527929 237
 dist/replica/network - 775 sys sys 1071079179 996
-dist/replica/plan9.proto - 664 sys sys 1112361655 2500
+dist/replica/plan9.proto - 664 sys sys 1114460221 2560
 env - 20000000775 sys sys 1015094872 0
 fd - 20000000775 sys sys 947958544 0
 lib - 20000000775 sys sys 958504315 0
@@ -3654,6 +3661,13 @@ sparc/include/ureg.h - 664 sys sys 944946363 599
 sparc/lib - 20000000775 sys sys 947992106 0
 sparc/lib/ape - 20000000775 sys sys 947992106 0
 sparc/mkfile - 664 sys sys 948141304 52
+sparc64 - 20000000775 sys sys 1114458667 0
+sparc64/bin - 20000000775 sys sys 1114458528 0
+sparc64/include - 20000000775 sys sys 1114458675 0
+sparc64/include/u.h - 644 sys sys 1114458675 1423
+sparc64/include/ureg.h - 644 sys sys 1114458675 719
+sparc64/lib - 20000000775 sys sys 1114458535 0
+sparc64/mkfile - 644 sys sys 1114458667 46
 sys - 20000000775 sys sys 952648870 0
 sys/doc - 20000000775 sys sys 1018471272 0
 sys/doc/-.2669382.gif - 664 sys sys 1019969850 2078
@@ -4117,7 +4131,7 @@ sys/lib/dist/pc/inst/stopppp - 775 sys sys 1018469719 250
 sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1112361039 361
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
-sys/lib/dist/pc/mkfile - 664 sys sys 1114364348 2045
+sys/lib/dist/pc/mkfile - 664 sys sys 1114446424 2148
 sys/lib/dist/pc/plan9.ini - 664 sys sys 1020361168 512
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1092148201 357
@@ -5643,7 +5657,7 @@ sys/man/8/udpecho - 664 sys sys 954305553 303
 sys/man/8/update - 664 sys sys 961259288 2336
 sys/man/8/venti - 664 sys sys 1069101926 5422
 sys/man/8/ventiaux - 664 sys sys 1063855987 10487
-sys/man/8/vga - 664 sys sys 959698505 3557
+sys/man/8/vga - 664 sys sys 1114454069 3936
 sys/man/fonts - 664 sys sys 944959700 218
 sys/man/index.html - 664 sys sys 1019918444 1859
 sys/man/mkfile - 664 sys sys 1018974173 2264
@@ -6976,7 +6990,7 @@ sys/src/boot/pc/apm.c - 664 sys sys 1015007947 289
 sys/src/boot/pc/bcom.c - 664 sys sys 1032215919 6421
 sys/src/boot/pc/boot.c - 664 sys sys 1109364490 8418
 sys/src/boot/pc/bootld.c - 664 sys sys 1015007948 1801
-sys/src/boot/pc/bootp.c - 664 sys sys 1107882190 12147
+sys/src/boot/pc/bootp.c - 664 sys sys 1114464742 12374
 sys/src/boot/pc/cga.c - 664 sys sys 1015007948 1362
 sys/src/boot/pc/clock.c - 664 sys sys 1103641772 6425
 sys/src/boot/pc/conf.c - 664 sys sys 1094674484 10217
@@ -7030,7 +7044,7 @@ sys/src/boot/pc/mem.h - 664 sys sys 1103641771 3371
 sys/src/boot/pc/memory.c - 664 sys sys 1019533021 10272
 sys/src/boot/pc/mkfile - 664 sys sys 1103641863 3105
 sys/src/boot/pc/noether.c - 664 sys sys 1094674488 358
-sys/src/boot/pc/part.c - 664 sys sys 1032215918 7505
+sys/src/boot/pc/part.c - 664 sys sys 1114427970 7509
 sys/src/boot/pc/pbs.s - 664 sys sys 1017854325 8279
 sys/src/boot/pc/pbsdisk - 775 sys sys 1017854325 509
 sys/src/boot/pc/pbsdisk.s - 664 sys sys 1017854325 6371
@@ -7060,7 +7074,7 @@ sys/src/cmd/1c - 20000000775 sys sys 945321342 0
 sys/src/cmd/1c/bits.c - 664 sys sys 944961353 1370
 sys/src/cmd/1c/cgen.c - 664 sys sys 1089299179 28257
 sys/src/cmd/1c/enam.c - 664 sys sys 1089299179 4239
-sys/src/cmd/1c/gc.h - 664 sys sys 1089299178 6006
+sys/src/cmd/1c/gc.h - 664 sys sys 1114449033 6008
 sys/src/cmd/1c/list.c - 664 sys sys 1014926630 4507
 sys/src/cmd/1c/mkfile - 664 sys sys 944961353 264
 sys/src/cmd/1c/mul.c - 664 sys sys 944961353 2599
@@ -7091,7 +7105,7 @@ sys/src/cmd/2c/2.out.h - 664 sys sys 1089299176 5075
 sys/src/cmd/2c/bits.c - 664 sys sys 944960717 1370
 sys/src/cmd/2c/cgen.c - 664 sys sys 1089299176 28451
 sys/src/cmd/2c/enam.c - 664 sys sys 1089299176 4239
-sys/src/cmd/2c/gc.h - 664 sys sys 1014924675 6203
+sys/src/cmd/2c/gc.h - 664 sys sys 1114449040 6205
 sys/src/cmd/2c/list.c - 664 sys sys 1089299176 5521
 sys/src/cmd/2c/mkfile - 664 sys sys 944960717 258
 sys/src/cmd/2c/mul.c - 664 sys sys 944960717 2599
@@ -7591,8 +7605,8 @@ sys/src/cmd/aux/vga/clgd542x.c - 664 sys sys 1014925007 6916
 sys/src/cmd/aux/vga/clgd546x.c - 664 sys sys 1014925007 7996
 sys/src/cmd/aux/vga/ct65540.c - 664 sys sys 1014925007 5355
 sys/src/cmd/aux/vga/cyber938x.c - 664 sys sys 1087406072 6543
-sys/src/cmd/aux/vga/data.c - 664 sys sys 1019498850 2200
-sys/src/cmd/aux/vga/db.c - 664 sys sys 1081201695 9430
+sys/src/cmd/aux/vga/data.c - 664 sys sys 1114453579 2249
+sys/src/cmd/aux/vga/db.c - 664 sys sys 1114453625 9568
 sys/src/cmd/aux/vga/error.c - 664 sys sys 1014925008 745
 sys/src/cmd/aux/vga/et4000.c - 664 sys sys 1014925008 6720
 sys/src/cmd/aux/vga/et4000hwgc.c - 664 sys sys 1014925008 552
@@ -7606,10 +7620,10 @@ sys/src/cmd/aux/vga/io.c - 664 sys sys 1014925009 6222
 sys/src/cmd/aux/vga/mach32.c - 664 sys sys 1014925009 6004
 sys/src/cmd/aux/vga/mach64.c - 664 sys sys 1014925009 8279
 sys/src/cmd/aux/vga/mach64xx.c - 664 sys sys 1097900455 30266
-sys/src/cmd/aux/vga/main.c - 664 sys sys 1014925010 8154
+sys/src/cmd/aux/vga/main.c - 664 sys sys 1114453579 9442
 sys/src/cmd/aux/vga/mga2164w.c - 664 sys sys 1014925010 13196
 sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1014925010 35895
-sys/src/cmd/aux/vga/mkfile - 664 sys sys 1048636613 905
+sys/src/cmd/aux/vga/mkfile - 664 sys sys 1114453579 915
 sys/src/cmd/aux/vga/neomagic.c - 664 sys sys 1104430499 8975
 sys/src/cmd/aux/vga/notes.txt - 664 sys sys 1028334647 14376
 sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1109511456 23718
@@ -7634,8 +7648,9 @@ sys/src/cmd/aux/vga/tvp3025.c - 664 sys sys 1014925013 1960
 sys/src/cmd/aux/vga/tvp3025clock.c - 664 sys sys 1014925013 1511
 sys/src/cmd/aux/vga/tvp3026.c - 664 sys sys 1014925013 3580
 sys/src/cmd/aux/vga/tvp3026clock.c - 664 sys sys 1014925013 1960
+sys/src/cmd/aux/vga/vesa.c - 664 sys sys 1114453579 9357
 sys/src/cmd/aux/vga/vga.c - 664 sys sys 1014925013 9305
-sys/src/cmd/aux/vga/vga.h - 664 sys sys 1025416295 10154
+sys/src/cmd/aux/vga/vga.h - 664 sys sys 1114453579 10336
 sys/src/cmd/aux/vga/virge.c - 664 sys sys 1090439328 18587
 sys/src/cmd/aux/vga/vision864.c - 664 sys sys 1014925014 2325
 sys/src/cmd/aux/vga/vision964.c - 664 sys sys 1014925014 3426
@@ -12525,44 +12540,53 @@ sys/src/liblex/reject.c - 664 sys sys 944961728 1000
 sys/src/liblex/yyless.c - 664 sys sys 944961728 403
 sys/src/liblex/yywrap.c - 664 sys sys 944961728 85
 sys/src/libmach - 20000000775 sys sys 969559166 0
-sys/src/libmach/0.c - 664 sys sys 1021927268 4042
+sys/src/libmach/0.c - 664 sys sys 1114459829 4037
+sys/src/libmach/0c - 20000000775 sys sys 1114459438 0
+sys/src/libmach/0c/README - 644 sys sys 1114459609 73
+sys/src/libmach/0c/ureg.h - 644 sys sys 1114459438 886
 sys/src/libmach/2.c - 664 sys sys 964540513 2034
 sys/src/libmach/2db.c - 664 sys sys 1014929543 61245
 sys/src/libmach/2obj.c - 664 sys sys 1091732624 2335
 sys/src/libmach/5.c - 664 sys sys 984710422 1513
 sys/src/libmach/5db.c - 664 sys sys 1114218476 21530
 sys/src/libmach/5obj.c - 664 sys sys 1091732625 2209
+sys/src/libmach/6.c - 644 sys sys 1114459868 3366
+sys/src/libmach/6c - 20000000775 sys sys 1114459480 0
+sys/src/libmach/6c/6.out.h - 644 sys sys 1114459480 7984
+sys/src/libmach/6obj.c - 644 sys sys 1114459831 2382
 sys/src/libmach/7.c - 664 sys sys 964540515 3267
 sys/src/libmach/7db.c - 664 sys sys 1014929543 17320
 sys/src/libmach/7obj.c - 664 sys sys 1091732676 2367
 sys/src/libmach/8.c - 664 sys sys 964540515 2020
-sys/src/libmach/8db.c - 664 sys sys 1088653064 39144
+sys/src/libmach/8db.c - 664 sys sys 1114459831 50189
 sys/src/libmach/8obj.c - 664 sys sys 1091732625 2200
 sys/src/libmach/access.c - 664 sys sys 1068478065 4309
-sys/src/libmach/elf.h - 664 sys sys 1107634043 2262
-sys/src/libmach/executable.c - 664 sys sys 1107963442 13918
+sys/src/libmach/elf.h - 664 sys sys 1114459895 2323
+sys/src/libmach/executable.c - 664 sys sys 1114459829 15179
 sys/src/libmach/k.c - 664 sys sys 964540516 3330
 sys/src/libmach/kdb.c - 664 sys sys 1014929544 21143
 sys/src/libmach/kobj.c - 664 sys sys 1091732625 2217
 sys/src/libmach/machdata.c - 664 sys sys 964540516 8814
 sys/src/libmach/map.c - 664 sys sys 964540517 3053
-sys/src/libmach/mkfile - 664 sys sys 1089313991 439
-sys/src/libmach/obj.c - 664 sys sys 1089313993 5760
+sys/src/libmach/mkfile - 664 sys sys 1114459827 467
+sys/src/libmach/obj.c - 664 sys sys 1114459829 5918
 sys/src/libmach/obj.h - 664 sys sys 964540517 603
 sys/src/libmach/q.c - 664 sys sys 1091732625 3590
-sys/src/libmach/qdb.c - 664 sys sys 1014929544 27188
+sys/src/libmach/qdb.c - 664 sys sys 1114459830 27490
 sys/src/libmach/qobj.c - 664 sys sys 1091732625 2310
-sys/src/libmach/setmach.c - 664 sys sys 1089313993 2682
+sys/src/libmach/setmach.c - 664 sys sys 1114459829 2913
 sys/src/libmach/swap.c - 664 sys sys 964540518 1026
 sys/src/libmach/sym.c - 664 sys sys 1106409575 26581
+sys/src/libmach/u.c - 644 sys sys 1114459829 3396
+sys/src/libmach/uc - 20000000775 sys sys 1114459488 0
+sys/src/libmach/uc/README - 644 sys sys 1114459488 73
+sys/src/libmach/uc/u.out.h - 644 sys sys 1114459488 3137
+sys/src/libmach/udb.c - 644 sys sys 1114459830 21893
+sys/src/libmach/uobj.c - 644 sys sys 1114459831 2219
 sys/src/libmach/v.c - 664 sys sys 964540518 3403
 sys/src/libmach/vcodas.c - 664 sys sys 1014929545 10253
 sys/src/libmach/vdb.c - 664 sys sys 1014929545 22248
 sys/src/libmach/vobj.c - 664 sys sys 1091732625 2206
-sys/src/libmach/xc - 20000000775 sys sys 964540563 0
-sys/src/libmach/xc/README - 664 sys sys 950326252 73
-sys/src/libmach/xc/mips2ureg.h - 664 sys sys 964540563 886
-sys/src/libmach/xc/x.out.h - 664 sys sys 950325899 3232
 sys/src/libmemdraw - 20000000775 sys sys 985020762 0
 sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
 sys/src/libmemdraw/alpha.hoc - 664 sys sys 944961741 220
@@ -12949,3 +12973,18 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/acid - 775 sys sys 1114484867 389719
+386/bin/ar - 775 sys sys 1114484868 110847
+386/bin/db - 775 sys sys 1114484869 336153
+386/bin/snap - 775 sys sys 1114484871 303547
+386/bin/snapfs - 775 sys sys 1114484872 372401
+386/bin/file - 775 sys sys 1114484869 118706
+386/bin/kprof - 775 sys sys 1114484870 102284
+386/bin/ktrace - 775 sys sys 1114484870 116436
+386/bin/nm - 775 sys sys 1114484870 121630
+386/bin/prof - 775 sys sys 1114484870 106950
+386/bin/size - 775 sys sys 1114484871 76817
+386/bin/aux/ms2 - 775 sys sys 1114484868 84166
+386/bin/aux/vga - 775 sys sys 1114484868 309981
+386/bin/tprof - 775 sys sys 1114484873 289115
+386/lib/libmach.a - 664 sys sys 1114484874 755168

+ 63 - 39
dist/replica/plan9.db

@@ -19,7 +19,7 @@
 386/bin/8l - 775 sys sys 1107835553 115728
 386/bin/9660srv - 775 sys sys 1113794389 103976
 386/bin/aan - 775 sys sys 1108354539 130710
-386/bin/acid - 775 sys sys 1114225965 357187
+386/bin/acid - 775 sys sys 1114484867 389719
 386/bin/acme - 775 sys sys 1111637282 428512
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1087442501 132681
@@ -38,7 +38,7 @@
 386/bin/ape/tar - 775 sys sys 1104121958 61903
 386/bin/ape/uname - 775 sys sys 1087442505 132510
 386/bin/aquarela - 775 sys sys 1064598027 319170
-386/bin/ar - 775 sys sys 1104121958 107438
+386/bin/ar - 775 sys sys 1114484868 110847
 386/bin/archfs - 775 sys sys 1108354542 140779
 386/bin/ascii - 775 sys sys 1104121959 64668
 386/bin/astro - 775 sys sys 1104121959 138803
@@ -117,7 +117,7 @@
 386/bin/aux/mklatinkbd - 775 sys sys 1104121979 64179
 386/bin/aux/mnihongo - 775 sys sys 1106799170 138512
 386/bin/aux/mouse - 775 sys sys 1104121979 44026
-386/bin/aux/ms2 - 775 sys sys 1108008332 81689
+386/bin/aux/ms2 - 775 sys sys 1114484868 84166
 386/bin/aux/msexceltables - 775 sys sys 1106453225 80995
 386/bin/aux/mswordstrings - 775 sys sys 1104121980 65317
 386/bin/aux/na - 775 sys sys 1113794390 154186
@@ -147,7 +147,7 @@
 386/bin/aux/tr2post - 775 sys sys 1104121987 176578
 386/bin/aux/trampoline - 775 sys sys 1104121988 83293
 386/bin/aux/typepasswd - 775 sys sys 1104121988 69503
-386/bin/aux/vga - 775 sys sys 1109563697 301643
+386/bin/aux/vga - 775 sys sys 1114484868 309981
 386/bin/aux/vmmousepoll - 775 sys sys 1032480572 41434
 386/bin/aux/vmware - 775 sys sys 1049428256 453
 386/bin/aux/vmwarefs - 775 sys sys 1095563640 99117
@@ -187,7 +187,7 @@
 386/bin/cpu - 775 sys sys 1108354550 137694
 386/bin/crop - 775 sys sys 1104121998 115763
 386/bin/date - 775 sys sys 1104121998 43261
-386/bin/db - 775 sys sys 1114225965 303621
+386/bin/db - 775 sys sys 1114484869 336153
 386/bin/dc - 775 sys sys 1104121999 99028
 386/bin/dd - 775 sys sys 1104121999 45347
 386/bin/deroff - 775 sys sys 1104122000 74244
@@ -224,7 +224,7 @@
 386/bin/faces - 775 sys sys 1106799174 192579
 386/bin/factor - 775 sys sys 1104122008 61475
 386/bin/fcp - 775 sys sys 1110859785 82162
-386/bin/file - 775 sys sys 1113361802 112820
+386/bin/file - 775 sys sys 1114484869 118706
 386/bin/fmt - 775 sys sys 1104122009 65301
 386/bin/fortune - 775 sys sys 1104122009 67136
 386/bin/fossil - 20000000775 sys sys 1042005470 0
@@ -308,8 +308,8 @@
 386/bin/join - 775 sys sys 1113794393 114091
 386/bin/jpg - 775 sys sys 1108960009 174528
 386/bin/kbmap - 775 sys sys 1106799176 142498
-386/bin/kprof - 775 sys sys 1108960009 99723
-386/bin/ktrace - 775 sys sys 1108960009 113674
+386/bin/kprof - 775 sys sys 1114484870 102284
+386/bin/ktrace - 775 sys sys 1114484870 116436
 386/bin/lens - 775 sys sys 1104122032 124095
 386/bin/lex - 775 sys sys 1104122033 98664
 386/bin/lnfs - 775 sys sys 1108354557 99449
@@ -342,7 +342,7 @@
 386/bin/netstat - 775 sys sys 1104122040 84385
 386/bin/news - 775 sys sys 1104122041 71653
 386/bin/nfs - 775 sys sys 1108354559 315389
-386/bin/nm - 775 sys sys 1108960010 115737
+386/bin/nm - 775 sys sys 1114484870 121630
 386/bin/nntpfs - 775 sys sys 1108354560 160898
 386/bin/ns - 775 sys sys 1104122042 65260
 386/bin/p - 775 sys sys 1108268390 64990
@@ -360,7 +360,7 @@
 386/bin/ppm - 775 sys sys 1108960012 149347
 386/bin/pr - 775 sys sys 1104122046 77408
 386/bin/primes - 775 sys sys 1104122046 38793
-386/bin/prof - 775 sys sys 1108960012 104466
+386/bin/prof - 775 sys sys 1114484870 106950
 386/bin/proof - 775 sys sys 1106799178 177605
 386/bin/ps - 775 sys sys 1104122047 65805
 386/bin/pwd - 775 sys sys 1104122047 36897
@@ -389,10 +389,10 @@
 386/bin/sed - 775 sys sys 1104122054 89523
 386/bin/seq - 775 sys sys 1104122054 38206
 386/bin/sha1sum - 775 sys sys 1104122054 61133
-386/bin/size - 775 sys sys 1108008334 74340
+386/bin/size - 775 sys sys 1114484871 76817
 386/bin/sleep - 775 sys sys 1085077097 3413
-386/bin/snap - 775 sys sys 1114225966 271015
-386/bin/snapfs - 775 sys sys 1114225967 339869
+386/bin/snap - 775 sys sys 1114484871 303547
+386/bin/snapfs - 775 sys sys 1114484872 372401
 386/bin/sniffer - 775 sys sys 1038443185 99028
 386/bin/snoopy - 775 sys sys 1108354563 157546
 386/bin/sort - 775 sys sys 1104122056 82285
@@ -425,7 +425,7 @@
 386/bin/topng - 775 sys sys 1108872012 138083
 386/bin/toppm - 775 sys sys 1104122065 164905
 386/bin/touch - 775 sys sys 1104122066 63763
-386/bin/tprof - 775 sys sys 1114225968 256583
+386/bin/tprof - 775 sys sys 1114484873 289115
 386/bin/tr - 775 sys sys 1104122066 61851
 386/bin/trace - 775 sys sys 1106799181 180728
 386/bin/troff - 775 sys sys 1094040114 357714
@@ -549,7 +549,7 @@
 386/lib/libhttpd.a - 664 sys sys 1108268398 99488
 386/lib/libip.a - 664 sys sys 1108268398 35602
 386/lib/libl.a - 664 sys sys 1108268398 5384
-386/lib/libmach.a - 664 sys sys 1114225969 658810
+386/lib/libmach.a - 664 sys sys 1114484874 755168
 386/lib/libmemdraw.a - 664 sys sys 1110946101 283198
 386/lib/libmemlayer.a - 664 sys sys 1108699740 47360
 386/lib/libmp.a - 664 sys sys 1108268401 79532
@@ -832,6 +832,13 @@ alpha/include/ureg.h - 664 sys sys 944946362 644
 alpha/lib - 20000000775 sys sys 947992106 0
 alpha/lib/ape - 20000000775 sys sys 947992106 0
 alpha/mkfile - 664 sys sys 948141303 46
+amd64 - 20000000775 sys sys 1114458599 0
+amd64/bin - 20000000775 sys sys 1114458475 0
+amd64/include - 20000000775 sys sys 1114458660 0
+amd64/include/u.h - 644 sys sys 1114458660 1658
+amd64/include/ureg.h - 644 sys sys 1114458660 454
+amd64/lib - 20000000775 sys sys 1114458490 0
+amd64/mkfile - 644 sys sys 1114458599 46
 arm - 20000000775 sys sys 947991045 0
 arm/bin - 20000000775 sys sys 1018321186 0
 arm/bin/ape - 20000000775 sys sys 985644327 0
@@ -870,7 +877,7 @@ dist/replica - 20000000775 sys sys 1019277119 0
 dist/replica/cd - 664 sys sys 1019527959 390
 dist/replica/kfs - 664 sys sys 1019527929 237
 dist/replica/network - 775 sys sys 1071079179 996
-dist/replica/plan9.proto - 664 sys sys 1112361655 2500
+dist/replica/plan9.proto - 664 sys sys 1114460221 2560
 env - 20000000775 sys sys 1015094872 0
 fd - 20000000775 sys sys 947958544 0
 lib - 20000000775 sys sys 958504315 0
@@ -3654,6 +3661,13 @@ sparc/include/ureg.h - 664 sys sys 944946363 599
 sparc/lib - 20000000775 sys sys 947992106 0
 sparc/lib/ape - 20000000775 sys sys 947992106 0
 sparc/mkfile - 664 sys sys 948141304 52
+sparc64 - 20000000775 sys sys 1114458667 0
+sparc64/bin - 20000000775 sys sys 1114458528 0
+sparc64/include - 20000000775 sys sys 1114458675 0
+sparc64/include/u.h - 644 sys sys 1114458675 1423
+sparc64/include/ureg.h - 644 sys sys 1114458675 719
+sparc64/lib - 20000000775 sys sys 1114458535 0
+sparc64/mkfile - 644 sys sys 1114458667 46
 sys - 20000000775 sys sys 952648870 0
 sys/doc - 20000000775 sys sys 1018471272 0
 sys/doc/-.2669382.gif - 664 sys sys 1019969850 2078
@@ -4117,7 +4131,7 @@ sys/lib/dist/pc/inst/stopppp - 775 sys sys 1018469719 250
 sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1112361039 361
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
-sys/lib/dist/pc/mkfile - 664 sys sys 1114364348 2045
+sys/lib/dist/pc/mkfile - 664 sys sys 1114446424 2148
 sys/lib/dist/pc/plan9.ini - 664 sys sys 1020361168 512
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1092148201 357
@@ -5643,7 +5657,7 @@ sys/man/8/udpecho - 664 sys sys 954305553 303
 sys/man/8/update - 664 sys sys 961259288 2336
 sys/man/8/venti - 664 sys sys 1069101926 5422
 sys/man/8/ventiaux - 664 sys sys 1063855987 10487
-sys/man/8/vga - 664 sys sys 959698505 3557
+sys/man/8/vga - 664 sys sys 1114454069 3936
 sys/man/fonts - 664 sys sys 944959700 218
 sys/man/index.html - 664 sys sys 1019918444 1859
 sys/man/mkfile - 664 sys sys 1018974173 2264
@@ -6976,7 +6990,7 @@ sys/src/boot/pc/apm.c - 664 sys sys 1015007947 289
 sys/src/boot/pc/bcom.c - 664 sys sys 1032215919 6421
 sys/src/boot/pc/boot.c - 664 sys sys 1109364490 8418
 sys/src/boot/pc/bootld.c - 664 sys sys 1015007948 1801
-sys/src/boot/pc/bootp.c - 664 sys sys 1107882190 12147
+sys/src/boot/pc/bootp.c - 664 sys sys 1114464742 12374
 sys/src/boot/pc/cga.c - 664 sys sys 1015007948 1362
 sys/src/boot/pc/clock.c - 664 sys sys 1103641772 6425
 sys/src/boot/pc/conf.c - 664 sys sys 1094674484 10217
@@ -7030,7 +7044,7 @@ sys/src/boot/pc/mem.h - 664 sys sys 1103641771 3371
 sys/src/boot/pc/memory.c - 664 sys sys 1019533021 10272
 sys/src/boot/pc/mkfile - 664 sys sys 1103641863 3105
 sys/src/boot/pc/noether.c - 664 sys sys 1094674488 358
-sys/src/boot/pc/part.c - 664 sys sys 1032215918 7505
+sys/src/boot/pc/part.c - 664 sys sys 1114427970 7509
 sys/src/boot/pc/pbs.s - 664 sys sys 1017854325 8279
 sys/src/boot/pc/pbsdisk - 775 sys sys 1017854325 509
 sys/src/boot/pc/pbsdisk.s - 664 sys sys 1017854325 6371
@@ -7060,7 +7074,7 @@ sys/src/cmd/1c - 20000000775 sys sys 945321342 0
 sys/src/cmd/1c/bits.c - 664 sys sys 944961353 1370
 sys/src/cmd/1c/cgen.c - 664 sys sys 1089299179 28257
 sys/src/cmd/1c/enam.c - 664 sys sys 1089299179 4239
-sys/src/cmd/1c/gc.h - 664 sys sys 1089299178 6006
+sys/src/cmd/1c/gc.h - 664 sys sys 1114449033 6008
 sys/src/cmd/1c/list.c - 664 sys sys 1014926630 4507
 sys/src/cmd/1c/mkfile - 664 sys sys 944961353 264
 sys/src/cmd/1c/mul.c - 664 sys sys 944961353 2599
@@ -7091,7 +7105,7 @@ sys/src/cmd/2c/2.out.h - 664 sys sys 1089299176 5075
 sys/src/cmd/2c/bits.c - 664 sys sys 944960717 1370
 sys/src/cmd/2c/cgen.c - 664 sys sys 1089299176 28451
 sys/src/cmd/2c/enam.c - 664 sys sys 1089299176 4239
-sys/src/cmd/2c/gc.h - 664 sys sys 1014924675 6203
+sys/src/cmd/2c/gc.h - 664 sys sys 1114449040 6205
 sys/src/cmd/2c/list.c - 664 sys sys 1089299176 5521
 sys/src/cmd/2c/mkfile - 664 sys sys 944960717 258
 sys/src/cmd/2c/mul.c - 664 sys sys 944960717 2599
@@ -7591,8 +7605,8 @@ sys/src/cmd/aux/vga/clgd542x.c - 664 sys sys 1014925007 6916
 sys/src/cmd/aux/vga/clgd546x.c - 664 sys sys 1014925007 7996
 sys/src/cmd/aux/vga/ct65540.c - 664 sys sys 1014925007 5355
 sys/src/cmd/aux/vga/cyber938x.c - 664 sys sys 1087406072 6543
-sys/src/cmd/aux/vga/data.c - 664 sys sys 1019498850 2200
-sys/src/cmd/aux/vga/db.c - 664 sys sys 1081201695 9430
+sys/src/cmd/aux/vga/data.c - 664 sys sys 1114453579 2249
+sys/src/cmd/aux/vga/db.c - 664 sys sys 1114453625 9568
 sys/src/cmd/aux/vga/error.c - 664 sys sys 1014925008 745
 sys/src/cmd/aux/vga/et4000.c - 664 sys sys 1014925008 6720
 sys/src/cmd/aux/vga/et4000hwgc.c - 664 sys sys 1014925008 552
@@ -7606,10 +7620,10 @@ sys/src/cmd/aux/vga/io.c - 664 sys sys 1014925009 6222
 sys/src/cmd/aux/vga/mach32.c - 664 sys sys 1014925009 6004
 sys/src/cmd/aux/vga/mach64.c - 664 sys sys 1014925009 8279
 sys/src/cmd/aux/vga/mach64xx.c - 664 sys sys 1097900455 30266
-sys/src/cmd/aux/vga/main.c - 664 sys sys 1014925010 8154
+sys/src/cmd/aux/vga/main.c - 664 sys sys 1114453579 9442
 sys/src/cmd/aux/vga/mga2164w.c - 664 sys sys 1014925010 13196
 sys/src/cmd/aux/vga/mga4xx.c - 664 sys sys 1014925010 35895
-sys/src/cmd/aux/vga/mkfile - 664 sys sys 1048636613 905
+sys/src/cmd/aux/vga/mkfile - 664 sys sys 1114453579 915
 sys/src/cmd/aux/vga/neomagic.c - 664 sys sys 1104430499 8975
 sys/src/cmd/aux/vga/notes.txt - 664 sys sys 1028334647 14376
 sys/src/cmd/aux/vga/nvidia.c - 664 sys sys 1109511456 23718
@@ -7634,8 +7648,9 @@ sys/src/cmd/aux/vga/tvp3025.c - 664 sys sys 1014925013 1960
 sys/src/cmd/aux/vga/tvp3025clock.c - 664 sys sys 1014925013 1511
 sys/src/cmd/aux/vga/tvp3026.c - 664 sys sys 1014925013 3580
 sys/src/cmd/aux/vga/tvp3026clock.c - 664 sys sys 1014925013 1960
+sys/src/cmd/aux/vga/vesa.c - 664 sys sys 1114453579 9357
 sys/src/cmd/aux/vga/vga.c - 664 sys sys 1014925013 9305
-sys/src/cmd/aux/vga/vga.h - 664 sys sys 1025416295 10154
+sys/src/cmd/aux/vga/vga.h - 664 sys sys 1114453579 10336
 sys/src/cmd/aux/vga/virge.c - 664 sys sys 1090439328 18587
 sys/src/cmd/aux/vga/vision864.c - 664 sys sys 1014925014 2325
 sys/src/cmd/aux/vga/vision964.c - 664 sys sys 1014925014 3426
@@ -12525,44 +12540,53 @@ sys/src/liblex/reject.c - 664 sys sys 944961728 1000
 sys/src/liblex/yyless.c - 664 sys sys 944961728 403
 sys/src/liblex/yywrap.c - 664 sys sys 944961728 85
 sys/src/libmach - 20000000775 sys sys 969559166 0
-sys/src/libmach/0.c - 664 sys sys 1021927268 4042
+sys/src/libmach/0.c - 664 sys sys 1114459829 4037
+sys/src/libmach/0c - 20000000775 sys sys 1114459438 0
+sys/src/libmach/0c/README - 644 sys sys 1114459609 73
+sys/src/libmach/0c/ureg.h - 644 sys sys 1114459438 886
 sys/src/libmach/2.c - 664 sys sys 964540513 2034
 sys/src/libmach/2db.c - 664 sys sys 1014929543 61245
 sys/src/libmach/2obj.c - 664 sys sys 1091732624 2335
 sys/src/libmach/5.c - 664 sys sys 984710422 1513
 sys/src/libmach/5db.c - 664 sys sys 1114218476 21530
 sys/src/libmach/5obj.c - 664 sys sys 1091732625 2209
+sys/src/libmach/6.c - 644 sys sys 1114459868 3366
+sys/src/libmach/6c - 20000000775 sys sys 1114459480 0
+sys/src/libmach/6c/6.out.h - 644 sys sys 1114459480 7984
+sys/src/libmach/6obj.c - 644 sys sys 1114459831 2382
 sys/src/libmach/7.c - 664 sys sys 964540515 3267
 sys/src/libmach/7db.c - 664 sys sys 1014929543 17320
 sys/src/libmach/7obj.c - 664 sys sys 1091732676 2367
 sys/src/libmach/8.c - 664 sys sys 964540515 2020
-sys/src/libmach/8db.c - 664 sys sys 1088653064 39144
+sys/src/libmach/8db.c - 664 sys sys 1114459831 50189
 sys/src/libmach/8obj.c - 664 sys sys 1091732625 2200
 sys/src/libmach/access.c - 664 sys sys 1068478065 4309
-sys/src/libmach/elf.h - 664 sys sys 1107634043 2262
-sys/src/libmach/executable.c - 664 sys sys 1107963442 13918
+sys/src/libmach/elf.h - 664 sys sys 1114459895 2323
+sys/src/libmach/executable.c - 664 sys sys 1114459829 15179
 sys/src/libmach/k.c - 664 sys sys 964540516 3330
 sys/src/libmach/kdb.c - 664 sys sys 1014929544 21143
 sys/src/libmach/kobj.c - 664 sys sys 1091732625 2217
 sys/src/libmach/machdata.c - 664 sys sys 964540516 8814
 sys/src/libmach/map.c - 664 sys sys 964540517 3053
-sys/src/libmach/mkfile - 664 sys sys 1089313991 439
-sys/src/libmach/obj.c - 664 sys sys 1089313993 5760
+sys/src/libmach/mkfile - 664 sys sys 1114459827 467
+sys/src/libmach/obj.c - 664 sys sys 1114459829 5918
 sys/src/libmach/obj.h - 664 sys sys 964540517 603
 sys/src/libmach/q.c - 664 sys sys 1091732625 3590
-sys/src/libmach/qdb.c - 664 sys sys 1014929544 27188
+sys/src/libmach/qdb.c - 664 sys sys 1114459830 27490
 sys/src/libmach/qobj.c - 664 sys sys 1091732625 2310
-sys/src/libmach/setmach.c - 664 sys sys 1089313993 2682
+sys/src/libmach/setmach.c - 664 sys sys 1114459829 2913
 sys/src/libmach/swap.c - 664 sys sys 964540518 1026
 sys/src/libmach/sym.c - 664 sys sys 1106409575 26581
+sys/src/libmach/u.c - 644 sys sys 1114459829 3396
+sys/src/libmach/uc - 20000000775 sys sys 1114459488 0
+sys/src/libmach/uc/README - 644 sys sys 1114459488 73
+sys/src/libmach/uc/u.out.h - 644 sys sys 1114459488 3137
+sys/src/libmach/udb.c - 644 sys sys 1114459830 21893
+sys/src/libmach/uobj.c - 644 sys sys 1114459831 2219
 sys/src/libmach/v.c - 664 sys sys 964540518 3403
 sys/src/libmach/vcodas.c - 664 sys sys 1014929545 10253
 sys/src/libmach/vdb.c - 664 sys sys 1014929545 22248
 sys/src/libmach/vobj.c - 664 sys sys 1091732625 2206
-sys/src/libmach/xc - 20000000775 sys sys 964540563 0
-sys/src/libmach/xc/README - 664 sys sys 950326252 73
-sys/src/libmach/xc/mips2ureg.h - 664 sys sys 964540563 886
-sys/src/libmach/xc/x.out.h - 664 sys sys 950325899 3232
 sys/src/libmemdraw - 20000000775 sys sys 985020762 0
 sys/src/libmemdraw/alloc.c - 664 sys sys 1046640198 3234
 sys/src/libmemdraw/alpha.hoc - 664 sys sys 944961741 220

+ 69 - 0
dist/replica/plan9.log

@@ -14740,3 +14740,72 @@
 1114365697 0 c sys/lib/dist/cmd/bargraph.c - 664 sys sys 1114364700 5871
 1114365697 1 c sys/lib/dist/pc/glenda/lib/profile - 664 sys sys 1114364353 359
 1114365697 2 c sys/lib/dist/pc/mkfile - 664 sys sys 1114364348 2045
+1114428709 0 c sys/src/boot/pc/part.c - 664 sys sys 1114427970 7509
+1114446713 0 c sys/lib/dist/pc/mkfile - 664 sys sys 1114446424 2148
+1114450314 0 c sys/src/cmd/2c/gc.h - 664 sys sys 1114449040 6205
+1114450314 1 c sys/src/cmd/1c/gc.h - 664 sys sys 1114449033 6008
+1114453915 0 c 386/bin/aux/vga - 775 sys sys 1114453635 309981
+1114453915 1 c sys/src/cmd/aux/vga/data.c - 664 sys sys 1114453579 2249
+1114453915 2 c sys/src/cmd/aux/vga/db.c - 664 sys sys 1114453625 9568
+1114453915 3 c sys/src/cmd/aux/vga/main.c - 664 sys sys 1114453579 9442
+1114453915 4 c sys/src/cmd/aux/vga/mkfile - 664 sys sys 1114453579 915
+1114453915 5 a sys/src/cmd/aux/vga/vesa.c - 664 sys sys 1114453579 9357
+1114453915 6 c sys/src/cmd/aux/vga/vga.h - 664 sys sys 1114453579 10336
+1114455715 0 c sys/man/8/vga - 664 sys sys 1114454069 3936
+1114461115 0 c 386/lib/libmach.a - 664 sys sys 1114459829 834000
+1114461115 1 a amd64 - 20000000775 sys sys 1114458599 0
+1114461115 2 a amd64/bin - 20000000775 sys sys 1114458475 0
+1114461115 3 a amd64/include - 20000000775 sys sys 1114458660 0
+1114461115 4 a amd64/include/u.h - 644 sys sys 1114458660 1658
+1114461115 5 a amd64/include/ureg.h - 644 sys sys 1114458660 454
+1114461115 6 a amd64/lib - 20000000775 sys sys 1114458490 0
+1114461115 7 a amd64/mkfile - 644 sys sys 1114458599 46
+1114461115 8 a sparc64 - 20000000775 sys sys 1114458667 0
+1114461115 9 a sparc64/bin - 20000000775 sys sys 1114458528 0
+1114461115 10 a sparc64/include - 20000000775 sys sys 1114458675 0
+1114461115 11 a sparc64/include/u.h - 644 sys sys 1114458675 1423
+1114461115 12 a sparc64/include/ureg.h - 644 sys sys 1114458675 719
+1114461115 13 a sparc64/lib - 20000000775 sys sys 1114458535 0
+1114461115 14 a sparc64/mkfile - 644 sys sys 1114458667 46
+1114461115 15 c sys/src/libmach/0.c - 664 sys sys 1114459829 4037
+1114461115 16 a sys/src/libmach/0c - 20000000775 sys sys 1114459438 0
+1114461115 17 a sys/src/libmach/0c/README - 644 sys sys 1114459609 73
+1114461115 18 a sys/src/libmach/0c/ureg.h - 644 sys sys 1114459438 886
+1114461115 19 a sys/src/libmach/6.c - 644 sys sys 1114459868 3366
+1114461115 20 a sys/src/libmach/6c - 20000000775 sys sys 1114459480 0
+1114461115 21 a sys/src/libmach/6c/6.out.h - 644 sys sys 1114459480 7984
+1114461115 22 a sys/src/libmach/6obj.c - 644 sys sys 1114459831 2382
+1114461115 23 c sys/src/libmach/8db.c - 664 sys sys 1114459831 50189
+1114461115 24 c sys/src/libmach/elf.h - 664 sys sys 1114459895 2323
+1114461115 25 c sys/src/libmach/executable.c - 664 sys sys 1114459829 15179
+1114461115 26 c sys/src/libmach/mkfile - 664 sys sys 1114459827 467
+1114461115 27 c sys/src/libmach/obj.c - 664 sys sys 1114459829 5918
+1114461115 28 c sys/src/libmach/qdb.c - 664 sys sys 1114459830 27490
+1114461115 29 c sys/src/libmach/setmach.c - 664 sys sys 1114459829 2913
+1114461115 30 a sys/src/libmach/u.c - 644 sys sys 1114459829 3396
+1114461115 31 a sys/src/libmach/uc - 20000000775 sys sys 1114459488 0
+1114461115 32 a sys/src/libmach/uc/README - 644 sys sys 1114459488 73
+1114461115 33 a sys/src/libmach/uc/u.out.h - 644 sys sys 1114459488 3137
+1114461115 34 a sys/src/libmach/udb.c - 644 sys sys 1114459830 21893
+1114461115 35 a sys/src/libmach/uobj.c - 644 sys sys 1114459831 2219
+1114461115 36 c dist/replica/plan9.proto - 664 sys sys 1114460221 2560
+1114461115 37 d sys/src/libmach/xc/x.out.h - 664 sys sys 950325899 0
+1114461115 38 d sys/src/libmach/xc/mips2ureg.h - 664 sys sys 964540563 0
+1114461115 39 d sys/src/libmach/xc/README - 664 sys sys 950326252 0
+1114461115 40 d sys/src/libmach/xc - 20000000775 sys sys 964540563 0
+1114464716 0 c sys/src/boot/pc/bootp.c - 664 sys sys 1114464742 12374
+1114486320 0 c 386/bin/acid - 775 sys sys 1114484867 389719
+1114486320 1 c 386/bin/ar - 775 sys sys 1114484868 110847
+1114486320 2 c 386/bin/db - 775 sys sys 1114484869 336153
+1114486320 3 c 386/bin/snap - 775 sys sys 1114484871 303547
+1114486320 4 c 386/bin/snapfs - 775 sys sys 1114484872 372401
+1114486320 5 c 386/bin/file - 775 sys sys 1114484869 118706
+1114486320 6 c 386/bin/kprof - 775 sys sys 1114484870 102284
+1114486320 7 c 386/bin/ktrace - 775 sys sys 1114484870 116436
+1114486320 8 c 386/bin/nm - 775 sys sys 1114484870 121630
+1114486320 9 c 386/bin/prof - 775 sys sys 1114484870 106950
+1114486320 10 c 386/bin/size - 775 sys sys 1114484871 76817
+1114486320 11 c 386/bin/aux/ms2 - 775 sys sys 1114484868 84166
+1114486320 12 c 386/bin/aux/vga - 775 sys sys 1114484868 309981
+1114486320 13 c 386/bin/tprof - 775 sys sys 1114484873 289115
+1114486320 14 c 386/lib/libmach.a - 664 sys sys 1114484874 755168

+ 4 - 0
dist/replica/plan9.proto

@@ -34,6 +34,8 @@ usr	- sys sys
 	+	- sys sys
 alpha	- sys sys
 	+	- sys sys
+amd64	- sys sys
+	+	- sys sys
 arm	- sys sys
 	+	- sys sys
 mips	- sys sys
@@ -42,6 +44,8 @@ power	- sys sys
 	+	- sys sys
 sparc	- sys sys
 	+	- sys sys
+sparc64	- sys sys
+	+	- sys sys
 
 # everything else is owned by sys
 acme	- sys sys

+ 0 - 152
dist/replica/plan9x.proto

@@ -1,152 +0,0 @@
-# files like NOTICE
-*	- sys sys
-
-# adm owns adm
-adm	- adm adm
-	+	- adm adm
-
-# upas owns mail
-mail	- upas upas
-	box	- upas upas
-		glenda	- glenda glenda
-			L.mbox	l666 glenda glenda
-			mbox	a662 glenda glenda
-	faxoutqueue	d777 upas upas
-	faxqueue	d777 upas upas
-		*	- upas upas
-	fs	- upas upas
-	lib	- upas upas
-		+	- upas upas
-	queue	d777 upas upas
-	tmp	d777 upas upas
-
-# glenda owns her home directory
-usr	- sys sys
-	glenda	- glenda glenda
-		+	- glenda glenda
-
-# architectures owned by sys
-386	- sys sys
-	+	- sys sys
-68000	- sys sys
-	+	- sys sys
-68020	- sys sys
-	+	- sys sys
-alpha	- sys sys
-	+	- sys sys
-arm	- sys sys
-	+	- sys sys
-mips	- sys sys
-	+	- sys sys
-power	- sys sys
-	+	- sys sys
-sparc	- sys sys
-	+	- sys sys
-
-# everything else is owned by sys
-acme	- sys sys
-	+	- sys sys
-cron	d777 sys sys
-	upas	- upas sys
-		+	- upas sys
-fd	- sys sys
-	+	- sys sys
-env	- sys sys
-	+	- sys sys
-lib	- sys sys
-	+	- sys sys
-lp	- sys sys
-	log	d777 sys sys
-	prob	d777 sys sys
-	queue	d777 sys sys
-	tmp	d777 sys sys
-mnt	- sys sys
-	+	- sys sys
-n	- sys sys
-	+	- sys sys
-rc	- sys sys
-	+	- sys sys
-sys	- sys sys
-	doc	- sys sys
-		+	- sys sys
-	games	- sys sys
-		+	- sys sys
-	include	- sys sys
-		+	- sys sys
-	lib	- sys sys
-		*	- sys sys
-		acid	- sys sys
-			+	- sys sys
-		antiword	- sys sys
-			+	- sys sys
-		astar	- sys sys
-			+	- sys sys
-		dist	- sys sys
-			+	- sys sys
-		fax	- sys sys
-			+	- sys sys
-		ghostscript	- sys sys
-			+	- sys sys
-		lex	- sys sys
-			+	- sys sys
-		lp	- sys sys
-			bin	- sys sys
-				+	- sys sys
-			daemon	- sys sys
-				+	- sys sys
-			kill	- sys sys
-				+	- sys sys
-			log	d777 sys sys
-			perm	- sys sys
-				+	- sys sys
-			process	- sys sys
-				+	- sys sys
-			sched	- sys sys
-				+	- sys sys
-			spooler	- sys sys
-				+	- sys sys
-			stat	- sys sys
-				+	- sys sys
-			tmp	d777 sys sys
-			*	- sys sys
-		man	- sys sys
-			+	- sys sys
-		plumb	- sys sys
-			+	- sys sys
-		postscript	- sys sys
-			+	- sys sys
-		scribble	- sys sys
-			+	- sys sys
-		ssh	- sys sys
-			+	- sys sys
-		sysconfig	- sys sys
-			+	- sys sys
-		texmf	- sys sys
-			+	- sys sys
-		tls	- sys sys
-			+	- sys sys
-		tmac	- sys sys
-			+	- sys sys
-		troff	- sys sys
-			+	- sys sys
-		wiki	- sys sys
-			+	- sys sys
-	log	- sys sys
-		*	a666 sys sys 
-		httpd	- sys sys
-			*	666 sys sys
-	man	- sys sys
-		+	- sys sys
-	src	- sys sys
-		+	- sys sys
-tmp	- sys sys
-	+	- sys sys
-
-# distribution metadata
-dist	- sys sys
-	replica	- sys sys
-		kfs	- sys sys
-		cd	- sys sys
-		network	- sys sys
-		plan9.proto	- sys sys
-

+ 63 - 0
sparc64/include/u.h

@@ -0,0 +1,63 @@
+#define nil		((void*)0)
+typedef	unsigned short	ushort;
+typedef	unsigned char	uchar;
+typedef	unsigned long	ulong;
+typedef	unsigned int	uint;
+typedef	signed char	schar;
+typedef	long long	vlong;
+typedef	unsigned long long uvlong;
+typedef	ushort		Rune;
+typedef 	union FPdbleword FPdbleword;
+typedef long	jmp_buf[2];
+#define	JMPBUFSP	0
+#define	JMPBUFPC	1
+#define	JMPBUFDPC	(-8)
+typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
+typedef unsigned int	u32int;
+typedef unsigned long long u64int;
+
+/* FCR */
+#define	FPINEX	(1<<23)
+#define	FPOVFL	(1<<26)
+#define	FPUNFL	(1<<25)
+#define	FPZDIV	(1<<24)
+#define	FPRNR	(0<<30)
+#define	FPRZ	(1<<30)
+#define	FPINVAL	(1<<27)
+#define	FPRPINF	(2<<30)
+#define	FPRNINF	(3<<30)
+#define	FPRMASK	(3<<30)
+#define	FPPEXT	0
+#define	FPPSGL	0
+#define	FPPDBL	0
+#define	FPPMASK	0
+/* FSR */
+#define	FPAINEX	(1<<5)
+#define	FPAZDIV	(1<<6)
+#define	FPAUNFL	(1<<7)
+#define	FPAOVFL	(1<<8)
+#define	FPAINVAL	(1<<9)
+union FPdbleword
+{
+	double	x;
+	struct {	/* big endian */
+		ulong hi;
+		ulong lo;
+	};
+};
+
+typedef	char*	va_list;
+#define va_start(list, start) list =\
+	(sizeof(start) < 4?\
+		(char*)((int*)&(start)+1):\
+		(char*)(&(start)+1))
+#define va_end(list)\
+	USED(list)
+#define va_arg(list, mode)\
+	((sizeof(mode) == 1)?\
+		((mode*)(list += 4))[-1]:\
+	(sizeof(mode) == 2)?\
+		((mode*)(list += 4))[-1]:\
+		((mode*)(list += sizeof(mode)))[-1])

+ 51 - 0
sparc64/include/ureg.h

@@ -0,0 +1,51 @@
+
+/*
+ * sparc64 registers.
+ * Currently just 32-bit registers (also somewhat compatible with
+ * the sparc32 ureg).
+ */
+struct Ureg
+{
+	ulong	r0;			/* unnecessary; just for symmetry */
+	union{
+		ulong	sp;		/* r1 */
+		ulong	usp;		/* r1 */
+		ulong	r1;
+	};
+	ulong	r2;
+	ulong	r3;
+	ulong	r4;
+	ulong	r5;
+	ulong	r6;
+	ulong	r7;
+	ulong	r8;
+	ulong	r9;
+	ulong	r10;
+	ulong	r11;
+	ulong	r12;
+	ulong	r13;
+	ulong	r14;
+	ulong	r15;
+	ulong	r16;
+	ulong	r17;
+	ulong	r18;
+	ulong	r19;
+	ulong	r20;
+	ulong	r21;
+	ulong	r22;
+	ulong	r23;
+	ulong	r24;
+	ulong	r25;
+	ulong	r26;
+	ulong	r27;
+	ulong	r28;
+	ulong	r29;
+	ulong	r30;
+	ulong	r31;
+	ulong	y;
+	ulong	tt;
+	ulong	pstate;
+	ulong	npc;
+	ulong	pc;
+	ulong	pad;	/* so structure is double word aligned */
+};

+ 6 - 0
sparc64/mkfile

@@ -0,0 +1,6 @@
+</sys/src/mkfile.proto
+
+CC=uc
+LD=ul
+O=u
+AS=ua

+ 4 - 1
sys/lib/dist/pc/mkfile

@@ -58,7 +58,10 @@ ndisk: 9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb
 		9load /sys/src/9/pc/9pcflop.gz plan9.ini /lib/vgadb
 	ls -l ndisk
 
-cddisk:D: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb /sys/src/9/pc/9pccd.gz
+# cannot list both 9pcflop.gz and 9pccd.gz because they cannot be built 
+# in parallel.  stupid mk
+cddisk:D: 9load /sys/src/9/pc/9pcflop.gz plan9.ini.cd /lib/vgadb
+	mk /sys/src/9/pc/9pccd.gz
 	rfork n
 	bind plan9.ini.cd plan9.ini
 	dd -if /dev/zero -of cddisk -bs 1024 -count 2880 >[2]/dev/null

+ 25 - 0
sys/man/8/vga

@@ -132,6 +132,31 @@ screen of the given size.
 The physical screen will pan to follow the mouse.
 This is useful on displays with small screens,
 such as laptops, but can be confusing.
+.PP
+Using the monitor name
+.B vesa
+instructs
+.I vga
+to use VESA BIOS calls to configure the display.
+There are no entries for the
+.B vesa
+monitor in 
+.IR vgadb .
+For a list of available VESA modes, use
+.IP
+.EX
+aux/vga -m vesa -p
+.EE
+.PP
+Loading the special mode
+.BR text :
+.IP
+.EX
+aux/vga -l text
+.EE
+.PP
+switches out of graphics mode back into text mode.
+It uses the VESA BIOS.
 .SH EXAMPLES
 Change the display resolution:
 .IP

+ 10 - 1
sys/src/boot/pc/bootp.c

@@ -367,7 +367,16 @@ tftpopen(int ctlrno, Netaddr *a, char *name, Tftp *tftp)
 				nak(ctlrno, a, 1, "block error", 0);
 				return -1;
 			}
-			return rlen-sizeof(tftp->header);
+			rlen -= sizeof(tftp->header);
+			if(rlen < Segsize){
+				/* ACK now, in case we don't later */
+				buf[0] = 0;
+				buf[1] = Tftp_ACK;
+				buf[2] = tftpblockno>>8;
+				buf[3] = tftpblockno;
+				udpsend(ctlrno, a, buf, sizeof(tftp->header));
+			}
+			return rlen;
 		}
 	}
 

+ 1 - 1
sys/src/boot/pc/part.c

@@ -183,7 +183,7 @@ mbrpart(SDunit *unit)
 	for(i=0; i<4; i++, dp++) {
 		if(trace)
 			print("dp %d...", dp->type);
-		start = mbroffset+GLONG(dp->start);
+		start = mbroffset/512+GLONG(dp->start);
 		end = start+GLONG(dp->len);
 
 		if(dp->type == PLAN9) {

+ 1 - 1
sys/src/cmd/1c/gc.h

@@ -14,7 +14,7 @@
 #define	SZ_VLONG	8
 #define	SZ_DOUBLE	8
 
-#define	ALLOP	92
+#define	ALLOP	OEND
 #define	NRGN	300
 #define	FNX	100
 #define	INDEXED	9

+ 1 - 1
sys/src/cmd/2c/gc.h

@@ -14,7 +14,7 @@
 #define	SZ_VLONG	8
 #define	SZ_DOUBLE	8
 
-#define	ALLOP	92
+#define	ALLOP	OEND
 #define	NRGN	300
 #define	FNX	100
 #define	INDEXED	9

+ 2 - 0
sys/src/cmd/aux/vga/data.c

@@ -59,6 +59,7 @@ Ctlr* ctlrs[] = {
 	&s3clock,				/* clock */
 	&s3hwgc,				/* hwgc */
 	&sc15025,				/* ramdac */
+	&softhwgc,				/* hwgc */
 	&stg1702,				/* ramdac */
 	&t2r4,					/* ctlr */
 	&t2r4hwgc,				/* hwgc */
@@ -72,6 +73,7 @@ Ctlr* ctlrs[] = {
 	&tvp3026,				/* ramdac */
 	&tvp3026clock,				/* clock */
 	&tvp3026hwgc,				/* hwgc */
+	&vesa,					/* ctlr */
 	&virge,					/* ctlr */
 	&vision864,				/* ctlr */
 	&vision964,				/* ctlr */

+ 11 - 6
sys/src/cmd/aux/vga/db.c

@@ -74,7 +74,7 @@ addctlr(Vga* vga, char* val)
 		return *ctlr;	
 	}
 
-	error("dbctlr: unknown controller \"%s\" ctlr\n", val);
+	fprint(2, "dbctlr: unknown controller \"%s\" ctlr\n", val);
 	return 0;
 }
 
@@ -158,20 +158,25 @@ dbpci(Vga *vga, Ndbtuple *tuple)
 static void
 save(Vga *vga, Ndbtuple *tuple)
 {
+	Ctlr *c;
 	Ndbtuple *t;
 
 	for(t = tuple->entry; t; t = t->entry){
-		if(strcmp(t->attr, "ctlr") == 0)
+		if(strcmp(t->attr, "ctlr") == 0){
 			vga->ctlr = addctlr(vga, t->val);
-		else if(strcmp(t->attr, "ramdac") == 0)
+			if(strcmp(t->val, "vesa") == 0)
+				vga->vesa = vga->ctlr;
+		}else if(strcmp(t->attr, "ramdac") == 0)
 			vga->ramdac = addctlr(vga, t->val);
 		else if(strcmp(t->attr, "clock") == 0)
 			vga->clock = addctlr(vga, t->val);
 		else if(strcmp(t->attr, "hwgc") == 0)
 			vga->hwgc = addctlr(vga, t->val);
-		else if(strcmp(t->attr, "link") == 0)
-			addctlr(vga, t->val);
-		else if(strcmp(t->attr, "linear") == 0)
+		else if(strcmp(t->attr, "link") == 0){
+			c = addctlr(vga, t->val);
+			if(strcmp(t->val, "vesa") == 0)
+				vga->vesa = c;
+		}else if(strcmp(t->attr, "linear") == 0)
 			vga->linear = strtol(t->val, 0, 0);
 		else if(strcmp(t->attr, "membw") == 0)
 			vga->membw = strtol(t->val, 0, 0)*1000000;

+ 81 - 21
sys/src/cmd/aux/vga/main.c

@@ -98,6 +98,7 @@ static void
 linear(Vga* vga)
 {
 	char buf[256];
+	char *p;
 
 	/*
 	 * Set up for linear addressing: try to allocate the
@@ -109,11 +110,28 @@ linear(Vga* vga)
 		return;
 	}
 	if(vga->ctlr->flag & Ulinear){
-		sprint(buf, "0x%lux 0x%lux", vga->apz ? vga->apz : vga->vmz, vga->vma);
-		vgactlw("linear", buf);
+		/*
+		 * If there's already an aperture don't bother trying
+		 * to set up a new one.
+		 */
 		vgactlr("addr", buf);
+		if(atoi(buf)==0 && (buf[0]!='p' || buf[1]!=' ' || atoi(buf+2)==0)){
+			sprint(buf, "0x%lux 0x%lux", vga->apz ? vga->apz : vga->vmz, vga->vma);
+			vgactlw("linear", buf);
+			vgactlr("addr", buf);
+		}
 		trace("linear->addr %s\n", buf);
-		vga->vmb = strtoul(buf, 0, 0);
+		/*
+		 * old: addr 0x12345678
+		 * new: addr p 0x12345678 v 0x82345678 size 0x123
+		 */
+		if(buf[0]=='p' && buf[1]==' '){
+			vga->vmb = strtoul(buf+2, 0, 0);
+			p = strstr(buf, "size");
+			if(p)
+				vga->apz = strtoul(p+4, 0, 0);
+		}else
+			vga->vmb = strtoul(buf, 0, 0);
 	}
 	else
 		vgactlw("linear", "0");
@@ -133,7 +151,8 @@ chanstr[32+1] = {
 void
 main(int argc, char** argv)
 {
-	char *bios, buf[256], sizeb[256], *p, *vsize, *psize, *type;
+	char *bios, buf[256], sizeb[256], *p, *vsize, *psize;
+	char *type, *vtype;
 	int virtual, len;
 	Ctlr *ctlr;
 	Vga *vga;
@@ -220,6 +239,12 @@ main(int argc, char** argv)
 		error(usage, argv0);
 	}
 
+	if(lflag && strcmp(vsize, "text") == 0){
+		vesatextmode();
+		vgactlw("textmode", "");
+		exits(0);
+	}
+
 	vga = alloc(sizeof(Vga));
 	if(bios){
 		if((vga->offset = strtol(bios, &p, 0)) == 0 || *p++ != '=')
@@ -234,8 +259,10 @@ main(int argc, char** argv)
 	 * Try to identify the VGA card and grab
 	 * registers. Print them out if requested.
 	 */
-	if(dbctlr(dbname, vga) == 0 || vga->ctlr == 0){
-		Bprint(&stdout, "%s: controller not in %s\n", argv0, dbname);
+	if(strcmp(type, "vesa") == 0
+		|| dbctlr(dbname, vga) == 0 || vga->ctlr == 0)
+	if(dbvesa(vga) == 0 || vga->ctlr == 0){
+		Bprint(&stdout, "%s: controller not in %s, not vesa\n", argv0, dbname);
 		dumpbios(256);
 		type = "vga";
 		vsize = psize = "640x480x1";
@@ -265,8 +292,14 @@ main(int argc, char** argv)
 		else
 			strcpy(monitordb, dbname);
 
-		if((vga->mode = dbmode(monitordb, type, psize)) == 0)
+		if(vga->vesa){
+			strcpy(monitordb, "vesa bios");
+			vga->mode = dbvesamode(psize);
+		}else
+			vga->mode = dbmode(monitordb, type, psize);
+		if(vga->mode == 0)
 			error("main: %s@%s not in %s\n", type, psize, monitordb);
+
 		if(virtual){
 			if((p = strchr(vsize, 'x')) == nil)
 				error("bad virtual size %s\n", vsize);
@@ -324,6 +357,10 @@ main(int argc, char** argv)
 			(*ctlr->options)(vga, ctlr);
 		}
 
+		/*
+		 * skip init for vesa - vesa will do the registers for us
+		 */
+		if(!vga->vesa)
 		for(ctlr = vga->link; ctlr; ctlr = ctlr->link){
 			if(ctlr->init == 0)
 				continue;
@@ -348,21 +385,38 @@ main(int argc, char** argv)
 					vga->ctlr->name, vga->vmz);
 
 			if(vga->ctlr->type)
-				vgactlw("type", vga->ctlr->type);
+				vtype = vga->ctlr->type;
 			else if(p = strchr(vga->ctlr->name, '-')){
 				strncpy(buf, vga->ctlr->name, p - vga->ctlr->name);
 				buf[p - vga->ctlr->name] = 0;
-				vgactlw("type", buf);
+				vtype = buf;
 			}
 			else
-				vgactlw("type", vga->ctlr->name);
-	
+				vtype = vga->ctlr->name;
+			vgactlw("type", vtype);
+
+			/*
+			 * VESA must be set up before linear.
+			 * Set type to vesa for linear.
+			 */
+			if(vga->vesa){
+				vgactlw("type", vesa.name);
+				vesa.load(vga, vga->vesa);
+			}
+
 			/*
 			 * The new draw device needs linear mode set
 			 * before size.
 			 */
 			linear(vga);
 
+			/*
+			 * Linear is over so switch to other driver for
+			 * acceleration.
+			 */
+			if(vga->vesa)
+				vgactlw("type", vtype);
+
 			sprint(buf, "%ludx%ludx%d %s",
 				vga->virtx, vga->virty,
 				vga->mode->z, vga->mode->chan);
@@ -376,19 +430,25 @@ main(int argc, char** argv)
 				vgactlw("size", buf);
 
 			/*
-			 * Turn off the display during the load.
+			 * No fiddling with registers if VESA set 
+			 * things up already.  Sorry.
 			 */
-			sequencer(vga, 0);
-
-			for(ctlr = vga->link; ctlr; ctlr = ctlr->link){
-				if(ctlr->load == 0)
-					continue;
-				trace("%s->load\n", ctlr->name);
-				(*ctlr->load)(vga, ctlr);
+			if(!vga->vesa){
+				/*
+				 * Turn off the display during the load.
+				 */
+				sequencer(vga, 0);
+	
+				for(ctlr = vga->link; ctlr; ctlr = ctlr->link){
+					if(ctlr->load == 0 || ctlr == &vesa)
+						continue;
+					trace("%s->load\n", ctlr->name);
+					(*ctlr->load)(vga, ctlr);
+				}
+	
+				sequencer(vga, 1);
 			}
 
-			sequencer(vga, 1);
-
 			vgactlw("drawinit", "");
 
 			if(vga->hwgc == 0 || cflag)

+ 1 - 0
sys/src/cmd/aux/vga/mkfile

@@ -51,6 +51,7 @@ OFILES=\
 	tvp3025clock.$O\
 	tvp3026.$O\
 	tvp3026clock.$O\
+	vesa.$O\
 	vga.$O\
 	virge.$O\
 	vision864.$O\

+ 512 - 0
sys/src/cmd/aux/vga/vesa.c

@@ -0,0 +1,512 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include </386/include/ureg.h>
+typedef struct Ureg Ureg;
+
+#include "pci.h"
+#include "vga.h"
+
+typedef struct Vbe Vbe;
+typedef struct Vmode Vmode;
+
+enum
+{
+	MemSize = 1024*1024,
+	PageSize = 4096,
+	RealModeBuf = 0x9000,
+};
+
+struct Vbe
+{
+	int	rmfd;	/* /dev/realmode */
+	int	memfd;	/* /dev/realmem */
+	uchar	*mem;	/* copy of memory; 1MB */
+	uchar	*isvalid;	/* 1byte per 4kB in mem */
+	uchar	*buf;
+	uchar	*modebuf;
+};
+
+struct Vmode
+{
+	char	name[32];
+	char	chan[32];
+	int	id;
+	int	attr;	/* flags */
+	int	bpl;
+	int	dx, dy;
+	int	depth;
+	char	*model;
+	int	r, g, b, x;
+	int	ro, go, bo, xo;
+	int	directcolor;	/* flags */
+	ulong	paddr;
+};
+
+
+#define WORD(p) ((p)[0] | ((p)[1]<<8))
+#define LONG(p) ((p)[0] | ((p)[1]<<8) | ((p)[2]<<16) | ((p)[3]<<24))
+#define PWORD(p, v) (p)[0] = (v); (p)[1] = (v)>>8
+#define PLONG(p, v) (p)[0] = (v); (p)[1] = (v)>>8; (p)[2] = (v)>>16; (p)[3] = (v)>>24
+
+static Vbe *vbe;
+
+Vbe *mkvbe(void);
+int vbecheck(Vbe*);
+uchar *vbemodes(Vbe*);
+int vbemodeinfo(Vbe*, int, Vmode*);
+int vbegetmode(Vbe*);
+int vbesetmode(Vbe*, int);
+void vbeprintinfo(Vbe*);
+void vbeprintmodeinfo(Vbe*, int);
+int vbesnarf(Vbe*, Vga*);
+
+int
+dbvesa(Vga* vga)
+{
+	vbe = mkvbe();
+	if(vbe == nil){
+		fprint(2, "mkvbe: %r\n");
+		return 0;
+	}
+	if(vbecheck(vbe) < 0){
+		fprint(2, "dbvesa: %r\n");
+		return 0;
+	}
+	vga->link = alloc(sizeof(Ctlr));
+	*vga->link = vesa;
+	vga->vesa = vga->link;
+	vga->ctlr = vga->link;
+
+	vga->link->link = alloc(sizeof(Ctlr));
+	*vga->link->link = softhwgc;
+	vga->hwgc = vga->link->link;
+
+	return 1;
+}
+
+Mode*
+dbvesamode(char *mode)
+{
+	uchar *p, *ep;
+	Vmode vm;
+	Mode *m;
+
+	if(vbe == nil)
+		return nil;
+
+	p = vbemodes(vbe);
+	if(p == nil)
+		return nil;
+	for(ep=p+1024; (p[0]!=0xFF || p[1]!=0xFF) && p<ep; p+=2){
+		if(vbemodeinfo(vbe, WORD(p), &vm) < 0)
+			continue;
+		if(strcmp(vm.name, mode) == 0)
+			goto havemode;
+	}
+	werrstr("no such vesa mode");
+	return nil;
+
+havemode:
+	m = alloc(sizeof(Mode));
+	strcpy(m->type, "vesa");
+	strcpy(m->size, vm.name);
+	strcpy(m->chan, vm.chan);
+	m->frequency = 100;
+	m->x = vm.dx;
+	m->y = vm.dy;
+	m->z = vm.depth;
+	m->ht = m->x;
+	m->shb = m->x;
+	m->ehb = m->x;
+	m->shs = m->x;
+	m->ehs = m->x;
+	m->vt = m->y;
+	m->vrs = m->y;
+	m->vre = m->y;
+
+	m->attr = alloc(sizeof(Attr));
+	m->attr->attr = "id";
+	m->attr->val = alloc(32);
+	sprint(m->attr->val, "0x%x", vm.id);
+	return m;
+}
+
+static void
+snarf(Vga* vga, Ctlr* ctlr)
+{
+	if(!vbe)
+		vbe = mkvbe();
+	if(vbe)
+		vga->vesa = ctlr;
+	vbesnarf(vbe, vga);
+	vga->linear = 1;
+	ctlr->flag |= Hlinear|Ulinear;
+}
+
+static void
+load(Vga* vga, Ctlr* ctlr)
+{
+	if(vbe == nil)
+		error("no vesa bios");
+	if(vbesetmode(vbe, atoi(dbattr(vga->mode->attr, "id"))) < 0){
+		ctlr->flag |= Ferror;
+		fprint(2, "vbesetmode: %r\n");
+	}
+}
+
+static void
+dump(Vga*, Ctlr*)
+{
+	uchar *p, *ep;
+
+	if(!vbe){
+		Bprint(&stdout, "no vesa bios\n");
+		return;
+	}
+
+	vbeprintinfo(vbe);
+	p = vbemodes(vbe);
+	if(p){
+		for(ep=p+1024; (p[0]!=0xFF || p[1]!=0xFF) && p<ep; p+=2)
+			vbeprintmodeinfo(vbe, WORD(p));
+	}
+}
+
+Ctlr vesa = {
+	"vesa",			/* name */
+	snarf,				/* snarf */
+	0,			/* options */
+	0,				/* init */
+	load,				/* load */
+	dump,				/* dump */
+};
+
+Ctlr softhwgc = {
+	"soft",
+};
+
+/*
+ * VESA bios extension
+ */
+
+typedef struct Flag Flag;
+struct Flag {
+	int bit;
+	char *desc;
+};
+
+static Flag capabilityflag[] = {
+	0x01, "8-bit-dac",
+	0x02, "not-vga",
+	0x04, "ramdac-needs-blank",
+	0x08, "stereoscopic",
+	0x10, "stereo-evc",
+	0
+};
+
+static Flag modeattributesflags[] = {
+	1<<0, "supported",
+	1<<2, "tty",
+	1<<3, "color",
+	1<<4, "graphics",
+	1<<5, "not-vga",
+	1<<6, "no-windowed-vga",
+	1<<7, "linear",
+	1<<8, "double-scan",
+	1<<9, "interlace",
+	1<<10, "triple-buffer",
+	1<<11, "stereoscopic",
+	1<<12, "dual-start-addr",
+	0
+};
+
+static Flag winattributesflags[] = {
+	1<<0, "relocatable",
+	1<<1, "readable",
+	1<<2, "writeable",
+	0
+};
+
+static Flag directcolorflags[] = {
+	1<<0, "programmable-color-ramp",
+	1<<1, "x-usable",
+	0
+};
+
+static char *modelstr[] = {
+	"text", "cga", "hercules", "planar", "packed", "non-chain4", "direct", "YUV"
+};
+
+static void
+printflags(Flag *f, int b)
+{
+	int i;
+
+	for(i=0; f[i].bit; i++)
+		if(f[i].bit & b)
+			Bprint(&stdout, " %s", f[i].desc);
+	Bprint(&stdout, "\n");
+}
+
+Vbe*
+mkvbe(void)
+{
+	Vbe *vbe;
+
+	vbe = alloc(sizeof(Vbe));
+	if((vbe->rmfd = open("/dev/realmode", ORDWR)) < 0)
+		return nil;
+	if((vbe->memfd = open("/dev/realmodemem", ORDWR)) < 0)
+		return nil;
+	vbe->mem = alloc(MemSize);
+	vbe->isvalid = alloc(MemSize/PageSize);
+	vbe->buf = alloc(PageSize);
+	vbe->modebuf = alloc(PageSize);
+	return vbe;
+}
+
+static void
+loadpage(Vbe *vbe, int p)
+{
+	if(p >= MemSize/PageSize || vbe->isvalid[p])
+		return;
+	if(pread(vbe->memfd, vbe->mem+p*PageSize, PageSize, p*PageSize) != PageSize)
+		error("read /dev/realmodemem: %r\n");
+	vbe->isvalid[p] = 1;
+}
+
+static void*
+unfarptr(Vbe *vbe, uchar *p)
+{
+	int seg, off;
+
+	seg = WORD(p+2);
+	off = WORD(p);
+	if(seg==0 && off==0)
+		return nil;
+	off += seg;
+	if(off >= MemSize)
+		return nil;
+	loadpage(vbe, off/PageSize);
+	loadpage(vbe, off/PageSize+1);	/* just in case */
+	return vbe->mem+off;
+}
+
+uchar*
+vbesetup(Vbe *vbe, Ureg *u, int ax)
+{
+	memset(vbe->buf, 0, PageSize);
+	memset(u, 0, sizeof *u);
+	u->ax = ax;
+	u->es = (RealModeBuf>>4)&0xF000;
+	u->di = RealModeBuf&0xFFFF;
+	return vbe->buf;
+}
+
+int
+vbecall(Vbe *vbe, Ureg *u)
+{
+	u->trap = 0x10;
+	if(pwrite(vbe->memfd, vbe->buf, PageSize, RealModeBuf) != PageSize)
+		error("write /dev/realmodemem: %r\n");
+	if(pwrite(vbe->rmfd, u, sizeof *u, 0) != sizeof *u)
+		error("write /dev/realmode: %r\n");
+	if(pread(vbe->rmfd, u, sizeof *u, 0) != sizeof *u)
+		error("read /dev/realmode: %r\n");
+	if(pread(vbe->memfd, vbe->buf, PageSize, RealModeBuf) != PageSize)
+		error("read /dev/realmodemem: %r\n");
+	if((u->ax&0xFFFF) != 0x004F){
+		werrstr("VBE error %#.4lux", u->ax&0xFFFF);
+		return -1;
+	}
+	memset(vbe->isvalid, 0, MemSize/PageSize);
+	return 0;
+}
+
+int
+vbecheck(Vbe *vbe)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F00);
+	strcpy((char*)p, "VBE2");
+	if(vbecall(vbe, &u) < 0)
+		return -1;
+	if(memcmp(p, "VESA", 4) != 0 || p[5] < 2)
+		return -1;
+	return 0;
+}
+
+int
+vbesnarf(Vbe *vbe, Vga *vga)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F00);
+	strcpy((char*)p, "VBE2");
+	if(vbecall(vbe, &u) < 0)
+		return -1;
+	if(memcmp(p, "VESA", 4) != 0 || p[5] < 2)
+		return -1;
+	vga->apz = WORD(p+18)*0x10000UL;
+	return 0;
+}
+
+void
+vbeprintinfo(Vbe *vbe)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F00);
+	strcpy((char*)p, "VBE2");
+	if(vbecall(vbe, &u) < 0)
+		return;
+
+	printitem("vesa", "sig");
+	Bprint(&stdout, "%.4s %d.%d\n", (char*)p, p[5], p[4]);
+	if(p[5] < 2)
+		return;
+
+	printitem("vesa", "oem");
+	Bprint(&stdout, "%s %d.%d\n", unfarptr(vbe, p+6), p[21], p[20]);
+	printitem("vesa", "vendor");
+	Bprint(&stdout, "%s\n", unfarptr(vbe, p+22));
+	printitem("vesa", "product");
+	Bprint(&stdout, "%s\n", unfarptr(vbe, p+26));
+	printitem("vesa", "rev");
+	Bprint(&stdout, "%s\n", unfarptr(vbe, p+30));
+
+	printitem("vesa", "cap");
+	printflags(capabilityflag, p[10]);
+
+	printitem("vesa", "mem");
+	Bprint(&stdout, "%lud\n", WORD(p+18)*0x10000UL);
+}
+
+uchar*
+vbemodes(Vbe *vbe)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F00);
+	strcpy((char*)p, "VBE2");
+	if(vbecall(vbe, &u) < 0)
+		return nil;
+	memmove(vbe->modebuf, unfarptr(vbe, p+14), 1024);
+	return vbe->modebuf;
+}
+
+int
+vbemodeinfo(Vbe *vbe, int id, Vmode *m)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F01);
+	u.cx = id;
+	if(vbecall(vbe, &u) < 0)
+		return -1;
+
+	m->id = id;
+	m->attr = WORD(p);
+	m->bpl = WORD(p+16);
+	m->dx = WORD(p+18);
+	m->dy = WORD(p+20);
+	m->depth = p[25];
+	m->model = p[27] < nelem(modelstr) ? modelstr[p[27]] : "unknown";
+	m->r = p[31];
+	m->g = p[33];
+	m->b = p[35];
+	m->x = p[37];
+	m->ro = p[32];
+	m->go = p[34];
+	m->bo = p[36];
+	m->xo = p[38];
+	m->directcolor = p[39];
+	m->paddr = LONG(p+40);
+	snprint(m->name, sizeof m->name, "%dx%dx%d",
+		m->dx, m->dy, m->depth);
+	if(m->depth <= 8)
+		snprint(m->chan, sizeof m->chan, "m%d", m->depth);
+	else if(m->xo)
+		snprint(m->chan, sizeof m->chan, "x%dr%dg%db%d", m->x, m->r, m->g, m->b);
+	else
+		snprint(m->chan, sizeof m->chan, "r%dg%db%d", m->r, m->g, m->b);
+	return 0;
+}
+
+void
+vbeprintmodeinfo(Vbe *vbe, int id)
+{
+	Vmode m;
+
+	if(vbemodeinfo(vbe, id, &m) < 0)
+		return;
+	printitem("vesa", "mode");
+	Bprint(&stdout, "0x%ux %s %s %s\n",
+		m.id, m.name, m.chan, m.model);
+}
+
+int
+vbegetmode(Vbe *vbe)
+{
+	Ureg u;
+
+	vbesetup(vbe, &u, 0x4F03);
+	if(vbecall(vbe, &u) < 0)
+		return 0;
+	return u.bx;
+}
+
+int
+vbesetmode(Vbe *vbe, int id)
+{
+	uchar *p;
+	Ureg u;
+
+	p = vbesetup(vbe, &u, 0x4F02);
+	if(id != 3)
+		id |= 3<<14;	/* graphics: use linear, do not clear */
+	u.bx = id;
+	USED(p);
+	/*
+	 * can set mode specifics (ht hss hse vt vss vse 0 clockhz refreshhz):
+	 *
+		u.bx |= 1<<11;
+		n = atoi(argv[2]); PWORD(p, n); p+=2;
+		n = atoi(argv[3]); PWORD(p, n); p+=2;
+		n = atoi(argv[4]); PWORD(p, n); p+=2;
+		n = atoi(argv[5]); PWORD(p, n); p+=2;
+		n = atoi(argv[6]); PWORD(p, n); p+=2;
+		n = atoi(argv[7]); PWORD(p, n); p+=2;
+		*p++ = atoi(argv[8]);
+		n = atoi(argv[9]); PLONG(p, n); p += 4;
+		n = atoi(argv[10]); PWORD(p, n); p += 2;
+		if(p != vbe.buf+19){
+			fprint(2, "prog error\n");
+			return;
+		}
+	 *
+	 */
+	return vbecall(vbe, &u);
+}
+
+void
+vesatextmode(void)
+{
+	if(vbe == nil){
+		vbe = mkvbe();
+		if(!vbe)
+			error("mkvbe: %r\n");
+	}
+	if(vbecheck(vbe) < 0)
+		error("vbecheck: %r\n");
+	if(vbesetmode(vbe, 3) < 0)
+		error("vbesetmode: %r\n");
+}
+

+ 8 - 0
sys/src/cmd/aux/vga/vga.h

@@ -184,6 +184,7 @@ typedef struct Vga {
 	Ctlr*	ramdac;
 	Ctlr*	clock;
 	Ctlr*	hwgc;
+	Ctlr* vesa;
 	Ctlr*	link;
 	int	linear;
 	Attr*	attr;
@@ -412,6 +413,13 @@ extern void vgao(long, uchar);
 extern void vgaxo(long, uchar, uchar);
 extern Ctlr generic;
 
+/* vesa.c */
+extern Ctlr vesa;
+extern Ctlr softhwgc;	/* has to go somewhere */
+extern int dbvesa(Vga*);
+extern Mode *dbvesamode(char*);
+extern void vesatextmode(void);
+
 /* virge.c */
 extern Ctlr virge;
 

+ 1 - 1
sys/src/libmach/0.c

@@ -3,7 +3,7 @@
  */
 #include <u.h>
 #include <bio.h>
-#include "xc/mips2ureg.h"
+#include "0c/ureg.h"
 #include <mach.h>
 
 #define	FPREGBYTES	4

+ 0 - 0
sys/src/libmach/xc/README → sys/src/libmach/0c/README


+ 0 - 0
sys/src/libmach/xc/mips2ureg.h → sys/src/libmach/0c/ureg.h


+ 117 - 0
sys/src/libmach/6.c

@@ -0,0 +1,117 @@
+/*
+ * amd64 definition
+ */
+#include <u.h>
+#include <bio.h>
+#include "/amd64/include/ureg.h"
+#include <mach.h>
+
+#define	REGOFF(x)	(uvlong)(&((struct Ureg *) 0)->x)
+
+#define PC		REGOFF(ip)
+#define SP		REGOFF(sp)
+#define	AX		REGOFF(ax)
+
+#define	REGSIZE		sizeof(struct Ureg)
+#define FP_CTLS(x)	(REGSIZE+2*(x))
+#define FP_CTL(x)	(REGSIZE+4*(x))
+#define FP_REG(x)	(FP_CTL(8)+16*(x))
+#define XM_REG(x)	(FP_CTL(8)+8*16+16*(x))
+
+#define	FPREGSIZE	512	/* TO DO? currently only 0x1A0 used */
+
+Reglist amd64reglist[] = {
+	{"AX",		REGOFF(ax),	RINT, 'Y'},
+	{"BX",		REGOFF(bx),	RINT, 'Y'},
+	{"CX",		REGOFF(cx),	RINT, 'Y'},
+	{"DX",		REGOFF(dx),	RINT, 'Y'},
+	{"SI",		REGOFF(si),	RINT, 'Y'},
+	{"DI",		REGOFF(di),	RINT, 'X'},
+	{"BP",		REGOFF(bp),	RINT, 'Y'},
+	{"R8",		REGOFF(r8),	RINT, 'Y'},
+	{"R9",		REGOFF(r9),	RINT, 'Y'},
+	{"R10",		REGOFF(r10),	RINT, 'Y'},
+	{"R11",		REGOFF(r11),	RINT, 'Y'},
+	{"R12",		REGOFF(r12),	RINT, 'Y'},
+	{"R13",		REGOFF(r13),	RINT, 'Y'},
+	{"R14",		REGOFF(r14),	RINT, 'Y'},
+	{"R15",		REGOFF(r15),	RINT, 'Y'},
+	{"DS",		REGOFF(ds),	RINT, 'x'},
+	{"ES",		REGOFF(es),	RINT, 'x'},
+	{"FS",		REGOFF(fs),	RINT, 'x'},
+	{"GS",		REGOFF(gs),	RINT, 'x'},
+	{"TYPE",	REGOFF(type), 	RINT, 'Y'},
+	{"ERROR",	REGOFF(error),	RINT, 'Y'},
+	{"PC",		PC,		RINT, 'Y'},
+	{"CS",		REGOFF(cs),	RINT, 'Y'},
+	{"FLAGS",	REGOFF(flags),	RINT, 'Y'},
+	{"SP",		SP,		RINT, 'Y'},
+	{"SS",		REGOFF(ss),	RINT, 'Y'},
+
+	{"FCW",		FP_CTLS(0),	RFLT, 'x'},
+	{"FSW",		FP_CTLS(1),	RFLT, 'x'},
+	{"FTW",		FP_CTLS(2),	RFLT, 'x'},
+	{"FOP",		FP_CTLS(3),	RFLT, 'x'},
+	{"FPC",		FP_CTL(2),	RFLT, 'Y'},
+	{"RDP",		FP_CTL(4),	RFLT, 'Y'},
+	{"MXCSR",	FP_CTL(6),	RFLT, 'X'},
+	{"MXCSRMSK",	FP_CTL(7),	RFLT, 'X'},
+	{"M0",		FP_REG(0),	RFLT, 'F'},	/* assumes double */
+	{"M1",		FP_REG(1),	RFLT, 'F'},
+	{"M2",		FP_REG(2),	RFLT, 'F'},
+	{"M3",		FP_REG(3),	RFLT, 'F'},
+	{"M4",		FP_REG(4),	RFLT, 'F'},
+	{"M5",		FP_REG(5),	RFLT, 'F'},
+	{"M6",		FP_REG(6),	RFLT, 'F'},
+	{"M7",		FP_REG(7),	RFLT, 'F'},
+	{"X0",		XM_REG(0),	RFLT, 'F'},	/* assumes double */
+	{"X1",		XM_REG(1),	RFLT, 'F'},
+	{"X2",		XM_REG(2),	RFLT, 'F'},
+	{"X3",		XM_REG(3),	RFLT, 'F'},
+	{"X4",		XM_REG(4),	RFLT, 'F'},
+	{"X5",		XM_REG(5),	RFLT, 'F'},
+	{"X6",		XM_REG(6),	RFLT, 'F'},
+	{"X7",		XM_REG(7),	RFLT, 'F'},
+	{"X8",		XM_REG(8),	RFLT, 'F'},
+	{"X9",		XM_REG(9),	RFLT, 'F'},
+	{"X10",		XM_REG(10),	RFLT, 'F'},
+	{"X11",		XM_REG(11),	RFLT, 'F'},
+	{"X12",		XM_REG(12),	RFLT, 'F'},
+	{"X13",		XM_REG(13),	RFLT, 'F'},
+	{"X14",		XM_REG(14),	RFLT, 'F'},
+	{"X15",		XM_REG(15),	RFLT, 'F'},
+	{"X16",		XM_REG(16),	RFLT, 'F'},
+/*
+	{"F0",		FP_REG(7),	RFLT, '3'},
+	{"F1",		FP_REG(6),	RFLT, '3'},
+	{"F2",		FP_REG(5),	RFLT, '3'},
+	{"F3",		FP_REG(4),	RFLT, '3'},
+	{"F4",		FP_REG(3),	RFLT, '3'},
+	{"F5",		FP_REG(2),	RFLT, '3'},
+	{"F6",		FP_REG(1),	RFLT, '3'},
+	{"F7",		FP_REG(0),	RFLT, '3'},
+*/
+	{  0 }
+};
+
+Mach mamd64=
+{
+	"amd64",
+	MI386,		/* machine type */	/* TO DO */
+	amd64reglist,	/* register list */
+	REGSIZE,	/* size of registers in bytes */
+	FPREGSIZE,	/* size of fp registers in bytes */
+	"PC",		/* name of PC */
+	"SP",		/* name of SP */
+	0,		/* link register */
+	"setSB",	/* static base register name (bogus anyways) */
+	0,		/* static base register value */
+	0x1000,		/* page size */
+	0x80100000,	/* kernel base */	/* TO DO: uvlong or vlong */
+	0,		/* kernel text mask */
+	1,		/* quantization of pc */
+	8,		/* szaddr */
+	4,		/* szreg */
+	4,		/* szfloat */
+	8,		/* szdouble */
+};

+ 820 - 0
sys/src/libmach/6c/6.out.h

@@ -0,0 +1,820 @@
+#define	NSYM	50
+#define	NSNAME	8
+#define NOPROF	(1<<0)
+#define DUPOK	(1<<1)
+
+/*
+ *	amd64
+ */
+
+enum	as
+{
+	AXXX,
+	AAAA,
+	AAAD,
+	AAAM,
+	AAAS,
+	AADCB,
+	AADCL,
+	AADCW,
+	AADDB,
+	AADDL,
+	AADDW,
+	AADJSP,
+	AANDB,
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OVLHPS,
+	AMOVLPD,
+	AMOVLPS,
+	AMOVMSKPD,
+	AMOVMSKPS,
+	AMOVNTO,
+	AMOVNTPD,
+	AMOVNTPS,
+	AMOVNTQ,
+	AMOVO,
+	AMOVQOZX,
+	AMOVSD,
+	AMOVSS,
+	AMOVUPD,
+	AMOVUPS,
+	AMULPD,
+	AMULPS,
+	AMULSD,
+	AMULSS,
+	AORPD,
+	AORPS,
+	APACKSSLW,
+	APACKSSWB,
+	APACKUSWB,
+	APADDB,
+	APADDL,
+	APADDQ,
+	APADDSB,
+	APADDSW,
+	APADDUSB,
+	APADDUSW,
+	APADDW,
+	APANDB,
+	APANDL,
+	APANDSB,
+	APANDSW,
+	APANDUSB,
+	APANDUSW,
+	APANDW,
+	APAND,
+	APANDN,
+	APAVGB,
+	APAVGW,
+	APCMPEQB,
+	APCMPEQL,
+	APCMPEQW,
+	APCMPGTB,
+	APCMPGTL,
+	APCMPGTW,
+	APEXTRW,
+	APFACC,
+	APFADD,
+	APFCMPEQ,
+	APFCMPGE,
+	APFCMPGT,
+	APFMAX,
+	APFMIN,
+	APFMUL,
+	APFNACC,
+	APFPNACC,
+	APFRCP,
+	APFRCPIT1,
+	APFRCPI2T,
+	APFRSQIT1,
+	APFRSQRT,
+	APFSUB,
+	APFSUBR,
+	APINSRW,
+	APMADDWL,
+	APMAXSW,
+	APMAXUB,
+	APMINSW,
+	APMINUB,
+	APMOVMSKB,
+	APMULHRW,
+	APMULHUW,
+	APMULHW,
+	APMULLW,
+	APMULULQ,
+	APOR,
+	APSADBW,
+	APSHUFHW,
+	APSHUFL,
+	APSHUFLW,
+	APSHUFW,
+	APSLLO,
+	APSLLL,
+	APSLLQ,
+	APSLLW,
+	APSRAL,
+	APSRAW,
+	APSRLO,
+	APSRLL,
+	APSRLQ,
+	APSRLW,
+	APSUBB,
+	APSUBL,
+	APSUBQ,
+	APSUBSB,
+	APSUBSW,
+	APSUBUSB,
+	APSUBUSW,
+	APSUBW,
+	APSWAPL,
+	APUNPCKHBW,
+	APUNPCKHLQ,
+	APUNPCKHQDQ,
+	APUNPCKHWL,
+	APUNPCKLBW,
+	APUNPCKLLQ,
+	APUNPCKLQDQ,
+	APUNPCKLWL,
+	APXOR,
+	ARCPPS,
+	ARCPSS,
+	ARSQRTPS,
+	ARSQRTSS,
+	ASHUFPD,
+	ASHUFPS,
+	ASQRTPD,
+	ASQRTPS,
+	ASQRTSD,
+	ASQRTSS,
+	ASTMXCSR,
+	ASUBPD,
+	ASUBPS,
+	ASUBSD,
+	ASUBSS,
+	AUCOMISD,
+	AUCOMISS,
+	AUNPCKHPD,
+	AUNPCKHPS,
+	AUNPCKLPD,
+	AUNPCKLPS,
+	AXORPD,
+	AXORPS,
+
+	APF2IW,
+	APF2IL,
+	API2FW,
+	API2FL,
+	ARETFW,
+	ARETFL,
+	ARETFQ,
+	ASWAPGS,
+
+	AMODE,
+
+	ALAST
+};
+
+enum
+{
+
+	D_AL		= 0,
+	D_CL,
+	D_DL,
+	D_BL,
+	D_SPB,
+	D_BPB,
+	D_SIB,
+	D_DIB,
+	D_R8B,
+	D_R9B,
+	D_R10B,
+	D_R11B,
+	D_R12B,
+	D_R13B,
+	D_R14B,
+	D_R15B,
+
+	D_AX		= 16,
+	D_CX,
+	D_DX,
+	D_BX,
+	D_SP,
+	D_BP,
+	D_SI,
+	D_DI,
+	D_R8,
+	D_R9,
+	D_R10,
+	D_R11,
+	D_R12,
+	D_R13,
+	D_R14,
+	D_R15,
+
+	D_AH		= 32,
+	D_CH,
+	D_DH,
+	D_BH,
+
+	D_F0		= 36,
+
+	D_M0		= 44,
+
+	D_X0		= 52,
+
+	D_CS		= 68,
+	D_SS,
+	D_DS,
+	D_ES,
+	D_FS,
+	D_GS,
+
+	D_GDTR,		/* global descriptor table register */
+	D_IDTR,		/* interrupt descriptor table register */
+	D_LDTR,		/* local descriptor table register */
+	D_MSW,		/* machine status word */
+	D_TASK,		/* task register */
+
+	D_CR		= 79,
+	D_DR		= 95,
+	D_TR		= 103,
+
+	D_NONE		= 111,
+
+	D_BRANCH	= 112,
+	D_EXTERN	= 113,
+	D_STATIC		= 114,
+	D_AUTO		= 115,
+	D_PARAM		= 116,
+	D_CONST		= 117,
+	D_FCONST	= 118,
+	D_SCONST	= 119,
+	D_ADDR		= 120,
+
+	D_FILE,
+	D_FILE1,
+
+	D_INDIR,	/* additive */
+
+	T_TYPE		= 1<<0,
+	T_INDEX		= 1<<1,
+	T_OFFSET	= 1<<2,
+	T_FCONST	= 1<<3,
+	T_SYM		= 1<<4,
+	T_SCONST	= 1<<5,
+	T_64	= 1<<6,
+
+	REGARG		= D_BP,	/* MIGHT CHANGE */
+	REGRET		= D_AX,
+	FREGRET		= D_X0,
+	REGSP		= D_SP,
+	REGTMP		= D_DI,
+	REGEXT		= D_R15,	/* compiler allocates external registers R15 down */
+	FREGMIN		= D_X0+5,	/* first register variable */
+	FREGEXT		= D_X0+7	/* first external register */
+};
+
+/*
+ * this is the ranlib header
+ */
+#define	SYMDEF	"__.SYMDEF"
+
+/*
+ * this is the simulated IEEE floating point
+ */
+typedef	struct	ieee	Ieee;
+struct	ieee
+{
+	long	l;	/* contains ls-man	0xffffffff */
+	long	h;	/* contains sign	0x80000000
+				    exp		0x7ff00000
+				    ms-man	0x000fffff */
+};

+ 143 - 0
sys/src/libmach/6obj.c