Browse Source

ANOTHER round of type fixes.

Fix ulong -> uint32_t.

We keep hitting these but we're very close to having libc building ...

Somebody needs to figure out what to do about USED. It can take many parameterswq

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 4 years ago
parent
commit
999e4ebda0
100 changed files with 898 additions and 870 deletions
  1. 2 2
      386/include/u.h
  2. 20 20
      386/include/ureg.h
  3. 3 3
      acme/bin/source/acd/acd.h
  4. 7 6
      acme/bin/source/acd/acme.c
  5. 2 2
      acme/bin/source/acd/cddb.c
  6. 1 1
      acme/bin/source/acd/mmc.c
  7. 1 1
      acme/bin/source/win/fs.c
  8. 6 6
      acme/bin/source/win/main.c
  9. 1 1
      acme/bin/source/win/pipe.c
  10. 2 2
      arm/include/u.h
  11. 20 20
      arm/include/ureg.h
  12. 5 5
      mips/include/mips2ureg.h
  13. 2 2
      mips/include/u.h
  14. 39 39
      mips/include/ureg.h
  15. 2 2
      power/include/u.h
  16. 48 48
      power/include/ureg.h
  17. 2 2
      power64/include/u.h
  18. 2 2
      sparc/include/u.h
  19. 40 40
      sparc/include/ureg.h
  20. 1 1
      sys/include/libc.h
  21. 9 9
      sys/lib/dist/cmd/bflz.c
  22. 1 1
      sys/lib/dist/cmd/bzfs/bzfs.h
  23. 8 6
      sys/lib/dist/cmd/bzfs/mkext.c
  24. 9 9
      sys/lib/dist/cmd/bzfs/oramfs.c
  25. 1 1
      sys/lib/dist/cmd/bzfs/unbflz.c
  26. 1 1
      sys/lib/dist/cmd/touchfs.c
  27. 12 12
      sys/src/9/ip/ip.h
  28. 9 9
      sys/src/9/k10/dat.h
  29. 1 1
      sys/src/9/k10/etherif.h
  30. 4 4
      sys/src/9/k10/fns.h
  31. 3 3
      sys/src/9/k10/io.h
  32. 22 22
      sys/src/9/port/lib.h
  33. 4 4
      sys/src/9/port/netif.h
  34. 33 33
      sys/src/9/port/portdat.h
  35. 21 21
      sys/src/9/port/portfns.h
  36. 7 7
      sys/src/9/port/sd.h
  37. 13 13
      sys/src/9/w/pxeload/dat.h
  38. 1 1
      sys/src/9/w/pxeload/devfloppy.h
  39. 23 23
      sys/src/9/w/pxeload/fns.h
  40. 1 1
      sys/src/9/w/pxeload/fs.h
  41. 11 11
      sys/src/9/w/pxeload/io.h
  42. 1 1
      sys/src/9/w/pxeload/ip.h
  43. 8 8
      sys/src/9/w/pxeload/lib.h
  44. 20 20
      sys/src/9/w/pxeload/ureg.h
  45. 7 7
      sys/src/ape/lib/9/libc.h
  46. 4 4
      sys/src/ape/lib/ap/plan9/dir.h
  47. 6 6
      sys/src/ape/lib/draw/libc.h
  48. 3 3
      sys/src/ape/lib/mp/port/libc.h
  49. 7 7
      sys/src/ape/lib/sec/port/libc.h
  50. 2 2
      sys/src/cmd/5c/gc.h
  51. 36 36
      sys/src/cmd/5i/arm.h
  52. 2 2
      sys/src/cmd/6c/gc.h
  53. 2 2
      sys/src/cmd/6l/l.h
  54. 2 2
      sys/src/cmd/8c/gc.h
  55. 15 10
      sys/src/cmd/8l/elf.h
  56. 2 2
      sys/src/cmd/8l/l.h
  57. 1 1
      sys/src/cmd/9660srv/dat.h
  58. 39 39
      sys/src/cmd/9nfs/dat.h
  59. 2 2
      sys/src/cmd/9nfs/fns.h
  60. 1 1
      sys/src/cmd/abaco/fns.h
  61. 1 1
      sys/src/cmd/acme/edit.h
  62. 14 8
      sys/src/cmd/aquarela/netbios.h
  63. 19 19
      sys/src/cmd/aquarela/smbdat.h
  64. 75 62
      sys/src/cmd/aquarela/smbfns.h
  65. 2 2
      sys/src/cmd/auth/factotum/dat.h
  66. 1 1
      sys/src/cmd/auth/secstore/SConn.h
  67. 1 1
      sys/src/cmd/auth/secstore/secstore.h
  68. 2 2
      sys/src/cmd/aux/flashfs/aux.h
  69. 39 38
      sys/src/cmd/aux/flashfs/flashfs.h
  70. 1 1
      sys/src/cmd/aux/vga/pci.h
  71. 23 23
      sys/src/cmd/aux/vga/vga.h
  72. 11 11
      sys/src/cmd/cc/cc.h
  73. 4 4
      sys/src/cmd/cdfs/dat.h
  74. 2 2
      sys/src/cmd/cdfs/fns.h
  75. 4 4
      sys/src/cmd/cfs/bcache.h
  76. 8 8
      sys/src/cmd/cfs/cformat.h
  77. 3 3
      sys/src/cmd/cfs/disk.h
  78. 4 4
      sys/src/cmd/cfs/file.h
  79. 5 5
      sys/src/cmd/cfs/inode.h
  80. 6 6
      sys/src/cmd/cfs/stats.h
  81. 2 2
      sys/src/cmd/cwfs/9netics32.16k/dat.h
  82. 2 2
      sys/src/cmd/cwfs/9netics64.8k/dat.h
  83. 6 6
      sys/src/cmd/cwfs/all.h
  84. 2 2
      sys/src/cmd/cwfs/choline/dat.h
  85. 2 2
      sys/src/cmd/cwfs/cwfs/dat.h
  86. 2 2
      sys/src/cmd/cwfs/emelie/dat.h
  87. 2 2
      sys/src/cmd/cwfs/fs/dat.h
  88. 2 2
      sys/src/cmd/cwfs/fs64/dat.h
  89. 21 21
      sys/src/cmd/cwfs/portdat.h
  90. 4 4
      sys/src/cmd/cwfs/portfns.h
  91. 1 1
      sys/src/cmd/db/defs.h
  92. 40 40
      sys/src/cmd/disk/9660/iso9660.h
  93. 8 8
      sys/src/cmd/disk/kfs/dat.h
  94. 3 3
      sys/src/cmd/disk/kfs/portdat.h
  95. 1 1
      sys/src/cmd/disk/kfs/portfns.h
  96. 9 9
      sys/src/cmd/dossrv/dat.h
  97. 3 3
      sys/src/cmd/dossrv/fns.h
  98. 2 2
      sys/src/cmd/ext2srv/dat.h
  99. 1 1
      sys/src/cmd/ext2srv/fns.h
  100. 0 0
      sys/src/cmd/faces/faces.h

+ 2 - 2
386/include/u.h

@@ -54,8 +54,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* little endian */
-		ulong lo;
-		ulong hi;
+		uint32_t lo;
+		uint32_t hi;
 	};
 };
 

+ 20 - 20
386/include/ureg.h

@@ -9,26 +9,26 @@
 
 struct Ureg
 {
-	ulong	di;		/* general registers */
-	ulong	si;		/* ... */
-	ulong	bp;		/* ... */
-	ulong	nsp;
-	ulong	bx;		/* ... */
-	ulong	dx;		/* ... */
-	ulong	cx;		/* ... */
-	ulong	ax;		/* ... */
-	ulong	gs;		/* data segments */
-	ulong	fs;		/* ... */
-	ulong	es;		/* ... */
-	ulong	ds;		/* ... */
-	ulong	trap;		/* trap type */
-	ulong	ecode;		/* error code (or zero) */
-	ulong	pc;		/* pc */
-	ulong	cs;		/* old context */
-	ulong	flags;		/* old flags */
+	uint32_t	di;		/* general registers */
+	uint32_t	si;		/* ... */
+	uint32_t	bp;		/* ... */
+	uint32_t	nsp;
+	uint32_t	bx;		/* ... */
+	uint32_t	dx;		/* ... */
+	uint32_t	cx;		/* ... */
+	uint32_t	ax;		/* ... */
+	uint32_t	gs;		/* data segments */
+	uint32_t	fs;		/* ... */
+	uint32_t	es;		/* ... */
+	uint32_t	ds;		/* ... */
+	uint32_t	trap;		/* trap type */
+	uint32_t	ecode;		/* error code (or zero) */
+	uint32_t	pc;		/* pc */
+	uint32_t	cs;		/* old context */
+	uint32_t	flags;		/* old flags */
 	union {
-		ulong	usp;
-		ulong	sp;
+		uint32_t	usp;
+		uint32_t	sp;
 	};
-	ulong	ss;		/* old stack segment */
+	uint32_t	ss;		/* old stack segment */
 };

+ 3 - 3
acme/bin/source/acd/acd.h

@@ -101,8 +101,8 @@ typedef struct Track Track;
 struct Track {
 	Msf start;
 	Msf end;
-	ulong bstart;
-	ulong bend;
+	uint32_t bstart;
+	uint32_t bend;
 	char *title;
 };
 
@@ -173,7 +173,7 @@ int stop(Drive*);
 int eject(Drive*);
 int ingest(Drive*);
 
-int markplay(Window*, ulong);
+int markplay(Window*, uint32_t);
 int setplaytime(Window*, char*);
 void advancetrack(Drive*, Window*);
 

+ 7 - 6
acme/bin/source/acd/acme.c

@@ -40,7 +40,7 @@ skip(char *s, char *cmd)
  * if q0, q1 are non-nil, set them to the addr of the string.
  */
 int
-findplay(Window *w, char *s, ulong *q0, ulong *q1)
+findplay(Window *w, char *s, uint32_t *q0, uint32_t *q1)
 {
 	char xbuf[25];
 	if(w->data < 0)
@@ -69,7 +69,7 @@ int
 setplaytime(Window *w, char *new)
 {
 	char buf[40];
-	ulong q0, q1;
+	uint32_t q0, q1;
 
 return 1;
 	if(!findplay(w, PLAYSTRING, &q0, &q1))
@@ -93,7 +93,8 @@ return 1;
  * (presumably a track number).
  */
 static int
-unmarkplay(Window *w, char *buf, int n, ulong *q0, ulong *q1, ulong *qbegin)
+unmarkplay(Window *w, char *buf, int n, uint32_t *q0, uint32_t *q1,
+	   uint32_t *qbegin)
 {
 	char xbuf[24];
 
@@ -121,7 +122,7 @@ unmarkplay(Window *w, char *buf, int n, ulong *q0, ulong *q1, ulong *qbegin)
 }
 
 int
-markplay(Window *w, ulong q0)
+markplay(Window *w, uint32_t q0)
 {
 	char buf[20];
 
@@ -219,7 +220,7 @@ void
 advancetrack(Drive *d, Window *w)
 {
 	int n;
-	ulong q0, q1, qnext;
+	uint32_t q0, q1, qnext;
 	char buf[20];
 
 	q0 = q1 = 0;
@@ -259,7 +260,7 @@ acmeevent(Drive *d, Window *w, Event *e)
 	Event *ea, *e2, *eq;
 	char *s, *t, *buf;
 	int n, na;
-	ulong q0, q1;
+	uint32_t q0, q1;
 
 	switch(e->c1){	/* origin of action */
 	default:

+ 2 - 2
acme/bin/source/acd/cddb.c

@@ -11,7 +11,7 @@
 #include <ctype.h>
 
 /* see CDDBPROTO */
-static ulong 
+static uint32_t 
 cddb_sum(int n)
 {
 	int ret;
@@ -23,7 +23,7 @@ cddb_sum(int n)
 	return ret;
 }
 
-static ulong
+static uint32_t
 diskid(Toc *t)
 {
 	int i, n, tmp;

+ 1 - 1
acme/bin/source/acd/mmc.c

@@ -132,7 +132,7 @@ rdmsf(uchar *p)
 	return msf;
 }
 
-static ulong
+static uint32_t
 rdlba(uchar *p)
 {
 	return (p[0]<<16) | (p[1]<<8) | p[2];

+ 1 - 1
acme/bin/source/win/fs.c

@@ -75,7 +75,7 @@ fswrite(Req *r)
 		i = newpipewin(pid, t);
 		free(s);
 		s = emalloc(32);
-		sprint(s, "%lud", (ulong)i);
+		sprint(s, "%lud", (uint32_t)i);
 		r->fid->aux = s;
 		r->ofcall.count = r->ifcall.count;
 		respond(r, nil);

+ 6 - 6
acme/bin/source/win/main.c

@@ -160,7 +160,7 @@ utfncpy(char *to, char *from, int n)
 static Req *q;
 static Req **eq;
 static int
-__sendinput(Window *w, ulong q0, ulong q1)
+__sendinput(Window *w, uint32_t q0, uint32_t q1)
 {
 	char *s, *t;
 	int n, nb, eofchar;
@@ -235,7 +235,7 @@ __sendinput(Window *w, ulong q0, ulong q1)
 }
 
 static int
-_sendinput(Window *w, ulong q0, ulong *q1)
+_sendinput(Window *w, uint32_t q0, uint32_t *q1)
 {
 	char buf[32];
 	int n;
@@ -252,9 +252,9 @@ _sendinput(Window *w, ulong q0, ulong *q1)
 }
 
 int
-sendinput(Window *w, ulong q0, ulong *q1)
+sendinput(Window *w, uint32_t q0, uint32_t *q1)
 {
-	ulong n;
+	uint32_t n;
 	Req *oq;
 
 	n = 0;
@@ -411,7 +411,7 @@ mainctl(void *v)
 	Window *w;
 	Event *e;
 	int delta, pendingS, pendingK;
-	ulong hostpt, endpt;
+	uint32_t hostpt, endpt;
 	char tmp[32];
 
 	w = v;
@@ -643,7 +643,7 @@ startcmd(char *argv[], int *notepg)
 
 	e = emalloc(sizeof(struct Exec));
 	e->argv = argv;
-	cpid = chancreate(sizeof(ulong), 0);
+	cpid = chancreate(sizeof(uint32_t), 0);
 	e->cpid = cpid;
 	sprint(buf, "/mnt/wsys/%d", win->id);
 	bind(buf, "/dev/acme", MREPL);

+ 1 - 1
acme/bin/source/win/pipe.c

@@ -52,7 +52,7 @@ newpipewin(int pid, char *p)
 int
 pipecommand(Window *w, char *s)
 {
-	ulong q0, q1;
+	uint32_t q0, q1;
 	char tmp[32], *t;
 	int n, k;
 

+ 2 - 2
arm/include/u.h

@@ -55,8 +55,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* little endian */
-		ulong lo;
-		ulong hi;
+		uint32_t lo;
+		uint32_t hi;
 	};
 };
 

+ 20 - 20
arm/include/ureg.h

@@ -8,28 +8,28 @@
  */
 
 typedef struct Ureg {
-	ulong	r0;
-	ulong	r1;
-	ulong	r2;
-	ulong	r3;
-	ulong	r4;
-	ulong	r5;
-	ulong	r6;
-	ulong	r7;
-	ulong	r8;
-	ulong	r9;
-	ulong	r10;
-	ulong	r11;
-	ulong	r12;	/* sb */
+	uint32_t	r0;
+	uint32_t	r1;
+	uint32_t	r2;
+	uint32_t	r3;
+	uint32_t	r4;
+	uint32_t	r5;
+	uint32_t	r6;
+	uint32_t	r7;
+	uint32_t	r8;
+	uint32_t	r9;
+	uint32_t	r10;
+	uint32_t	r11;
+	uint32_t	r12;	/* sb */
 	union {
-		ulong	r13;
-		ulong	sp;
+		uint32_t	r13;
+		uint32_t	sp;
 	};
 	union {
-		ulong	r14;
-		ulong	link;
+		uint32_t	r14;
+		uint32_t	link;
 	};
-	ulong	type;	/* of exception */
-	ulong	psr;
-	ulong	pc;	/* interrupted addr */
+	uint32_t	type;	/* of exception */
+	uint32_t	psr;
+	uint32_t	pc;	/* interrupted addr */
 } Ureg;

+ 5 - 5
mips/include/mips2ureg.h

@@ -9,23 +9,23 @@
 
 struct Ureg
 {
-	ulong	status;
+	uint32_t	status;
 	long	pc;
 	union
 	{
 		struct
 		{
 			long	sp;	/* r29 */
-			ulong	cause;
+			uint32_t	cause;
 		};
 		struct
 		{
 			long	usp;	/* r29 */
-			ulong	ucause;
+			uint32_t	ucause;
 		};
 	};
-	ulong	badvaddr;
-	ulong	tlbvirt;
+	uint32_t	badvaddr;
+	uint32_t	tlbvirt;
 
 	long	hhi;	long	hi;
 	long	hlo;	long	lo;

+ 2 - 2
mips/include/u.h

@@ -57,8 +57,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* big endian */
-		ulong hi;
-		ulong lo;
+		uint32_t hi;
+		uint32_t lo;
 	};
 };
 

+ 39 - 39
mips/include/ureg.h

@@ -9,45 +9,45 @@
 
 struct Ureg
 {
-	ulong	status;
-	ulong	pc;
+	uint32_t	status;
+	uint32_t	pc;
 	union{
-		ulong	sp;		/* r29 */
-		ulong	usp;		/* r29 */
+		uint32_t	sp;		/* r29 */
+		uint32_t	usp;		/* r29 */
 	};
-	ulong	cause;
-	ulong	badvaddr;
-	ulong	tlbvirt;
-	ulong	hi;
-	ulong	lo;
-	ulong	r31;
-	ulong	r30;
-	ulong	r28;
-	ulong	r27;		/* unused */
-	ulong	r26;		/* unused */
-	ulong	r25;
-	ulong	r24;
-	ulong	r23;
-	ulong	r22;
-	ulong	r21;
-	ulong	r20;
-	ulong	r19;
-	ulong	r18;
-	ulong	r17;
-	ulong	r16;
-	ulong	r15;
-	ulong	r14;
-	ulong	r13;
-	ulong	r12;
-	ulong	r11;
-	ulong	r10;
-	ulong	r9;
-	ulong	r8;
-	ulong	r7;
-	ulong	r6;
-	ulong	r5;
-	ulong	r4;
-	ulong	r3;
-	ulong	r2;
-	ulong	r1;
+	uint32_t	cause;
+	uint32_t	badvaddr;
+	uint32_t	tlbvirt;
+	uint32_t	hi;
+	uint32_t	lo;
+	uint32_t	r31;
+	uint32_t	r30;
+	uint32_t	r28;
+	uint32_t	r27;		/* unused */
+	uint32_t	r26;		/* unused */
+	uint32_t	r25;
+	uint32_t	r24;
+	uint32_t	r23;
+	uint32_t	r22;
+	uint32_t	r21;
+	uint32_t	r20;
+	uint32_t	r19;
+	uint32_t	r18;
+	uint32_t	r17;
+	uint32_t	r16;
+	uint32_t	r15;
+	uint32_t	r14;
+	uint32_t	r13;
+	uint32_t	r12;
+	uint32_t	r11;
+	uint32_t	r10;
+	uint32_t	r9;
+	uint32_t	r8;
+	uint32_t	r7;
+	uint32_t	r6;
+	uint32_t	r5;
+	uint32_t	r4;
+	uint32_t	r3;
+	uint32_t	r2;
+	uint32_t	r1;
 };

+ 2 - 2
power/include/u.h

@@ -74,8 +74,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* big endian */
-		ulong hi;
-		ulong lo;
+		uint32_t hi;
+		uint32_t lo;
 	};
 };
 

+ 48 - 48
power/include/ureg.h

@@ -9,52 +9,52 @@
 
 struct Ureg
 {
-/*  0*/	ulong	cause;
-/*  4*/	union { ulong	srr1; ulong status;};
-/*  8*/	ulong	pc;	/* SRR0 */
-/* 12*/	ulong	pad;
-/* 16*/	ulong	lr;
-/* 20*/	ulong	cr;
-/* 24*/	ulong	xer;
-/* 28*/	ulong	ctr;
-/* 32*/	ulong	r0;
-/* 36*/	union{ ulong r1;	ulong	sp;	ulong	usp; };
-/* 40*/	ulong	r2;
-/* 44*/	ulong	r3;
-/* 48*/	ulong	r4;
-/* 52*/	ulong	r5;
-/* 56*/	ulong	r6;
-/* 60*/	ulong	r7;
-/* 64*/	ulong	r8;
-/* 68*/	ulong	r9;
-/* 72*/	ulong	r10;
-/* 76*/	ulong	r11;
-/* 80*/	ulong	r12;
-/* 84*/	ulong	r13;
-/* 88*/	ulong	r14;
-/* 92*/	ulong	r15;
-/* 96*/	ulong	r16;
-/*100*/	ulong	r17;
-/*104*/	ulong	r18;
-/*108*/	ulong	r19;
-/*112*/	ulong	r20;
-/*116*/	ulong	r21;
-/*120*/	ulong	r22;
-/*124*/	ulong	r23;
-/*128*/	ulong	r24;
-/*132*/	ulong	r25;
-/*136*/	ulong	r26;
-/*140*/	ulong	r27;
-/*144*/	ulong	r28;
-/*148*/	ulong	r29;
-/*152*/	ulong	r30;
-/*156*/	ulong	r31;
-/*160*/	ulong	dcmp;
-/*164*/	ulong	icmp;
-/*168*/	ulong	dmiss;
-/*172*/	ulong	imiss;
-/*176*/	ulong	hash1;
-/*180*/	ulong	hash2;
-/*184*/	ulong	dar;
-/*188*/	ulong	dsisr;
+/*  0*/	uint32_t	cause;
+/*  4*/	union { uint32_t	srr1; uint32_t status;};
+/*  8*/	uint32_t	pc;	/* SRR0 */
+/* 12*/	uint32_t	pad;
+/* 16*/	uint32_t	lr;
+/* 20*/	uint32_t	cr;
+/* 24*/	uint32_t	xer;
+/* 28*/	uint32_t	ctr;
+/* 32*/	uint32_t	r0;
+/* 36*/	union{ uint32_t r1;	uint32_t	sp;	uint32_t	usp; };
+/* 40*/	uint32_t	r2;
+/* 44*/	uint32_t	r3;
+/* 48*/	uint32_t	r4;
+/* 52*/	uint32_t	r5;
+/* 56*/	uint32_t	r6;
+/* 60*/	uint32_t	r7;
+/* 64*/	uint32_t	r8;
+/* 68*/	uint32_t	r9;
+/* 72*/	uint32_t	r10;
+/* 76*/	uint32_t	r11;
+/* 80*/	uint32_t	r12;
+/* 84*/	uint32_t	r13;
+/* 88*/	uint32_t	r14;
+/* 92*/	uint32_t	r15;
+/* 96*/	uint32_t	r16;
+/*100*/	uint32_t	r17;
+/*104*/	uint32_t	r18;
+/*108*/	uint32_t	r19;
+/*112*/	uint32_t	r20;
+/*116*/	uint32_t	r21;
+/*120*/	uint32_t	r22;
+/*124*/	uint32_t	r23;
+/*128*/	uint32_t	r24;
+/*132*/	uint32_t	r25;
+/*136*/	uint32_t	r26;
+/*140*/	uint32_t	r27;
+/*144*/	uint32_t	r28;
+/*148*/	uint32_t	r29;
+/*152*/	uint32_t	r30;
+/*156*/	uint32_t	r31;
+/*160*/	uint32_t	dcmp;
+/*164*/	uint32_t	icmp;
+/*168*/	uint32_t	dmiss;
+/*172*/	uint32_t	imiss;
+/*176*/	uint32_t	hash1;
+/*180*/	uint32_t	hash2;
+/*184*/	uint32_t	dar;
+/*188*/	uint32_t	dsisr;
 };

+ 2 - 2
power64/include/u.h

@@ -74,8 +74,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* big endian */
-		ulong hi;
-		ulong lo;
+		uint32_t hi;
+		uint32_t lo;
 	};
 };
 

+ 2 - 2
sparc/include/u.h

@@ -54,8 +54,8 @@ union FPdbleword
 {
 	double	x;
 	struct {	/* big endian */
-		ulong hi;
-		ulong lo;
+		uint32_t hi;
+		uint32_t lo;
 	};
 };
 

+ 40 - 40
sparc/include/ureg.h

@@ -9,46 +9,46 @@
 
 struct Ureg
 {
-	ulong	r0;			/* unnecessary; just for symmetry */
+	uint32_t	r0;			/* unnecessary; just for symmetry */
 	union{
-		ulong	sp;		/* r1 */
-		ulong	usp;		/* r1 */
-		ulong	r1;
+		uint32_t	sp;		/* r1 */
+		uint32_t	usp;		/* r1 */
+		uint32_t	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	tbr;
-	ulong	psr;
-	ulong	npc;
-	ulong	pc;
-	ulong	pad;	/* so structure is double word aligned */
+	uint32_t	r2;
+	uint32_t	r3;
+	uint32_t	r4;
+	uint32_t	r5;
+	uint32_t	r6;
+	uint32_t	r7;
+	uint32_t	r8;
+	uint32_t	r9;
+	uint32_t	r10;
+	uint32_t	r11;
+	uint32_t	r12;
+	uint32_t	r13;
+	uint32_t	r14;
+	uint32_t	r15;
+	uint32_t	r16;
+	uint32_t	r17;
+	uint32_t	r18;
+	uint32_t	r19;
+	uint32_t	r20;
+	uint32_t	r21;
+	uint32_t	r22;
+	uint32_t	r23;
+	uint32_t	r24;
+	uint32_t	r25;
+	uint32_t	r26;
+	uint32_t	r27;
+	uint32_t	r28;
+	uint32_t	r29;
+	uint32_t	r30;
+	uint32_t	r31;
+	uint32_t	y;
+	uint32_t	tbr;
+	uint32_t	psr;
+	uint32_t	npc;
+	uint32_t	pc;
+	uint32_t	pad;	/* so structure is double word aligned */
 };

+ 1 - 1
sys/include/libc.h

@@ -30,7 +30,7 @@ extern	void*	memccpy(void*, void*, int, uint32_t);
 //extern	char*	strcat(char*, char*);
 //extern	char*	strchr(char*, int);
 //extern	int	strcmp(char*, char*);
-//extern	char*	strcpy(char*, char*);
+char*	strcpy(char*, const char*);
 extern	char*	strecpy(char*, char*, char*);
 //extern	char*	strdup(char*);
 //extern	char*	strncat(char*, char*, int32_t);

+ 9 - 9
sys/lib/dist/cmd/bflz.c

@@ -36,7 +36,7 @@
 
 int minrun = 16;
 int win = 16;
-ulong outn;
+uint32_t outn;
 int verbose;
 int mindist;
 
@@ -44,9 +44,9 @@ enum { Prime = 16777213 };	/* smallest prime < 2^24 (so p*256+256 < 2^32) */
 enum { NOFF = 3 };
 
 Biobuf bout;
-ulong length;
+uint32_t length;
 uchar *data;
-ulong sum32(ulong, void*, long);
+uint32_t sum32(uint32_t, void*, long);
 uchar *odat;
 int nodat;
 int nraw;
@@ -60,8 +60,8 @@ int nnew;
 typedef struct Node Node;
 struct Node {
 	Node *link;
-	ulong key;
-	ulong offset[NOFF];
+	uint32_t key;
+	uint32_t offset[NOFF];
 };
 
 Node *nodepool;
@@ -113,7 +113,7 @@ freenode(Node *n)
 }
 
 Node**
-llookup(ulong key)
+llookup(uint32_t key)
 {
 	uint c;
 	Node **l, **top, *n;
@@ -146,13 +146,13 @@ llookup(ulong key)
 }
 
 Node*
-lookup(ulong key)
+lookup(uint32_t key)
 {
 	return *llookup(key);
 }
 
 void
-insertnode(ulong key, ulong offset)
+insertnode(uint32_t key, uint32_t offset)
 {
 	int i;
 	Node *n, **l;
@@ -253,7 +253,7 @@ void
 compress(void)
 {
 	int best, i, j, o, rle, run, maxrun, maxoff;
-	ulong sum;
+	uint32_t sum;
 	Node *n;
 
 	sum = 0;

+ 1 - 1
sys/lib/dist/cmd/bzfs/bzfs.h

@@ -12,7 +12,7 @@ void _unbzip(int, int);
 int unbflz(int);
 int xexpand(int);
 void *emalloc(ulong);
-void *erealloc(void*, ulong);
+void *erealloc(void*, uint32_t);
 char *estrdup(char*);
 
 void ramfsmain(int, char**);

+ 8 - 6
sys/lib/dist/cmd/bzfs/mkext.c

@@ -41,9 +41,9 @@ enum{
 };
 
 void	mkdirs(char*, char*);
-void	mkdir(char*, ulong, ulong, char*, char*);
-void	extract(char*, ulong, ulong, char*, char*, ulong);
-void	seekpast(ulong);
+void	mkdir(char*, uint32_t, uint32_t, char*, char*);
+void	extract(char*, uint32_t, uint32_t, char*, char*, uint32_t);
+void	seekpast(uint32_t);
 void	error(char*, ...);
 void	warn(char*, ...);
 void	usage(void);
@@ -212,7 +212,8 @@ if(chatty) fprint(2, "%s\n", p);
 char buf[8192];
 
 int
-ffcreate(char *name, ulong mode, char *uid, char *gid, ulong mtime, int length)
+ffcreate(char *name, uint32_t mode, char *uid, char *gid, uint32_t mtime,
+	 int length)
 {
 	int fd, om;
 	Dir nd;
@@ -238,13 +239,14 @@ ffcreate(char *name, ulong mode, char *uid, char *gid, ulong mtime, int length)
 }
 
 void
-mkdir(char *name, ulong mode, ulong mtime, char *uid, char *gid)
+mkdir(char *name, uint32_t mode, uint32_t mtime, char *uid, char *gid)
 {
 	close(ffcreate(name, mode, uid, gid, mtime, 0));
 }
 
 void
-extract(char *name, ulong mode, ulong mtime, char *uid, char *gid, ulong bytes)
+extract(char *name, uint32_t mode, uint32_t mtime, char *uid, char *gid,
+	uint32_t bytes)
 {
 	int fd, tot, n;
 

+ 9 - 9
sys/lib/dist/cmd/bzfs/oramfs.c

@@ -50,8 +50,8 @@ struct Ram
 	Qid	qid;
 	long	perm;
 	char	*name;
-	ulong	atime;
-	ulong	mtime;
+	uint32_t	atime;
+	uint32_t	mtime;
 	char	*user;
 	char	*group;
 	char	*muid;
@@ -69,7 +69,7 @@ enum
 	Powner =	64,
 };
 
-ulong	path;		/* incremented for each new file */
+uint32_t	path;		/* incremented for each new file */
 Fid	*fids;
 Ram	ram[Nram];
 int	nram;
@@ -85,8 +85,8 @@ int	messagesize = sizeof mdata;
 Fid *	newfid(int);
 uint	ramstat(Ram*, uchar*, uint);
 void	io(void);
-void	*erealloc(void*, ulong);
-void	*emalloc(ulong);
+void	*erealloc(void*, uint32_t);
+void	*emalloc(uint32_t);
 char	*estrdup(char*);
 void	ramfsusage(void);
 int	perm(Fid*, Ram*, int);
@@ -295,7 +295,7 @@ rwalk(Fid *f)
 	Ram *parent;
 	Fid *nf;
 	char *err;
-	ulong t;
+	uint32_t t;
 	int i;
 
 	err = nil;
@@ -524,7 +524,7 @@ char*
 rwrite(Fid *f)
 {
 	Ram *r;
-	ulong off;
+	uint32_t off;
 	int cnt;
 
 	r = f->ram;
@@ -805,7 +805,7 @@ perm(Fid *f, Ram *r, int p)
 }
 
 void *
-emalloc(ulong n)
+emalloc(uint32_t n)
 {
 	void *p;
 
@@ -817,7 +817,7 @@ emalloc(ulong n)
 }
 
 void *
-erealloc(void *p, ulong n)
+erealloc(void *p, uint32_t n)
 {
 	p = realloc(p, n);
 	if(!p)

+ 1 - 1
sys/lib/dist/cmd/bzfs/unbflz.c

@@ -40,7 +40,7 @@ unbflz(int in)
 	char buf[5];
 	uchar *data;
 	int i, j, length, n, m, o, sum;
-	ulong *blk;
+	uint32_t *blk;
 	int nblk, mblk;
 
 	if(pipe(p) < 0)

+ 1 - 1
sys/lib/dist/cmd/touchfs.c

@@ -38,7 +38,7 @@ main(int argc, char **argv)
 	char *p, *f[10];
 	Biobuf bin, bout;
 	int nf;
-	ulong d, size;
+	uint32_t d, size;
 
 	if(argc != 2) {
 		fprint(2, "usage: cat mkfs-archive | touchfs date (in seconds)\n");

+ 12 - 12
sys/src/9/ip/ip.h

@@ -192,7 +192,7 @@ struct Iplink
 	Iplifc	*lifc;
 	Iplink	*selflink;	/* next link for this local address */
 	Iplink	*lifclink;	/* next link for this ifc */
-	ulong	expire;
+	uint32_t	expire;
 	Iplink	*next;		/* free list */
 	int	ref;
 };
@@ -386,7 +386,7 @@ Proto*	Fsrcvpcolx(Fs*, uchar);
 char*	Fsstdconnect(Conv*, char**, int);
 char*	Fsstdannounce(Conv*, char**, int);
 char*	Fsstdbind(Conv*, char**, int);
-ulong	scalednconv(void);
+uint32_t	scalednconv(void);
 void	closeconv(Conv*);
 /*
  *  logging
@@ -417,10 +417,10 @@ void	netloginit(Fs*);
 void	netlogopen(Fs*);
 void	netlogclose(Fs*);
 void	netlogctl(Fs*, char*, int);
-long	netlogread(Fs*, void*, ulong, long);
+long	netlogread(Fs*, void*, uint32_t, long);
 void	netlog(Fs*, int, char*, ...);
 void	ifcloginit(Fs*);
-long	ifclogread(Fs*, Chan *,void*, ulong, long);
+long	ifclogread(Fs*, Chan *,void*, uint32_t, long);
 void	ifclog(Fs*, uchar *, int);
 void	ifclogopen(Fs*, Chan*);
 void	ifclogclose(Fs*, Chan*);
@@ -471,15 +471,15 @@ struct	RouteTree
 
 struct V4route
 {
-	ulong	address;
-	ulong	endaddress;
+	uint32_t	address;
+	uint32_t	endaddress;
 	uchar	gate[IPv4addrlen];
 };
 
 struct V6route
 {
-	ulong	address[IPllen];
-	ulong	endaddress[IPllen];
+	uint32_t	address[IPllen];
+	uint32_t	endaddress[IPllen];
 	uchar	gate[IPaddrlen];
 };
 
@@ -498,7 +498,7 @@ extern void	v4delroute(Fs *f, uchar *a, uchar *mask, int dolock);
 extern void	v6delroute(Fs *f, uchar *a, uchar *mask, int dolock);
 extern Route*	v4lookup(Fs *f, uchar *a, Conv *c);
 extern Route*	v6lookup(Fs *f, uchar *a, Conv *c);
-extern long	routeread(Fs *f, char*, ulong, int);
+extern long	routeread(Fs *f, char*, uint32_t, int);
 extern long	routewrite(Fs *f, Chan*, char*, int);
 extern void	routetype(int, char*);
 extern void	ipwalkroutes(Fs*, Routewalk*);
@@ -542,7 +542,7 @@ struct Arpent
 };
 
 extern void	arpinit(Fs*);
-extern int	arpread(Arp*, char*, ulong, int);
+extern int	arpread(Arp*, char*, uint32_t, int);
 extern int	arpwrite(Fs*, char*, int);
 extern Arpent*	arpget(Arp*, Block *bp, int version, Ipifc *ifc, uchar *ip, uchar *h);
 extern void	arprelease(Arp*, Arpent *a);
@@ -612,7 +612,7 @@ extern void	ipifcremmulti(Conv *c, uchar *ma, uchar *ia);
 extern void	ipifcaddmulti(Conv *c, uchar *ma, uchar *ia);
 extern char*	ipifcrem(Ipifc *ifc, char **argv, int argc);
 extern char*	ipifcadd(Ipifc *ifc, char **argv, int argc, int tentative, Iplifc *lifcp);
-extern long	ipselftabread(Fs*, char *a, ulong offset, int n);
+extern long	ipselftabread(Fs*, char *a, uint32_t offset, int n);
 extern char*	ipifcadd6(Ipifc *ifc, char**argv, int argc);
 /*
  *  ip.c
@@ -634,7 +634,7 @@ extern void	ip_init(Fs*);
  * bootp.c
  */
 extern char*	bootp(Ipifc*);
-extern int	bootpread(char*, ulong, int);
+extern int	bootpread(char*, uint32_t, int);
 
 /*
  *  resolving inferno/plan9 differences

+ 9 - 9
sys/src/9/k10/dat.h

@@ -119,13 +119,13 @@ struct Confmem
 
 struct Conf
 {
-	ulong	nproc;		/* processes */
+	uint32_t	nproc;		/* processes */
 	Confmem	mem[4];		/* physical memory */
 	uvlong	npage;		/* total physical pages of memory */
 	usize	upages;		/* user page pool */
-	ulong	copymode;	/* 0 is copy on write, 1 is copy on reference */
-	ulong	ialloc;		/* max interrupt time allocation in bytes */
-	ulong	nimage;		/* number of page cache image headers */
+	uint32_t	copymode;	/* 0 is copy on write, 1 is copy on reference */
+	uint32_t	ialloc;		/* max interrupt time allocation in bytes */
+	uint32_t	nimage;		/* number of page cache image headers */
 };
 
 enum
@@ -268,13 +268,13 @@ struct Mach
 	void*	gdt;
 	void*	tss;
 
-	ulong	ticks;			/* of the clock since boot time */
+	uint32_t	ticks;			/* of the clock since boot time */
 	Label	sched;			/* scheduler wakeup */
 	Lock	alarmlock;		/* access to alarm list */
 	void*	alarm;			/* alarms bound to this clock */
 	int	inclockintr;
 
-	ulong	qstart;			/* time when up started running */
+	uint32_t	qstart;			/* time when up started running */
 	int	qexpired;		/* quantum expired */
 
 	int	tlbfault;
@@ -346,7 +346,7 @@ struct Sys {
 			int		nc[NIXROLES];		/* number of online processors */
 			int		nmach;
 			int		load;
-			ulong	ticks;			/* of the clock since boot time */
+			uint32_t	ticks;			/* of the clock since boot time */
 		};
 		uchar	syspage[4*KiB];
 	};
@@ -389,10 +389,10 @@ struct ISAConf {
 	char	*type;
 	uintptr	port;
 	int	irq;
-	ulong	dma;
+	uint32_t	dma;
 	uintptr	mem;
 	usize	size;
-	ulong	freq;
+	uint32_t	freq;
 
 	int	nopt;
 	char	*opt[NISAOPT];

+ 1 - 1
sys/src/9/k10/etherif.h

@@ -53,7 +53,7 @@ struct Etherpkt
 
 extern Block* etheriq(Ether*, Block*, int);
 extern void addethercard(char*, int(*)(Ether*));
-extern ulong ethercrc(uchar*, int);
+extern uint32_t ethercrc(uchar*, int);
 extern int parseether(uchar*, char*);
 
 #define NEXT(x, l)	(((x)+1)%(l))

+ 4 - 4
sys/src/9/k10/fns.h

@@ -76,7 +76,7 @@ int	incref(Ref*);
 void	insb(int, void*, int);
 ushort	ins(int);
 void	inss(int, void*, int);
-ulong	inl(int);
+uint32_t	inl(int);
 void	insl(int, void*, int);
 int	intrdisable(void*);
 void*	intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
@@ -97,7 +97,7 @@ void	links(void);
 void	machinit(void);
 void	mach0init(void);
 void	mapraminit(uvlong, uvlong);
-void	mapupainit(uvlong, ulong);
+void	mapupainit(uvlong, uint32_t);
 void	meminit(void);
 void	mfence(void);
 void	mmuflushtlb(u64int);
@@ -115,7 +115,7 @@ void	outb(int, int);
 void	outsb(int, void*, int);
 void	outs(int, ushort);
 void	outss(int, void*, int);
-void	outl(int, ulong);
+void	outl(int, uint32_t);
 void	outsl(int, void*, int);
 int	pcicap(Pcidev*, int);
 int	pcicfgr8(Pcidev*, int);
@@ -148,7 +148,7 @@ void	splxpc(u64int);
 void	stopac(void);
 void	syncclock(void);
 void	syscall(int scallnr, Ureg* ureg);
-void*	sysexecregs(uintptr, ulong, ulong);
+void*	sysexecregs(uintptr, uint32_t, uint32_t);
 uintptr	sysexecstack(uintptr, int);
 void	sysprocsetup(Proc*);
 void	tssrsp0(u64int);

+ 3 - 3
sys/src/9/k10/io.h

@@ -247,12 +247,12 @@ struct Pcidev
 	uchar	ltr;
 
 	struct {
-		ulong	bar;		/* base address */
+		uint32_t	bar;		/* base address */
 		int	size;
 	} mem[6];
 
 	struct {
-		ulong	bar;
+		uint32_t	bar;
 		int	size;
 	} rom;
 	uchar	intl;			/* interrupt line */
@@ -262,7 +262,7 @@ struct Pcidev
 
 	Pcidev*	bridge;			/* down a bus */
 	struct {
-		ulong	bar;
+		uint32_t	bar;
 		int	size;
 	} ioa, mema;
 };

+ 22 - 22
sys/src/9/port/lib.h

@@ -17,11 +17,11 @@
 /*
  * mem routines
  */
-extern	void*	memccpy(void*, void*, int, ulong);
-extern	void*	memset(void*, int, ulong);
-extern	int	memcmp(void*, void*, ulong);
-extern	void*	memmove(void*, void*, ulong);
-extern	void*	memchr(void*, int, ulong);
+extern	void*	memccpy(void*, void*, int, uint32_t);
+extern	void*	memset(void*, int, uint32_t);
+extern	int	memcmp(void*, void*, uint32_t);
+extern	void*	memmove(void*, void*, uint32_t);
+extern	void*	memchr(void*, int, uint32_t);
 
 /*
  * string routines
@@ -63,16 +63,16 @@ extern	char*	utfrune(char*, long);
 /*
  * malloc
  */
-extern	void*	malloc(ulong);
-extern	void*	mallocz(ulong, int);
+extern	void*	malloc(uint32_t);
+extern	void*	mallocz(uint32_t, int);
 extern	void	free(void*);
-extern	ulong	msize(void*);
-extern	void*	mallocalign(ulong, ulong, long, ulong);
-extern	void	setmalloctag(void*, ulong);
-extern	void	setrealloctag(void*, ulong);
-extern	ulong	getmalloctag(void*);
-extern	ulong	getrealloctag(void*);
-extern	void*	realloc(void *, ulong);
+extern	uint32_t	msize(void*);
+extern	void*	mallocalign(uint32_t, uint32_t, long, uint32_t);
+extern	void	setmalloctag(void*, uint32_t);
+extern	void	setrealloctag(void*, uint32_t);
+extern	uint32_t	getmalloctag(void*);
+extern	uint32_t	getrealloctag(void*);
+extern	void*	realloc(void *, uint32_t);
 
 /*
  * print routines
@@ -90,7 +90,7 @@ struct Fmt{
 	int	r;			/* % format Rune */
 	int	width;
 	int	prec;
-	ulong	flags;
+	uint32_t	flags;
 };
 
 enum {
@@ -187,7 +187,7 @@ extern	uintptr	getcallerpc(void*);
 extern	int	getfields(char*, char**, int, int, char*);
 extern	int	gettokens(char *, char **, int, char *);
 extern	long	strtol(char*, char**, int);
-extern	ulong	strtoul(char*, char**, int);
+extern	uint32_t	strtoul(char*, char**, int);
 extern	vlong	strtoll(char*, char**, int);
 extern	uvlong	strtoull(char*, char**, int);
 extern	void	qsort(void*, long, long, int (*)(void*, void*));
@@ -244,7 +244,7 @@ typedef struct Waitmsg	Waitmsg;
 struct Qid
 {
 	uvlong	path;
-	ulong	vers;
+	uint32_t	vers;
 	uchar	type;
 };
 
@@ -254,9 +254,9 @@ struct Dir {
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	ulong	mode;	/* permissions */
-	ulong	atime;	/* last read time */
-	ulong	mtime;	/* last write time */
+	uint32_t	mode;	/* permissions */
+	uint32_t	atime;	/* last read time */
+	uint32_t	mtime;	/* last write time */
 	vlong	length;	/* file length: see <u.h> */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */
@@ -274,7 +274,7 @@ struct OWaitmsg
 struct Waitmsg
 {
 	int	pid;		/* of loved one */
-	ulong	time[3];	/* of loved one and descendants */
+	uint32_t	time[3];	/* of loved one and descendants */
 	char	msg[ERRMAX];	/* actually variable-size in user mode */
 };
 
@@ -286,7 +286,7 @@ typedef struct Zio Zio;
 struct Zio
 {
 	void*	data;
-	ulong	size;
+	uint32_t	size;
 };
 
 extern	char	etext[];

+ 4 - 4
sys/src/9/port/netif.h

@@ -31,9 +31,9 @@ enum
 /*
  *  Macros to manage Qid's used for multiplexed devices
  */
-#define NETTYPE(x)	(((ulong)x)&0x1f)
-#define NETID(x)	((((ulong)x))>>5)
-#define NETQID(i,t)	((((ulong)i)<<5)|(t))
+#define NETTYPE(x)	(((uint32_t)x)&0x1f)
+#define NETID(x)	((((uint32_t)x))>>5)
+#define NETQID(i,t)	((((uint32_t)i)<<5)|(t))
 
 /*
  *  one per multiplexed connection
@@ -118,7 +118,7 @@ struct Netif
 	void	(*scanbs)(void*, uint);	/* scan for base stations */
 };
 
-void	netifinit(Netif*, char*, int, ulong);
+void	netifinit(Netif*, char*, int, uint32_t);
 Walkqid*	netifwalk(Netif*, Chan*, Chan*, char **, int);
 Chan*	netifopen(Netif*, Chan*, int);
 void	netifclose(Netif*, Chan*);

+ 33 - 33
sys/src/9/port/portdat.h

@@ -114,20 +114,20 @@ extern Waitstats waitstats;
 
 struct Lockstats
 {
-	ulong	locks;
-	ulong	glare;
-	ulong	inglare;
+	uint32_t	locks;
+	uint32_t	glare;
+	uint32_t	inglare;
 };
 extern Lockstats lockstats;
 
 struct QLockstats
 {
-	ulong rlock;
-	ulong rlockq;
-	ulong wlock;
-	ulong wlockq;
-	ulong qlock;
-	ulong qlockq;
+	uint32_t rlock;
+	uint32_t rlockq;
+	uint32_t wlock;
+	uint32_t wlockq;
+	uint32_t qlock;
+	uint32_t qlockq;
 };
 extern QLockstats qlockstats;
 
@@ -218,7 +218,7 @@ struct Chan
 	ushort	flag;
 	Qid	qid;
 	int	fid;			/* for devmnt */
-	ulong	iounit;			/* chunk size for i/o; 0==default */
+	uint32_t	iounit;			/* chunk size for i/o; 0==default */
 	Mhead*	umh;			/* mount point that derived Chan; used in unionread */
 	Chan*	umc;			/* channel in union; held for union read */
 	QLock	umqlock;		/* serialize unionreads */
@@ -234,7 +234,7 @@ struct Chan
 	union {
 		void*	aux;
 		Qid	pgrpid;		/* for #p/notepg */
-		ulong	mid;		/* for ns in devproc */
+		uint32_t	mid;		/* for ns in devproc */
 	};
 	Chan*	mchan;			/* channel to mounted server */
 	Qid	mqid;			/* qid of root of mount point */
@@ -372,7 +372,7 @@ struct Page
 	Lock;
 	uintmem	pa;			/* Physical address in memory */
 	uintptr	va;			/* Virtual address for user */
-	ulong	daddr;			/* Disc address on swap */
+	uint32_t	daddr;			/* Disc address on swap */
 	int	ref;			/* Reference count */
 	uchar	modref;			/* Simulated modify/reference bits */
 	int	color;			/* Cache coloring */
@@ -451,7 +451,7 @@ enum
 
 struct Physseg
 {
-	ulong	attr;			/* Segment attributes */
+	uint32_t	attr;			/* Segment attributes */
 	char	*name;			/* Attach name */
 	uintmem	pa;			/* Physical address */
 	usize	size;			/* Maximum segment size in pages */
@@ -511,12 +511,12 @@ struct Segment
 	uintptr	base;		/* virtual base */
 	uintptr	top;		/* virtual top */
 	usize	size;		/* size in pages */
-	ulong	fstart;		/* start address in file for demand load */
-	ulong	flen;		/* length of segment in file */
+	uint32_t	fstart;		/* start address in file for demand load */
+	uint32_t	flen;		/* length of segment in file */
 	int	flushme;	/* maintain icache for this segment */
 	Image	*image;		/* text in file attached to this segment */
 	Physseg *pseg;
-	ulong*	profile;	/* Tick profile area */
+	uint32_t*	profile;	/* Tick profile area */
 	Pte	**map;
 	int	mapsize;
 	Pte	*ssegmap[SSEGMAPSIZE];
@@ -552,7 +552,7 @@ struct Pgrp
 {
 	Ref;				/* also used as a lock when mounting */
 	int	noattach;
-	ulong	pgrpid;
+	uint32_t	pgrpid;
 	QLock	debug;			/* single access via devproc.c */
 	RWlock	ns;			/* Namespace n read/one write lock */
 	Mhead	*mnthash[MNTHASH];
@@ -571,8 +571,8 @@ struct Egrp
 	Evalue	**ent;
 	int	nent;
 	int	ment;
-	ulong	path;	/* qid.path of next Evalue to be allocated */
-	ulong	vers;	/* of Egrp */
+	uint32_t	path;	/* qid.path of next Evalue to be allocated */
+	uint32_t	vers;	/* of Egrp */
 };
 
 struct Evalue
@@ -601,12 +601,12 @@ enum
 struct Pallocmem
 {
 	uintmem	base;
-	ulong	npage;
+	uint32_t	npage;
 };
 
 struct Pgsza
 {
-	ulong	freecount;	/* how many pages in the free list? */
+	uint32_t	freecount;	/* how many pages in the free list? */
 	Ref	npages;		/* how many pages of this size? */
 	Page	*head;		/* MRU */
 	Page	*tail;		/* LRU */
@@ -747,15 +747,15 @@ struct Sched
 {
 	Lock;			/* runq */
 	int	nrdy;
-	ulong delayedscheds;	/* statistics */
+	uint32_t delayedscheds;	/* statistics */
 	long skipscheds;
 	long preempts;
 	int schedgain;
-	ulong balancetime;
+	uint32_t balancetime;
 	Schedq	runq[Nrq];
-	ulong	runvec;
+	uint32_t	runvec;
 	int	nmach;		/* # of cores with this color */
-	ulong	nrun;		/* to compute load */
+	uint32_t	nrun;		/* to compute load */
 };
 
 typedef union Ar0 Ar0;
@@ -1059,7 +1059,7 @@ struct Uart
 	void*	regs;			/* hardware stuff */
 	void*	saveregs;		/* place to put registers on power down */
 	char*	name;			/* internal name */
-	ulong	freq;			/* clock frequency */
+	uint32_t	freq;			/* clock frequency */
 	int	bits;			/* bits per character */
 	int	stop;			/* stop bits */
 	int	parity;			/* even, odd or no parity */
@@ -1118,13 +1118,13 @@ extern	Uart*	consuart;
  */
 struct Perf
 {
-	ulong	intrts;		/* time of last interrupt */
-	ulong	inintr;		/* time since last clock tick in interrupt handlers */
-	ulong	avg_inintr;	/* avg time per clock tick in interrupt handlers */
-	ulong	inidle;		/* time since last clock tick in idle loop */
-	ulong	avg_inidle;	/* avg time per clock tick in idle loop */
-	ulong	last;		/* value of perfticks() at last clock tick */
-	ulong	period;		/* perfticks() per clock tick */
+	uint32_t	intrts;		/* time of last interrupt */
+	uint32_t	inintr;		/* time since last clock tick in interrupt handlers */
+	uint32_t	avg_inintr;	/* avg time per clock tick in interrupt handlers */
+	uint32_t	inidle;		/* time since last clock tick in idle loop */
+	uint32_t	avg_inidle;	/* avg time per clock tick in idle loop */
+	uint32_t	last;		/* value of perfticks() at last clock tick */
+	uint32_t	period;		/* perfticks() per clock tick */
 };
 
 struct Watchdog

+ 21 - 21
sys/src/9/port/portfns.h

@@ -10,7 +10,7 @@
 void		_assert(char*);
 void		accounttime(void);
 void		acsched(void);
-void		addbootfile(char*, uchar*, ulong);
+void		addbootfile(char*, uchar*, uint32_t);
 Timer*		addclock0link(void (*)(void), int);
 int		addconsdev(Queue*, void (*fn)(char*,int), int, int);
 int		addkbdq(Queue*, int);
@@ -30,7 +30,7 @@ Page*		auxpage(usize);
 Block*		bl2mem(uchar*, Block*, int);
 int		blocklen(Block*);
 void		bootlinks(void);
-void		cachedel(Image*, ulong);
+void		cachedel(Image*, uint32_t);
 void		cachepage(Page*, Image*);
 void		callwithureg(void (*)(Ureg*));
 int		canlock(Lock*);
@@ -131,9 +131,9 @@ void		freeb(Block*);
 void		freeblist(Block*);
 int		freebroken(void);
 void		freepte(Segment*, Pte*);
-void		getcolor(ulong, ulong*, ulong*, ulong*);
+void		getcolor(uint32_t, uint32_t*, uint32_t*, uint32_t*);
 char*		getconfenv(void);
-int		getpgszi(ulong);
+int		getpgszi(uint32_t);
 Segment*	getzkseg(void);
 void		gotolabel(Label*);
 int		haswaitq(void*);
@@ -174,8 +174,8 @@ void		logclose(Log*);
 char*		logctl(Log*, int, char**, Logflag*);
 void		logn(Log*, int, void*, int);
 void		logopen(Log*);
-long		logread(Log*, void*, ulong, long);
-Page*		lookpage(Image*, ulong);
+long		logread(Log*, void*, uint32_t, long);
+Page*		lookpage(Image*, uint32_t);
 Cmdtab*		lookupcmd(Cmdbuf*, Cmdtab*, int);
 void		mallocinit(void);
 long		mallocreadsummary(Chan*, void*, long, long);
@@ -189,7 +189,7 @@ void		(*mfcwrite)(Chan*, uchar*, int, vlong);
 void		mfreeseg(Segment*, uintptr, int);
 void		microdelay(int);
 uvlong		mk64fract(uvlong, uvlong);
-void		mkqid(Qid*, vlong, ulong, int);
+void		mkqid(Qid*, vlong, uint32_t, int);
 void		mmuflush(void);
 void		mmuput(uintptr, Page*, uint);
 void		mmurelease(Proc*);
@@ -197,9 +197,9 @@ void		mmuswitch(Proc*);
 Chan*		mntauth(Chan*, char*);
 usize		mntversion(Chan*, u32int, char*, usize);
 void		mountfree(Mount*);
-uvlong		ms2fastticks(ulong);
+uvlong		ms2fastticks(uint32_t);
 #define		MS2NS(n) (((vlong)(n))*1000000LL)
-ulong		ms2tk(ulong);
+uint32_t		ms2tk(uint32_t);
 void		mul64fract(uvlong*, uvlong, uvlong);
 void		muxclose(Mnt*);
 void		(*mwait)(void *);
@@ -229,25 +229,25 @@ Block*		packblock(Block*);
 Block*		padblock(Block*, int);
 void		pagechainhead(Page*);
 void		pageinit(void);
-ulong		pagenumber(Page*);
+uint32_t		pagenumber(Page*);
 uvlong		pagereclaim(Image*);
 void		pagersummary(void);
 void		pageunchain(Page*);
 void		panic(char*, ...);
 Cmdbuf*		parsecmd(char *a, int n);
 void		pathclose(Path*);
-ulong		perfticks(void);
+uint32_t		perfticks(void);
 void		pexit(char*, int);
 Page*		pgalloc(usize, int);
 void		pgfree(Page*);
 void		pgrpcpy(Pgrp*, Pgrp*);
-void		pgrpnote(ulong, char*, long, int);
+void		pgrpnote(uint32_t, char*, long, int);
 uintmem		physalloc(u64int, int*, void*);
 void		physdump(void);
 void		physfree(uintmem, u64int);
 void		physinit(uintmem, u64int);
 void*		phystag(uintmem);
-void		pio(Segment*, uintptr, ulong, Page**, int);
+void		pio(Segment*, uintptr, uint32_t, Page**, int);
 #define		poperror()		up->nerrlab--
 void		portmwait(void*);
 int		postnote(Proc*, int, char*, int);
@@ -255,7 +255,7 @@ int		pprint(char*, ...);
 int		preempted(void);
 void		prflush(void);
 void		printinit(void);
-ulong		procalarm(ulong);
+uint32_t		procalarm(uint32_t);
 void		procctl(Proc*);
 void		procdump(void);
 int		procfdprint(Chan*, int, int, char*, int);
@@ -290,7 +290,7 @@ Queue*		qbypass(void (*)(void*, Block*), void*);
 int		qcanread(Queue*);
 void		qclose(Queue*);
 int		qconsume(Queue*, void*, int);
-Block*		qcopy(Queue*, int, ulong);
+Block*		qcopy(Queue*, int, uint32_t);
 int		qdiscard(Queue*, int);
 void		qflush(Queue*);
 void		qfree(Queue*);
@@ -316,9 +316,9 @@ int		qwindow(Queue*);
 int		qwrite(Queue*, void*, int);
 int		rand(void);
 void		randominit(void);
-ulong		randomread(void*, ulong);
+uint32_t		randomread(void*, uint32_t);
 void		rdb(void);
-int		readnum(ulong, char*, ulong, ulong, int);
+int		readnum(uint32_t, char*, uint32_t, uint32_t, int);
 long		readstr(long, char*, long, char*);
 void		ready(Proc*);
 long		readzio(Kzio[], int, void*, long);
@@ -347,16 +347,16 @@ int		semadec(int*);
 int		semainc(int*);
 char*		seprintpagestats(char*, char*);
 char*		seprintphysstats(char*, char*);
-int		setcolor(ulong, ulong, ulong, ulong);
+int		setcolor(uint32_t, uint32_t, uint32_t, uint32_t);
 void		setkernur(Ureg*, Proc*);
 int		setlabel(Label*);
 void		setregisters(Ureg*, char*, char*, int);
 char*		skipslash(char*);
 void		sleep(Rendez*, int (*)(void*), void*);
-void*		smalloc(ulong);
+void*		smalloc(uint32_t);
 char*		srvname(Chan*);
 void		startwaitstats(int);
-int		swapcount(ulong);
+int		swapcount(uint32_t);
 void		swapinit(void);
 void		syscallfmt(int, va_list list);
 void		sysretfmt(int, va_list, Ar0*, uvlong, uvlong);
@@ -366,7 +366,7 @@ void		timerdel(Timer*);
 void		timerintr(Ureg*, vlong);
 void		timerset(uvlong);
 void		timersinit(void);
-ulong		tk2ms(ulong);
+uint32_t		tk2ms(uint32_t);
 #define		TK2MS(x) ((x)*(1000/HZ))
 uvlong		tod2fastticks(vlong);
 vlong		todget(vlong*);

+ 7 - 7
sys/src/9/port/sd.h

@@ -20,7 +20,7 @@ typedef struct SDunit SDunit;
 struct SDperm {
 	char*	name;
 	char*	user;
-	ulong	perm;
+	uint32_t	perm;
 };
 
 struct SDpart {
@@ -28,7 +28,7 @@ struct SDpart {
 	uvlong	end;
 	SDperm;
 	int	valid;
-	ulong	vers;
+	uint32_t	vers;
 };
 
 struct SDunit {
@@ -40,14 +40,14 @@ struct SDunit {
 
 	QLock	ctl;
 	uvlong	sectors;
-	ulong	secsize;
+	uint32_t	secsize;
 	SDpart*	part;			/* nil or array of size npart */
 	int	npart;
-	ulong	vers;
+	uint32_t	vers;
 	SDperm	ctlperm;
 
 	QLock	raw;			/* raw read or write in progress */
-	ulong	rawinuse;		/* really just a test-and-set */
+	uint32_t	rawinuse;		/* really just a test-and-set */
 	int	state;
 	SDreq*	req;
 	SDperm	rawperm;
@@ -149,13 +149,13 @@ extern SDev* scsiid(SDev*, SDifc*);
  *  hardware info about a device
  */
 typedef struct {
-	ulong	port;	
+	uint32_t	port;	
 	int	size;
 } Devport;
 
 struct DevConf
 {
-	ulong	intnum;			/* interrupt number */
+	uint32_t	intnum;			/* interrupt number */
 	char	*type;			/* card type, malloced */
 	int	nports;			/* Number of ports */
 	Devport	*ports;			/* The ports themselves */

+ 13 - 13
sys/src/9/w/pxeload/dat.h

@@ -37,7 +37,7 @@ struct Block {
 	uchar*	wp;			/* first empty byte */
 	uchar*	lim;			/* 1 past the end of the buffer */
 	uchar*	base;			/* start of the buffer */
-	ulong	flag;
+	uint32_t	flag;
 };
 #define BLEN(s)	((s)->wp - (s)->rp)
 
@@ -75,18 +75,18 @@ extern uchar broadcast[Eaddrlen];
 typedef struct Ureg Ureg;
 
 typedef struct Segdesc {
-	ulong	d0;
-	ulong	d1;
+	uint32_t	d0;
+	uint32_t	d1;
 } Segdesc;
 
 typedef struct Mach {
 	int	machno;			/* physical id of processor (KNOWN TO ASSEMBLY) */
-	ulong	splpc;			/* pc of last caller to splhi */
+	uint32_t	splpc;			/* pc of last caller to splhi */
 
-	ulong*	pdb;			/* page directory base for this processor (va) */
+	uint32_t*	pdb;			/* page directory base for this processor (va) */
 	Segdesc	*gdt;			/* gdt for this processor */
 
-	ulong	ticks;			/* of the clock since boot time */
+	uint32_t	ticks;			/* of the clock since boot time */
 	void	*alarm;			/* alarms bound to this clock */
 } Mach;
 
@@ -116,12 +116,12 @@ struct	Exec
 
 typedef struct  ISAConf {
 	char*	type;
-	ulong	port;
-	ulong	irq;
-	ulong	dma;
-	ulong	mem;
-	ulong	size;
-	ulong	freq;
+	uint32_t	port;
+	uint32_t	irq;
+	uint32_t	dma;
+	uint32_t	mem;
+	uint32_t	size;
+	uint32_t	freq;
 	uchar	ea[6];
 
 	int	nopt;
@@ -323,7 +323,7 @@ typedef struct Netif Netif;
 typedef struct Ether Ether;
 struct Netif {
 	/* Ether */
-	long	(*ifstat)(Ether*, void*, long, ulong);
+	long	(*ifstat)(Ether*, void*, long, uint32_t);
 	long 	(*ctl)(Ether*, void*, long);
 
 	/* Netif */

+ 1 - 1
sys/src/9/w/pxeload/devfloppy.h

@@ -25,7 +25,7 @@ struct FDrive
 	int	dt;		/* drive type */
 	int	dev;
 
-	ulong	lasttouched;	/* time last touched */
+	uint32_t	lasttouched;	/* time last touched */
 	int	cyl;		/* current arm position */
 	int	confused;	/* needs to be recalibrated */
 	int	offset;		/* current offset */

+ 23 - 23
sys/src/9/w/pxeload/fns.h

@@ -46,23 +46,23 @@ void	floppyprintdevs(int);
 void*	floppygetfspart(int, char*, int);
 void	freeb(Block*);
 char*	getconf(char*);
-ulong	getcr0(void);
-ulong	getcr2(void);
-ulong	getcr3(void);
-ulong	getcr4(void);
+uint32_t	getcr0(void);
+uint32_t	getcr2(void);
+uint32_t	getcr3(void);
+uint32_t	getcr4(void);
 int	getfields(char*, char**, int, char);
 int	getstr(char*, char*, int, char*, int);
 int	gunzip(uchar*, int, uchar*, int);
 void	i8042a20(void);
 void	i8042init(void);
 void	i8042reset(void);
-void*	ialloc(ulong, int);
+void*	ialloc(uint32_t, int);
 void	idle(void);
 void	ilock(Lock*);
 void	impulse(void);
 int	inb(int);
 ushort	ins(int);
-ulong	inl(int);
+uint32_t	inl(int);
 void	insb(int, void*, int);
 void	inss(int, void*, int);
 void	insl(int, void*, int);
@@ -75,8 +75,8 @@ void	kbdchar(int);
 void	lgdt(ushort[3]);
 void	lidt(ushort[3]);
 void	machinit(void);
-void	mapraminit(uvlong, ulong);
-void	mapupainit(uvlong, ulong);
+void	mapraminit(uvlong, uint32_t);
+void	mapupainit(uvlong, uint32_t);
 void	mb386(void);
 void	meminit(u32int);
 void	microdelay(int);
@@ -87,12 +87,12 @@ char*	nextelem(char*, char*);
 uchar	nvramread(int);
 void	outb(int, int);
 void	outs(int, ushort);
-void	outl(int, ulong);
+void	outl(int, uint32_t);
 void	outsb(int, void*, int);
 void	outss(int, void*, int);
 void	outsl(int, void*, int);
 void	panic(char*, ...);
-ulong	pcibarsize(Pcidev*, int);
+uint32_t	pcibarsize(Pcidev*, int);
 int	pcicfgr8(Pcidev*, int);
 int	pcicfgr16(Pcidev*, int);
 int	pcicfgr32(Pcidev*, int);
@@ -114,12 +114,12 @@ void	pcisetmwi(Pcidev*);
 int	pcisetpms(Pcidev*, int);
 void	pcmcisread(PCMslot*);
 int	pcmcistuple(int, int, int, void*, int);
-PCMmap*	pcmmap(int, ulong, int, int);
+PCMmap*	pcmmap(int, uint32_t, int, int);
 int	pcmspecial(char*, ISAConf*);
 void	pcmspecialclose(int);
 void	pcmunmap(int, PCMmap*);
 void	ptcheck(char*);
-void	putcr3(ulong);
+void	putcr3(uint32_t);
 void	putidt(Segdesc*, int);
 void*	pxegetfspart(int, char*, int);
 void	qinit(IOQ*);
@@ -145,16 +145,16 @@ void	turnwheel(int);
 void	uartdrain(IOQ*);
 int	uartspecial(int, void (*)(int), int (*)(void), int);
 void	uartputs(IOQ*, char*, int);
-ulong	umbmalloc(ulong, int, int);
-void	umbfree(ulong, int);
-ulong	umbrwmalloc(ulong, int, int);
-void	upafree(ulong, int);
-ulong	upamalloc(ulong, int, int);
+uint32_t	umbmalloc(uint32_t, int, int);
+void	umbfree(uint32_t, int);
+uint32_t	umbrwmalloc(uint32_t, int, int);
+void	upafree(uint32_t, int);
+uint32_t	upamalloc(uint32_t, int, int);
 void	warp64(uvlong);
-void	warp86(char*, ulong);
-void	warp9(ulong);
+void	warp86(char*, uint32_t);
+void	warp9(uint32_t);
 int	x86cpuid(int*, int*);
-void*	xspanalloc(ulong, int, ulong);
+void*	xspanalloc(uint32_t, int, uint32_t);
 
 #define malloc(n)	ialloc(n, 0)
 #define mallocz(n, c)	ialloc(n, 0)
@@ -163,11 +163,11 @@ void*	xspanalloc(ulong, int, ulong);
 #define	GSHORT(p)	(((p)[1]<<8)|(p)[0])
 #define	GLONG(p)	((GSHORT(p+2)<<16)|GSHORT(p))
 #define	GLSHORT(p)	(((p)[0]<<8)|(p)[1])
-#define	GLLONG(p)	(((ulong)GLSHORT(p)<<16)|GLSHORT(p+2))
+#define	GLLONG(p)	(((uint32_t)GLSHORT(p)<<16)|GLSHORT(p+2))
 #define	PLLONG(p,v)	(p)[3]=(v);(p)[2]=(v)>>8;(p)[1]=(v)>>16;(p)[0]=(v)>>24
 
-#define KADDR(a)	((void*)((ulong)(a)|KZERO))
-#define PADDR(a)	((ulong)(a)&~0xF0000000)
+#define KADDR(a)	((void*)((uint32_t)(a)|KZERO))
+#define PADDR(a)	((uint32_t)(a)&~0xF0000000)
 
 #define	HOWMANY(x, y)	(((x)+((y)-1))/(y))
 #define ROUNDUP(x, y)	(HOWMANY((x), (y))*(y))

+ 1 - 1
sys/src/9/w/pxeload/fs.h

@@ -42,4 +42,4 @@ extern int fswalk(Fs*, char*, File*);
 extern int fsread(File*, void*, long);
 extern int fsboot(Fs*, char*, Boot*);
 
-#define BADPTR(x) ((ulong)x < (ulong)(KZERO+0x7c00))
+#define BADPTR(x) ((uint32_t)x < (uint32_t)(KZERO+0x7c00))

+ 11 - 11
sys/src/9/w/pxeload/io.h

@@ -172,12 +172,12 @@ typedef struct Pcidev {
 	uchar	ltr;
 
 	struct {
-		ulong	bar;		/* base address */
+		uint32_t	bar;		/* base address */
 		int	size;
 	} mem[6];
 
 	struct {
-		ulong	bar;
+		uint32_t	bar;
 		int	size;
 	} rom;
 	uchar	intl;			/* interrupt line */
@@ -188,7 +188,7 @@ typedef struct Pcidev {
 
 	Pcidev*	bridge;			/* down a bus */
 	struct {
-		ulong	bar;
+		uint32_t	bar;
 		int	size;
 	} ioa, mema;
 
@@ -210,9 +210,9 @@ typedef struct PCMconftab	PCMconftab;
  * Map between ISA memory space and PCMCIA card memory space.
  */
 struct PCMmap {
-	ulong	ca;			/* card address */
-	ulong	cea;			/* card end address */
-	ulong	isa;			/* ISA address */
+	uint32_t	ca;			/* card address */
+	uint32_t	cea;			/* card end address */
+	uint32_t	isa;			/* ISA address */
 	int	len;			/* length of the ISA area */
 	int	attr;			/* attribute memory */
 	int	ref;
@@ -226,16 +226,16 @@ struct PCMconftab
 	uchar	irqtype;
 	uchar	bit16;		/* true for 16 bit access */
 	struct {
-		ulong	start;
-		ulong	len;
+		uint32_t	start;
+		uint32_t	len;
 	} io[16];
 	int	nio;
 	uchar	vpp1;
 	uchar	vpp2;
 	uchar	memwait;
-	ulong	maxwait;
-	ulong	readywait;
-	ulong	otherwait;
+	uint32_t	maxwait;
+	uint32_t	readywait;
+	uint32_t	otherwait;
 };
 
 /* a card slot */

+ 1 - 1
sys/src/9/w/pxeload/ip.h

@@ -101,7 +101,7 @@ struct Bootp
 typedef struct Netaddr Netaddr;
 struct Netaddr
 {
-	ulong	ip;
+	uint32_t	ip;
 	ushort	port;
 	char	ea[Eaddrlen];
 };

+ 8 - 8
sys/src/9/w/pxeload/lib.h

@@ -14,11 +14,11 @@
 /*
  * mem routines
  */
-extern	void*	memccpy(void*, void*, int, ulong);
-extern	void*	memset(void*, int, ulong);
-extern	int	memcmp(void*, void*, ulong);
-extern	void*	memmove(void*, void*, ulong);
-extern	void*	memchr(void*, int, ulong);
+extern	void*	memccpy(void*, void*, int, uint32_t);
+extern	void*	memset(void*, int, uint32_t);
+extern	int	memcmp(void*, void*, uint32_t);
+extern	void*	memmove(void*, void*, uint32_t);
+extern	void*	memchr(void*, int, uint32_t);
 
 /*
  * string routines
@@ -53,7 +53,7 @@ struct Fmt{
 	int	r;			/* % format Rune */
 	int	width;
 	int	prec;
-	ulong	flags;
+	uint32_t	flags;
 };
 extern	int	print(char*, ...);
 extern	char*	vseprint(char*, char*, char*, va_list);
@@ -106,9 +106,9 @@ extern	int	fmtstrcpy(Fmt*, char*);
  * one-of-a-kind
  */
 extern	int	atoi(char*);
-extern	ulong	getcallerpc(void*);
+extern	uint32_t	getcallerpc(void*);
 extern	long	strtol(char*, char**, int);
-extern	ulong	strtoul(char*, char**, int);
+extern	uint32_t	strtoul(char*, char**, int);
 extern	char	end[];
 
 #define	NAMELEN	28

+ 20 - 20
sys/src/9/w/pxeload/ureg.h

@@ -11,26 +11,26 @@ typedef struct Ureg	Ureg;
 
 struct Ureg
 {
-	ulong	di;		/* general registers */
-	ulong	si;		/* ... */
-	ulong	bp;		/* ... */
-	ulong	nsp;
-	ulong	bx;		/* ... */
-	ulong	dx;		/* ... */
-	ulong	cx;		/* ... */
-	ulong	ax;		/* ... */
-	ulong	gs;		/* data segments */
-	ulong	fs;		/* ... */
-	ulong	es;		/* ... */
-	ulong	ds;		/* ... */
-	ulong	trap;		/* trap type */
-	ulong	ecode;		/* error code (or zero) */
-	ulong	pc;		/* pc */
-	ulong	cs;		/* old context */
-	ulong	flags;		/* old flags */
+	uint32_t	di;		/* general registers */
+	uint32_t	si;		/* ... */
+	uint32_t	bp;		/* ... */
+	uint32_t	nsp;
+	uint32_t	bx;		/* ... */
+	uint32_t	dx;		/* ... */
+	uint32_t	cx;		/* ... */
+	uint32_t	ax;		/* ... */
+	uint32_t	gs;		/* data segments */
+	uint32_t	fs;		/* ... */
+	uint32_t	es;		/* ... */
+	uint32_t	ds;		/* ... */
+	uint32_t	trap;		/* trap type */
+	uint32_t	ecode;		/* error code (or zero) */
+	uint32_t	pc;		/* pc */
+	uint32_t	cs;		/* old context */
+	uint32_t	flags;		/* old flags */
 	union {
-		ulong	usp;
-		ulong	sp;
+		uint32_t	usp;
+		uint32_t	sp;
 	};
-	ulong	ss;		/* old stack segment */
+	uint32_t	ss;		/* old stack segment */
 };

+ 7 - 7
sys/src/ape/lib/9/libc.h

@@ -33,7 +33,7 @@ typedef
 struct Qid
 {
 	uvlong	path;
-	ulong	vers;
+	uint32_t	vers;
 	uchar	type;
 } Qid;
 
@@ -44,9 +44,9 @@ struct Dir {
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	ulong	mode;	/* permissions */
-	ulong	atime;	/* last read time */
-	ulong	mtime;	/* last write time */
+	uint32_t	mode;	/* permissions */
+	uint32_t	atime;	/* last read time */
+	uint32_t	mtime;	/* last write time */
 	vlong	length;	/* file length: see <u.h> */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */
@@ -147,8 +147,8 @@ extern	int	_IOUNIT(int);
 
 #define ERRMAX 128
 
-extern	void	setmalloctag(void*, ulong);
-extern	ulong	getcallerpc(void*);
+extern	void	setmalloctag(void*, uint32_t);
+extern	uint32_t	getcallerpc(void*);
 
 /* Used in libsec.h and not picked up in earlier type definitions */
 typedef unsigned int u32int;
@@ -165,5 +165,5 @@ extern	vlong	nsec(void);
 
 extern void sysfatal(char*, ...);
 
-extern	ulong	truerand(void);			/* uses /dev/random */
+extern	uint32_t	truerand(void);			/* uses /dev/random */
 extern	int	getfields(char*, char**, int, int, char*);

+ 4 - 4
sys/src/ape/lib/ap/plan9/dir.h

@@ -51,7 +51,7 @@ typedef
 struct Qid
 {
 	uvlong	path;
-	ulong	vers;
+	uint32_t	vers;
 	uchar	type;
 } Qid;
 
@@ -62,9 +62,9 @@ struct Dir {
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	ulong	mode;	/* permissions */
-	ulong	atime;	/* last read time */
-	ulong	mtime;	/* last write time */
+	uint32_t	mode;	/* permissions */
+	uint32_t	atime;	/* last read time */
+	uint32_t	mtime;	/* last write time */
 	vlong	length;	/* file length: see <u.h> */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */

+ 6 - 6
sys/src/ape/lib/draw/libc.h

@@ -28,7 +28,7 @@ typedef
 struct Qid
 {
 	uvlong	path;
-	ulong	vers;
+	uint32_t	vers;
 	uchar	type;
 } Qid;
 
@@ -39,9 +39,9 @@ struct Dir {
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	ulong	mode;	/* permissions */
-	ulong	atime;	/* last read time */
-	ulong	mtime;	/* last write time */
+	uint32_t	mode;	/* permissions */
+	uint32_t	atime;	/* last read time */
+	uint32_t	mtime;	/* last write time */
 	vlong	length;	/* file length: see <u.h> */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */
@@ -143,5 +143,5 @@ extern	int	_IOUNIT(int);
 
 #define ERRMAX 128
 
-extern	void	setmalloctag(void*, ulong);
-extern	ulong	getcallerpc(void*);
+extern	void	setmalloctag(void*, uint32_t);
+extern	uint32_t	getcallerpc(void*);

+ 3 - 3
sys/src/ape/lib/mp/port/libc.h

@@ -19,9 +19,9 @@ typedef unsigned long long u64int;
 
 #define	nelem(x)	(sizeof(x)/sizeof((x)[0]))
 
-extern	ulong	getcallerpc(void*);
-extern	void*	mallocz(ulong, int);
-extern	void	setmalloctag(void*, ulong);
+extern	uint32_t	getcallerpc(void*);
+extern	void*	mallocz(uint32_t, int);
+extern	void	setmalloctag(void*, uint32_t);
 
 extern int  dec16(uchar *, int, char *, int);
 extern int  enc16(char *, int, uchar *, int);

+ 7 - 7
sys/src/ape/lib/sec/port/libc.h

@@ -33,7 +33,7 @@ typedef
 struct Qid
 {
 	uvlong	path;
-	ulong	vers;
+	uint32_t	vers;
 	uchar	type;
 } Qid;
 
@@ -44,9 +44,9 @@ struct Dir {
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	ulong	mode;	/* permissions */
-	ulong	atime;	/* last read time */
-	ulong	mtime;	/* last write time */
+	uint32_t	mode;	/* permissions */
+	uint32_t	atime;	/* last read time */
+	uint32_t	mtime;	/* last write time */
 	vlong	length;	/* file length: see <u.h> */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */
@@ -178,8 +178,8 @@ extern	int	_IOUNIT(int);
 
 #define ERRMAX 128
 
-extern	void	setmalloctag(void*, ulong);
-extern	ulong	getcallerpc(void*);
+extern	void	setmalloctag(void*, uint32_t);
+extern	uint32_t	getcallerpc(void*);
 
 /* Used in libsec.h and not picked up in earlier type definitions */
 typedef unsigned int u32int;
@@ -196,7 +196,7 @@ extern	vlong	nsec(void);
 
 extern void sysfatal(char*, ...);
 
-extern	ulong	truerand(void);			/* uses /dev/random */
+extern	uint32_t	truerand(void);			/* uses /dev/random */
 extern	int	getfields(char*, char**, int, int, char*);
 
 #pragma	varargck	type	"lld"	vlong

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

@@ -313,9 +313,9 @@ Bits	mkvar(Adr*, int);
 void	prop(Reg*, Bits, Bits);
 void	loopit(Reg*, long);
 void	synch(Reg*, Bits);
-ulong	allreg(ulong, Rgn*);
+uint32_t	allreg(uint32_t, Rgn*);
 void	paint1(Reg*, int);
-ulong	paint2(Reg*, int);
+uint32_t	paint2(Reg*, int);
 void	paint3(Reg*, int, long, int);
 void	addreg(Adr*, int);
 

+ 36 - 36
sys/src/cmd/5i/arm.h

@@ -36,7 +36,7 @@ enum
 struct Breakpoint
 {
 	int		type;		/* Instruction/Read/Access/Write/Equal */
-	ulong		addr;		/* Place at address */
+	uint32_t		addr;		/* Place at address */
 	int		count;		/* To execute count times or value */
 	int		done;		/* How many times passed through */
 	Breakpoint*	next;		/* Link to next one */
@@ -64,7 +64,7 @@ struct Tlb
 {
 	int	on;			/* Being updated */
 	int	tlbsize;		/* Number of entries */
-	ulong	tlbent[Nmaxtlb];	/* Virtual address tags */
+	uint32_t	tlbent[Nmaxtlb];	/* Virtual address tags */
 	int	hit;			/* Number of successful tag matches */
 	int	miss;			/* Number of failed tag matches */
 };		
@@ -75,13 +75,13 @@ struct Icache
 	int	linesize;		/* Line size in bytes */
 	int	stall;			/* Cache stalls */
 	int*	lines;			/* Tag array */
-	int*	(*hash)(ulong);		/* Hash function */
+	int*	(*hash)(uint32_t);		/* Hash function */
 	char*	hashtext;		/* What the function looks like */
 };
 
 struct Inst
 {
-	void 	(*func)(ulong);
+	void 	(*func)(uint32_t);
 	char*	name;
 	int	type;
 	int	count;
@@ -91,8 +91,8 @@ struct Inst
 
 struct Registers
 {
-	ulong	ar;
-	ulong	ir;
+	uint32_t	ar;
+	uint32_t	ir;
 	Inst*	ip;
 	long	r[16];
 	long	cc1;
@@ -137,10 +137,10 @@ enum
 struct Segment
 {
 	short	type;
-	ulong	base;
-	ulong	end;
-	ulong	fileoff;
-	ulong	fileend;
+	uint32_t	base;
+	uint32_t	end;
+	uint32_t	fileoff;
+	uint32_t	fileend;
 	int	rss;
 	int	refs;
 	uchar**	table;
@@ -151,27 +151,27 @@ struct Memory
 	Segment	seg[Nseg];
 };
 
-void		Ssyscall(ulong);
+void		Ssyscall(uint32_t);
 int		armclass(long);
 void		breakpoint(char*, char*);
-void		brkchk(ulong, int);
+void		brkchk(uint32_t, int);
 void		cmd(void);
 void		delbpt(char*);
 void		dobplist(void);
 void		dumpdreg(void);
 void		dumpfreg(void);
 void		dumpreg(void);
-void*		emalloc(ulong);
-void*		erealloc(void*, ulong, ulong);
-ulong		expr(char*);
+void*		emalloc(uint32_t);
+void*		erealloc(void*, uint32_t, uint32_t);
+uint32_t		expr(char*);
 void		fatal(int, char*, ...);
-ulong		getmem_2(ulong);
-ulong		getmem_4(ulong);
-uchar		getmem_b(ulong);
-ushort		getmem_h(ulong);
-uvlong		getmem_v(ulong);
-ulong		getmem_w(ulong);
-ulong		ifetch(ulong);
+uint32_t		getmem_2(uint32_t);
+uint32_t		getmem_4(uint32_t);
+uchar		getmem_b(uint32_t);
+ushort		getmem_h(uint32_t);
+uvlong		getmem_v(uint32_t);
+uint32_t		getmem_w(uint32_t);
+uint32_t		ifetch(uint32_t);
 void		inithdr(int);
 void		initicache(void);
 void		initmap(void);
@@ -180,27 +180,27 @@ void		iprofile(void);
 void		isum(void);
 void		itrace(char*, ...);
 long		lnrand(long);
-char*		memio(char*, ulong, int, int);
-int		_mipscoinst(Map*, ulong, char*, int);
+char*		memio(char*, uint32_t, int, int);
+int		_mipscoinst(Map*, uint32_t, char*, int);
 Mul		mul(long, long);
-Mulu		mulu(ulong, ulong);
+Mulu		mulu(uint32_t, uint32_t);
 char*		nextc(char*);
-void		printlocals(Symbol*, ulong);
-void		printparams(Symbol*, ulong);
+void		printlocals(Symbol*, uint32_t);
+void		printparams(Symbol*, uint32_t);
 void		printsource(long);
 void		procinit(int);
-void		putmem_b(ulong, uchar);
-void		putmem_h(ulong, ushort);
-void		putmem_v(ulong, uvlong);
-void		putmem_w(ulong, ulong);
+void		putmem_b(uint32_t, uchar);
+void		putmem_h(uint32_t, ushort);
+void		putmem_v(uint32_t, uvlong);
+void		putmem_w(uint32_t, uint32_t);
 void		reset(void);
 void		run(void);
 void		segsum(void);
 void		stktrace(int);
 void		tlbsum(void);
-void		undef(ulong);
-void		updateicache(ulong addr);
-void*		vaddr(ulong);
+void		undef(uint32_t);
+void		updateicache(uint32_t addr);
+void*		vaddr(uint32_t);
 
 /* Globals */
 EXTERN	Registers	reg;
@@ -220,11 +220,11 @@ EXTERN	int		atbpt;
 EXTERN	int		membpt;
 EXTERN	int		cmdcount;
 EXTERN	int		nopcount;
-EXTERN	ulong		dot;
+EXTERN	uint32_t		dot;
 EXTERN	char*		file;
 EXTERN	Biobuf*		bioout;
 EXTERN	Biobuf*		bin;
-EXTERN	ulong*		iprof;
+EXTERN	uint32_t*		iprof;
 EXTERN	int		datasize;
 EXTERN	Map*		symmap;	
 

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

@@ -314,9 +314,9 @@ Bits	mkvar(Reg*, Adr*);
 void	prop(Reg*, Bits, Bits);
 void	loopit(Reg*, long);
 void	synch(Reg*, Bits);
-ulong	allreg(ulong, Rgn*);
+uint32_t	allreg(uint32_t, Rgn*);
 void	paint1(Reg*, int);
-ulong	paint2(Reg*, int);
+uint32_t	paint2(Reg*, int);
 void	paint3(Reg*, int, long, int);
 void	addreg(Adr*, int);
 

+ 2 - 2
sys/src/cmd/6l/l.h

@@ -363,7 +363,7 @@ void	doinit(void);
 void	doprof1(void);
 void	doprof2(void);
 void	dostkoff(void);
-void	dynreloc(Sym*, ulong, int);
+void	dynreloc(Sym*, uint32_t, int);
 vlong	entryvalue(void);
 void	errorexit(void);
 void	export(void);
@@ -387,7 +387,7 @@ void	lput(long);
 void	lputl(long);
 void	main(int, char*[]);
 void	mkfwd(void);
-void*	mysbrk(ulong);
+void*	mysbrk(uint32_t);
 void	nuxiinit(void);
 void	objfile(char*);
 int	opsize(Prog*);

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

@@ -311,9 +311,9 @@ Bits	mkvar(Reg*, Adr*, int);
 void	prop(Reg*, Bits, Bits);
 void	loopit(Reg*, long);
 void	synch(Reg*, Bits);
-ulong	allreg(ulong, Rgn*);
+uint32_t	allreg(uint32_t, Rgn*);
 void	paint1(Reg*, int);
-ulong	paint2(Reg*, int);
+uint32_t	paint2(Reg*, int);
 void	paint3(Reg*, int, long, int);
 void	addreg(Adr*, int);
 

+ 15 - 10
sys/src/cmd/8l/elf.h

@@ -91,16 +91,21 @@ enum {
 typedef void (*Putl)(long);
 
 void	elf32(int mach, int bo, int addpsects, void (*putpsects)(Putl));
-void	elf32phdr(void (*putl)(long), ulong type, ulong off, ulong vaddr,
-	ulong paddr, ulong filesz, ulong memsz, ulong prots, ulong align);
-void	elf32shdr(void (*putl)(long), ulong name, ulong type, ulong flags,
-	ulong vaddr, ulong off, ulong sectsz, ulong link, ulong addnl,
-	ulong align, ulong entsz);
+void	elf32phdr(void (*putl)(long), uint32_t type, uint32_t off,
+		      uint32_t vaddr,
+	uint32_t paddr, uint32_t filesz, uint32_t memsz, uint32_t prots,
+		      uint32_t align);
+void	elf32shdr(void (*putl)(long), uint32_t name, uint32_t type,
+		      uint32_t flags,
+	uint32_t vaddr, uint32_t off, uint32_t sectsz, uint32_t link,
+		      uint32_t addnl,
+	uint32_t align, uint32_t entsz);
 
 void	elf64(int mach, int bo, int addpsects, void (*putpsects)(Putl));
-void	elf64phdr(void (*putl)(long), void (*putll)(vlong), ulong type,
+void	elf64phdr(void (*putl)(long), void (*putll)(vlong), uint32_t type,
 	uvlong off, uvlong vaddr, uvlong paddr, uvlong filesz, uvlong memsz,
-	ulong prots, uvlong align);
-void	elf64shdr(void (*putl)(long), void (*putll)(vlong), ulong name,
-	ulong type, uvlong flags, uvlong vaddr, uvlong off, uvlong sectsz,
-	ulong link, ulong addnl, uvlong align, uvlong entsz);
+	uint32_t prots, uvlong align);
+void	elf64shdr(void (*putl)(long), void (*putll)(vlong), uint32_t name,
+	uint32_t type, uvlong flags, uvlong vaddr, uvlong off,
+		      uvlong sectsz,
+	uint32_t link, uint32_t addnl, uvlong align, uvlong entsz);

+ 2 - 2
sys/src/cmd/8l/l.h

@@ -322,7 +322,7 @@ void	doinit(void);
 void	doprof1(void);
 void	doprof2(void);
 void	dostkoff(void);
-void	dynreloc(Sym*, ulong, int);
+void	dynreloc(Sym*, uint32_t, int);
 long	entryvalue(void);
 void	errorexit(void);
 void	export(void);
@@ -346,7 +346,7 @@ void	llput(vlong v);
 void	llputl(vlong v);
 void	main(int, char*[]);
 void	mkfwd(void);
-void*	mysbrk(ulong);
+void*	mysbrk(uint32_t);
 void	nuxiinit(void);
 void	objfile(char*);
 int	opsize(Prog*);

+ 1 - 1
sys/src/cmd/9660srv/dat.h

@@ -89,7 +89,7 @@ struct Xfile
 	Xfile*	next;		/* in fid hash bucket */
 	Xfs*	xf;
 	long	fid;
-	ulong	flags;
+	uint32_t	flags;
 	Qid	qid;
 	int	len;		/* of private data */
 	Isofile*	ptr;

+ 39 - 39
sys/src/cmd/9nfs/dat.h

@@ -36,7 +36,7 @@ typedef struct Xfile	Xfile;
 
 struct String
 {
-	ulong	n;
+	uint32_t	n;
 	char *	s;
 };
 
@@ -56,43 +56,43 @@ struct Procmap
 
 struct Auth
 {
-	ulong	flavor;
-	ulong	count;
+	uint32_t	flavor;
+	uint32_t	count;
 	void *	data;
 };
 
 struct Authunix
 {
-	ulong	stamp;
+	uint32_t	stamp;
 	String	mach;
-	ulong	uid;
-	ulong	gid;
+	uint32_t	uid;
+	uint32_t	gid;
 	int	gidlen;
-	ulong	gids[10];
+	uint32_t	gids[10];
 };
 
 struct Accept
 {
 	Auth	averf;
-	ulong	astat;
+	uint32_t	astat;
 	union{
 		void *	results;	/* SUCCESS */
 		struct{			/* PROG_MISMATCH */
-			ulong	plow;	/* acceptable version numbers */
-			ulong	phigh;
+			uint32_t	plow;	/* acceptable version numbers */
+			uint32_t	phigh;
 		};
 	};
 };
 
 struct Reject
 {
-	ulong	rstat;
+	uint32_t	rstat;
 	union{
 		struct{			/* RPC_MISMATCH */
-			ulong	rlow;	/* acceptable  rpc version numbers */
-			ulong	rhigh;
+			uint32_t	rlow;	/* acceptable  rpc version numbers */
+			uint32_t	rhigh;
 		};
-		ulong	authstat;	/* AUTH_ERROR */
+		uint32_t	authstat;	/* AUTH_ERROR */
 	};
 };
 
@@ -100,21 +100,21 @@ struct Rpccall
 {
 	/* corresponds to Udphdr */
 	uchar	prefix0[12];
-	ulong	host;		/* ipv4 subset: prefixed to RPC message */
+	uint32_t	host;		/* ipv4 subset: prefixed to RPC message */
 	uchar	prefix1[12];
-	ulong	lhost;		/* ipv4 subset: prefixed to RPC message */
+	uint32_t	lhost;		/* ipv4 subset: prefixed to RPC message */
 	/* ignore ifcaddr */
-	ulong	port;		/* prefixed to RPC message */
-	ulong	lport;		/* prefixed to RPC message */
+	uint32_t	port;		/* prefixed to RPC message */
+	uint32_t	lport;		/* prefixed to RPC message */
 
-	ulong	xid;		/* transaction id */
-	ulong	mtype;		/* CALL or REPLY */
+	uint32_t	xid;		/* transaction id */
+	uint32_t	mtype;		/* CALL or REPLY */
 	union{
 		struct{		/* CALL */
-			ulong	rpcvers;	/* must be equal to two (2) */
-			ulong	prog;		/* program number */
-			ulong	vers;		/* program version */
-			ulong	proc;		/* procedure number */
+			uint32_t	rpcvers;	/* must be equal to two (2) */
+			uint32_t	prog;		/* program number */
+			uint32_t	vers;		/* program version */
+			uint32_t	proc;		/* procedure number */
 			Auth	cred;		/* authentication credentials */
 			Auth	verf;		/* authentication verifier */
 			Unixidmap *up;
@@ -122,7 +122,7 @@ struct Rpccall
 			void *	args;		/* procedure-specific */
 		};
 		struct{		/* REPLY */
-			ulong	stat;		/* MSG_ACCEPTED or MSG_DENIED */
+			uint32_t	stat;		/* MSG_ACCEPTED or MSG_DENIED */
 			union{
 				Accept;
 				Reject;
@@ -135,23 +135,23 @@ struct Rpccache
 {
 	Rpccache *prev;
 	Rpccache *next;
-	ulong	host;
-	ulong	port;
-	ulong	xid;
+	uint32_t	host;
+	uint32_t	port;
+	uint32_t	xid;
 	int	n;
 	uchar	data[4];
 };
 
 struct Sattr
 {
-	ulong	mode;
-	ulong	uid;
-	ulong	gid;
-	ulong	size;
-	ulong	atime;		/* sec's */
-	ulong	ausec;		/* microsec's */
-	ulong	mtime;
-	ulong	musec;
+	uint32_t	mode;
+	uint32_t	uid;
+	uint32_t	gid;
+	uint32_t	size;
+	uint32_t	atime;		/* sec's */
+	uint32_t	ausec;		/* microsec's */
+	uint32_t	mtime;
+	uint32_t	musec;
 };
 
 struct Strnode
@@ -191,7 +191,7 @@ struct Unixscmap
 {
 	Unixscmap *next;
 	char *	server;
-	ulong	clientip;
+	uint32_t	clientip;
 	Unixidmap *map;
 };
 
@@ -222,8 +222,8 @@ struct Xfid
 	char *	uid;