Browse Source

Finish converting types to Rust style

The only remaining are uintptr*.

I would still like to change those too but we can see.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 3 years ago
parent
commit
204a5a438c
100 changed files with 1724 additions and 1728 deletions
  1. 20 20
      386/include/ureg.h
  2. 11 11
      aarch64/include/mach_acpi.h
  3. 17 17
      aarch64/include/u.h
  4. 39 39
      aarch64/include/ureg.h
  5. 3 3
      acme/bin/source/acd/acd.h
  6. 7 7
      acme/bin/source/acd/acme.c
  7. 2 2
      acme/bin/source/acd/cddb.c
  8. 13 13
      acme/bin/source/acd/mmc.c
  9. 3 3
      acme/bin/source/adict/adict.c
  10. 1 1
      acme/bin/source/spout.c
  11. 1 1
      acme/bin/source/win/fs.c
  12. 6 6
      acme/bin/source/win/main.c
  13. 1 1
      acme/bin/source/win/pipe.c
  14. 8 8
      acme/mail/src/dat.h
  15. 2 2
      acme/mail/src/mesg.c
  16. 1 1
      acme/wiki/src/awiki.h
  17. 13 13
      amd64/include/mach_acpi.h
  18. 5 13
      amd64/include/u.h
  19. 26 26
      amd64/include/ureg.h
  20. 7 1
      bootstrap.sh
  21. 11 11
      riscv/include/mach_acpi.h
  22. 6 14
      riscv/include/u.h
  23. 27 27
      sys/include/9p.h
  24. 8 8
      sys/include/a.out.h
  25. 2 2
      sys/include/acpi/acpica/platform/acdragonfly.h
  26. 5 5
      sys/include/acpi/acpica/platform/acefi.h
  27. 8 8
      sys/include/acpi/acpica/platform/acefiex.h
  28. 2 2
      sys/include/acpi/acpica/platform/acfreebsd.h
  29. 2 2
      sys/include/acpi/acpica/platform/acnetbsd.h
  30. 2 2
      sys/include/acpi/acpica/platform/acqnx.h
  31. 2 2
      sys/include/auth.h
  32. 8 8
      sys/include/authsrv.h
  33. 2 2
      sys/include/bin.h
  34. 12 12
      sys/include/bio.h
  35. 3 3
      sys/include/cc.h
  36. 2 2
      sys/include/complete.h
  37. 106 106
      sys/include/coreboot.h
  38. 2 2
      sys/include/cursor.h
  39. 6 6
      sys/include/disk.h
  40. 44 44
      sys/include/draw.h
  41. 53 53
      sys/include/elf.h
  42. 10 10
      sys/include/event.h
  43. 26 26
      sys/include/fcall.h
  44. 7 7
      sys/include/flate.h
  45. 23 23
      sys/include/frame.h
  46. 5 5
      sys/include/hashmap.h
  47. 21 21
      sys/include/html.h
  48. 24 24
      sys/include/httpd.h
  49. 53 53
      sys/include/ip.h
  50. 24 24
      sys/include/jay.h
  51. 94 94
      sys/include/libc.h
  52. 114 114
      sys/include/libsec.h
  53. 86 86
      sys/include/mach.h
  54. 24 24
      sys/include/memdraw.h
  55. 3 3
      sys/include/memlayer.h
  56. 4 3
      sys/include/mouse.h
  57. 9 9
      sys/include/mp.h
  58. 9 9
      sys/include/ndb.h
  59. 108 108
      sys/include/nfs3.h
  60. 1 1
      sys/include/oprofile.h
  61. 41 41
      sys/include/oventi.h
  62. 13 13
      sys/include/pool.h
  63. 15 11
      sys/include/rijndael.h
  64. 14 14
      sys/include/sha2.h
  65. 7 7
      sys/include/stdio.h
  66. 66 66
      sys/include/sunrpc.h
  67. 12 12
      sys/include/thread.h
  68. 8 8
      sys/include/tos.h
  69. 4 4
      sys/include/trace.h
  70. 4 4
      sys/include/usb/audio.h
  71. 6 6
      sys/include/usb/audioctl.h
  72. 11 11
      sys/include/usb/ether.h
  73. 4 4
      sys/include/usb/hid.h
  74. 54 54
      sys/include/usb/scsireq.h
  75. 5 5
      sys/include/usb/serial.h
  76. 9 9
      sys/include/usb/ums.h
  77. 53 52
      sys/include/usb/usb.h
  78. 5 5
      sys/include/usb/usbfs.h
  79. 71 71
      sys/include/venti.h
  80. 2 2
      sys/include/virtio_9p.h
  81. 21 21
      sys/include/virtio_blk.h
  82. 8 8
      sys/include/virtio_console.h
  83. 19 19
      sys/include/virtio_lib.h
  84. 24 24
      sys/include/virtio_net.h
  85. 29 29
      sys/include/virtio_pci.h
  86. 29 29
      sys/include/virtio_ring.h
  87. 2 2
      sys/src/9/386/ether8169.c
  88. 1 1
      sys/src/9/aarch64/cpu.json
  89. 1 1
      sys/src/9/amd64/acore.c
  90. 1 1
      sys/src/9/amd64/acpi.h
  91. 1 1
      sys/src/9/amd64/build.json
  92. 5 5
      sys/src/9/amd64/dat.h
  93. 1 1
      sys/src/9/amd64/devvga.c
  94. 2 2
      sys/src/9/amd64/ether8139.c
  95. 14 14
      sys/src/9/amd64/etherbcm.c.NO
  96. 2 2
      sys/src/9/amd64/fns.h
  97. 1 1
      sys/src/9/amd64/l64v.S
  98. 1 1
      sys/src/9/amd64/main.c
  99. 12 12
      sys/src/9/amd64/root/cpu.c
  100. 2 2
      sys/src/9/amd64/sdata.c

+ 20 - 20
386/include/ureg.h

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

+ 11 - 11
aarch64/include/mach_acpi.h

@@ -6,18 +6,18 @@
  */
 
 #define ACPI_USE_SYSTEM_INTTYPES
-typedef uint8_t BOOLEAN;
+typedef u8 BOOLEAN;
 typedef QLock ACPI_MUTEX;
-typedef uint64_t COMPILER_DEPENDENT_UINT64;
-typedef uint64_t UINT64;
-typedef uint32_t UINT32;
-typedef uint16_t UINT16;
-typedef uint8_t UINT8;
-typedef int64_t COMPILER_DEPENDENT_INT64;
-typedef int64_t INT64;
-typedef int32_t INT32;
-typedef int16_t INT16;
-typedef int8_t INT8;
+typedef u64 COMPILER_DEPENDENT_UINT64;
+typedef u64 UINT64;
+typedef u32 UINT32;
+typedef u16 UINT16;
+typedef u8 UINT8;
+typedef i64 COMPILER_DEPENDENT_INT64;
+typedef i64 INT64;
+typedef i32 INT32;
+typedef i16 INT16;
+typedef i8 INT8;
 typedef int ACPI_THREAD_ID;
 
 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED

+ 17 - 17
aarch64/include/u.h

@@ -10,32 +10,32 @@
 
 #define nil ((void *)0)
 
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
+typedef signed char i8;
+typedef unsigned char u8;
+typedef signed short i16;
+typedef unsigned short u16;
+typedef signed int i32;
+typedef unsigned int u32;
 typedef unsigned int uint;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef uint64_t uintptr;
-typedef uint64_t uintptr_t;
-typedef uint64_t usize;
-typedef uint64_t size_t;
-typedef uint32_t Rune;
+typedef signed long long i64;
+typedef unsigned long long u64;
+typedef u64 uintptr;
+typedef u64 uintptr_t;
+typedef u64 usize;
+typedef u64 size_t;
+typedef u32 Rune;
 
 typedef union FPdbleword FPdbleword;
 union FPdbleword
 {
 	double x;
 	struct {	// little endian
-		uint32_t lo;
-                uint32_t hi;
+		u32 lo;
+                u32 hi;
 	};
 };
 
-typedef uint64_t jmp_buf[32];
+typedef u64 jmp_buf[32];
 
 #define JMPBUFDPC       0
 #define JMPBUFSP        30
@@ -43,7 +43,7 @@ typedef uint64_t jmp_buf[32];
 #define JMPBUFARG1      0
 #define JMPBUFARG2      1
 
-typedef uint32_t	mpdigit;	// for /sys/include/mp.h
+typedef u32	mpdigit;	// for /sys/include/mp.h
 
 typedef __builtin_va_list va_list;
 

+ 39 - 39
aarch64/include/ureg.h

@@ -9,51 +9,51 @@
  */
 
 typedef struct Ureg {
-	uint64_t x0;
-	uint64_t x1;
-	uint64_t x2;
-	uint64_t x3;
-	uint64_t x4;
-	uint64_t x5;
-	uint64_t x6;
-	uint64_t x7;
-	uint64_t x8;
-	uint64_t x9;
-	uint64_t x10;
-	uint64_t x11;
-	uint64_t x12;
-	uint64_t x13;
-	uint64_t x14;
-	uint64_t x15;
+	u64 x0;
+	u64 x1;
+	u64 x2;
+	u64 x3;
+	u64 x4;
+	u64 x5;
+	u64 x6;
+	u64 x7;
+	u64 x8;
+	u64 x9;
+	u64 x10;
+	u64 x11;
+	u64 x12;
+	u64 x13;
+	u64 x14;
+	u64 x15;
 	union {
-		uint64_t x16;
-		uint64_t ip0;
+		u64 x16;
+		u64 ip0;
 	};
 	union {
-		uint64_t x17;
-		uint64_t ip1;
+		u64 x17;
+		u64 ip1;
 	};
-	uint64_t x18;
-	uint64_t x19;
-	uint64_t x20;
-	uint64_t x21;
-	uint64_t x22;
-	uint64_t x23;
-	uint64_t x24;
-	uint64_t x25;
-	uint64_t x26;
-	uint64_t x27;
-	uint64_t x28;
+	u64 x18;
+	u64 x19;
+	u64 x20;
+	u64 x21;
+	u64 x22;
+	u64 x23;
+	u64 x24;
+	u64 x25;
+	u64 x26;
+	u64 x27;
+	u64 x28;
 	union {
-		uint64_t x29;
-		uint64_t fp;
+		u64 x29;
+		u64 fp;
 	};
 	union {
-		uint64_t x30;
-		uint64_t lr;
+		u64 x30;
+		u64 lr;
 	};
-	uint64_t sp;
-	uint64_t type;	// of exception
-	uint64_t psr;
-	uint64_t pc;	// interrupted addr
+	u64 sp;
+	u64 type;	// of exception
+	u64 psr;
+	u64 pc;	// interrupted addr
 } Ureg;

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

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

+ 7 - 7
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, uint32_t *q0, uint32_t *q1)
+findplay(Window *w, char *s, u32 *q0, u32 *q1)
 {
 	char xbuf[25];
 	if(w->data < 0)
@@ -69,7 +69,7 @@ int
 setplaytime(Window *w, char *new)
 {
 	char buf[40];
-	uint32_t q0, q1;
+	u32 q0, q1;
 
 return 1;
 	if(!findplay(w, PLAYSTRING, &q0, &q1))
@@ -93,8 +93,8 @@ return 1;
  * (presumably a track number).
  */
 static int
-unmarkplay(Window *w, char *buf, int n, uint32_t *q0, uint32_t *q1,
-	   uint32_t *qbegin)
+unmarkplay(Window *w, char *buf, int n, u32 *q0, u32 *q1,
+	   u32 *qbegin)
 {
 	char xbuf[24];
 
@@ -122,7 +122,7 @@ unmarkplay(Window *w, char *buf, int n, uint32_t *q0, uint32_t *q1,
 }
 
 int
-markplay(Window *w, uint32_t q0)
+markplay(Window *w, u32 q0)
 {
 	char buf[20];
 
@@ -220,7 +220,7 @@ void
 advancetrack(Drive *d, Window *w)
 {
 	int n;
-	uint32_t q0, q1, qnext;
+	u32 q0, q1, qnext;
 	char buf[20];
 
 	q0 = q1 = 0;
@@ -260,7 +260,7 @@ acmeevent(Drive *d, Window *w, Event *e)
 	Event *ea, *e2, *eq;
 	char *s, *t, *buf;
 	int n, na;
-	uint32_t q0, q1;
+	u32 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 uint32_t 
+static u32 
 cddb_sum(int n)
 {
 	int ret;
@@ -23,7 +23,7 @@ cddb_sum(int n)
 	return ret;
 }
 
-static uint32_t
+static u32
 diskid(Toc *t)
 {
 	int i, n, tmp;

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

@@ -22,7 +22,7 @@ msfconv(Fmt *fp)
 static int
 playmsf(Drive *d, Msf start, Msf end)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x47;
@@ -59,7 +59,7 @@ playtrack(Drive *d, int start, int end)
 int
 resume(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x4B;
@@ -70,7 +70,7 @@ resume(Drive *d)
 int
 pause(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x4B;
@@ -80,7 +80,7 @@ pause(Drive *d)
 int
 stop(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x4E;
@@ -90,7 +90,7 @@ stop(Drive *d)
 int
 eject(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x1B;
@@ -102,7 +102,7 @@ eject(Drive *d)
 int
 ingest(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x1B;
@@ -112,7 +112,7 @@ ingest(Drive *d)
 }
 
 static Msf
-rdmsf(uint8_t *p)
+rdmsf(u8 *p)
 {
 	Msf msf;
 
@@ -122,8 +122,8 @@ rdmsf(uint8_t *p)
 	return msf;
 }
 
-static uint32_t
-rdlba(uint8_t *p)
+static u32
+rdlba(u8 *p)
 {
 	return (p[0]<<16) | (p[1]<<8) | p[2];
 }
@@ -133,8 +133,8 @@ int
 gettoc(Scsi *s, Toc *t)
 {
 	int i, n;
-	uint8_t cmd[12];
-	uint8_t resp[1024];
+	u8 cmd[12];
+	u8 resp[1024];
 
 Again:
 	memset(t, 0, sizeof(*t));
@@ -222,7 +222,7 @@ dumptoc(Toc *t)
 static void
 ping(Drive *d)
 {
-	uint8_t cmd[12];
+	u8 cmd[12];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x43;
@@ -232,7 +232,7 @@ ping(Drive *d)
 static int
 playstatus(Drive *d, Cdstatus *stat)
 {
-	uint8_t cmd[12], resp[16];
+	u8 cmd[12], resp[16];
 
 	memset(cmd, 0, sizeof cmd);
 	cmd[0] = 0x42;

+ 3 - 3
acme/bin/source/adict/adict.c

@@ -99,7 +99,7 @@ procrexec(char *xprog, ...)
 	}
 	args[i] = nil;
 
-	c = chancreate(sizeof(uint32_t), 0);
+	c = chancreate(sizeof(u32), 0);
 	rexarg[0] = xprog;
 	rexarg[1] = args;
 	rexarg[2] = fpipe;
@@ -362,7 +362,7 @@ procopenwin(char *name, char *buttons, Win *twin, int wintype)
 	void *arg[5];
 	Channel *c;
 
-	c = chancreate(sizeof(uint32_t), 0);
+	c = chancreate(sizeof(u32), 0);
 	arg[0] = name;
 	arg[1] = buttons;
 	arg[2] = twin;
@@ -423,7 +423,7 @@ procpexec(char *prog, char **args)
 	void *rexarg[4];
 	Channel *c;
 
-	c = chancreate(sizeof(uint32_t), 0);
+	c = chancreate(sizeof(u32), 0);
 	rexarg[0] = prog;
 	rexarg[1] = args;
 	rexarg[2] = c;

+ 1 - 1
acme/bin/source/spout.c

@@ -61,7 +61,7 @@ spout(int fd, char *name)
 		w = s;
 		t = s;
 		do{
-			c = *(uint8_t*)t;
+			c = *(u8*)t;
 			if(c < Runeself)
 				wid = 1;
 			else{

+ 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, "%lu", (uint32_t)i);
+		sprint(s, "%lu", (u32)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, uint32_t q0, uint32_t q1)
+__sendinput(Window *w, u32 q0, u32 q1)
 {
 	char *s, *t;
 	int n, nb, eofchar;
@@ -235,7 +235,7 @@ __sendinput(Window *w, uint32_t q0, uint32_t q1)
 }
 
 static int
-_sendinput(Window *w, uint32_t q0, uint32_t *q1)
+_sendinput(Window *w, u32 q0, u32 *q1)
 {
 	char buf[32];
 	int n;
@@ -252,9 +252,9 @@ _sendinput(Window *w, uint32_t q0, uint32_t *q1)
 }
 
 int
-sendinput(Window *w, uint32_t q0, uint32_t *q1)
+sendinput(Window *w, u32 q0, u32 *q1)
 {
-	uint32_t n;
+	u32 n;
 	Req *oq;
 
 	n = 0;
@@ -411,7 +411,7 @@ mainctl(void *v)
 	Window *w;
 	Event *e;
 	int delta, pendingS, pendingK;
-	uint32_t hostpt, endpt;
+	u32 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(uint32_t), 0);
+	cpid = chancreate(sizeof(u32), 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)
 {
-	uint32_t q0, q1;
+	u32 q0, q1;
 	char tmp[32], *t;
 	int n, k;
 

+ 8 - 8
acme/mail/src/dat.h

@@ -58,14 +58,14 @@ struct Message
 	int		ctlfd;
 	char		*name;
 	char		*replyname;
-	uint8_t	opened;
-	uint8_t	dirty;
-	uint8_t	isreply;
-	uint8_t	deleted;
-	uint8_t	writebackdel;
-	uint8_t	tagposted;
-	uint8_t	recursed;
-	uint8_t	level;
+	u8	opened;
+	u8	dirty;
+	u8	isreply;
+	u8	deleted;
+	u8	writebackdel;
+	u8	tagposted;
+	u8	recursed;
+	u8	level;
 
 	/* header info */
 	char		*fromcolon;	/* from header file; all rest are from info file */

+ 2 - 2
acme/mail/src/mesg.c

@@ -708,7 +708,7 @@ mesgtagpost(Message *m)
 /* need to expand selection more than default word */
 //#pragma varargck argpos eval 2
 
-int32_t
+i32
 eval(Window *w, char *s, ...)
 {
 	char buf[64];
@@ -745,7 +745,7 @@ char*
 expandaddr(Window *w, Event *e)
 {
 	char *s;
-	int32_t q0, q1;
+	i32 q0, q1;
 
 	if(e->q0 != e->q1)	/* cannot happen */
 		return nil;

+ 1 - 1
acme/wiki/src/awiki.h

@@ -104,7 +104,7 @@ struct Wiki {
 	int n;
 	int dead;
 	Window *win;
-	uint32_t time;
+	u32 time;
 	int linked;
 	Wiki *next;
 	Wiki *prev;

+ 13 - 13
amd64/include/mach_acpi.h

@@ -7,8 +7,8 @@
 #if 0
 typedef
 struct Lock {
-	int32_t	key;
-	int32_t	sem;
+	i32	key;
+	i32	sem;
 } Lock;
 
 typedef struct QLp QLp;
@@ -30,18 +30,18 @@ struct QLock
 
 #endif
 #define ACPI_USE_SYSTEM_INTTYPES
-typedef uint8_t BOOLEAN;
+typedef u8 BOOLEAN;
 typedef QLock ACPI_MUTEX;
-typedef uint64_t COMPILER_DEPENDENT_UINT64;
-typedef uint64_t UINT64;
-typedef uint32_t UINT32;
-typedef uint16_t UINT16;
-typedef uint8_t UINT8;
-typedef int64_t COMPILER_DEPENDENT_INT64;
-typedef int64_t INT64;
-typedef int32_t INT32;
-typedef int16_t INT16;
-typedef int8_t INT8;
+typedef u64 COMPILER_DEPENDENT_UINT64;
+typedef u64 UINT64;
+typedef u32 UINT32;
+typedef u16 UINT16;
+typedef u8 UINT8;
+typedef i64 COMPILER_DEPENDENT_INT64;
+typedef i64 INT64;
+typedef i32 INT32;
+typedef i16 INT16;
+typedef i8 INT8;
 typedef int ACPI_THREAD_ID;
 
 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED

+ 5 - 13
amd64/include/u.h

@@ -20,23 +20,15 @@ typedef signed long long i64;
 typedef u64 		usize;
 typedef	i64		isize;
 
-typedef	unsigned char	uint8_t;
-typedef signed char	int8_t;
-typedef	unsigned short	uint16_t;
-typedef	signed short	int16_t;
-typedef unsigned int	uint32_t;
 typedef unsigned int	uint;
-typedef signed int	int32_t;
 typedef long		ssize_t;
-typedef	unsigned long long uint64_t;
-typedef	long long	int64_t;
-typedef uint64_t	uintptr;
-typedef uint64_t	uintptr_t;
-typedef int64_t		intptr_t;
+typedef u64	uintptr;
+typedef u64	uintptr_t;
+typedef i64		intptr_t;
 typedef unsigned long	size_t;
 typedef	u32	Rune;
 typedef union FPdbleword FPdbleword;
-typedef uint64_t	jmp_buf[10]; // for registers.
+typedef u64	jmp_buf[10]; // for registers.
 
 #define	alignas		_Alignas
 #define static_assert	_Static_assert
@@ -89,7 +81,7 @@ union FPdbleword
 typedef	char*	va_list;
 #define va_start(list, start) list =\
 	(sizeof(start) < 8?\
-		(char*)((int64_t*)&(start)+1):\
+		(char*)((i64*)&(start)+1):\
 		(char*)(&(start)+1))
 #define va_end(list)\
 	USED(list)

+ 26 - 26
amd64/include/ureg.h

@@ -8,35 +8,35 @@
  */
 
 struct Ureg {
-	uint64_t	ax;
-	uint64_t	bx;
-	uint64_t	cx;
-	uint64_t	dx;
-	uint64_t	si;
-	uint64_t	di;
-	uint64_t	bp;
-	uint64_t	r8;
-	uint64_t	r9;
-	uint64_t	r10;
-	uint64_t	r11;
-	uint64_t	r12;
-	uint64_t	r13;
-	uint64_t	r14;
-	uint64_t	r15;
+	u64	ax;
+	u64	bx;
+	u64	cx;
+	u64	dx;
+	u64	si;
+	u64	di;
+	u64	bp;
+	u64	r8;
+	u64	r9;
+	u64	r10;
+	u64	r11;
+	u64	r12;
+	u64	r13;
+	u64	r14;
+	u64	r15;
 
 	// These are pointless and not pushing them would simplify the
 	// interrupt handler a lot. However, removing them would break
 	// compatibility with Go Plan 9 binaries.
-	uint16_t	ds;
-	uint16_t	es;
-	uint16_t	fs;
-	uint16_t	gs;
+	u16	ds;
+	u16	es;
+	u16	fs;
+	u16	gs;
 
-	uint64_t	type;
-	uint64_t	error;				/* error code (or zero) */
-	uint64_t	ip;				/* pc */
-	uint64_t	cs;				/* old context */
-	uint64_t	flags;				/* old flags */
-	uint64_t	sp;				/* sp */
-	uint64_t	ss;				/* old stack segment */
+	u64	type;
+	u64	error;				/* error code (or zero) */
+	u64	ip;				/* pc */
+	u64	cs;				/* old context */
+	u64	flags;				/* old flags */
+	u64	sp;				/* sp */
+	u64	ss;				/* old stack segment */
 };

+ 7 - 1
bootstrap.sh

@@ -8,7 +8,13 @@ echo GOBIN is now $GOBIN
 
 echo Building harvey-os.org commands into $HOSTBIN
 GO111MODULE=off go get -d -u harvey-os.org/cmd/...
-GO111MODULE=off go install harvey-os.org/cmd/...
+GO111MODULE=off go install harvey-os.org/cmd/build
+GO111MODULE=off go install harvey-os.org/cmd/elf2c
+GO111MODULE=off go install harvey-os.org/cmd/mksys
+GO111MODULE=off go install harvey-os.org/cmd/data2c
+GO111MODULE=off go install harvey-os.org/cmd/qtap
+echo 'Can not build ... until ipfs gets fixed :-('
+echo GO111MODULE=off go install harvey-os.org/cmd/...
 
 echo Building u-root into $HOSTBIN
 # Download u-root sources into $GOPATH because that's what u-root expects.

+ 11 - 11
riscv/include/mach_acpi.h

@@ -6,18 +6,18 @@
  */
 
 #define ACPI_USE_SYSTEM_INTTYPES
-typedef uint8_t BOOLEAN;
+typedef u8 BOOLEAN;
 typedef QLock ACPI_MUTEX;
-typedef uint64_t COMPILER_DEPENDENT_UINT64;
-typedef uint64_t UINT64;
-typedef uint32_t UINT32;
-typedef uint16_t UINT16;
-typedef uint8_t UINT8;
-typedef int64_t COMPILER_DEPENDENT_INT64;
-typedef int64_t INT64;
-typedef int32_t INT32;
-typedef int16_t INT16;
-typedef int8_t INT8;
+typedef u64 COMPILER_DEPENDENT_UINT64;
+typedef u64 UINT64;
+typedef u32 UINT32;
+typedef u16 UINT16;
+typedef u8 UINT8;
+typedef i64 COMPILER_DEPENDENT_INT64;
+typedef i64 INT64;
+typedef i32 INT32;
+typedef i16 INT16;
+typedef i8 INT8;
 typedef int ACPI_THREAD_ID;
 
 #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED

+ 6 - 14
riscv/include/u.h

@@ -20,21 +20,13 @@ typedef	signed long long i64;
 typedef	u64		usize;
 typedef	i64		isize;
 
-typedef	unsigned char	uint8_t;
-typedef signed char	int8_t;
-typedef	unsigned short	uint16_t;
-typedef	signed short	int16_t;
-typedef unsigned int	uint32_t;
 typedef unsigned int	uint;
-typedef signed int	int32_t;
-typedef	unsigned long long uint64_t;
-typedef	long long	int64_t;
-typedef int64_t intptr_t;
-typedef uint64_t uintptr;
-typedef uint64_t uintptr_t;
-typedef uint32_t	usize;
-typedef int64_t size_t;
-typedef	uint32_t		Rune;
+typedef i64 intptr_t;
+typedef u64 uintptr;
+typedef u64 uintptr_t;
+typedef u32	usize;
+typedef i64 size_t;
+typedef	u32		Rune;
 typedef union FPdbleword FPdbleword;
 // This is a guess! Assumes float!
 typedef uintptr		jmp_buf[64]; // for registers.

+ 27 - 27
sys/include/9p.h

@@ -16,10 +16,10 @@ typedef struct Intmap	Intmap;
 
 Intmap*	allocmap(void (*inc)(void*));
 void	freemap(Intmap*, void (*destroy)(void*));
-void*	lookupkey(Intmap*, uint32_t);
-void*	insertkey(Intmap*, uint32_t, void*);
-int	caninsertkey(Intmap*, uint32_t, void*);
-void*	deletekey(Intmap*, uint32_t);
+void*	lookupkey(Intmap*, u32);
+void*	insertkey(Intmap*, u32, void*);
+int	caninsertkey(Intmap*, u32, void*);
+void*	deletekey(Intmap*, u32);
 
 /*
  * Fid and Request structures.
@@ -37,7 +37,7 @@ typedef struct Srv 	Srv;
 
 struct Fid
 {
-	uint32_t	fid;
+	u32	fid;
 	char		omode;	/* -1 = not open */
 	File*		file;
 	char*		uid;
@@ -48,13 +48,13 @@ struct Fid
 	Readdir*	rdir;
 	Ref		ref;
 	Fidpool*	pool;
-	int64_t		diroffset;
-	int32_t		dirindex;
+	i64		diroffset;
+	i32		dirindex;
 };
 
 struct Req
 {
-	uint32_t	tag;
+	u32	tag;
 	void*		aux;
 	Fcall		ifcall;
 	Fcall		ofcall;
@@ -69,9 +69,9 @@ struct Req
 	QLock		lk;
 	Ref		ref;
 	Reqpool*	pool;
-	uint8_t*	buf;
-	uint8_t		type;
-	uint8_t		responded;
+	u8 *	buf;
+	u8		type;
+	u8		responded;
 	char*		error;
 	void*		rbuf;
 	Req**		flush;
@@ -96,17 +96,17 @@ struct Reqpool {
 
 Fidpool*	allocfidpool(void (*destroy)(Fid*));
 void		freefidpool(Fidpool*);
-Fid*		allocfid(Fidpool*, uint32_t);
-Fid*		lookupfid(Fidpool*, uint32_t);
+Fid*		allocfid(Fidpool*, u32);
+Fid*		lookupfid(Fidpool*, u32);
 void		closefid(Fid*);
-Fid*		removefid(Fidpool*, uint32_t);
+Fid*		removefid(Fidpool*, u32);
 
 Reqpool*	allocreqpool(void (*destroy)(Req*));
 void		freereqpool(Reqpool*);
-Req*		allocreq(Reqpool*, uint32_t);
-Req*		lookupreq(Reqpool*, uint32_t);
+Req*		allocreq(Reqpool*, u32);
+Req*		lookupreq(Reqpool*, u32);
 void		closereq(Req*);
-Req*		removereq(Reqpool*, uint32_t);
+Req*		removereq(Reqpool*, u32);
 
 typedef	int	Dirgen(int, Dir*, void*);
 void		dirread9p(Req*, Dirgen*, void*);
@@ -136,18 +136,18 @@ struct Tree {
 
 /* below is implementation-specific; don't use */
 	Lock 		genlock;
-	uint32_t 	qidgen;
-	uint32_t 	dirqidgen;
+	u32 	qidgen;
+	u32 	dirqidgen;
 };
 
-Tree*		alloctree(char*, char*, uint32_t, void(*destroy)(File*));
+Tree*		alloctree(char*, char*, u32, void(*destroy)(File*));
 void		freetree(Tree*);
-File*		createfile(File*, char*, char*, uint32_t, void*);
+File*		createfile(File*, char*, char*, u32, void*);
 int		removefile(File*);
 void		closefile(File*);
 File*		walkfile(File*, char*);
 Readdir*	opendirfile(File*);
-int32_t		readdirfile(Readdir*, uint8_t*, int32_t);
+i32		readdirfile(Readdir*, u8*, i32);
 void		closedirfile(Readdir*);
 
 /*
@@ -208,9 +208,9 @@ struct Srv {
 	Reqpool*	rpool;
 	uint		msize;
 
-	uint8_t*	rbuf;
+	u8 *	rbuf;
 	QLock		rlock;
-	uint8_t*	wbuf;
+	u8 *	wbuf;
 	QLock		wlock;
 	
 	char*		addr;
@@ -233,8 +233,8 @@ void		threadlistensrv(Srv *s, char *addr);
  */
 int	hasperm(File*, char*, int);
 
-void*	emalloc9p(uint32_t);
-void*	erealloc9p(void*, uint32_t);
+void*	emalloc9p(u32);
+void*	erealloc9p(void*, u32);
 char*	estrdup9p(char*);
 
 enum {
@@ -242,7 +242,7 @@ enum {
 };
 
 void	readstr(Req*, char*);
-void	readbuf(Req*, void*, int32_t);
+void	readbuf(Req*, void*, i32);
 void	walkandclone(Req*, char*(*walk1)(Fid*,char*,void*), 
 		char*(*clone)(Fid*,Fid*,void*), void*);
 

+ 8 - 8
sys/include/a.out.h

@@ -10,14 +10,14 @@
 typedef	struct	Exec	Exec;
 struct	Exec
 {
-	int32_t	magic;		/* magic number */
-	int32_t	text;	 	/* size of text segment */
-	int32_t	data;	 	/* size of initialized data */
-	int32_t	bss;	  	/* size of uninitialized data */
-	int32_t	syms;	 	/* size of symbol table */
-	int32_t	entry;	 	/* entry point */
-	int32_t	spsz;		/* size of pc/sp offset table */
-	int32_t	pcsz;		/* size of pc/line number table */
+	i32	magic;		/* magic number */
+	i32	text;	 	/* size of text segment */
+	i32	data;	 	/* size of initialized data */
+	i32	bss;	  	/* size of uninitialized data */
+	i32	syms;	 	/* size of symbol table */
+	i32	entry;	 	/* entry point */
+	i32	spsz;		/* size of pc/sp offset table */
+	i32	pcsz;		/* size of pc/line number table */
 };
 
 #define HDR_MAGIC	0x00008000		/* header expansion */

+ 2 - 2
sys/include/acpi/acpica/platform/acdragonfly.h

@@ -163,8 +163,8 @@
 #endif
 
 #define ACPI_UINTPTR_T                  uintptr_t
-#define COMPILER_DEPENDENT_INT64        int64_t
-#define COMPILER_DEPENDENT_UINT64       uint64_t
+#define COMPILER_DEPENDENT_INT64        i64
+#define COMPILER_DEPENDENT_UINT64       u64
 
 #define ACPI_USE_DO_WHILE_0
 #define ACPI_USE_SYSTEM_CLIBRARY

+ 5 - 5
sys/include/acpi/acpica/platform/acefi.h

@@ -208,8 +208,8 @@
 #endif
 
 #ifndef USE_STDLIB
-#define UINTN       uint64_t
-#define INTN        int64_t
+#define UINTN       u64
+#define INTN        i64
 #endif
 
 #define ACPI_EFI_ERR(a)             (0x8000000000000000 | a)
@@ -219,15 +219,15 @@
 #define ACPI_MACHINE_WIDTH          32
 
 #ifndef USE_STDLIB
-#define UINTN       uint32_t
-#define INTN        int32_t
+#define UINTN       u32
+#define INTN        i32
 #endif
 
 #define ACPI_EFI_ERR(a)             (0x80000000 | a)
 
 #endif
 
-#define CHAR16      uint16_t
+#define CHAR16      u16
 
 #ifdef USE_EFI_FUNCTION_WRAPPER
 #define __VA_NARG__(...)                        \

+ 8 - 8
sys/include/acpi/acpica/platform/acefiex.h

@@ -155,14 +155,14 @@
 
 #ifndef ACPI_USE_SYSTEM_CLIBRARY
 
-typedef signed char                     int8_t;
-typedef short int                       int16_t;
-typedef int                             int32_t;
-typedef unsigned char                   uint8_t;
-typedef unsigned short int              uint16_t;
-typedef unsigned int                    uint32_t;
-typedef COMPILER_DEPENDENT_INT64        int64_t;
-typedef COMPILER_DEPENDENT_UINT64       uint64_t;
+typedef signed char                     i8;
+typedef short int                       i16;
+typedef int                             i32;
+typedef unsigned char                   u8;
+typedef unsigned short int              u16;
+typedef unsigned int                    u32;
+typedef COMPILER_DEPENDENT_INT64        i64;
+typedef COMPILER_DEPENDENT_UINT64       u64;
 
 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
 

+ 2 - 2
sys/include/acpi/acpica/platform/acfreebsd.h

@@ -161,8 +161,8 @@
 #define ACPI_MACHINE_WIDTH      32
 #endif
 
-#define COMPILER_DEPENDENT_INT64        int64_t
-#define COMPILER_DEPENDENT_UINT64       uint64_t
+#define COMPILER_DEPENDENT_INT64        i64
+#define COMPILER_DEPENDENT_UINT64       u64
 
 #define ACPI_UINTPTR_T      uintptr_t
 

+ 2 - 2
sys/include/acpi/acpica/platform/acnetbsd.h

@@ -162,8 +162,8 @@
 #define ACPI_MACHINE_WIDTH      32
 #endif
 
-#define COMPILER_DEPENDENT_INT64  int64_t
-#define COMPILER_DEPENDENT_UINT64 uint64_t
+#define COMPILER_DEPENDENT_INT64  i64
+#define COMPILER_DEPENDENT_UINT64 u64
 
 #if defined(_KERNEL) || defined(_STANDALONE)
 #ifdef _KERNEL_OPT

+ 2 - 2
sys/include/acpi/acpica/platform/acqnx.h

@@ -162,8 +162,8 @@
 /* At present time (QNX 6.6) all supported architectures are 32 bits. */
 #define ACPI_MACHINE_WIDTH      32
 
-#define COMPILER_DEPENDENT_INT64  int64_t
-#define COMPILER_DEPENDENT_UINT64 uint64_t
+#define COMPILER_DEPENDENT_INT64  i64
+#define COMPILER_DEPENDENT_UINT64 u64
 
 #include <ctype.h>
 #include <stdint.h>

+ 2 - 2
sys/include/auth.h

@@ -54,7 +54,7 @@ struct AuthInfo
 	char	*suid;		/* server id */
 	char	*cap;		/* capability (only valid on server side) */
 	int	nsecret;	/* length of secret */
-	uint8_t	*secret;	/* secret */
+	u8	*secret;	/* secret */
 };
 
 struct Chalstate
@@ -74,7 +74,7 @@ struct Chalstate
 
 struct	Chapreply		/* for protocol "chap" */
 {
-	uint8_t	id;
+	u8	id;
 	char	resp[MD5LEN];
 };
 

+ 8 - 8
sys/include/authsrv.h

@@ -87,7 +87,7 @@ struct Authenticator
 {
 	char	num;			/* replay protection */
 	char	chal[CHALLEN];
-	uint32_t	id;			/* authenticator id, ++'d with each auth */
+	u32	id;			/* authenticator id, ++'d with each auth */
 };
 #define	AUTHENTLEN	(CHALLEN+4+1)
 
@@ -103,7 +103,7 @@ struct Passwordreq
 
 struct	OChapreply
 {
-	uint8_t	id;
+	u8	id;
 	char	uid[ANAMELEN];
 	char	resp[OMD5LEN];
 };
@@ -148,22 +148,22 @@ enum {
 struct Nvrsafe
 {
 	char	machkey[DESKEYLEN];	/* was file server's authid's des key */
-	uint8_t	machsum;
+	u8	machsum;
 	char	authkey[DESKEYLEN];	/* authid's des key from password */
-	uint8_t	authsum;
+	u8	authsum;
 	/*
 	 * file server config string of device holding full configuration;
 	 * secstore key on non-file-servers.
 	 */
 	char	config[CONFIGLEN];
-	uint8_t	configsum;
+	u8	configsum;
 	char	authid[ANAMELEN];	/* auth userid, e.g., bootes */
-	uint8_t	authidsum;
+	u8	authidsum;
 	char	authdom[DOMLEN]; /* auth domain, e.g., cs.bell-labs.com */
-	uint8_t	authdomsum;
+	u8	authdomsum;
 };
 
-extern	uint8_t	nvcsum(void*, int);
+extern	u8	nvcsum(void*, int);
 extern int	readnvram(Nvrsafe*, int);
 
 /*

+ 2 - 2
sys/include/bin.h

@@ -11,7 +11,7 @@
 typedef struct Bin	Bin;
 
 
-void	*binalloc(Bin **, uint32_t size, int zero);
-void	*bingrow(Bin **, void *op, uint32_t osize, uint32_t size,
+void	*binalloc(Bin **, u32 size, int zero);
+void	*bingrow(Bin **, void *op, u32 osize, u32 size,
 		     int zero);
 void	binfree(Bin **);

+ 12 - 12
sys/include/bio.h

@@ -34,12 +34,12 @@ struct	Biobuf
 	int	state;		/* r/w/inactive */
 	int	fid;		/* open file */
 	int	flag;		/* magic if malloc'ed */
-	int64_t	offset;		/* offset of buffer in file */
+	i64	offset;		/* offset of buffer in file */
 	int	bsize;		/* size of buffer */
-	uint8_t*	bbuf;		/* pointer to beginning of buffer */
-	uint8_t*	ebuf;		/* pointer to end of buffer */
-	uint8_t*	gbuf;		/* pointer to good data in buf */
-	uint8_t	b[Bungetsize+Bsize];
+	u8 *	bbuf;		/* pointer to beginning of buffer */
+	u8 *	ebuf;		/* pointer to end of buffer */
+	u8 *	gbuf;		/* pointer to good data in buf */
+	u8	b[Bungetsize+Bsize];
 };
 
 /* Dregs, redefined as functions for backwards compatibility */
@@ -54,22 +54,22 @@ int	Bfildes(Biobufhdr*);
 int	Bflush(Biobufhdr*);
 int	Bgetc(Biobufhdr*);
 int	Bgetd(Biobufhdr*, double*);
-int32_t	Bgetrune(Biobufhdr*);
+i32	Bgetrune(Biobufhdr*);
 int	Binit(Biobuf*, int, int);
-int	Binits(Biobufhdr*, int, int, uint8_t*, int);
+int	Binits(Biobufhdr*, int, int, u8*, int);
 int	Blinelen(Biobufhdr*);
-int64_t	Boffset(Biobufhdr*);
+i64	Boffset(Biobufhdr*);
 Biobuf*	Bopen(char*, int);
 int	Bprint(Biobufhdr*, char*, ...);
 int	Bvprint(Biobufhdr*, char*, va_list);
 int	Bputc(Biobufhdr*, int);
-int	Bputrune(Biobufhdr*, int32_t);
+int	Bputrune(Biobufhdr*, i32);
 void*	Brdline(Biobufhdr*, int);
 char*	Brdstr(Biobufhdr*, int, int);
-int32_t	Bread(Biobufhdr*, void*, int32_t);
-int64_t	Bseek(Biobufhdr*, int64_t, int);
+i32	Bread(Biobufhdr*, void*, i32);
+i64	Bseek(Biobufhdr*, i64, int);
 int	Bterm(Biobufhdr*);
 int	Bungetc(Biobufhdr*);
 int	Bungetrune(Biobufhdr*);
-int32_t	Bwrite(Biobufhdr*, void*, int32_t);
+i32	Bwrite(Biobufhdr*, void*, i32);
 

+ 3 - 3
sys/include/cc.h

@@ -78,7 +78,7 @@ struct	Node
 	char	oldop;
 	char xcast;
 	char	class;
-	uint8_t	etype;
+	u8	etype;
 	char	complex;
 	char	addable;
 	char	scale;
@@ -102,7 +102,7 @@ struct	Sym
 	char	*name;
 	ushort	block;
 	ushort	sueblock;
-	uint8_t	class;
+	u8	class;
 	char	sym;
 	char	aused;
 	char	sig;
@@ -143,7 +143,7 @@ struct	Type
 	long	lineno;
 	schar	shift;
 	char	nbits;
-	uint8_t	etype;
+	u8	etype;
 	char	garb;
 };
 

+ 2 - 2
sys/include/complete.h

@@ -11,8 +11,8 @@
 typedef struct Completion Completion;
 
 struct Completion{
-	uint8_t advance;		/* whether forward progress has been made */
-	uint8_t complete;	/* whether the completion now represents a file or directory */
+	u8 advance;		/* whether forward progress has been made */
+	u8 complete;	/* whether the completion now represents a file or directory */
 	char *string;		/* the string to advance, suffixed " " or "/" for file or directory */
 	int nmatch;		/* number of files that matched */
 	int nfile;			/* number of files returned */

+ 106 - 106
sys/include/coreboot.h

@@ -33,22 +33,22 @@
 #define SYSINFO_MAX_GPIOS 8
 
 struct cbuint64 {
-	uint32_t lo;
-	uint32_t hi;
+	u32 lo;
+	u32 hi;
 };
 
 struct cb_header {
-	uint8_t signature[4];
-	uint32_t header_bytes;
-	uint32_t header_checksum;
-	uint32_t table_bytes;
-	uint32_t table_checksum;
-	uint32_t table_entries;
+	u8 signature[4];
+	u32 header_bytes;
+	u32 header_checksum;
+	u32 table_bytes;
+	u32 table_checksum;
+	u32 table_entries;
 };
 
 struct cb_record {
-	uint32_t tag;
-	uint32_t size;
+	u32 tag;
+	u32 size;
 };
 
 #define CB_TAG_UNUSED     0x0000
@@ -57,7 +57,7 @@ struct cb_record {
 struct cb_memory_range {
 	struct cbuint64 start;
 	struct cbuint64 size;
-	uint32_t type;
+	u32 type;
 };
 
 #define CB_MEM_RAM          1
@@ -69,27 +69,27 @@ struct cb_memory_range {
 #define CB_MEM_TABLE       16
 
 struct cb_memory {
-	uint32_t tag;
-	uint32_t size;
+	u32 tag;
+	u32 size;
 	struct cb_memory_range map[0];
 };
 
 #define CB_TAG_HWRPB      0x0002
 
 struct cb_hwrpb {
-	uint32_t tag;
-	uint32_t size;
-	uint64_t hwrpb;
+	u32 tag;
+	u32 size;
+	u64 hwrpb;
 };
 
 #define CB_TAG_MAINBOARD  0x0003
 
 struct cb_mainboard {
-	uint32_t tag;
-	uint32_t size;
-	uint8_t vendor_idx;
-	uint8_t part_number_idx;
-	uint8_t strings[0];
+	u32 tag;
+	u32 size;
+	u8 vendor_idx;
+	u8 part_number_idx;
+	u8 strings[0];
 };
 
 #define CB_TAG_VERSION        0x0004
@@ -104,29 +104,29 @@ struct cb_mainboard {
 #define CB_TAG_ASSEMBLER      0x000d
 
 struct cb_string {
-	uint32_t tag;
-	uint32_t size;
-	uint8_t string[0];
+	u32 tag;
+	u32 size;
+	u8 string[0];
 };
 
 #define CB_TAG_SERIAL         0x000f
 
 struct cb_serial {
-	uint32_t tag;
-	uint32_t size;
+	u32 tag;
+	u32 size;
 #define CB_SERIAL_TYPE_IO_MAPPED     1
 #define CB_SERIAL_TYPE_MEMORY_MAPPED 2
-	uint32_t type;
-	uint32_t baseaddr;
-	uint32_t baud;
+	u32 type;
+	u32 baseaddr;
+	u32 baud;
 };
 
 #define CB_TAG_CONSOLE       0x00010
 
 struct cb_console {
-	uint32_t tag;
-	uint32_t size;
-	uint16_t type;
+	u32 tag;
+	u32 size;
+	u16 type;
 };
 
 #define CB_TAG_CONSOLE_SERIAL8250 0
@@ -139,29 +139,29 @@ struct cb_console {
 #define CB_TAG_FORWARD       0x00011
 
 struct cb_forward {
-	uint32_t tag;
-	uint32_t size;
-	uint64_t forward;
+	u32 tag;
+	u32 size;
+	u64 forward;
 };
 
 #define CB_TAG_FRAMEBUFFER      0x0012
 struct cb_framebuffer {
-	uint32_t tag;
-	uint32_t size;
-
-	uint64_t physical_address;
-	uint32_t x_resolution;
-	uint32_t y_resolution;
-	uint32_t bytes_per_line;
-	uint8_t bits_per_pixel;
-        uint8_t red_mask_pos;
-	uint8_t red_mask_size;
-	uint8_t green_mask_pos;
-	uint8_t green_mask_size;
-	uint8_t blue_mask_pos;
-	uint8_t blue_mask_size;
-	uint8_t reserved_mask_pos;
-	uint8_t reserved_mask_size;
+	u32 tag;
+	u32 size;
+
+	u64 physical_address;
+	u32 x_resolution;
+	u32 y_resolution;
+	u32 bytes_per_line;
+	u8 bits_per_pixel;
+        u8 red_mask_pos;
+	u8 red_mask_size;
+	u8 green_mask_pos;
+	u8 green_mask_size;
+	u8 blue_mask_pos;
+	u8 blue_mask_size;
+	u8 reserved_mask_pos;
+	u8 reserved_mask_size;
 };
 
 #define CB_TAG_GPIO 0x0013
@@ -169,17 +169,17 @@ struct cb_framebuffer {
 #define CB_GPIO_ACTIVE_HIGH 1
 #define CB_GPIO_MAX_NAME_LENGTH 16
 struct cb_gpio {
-	uint32_t port;
-	uint32_t polarity;
-	uint32_t value;
-	uint8_t name[CB_GPIO_MAX_NAME_LENGTH];
+	u32 port;
+	u32 polarity;
+	u32 value;
+	u8 name[CB_GPIO_MAX_NAME_LENGTH];
 };
 
 struct cb_gpios {
-	uint32_t tag;
-	uint32_t size;
+	u32 tag;
+	u32 size;
 
-	uint32_t count;
+	u32 count;
 	struct cb_gpio gpios[0];
 };
 
@@ -188,10 +188,10 @@ struct cb_gpios {
 #define CB_TAG_VBOOT_HANDOFF	0x0020
 #define CB_TAG_DMA		0x0022
 struct cb_range {
-	uint32_t tag;
-	uint32_t size;
-	uint64_t range_start;
-	uint32_t range_size;
+	u32 tag;
+	u32 size;
+	u64 range_start;
+	u32 range_size;
 };
 
 #define CB_TAG_TIMESTAMPS	0x0016
@@ -199,86 +199,86 @@ struct cb_range {
 #define CB_TAG_MRC_CACHE	0x0018
 #define CB_TAG_ACPI_GNVS	0x0024
 struct cb_cbmem_tab {
-	uint32_t tag;
-	uint32_t size;
-	uint64_t cbmem_tab;
+	u32 tag;
+	u32 size;
+	u64 cbmem_tab;
 };
 
 #define CB_TAG_X86_ROM_MTRR	0x0021
 struct cb_x86_rom_mtrr {
-	uint32_t tag;
-	uint32_t size;
+	u32 tag;
+	u32 size;
 	/* The variable range MTRR index covering the ROM. If one wants to
 	 * enable caching the ROM, the variable MTRR needs to be set to
 	 * write-protect. To disable the caching after enabling set the
 	 * type to uncacheable. */
-	uint32_t index;
+	u32 index;
 };
 
 
 #define CB_TAG_CMOS_OPTION_TABLE 0x00c8
 struct cb_cmos_option_table {
-	uint32_t tag;
-	uint32_t size;
-	uint32_t header_length;
+	u32 tag;
+	u32 size;
+	u32 header_length;
 };
 
 #define CB_TAG_OPTION         0x00c9
 #define CB_CMOS_MAX_NAME_LENGTH    32
 struct cb_cmos_entries {
-	uint32_t tag;
-	uint32_t size;
-	uint32_t bit;
-	uint32_t length;
-	uint32_t config;
-	uint32_t config_id;
-	uint8_t name[CB_CMOS_MAX_NAME_LENGTH];
+	u32 tag;
+	u32 size;
+	u32 bit;
+	u32 length;
+	u32 config;
+	u32 config_id;
+	u8 name[CB_CMOS_MAX_NAME_LENGTH];
 };
 
 
 #define CB_TAG_OPTION_ENUM    0x00ca
 #define CB_CMOS_MAX_TEXT_LENGTH 32
 struct cb_cmos_enums {
-	uint32_t tag;
-	uint32_t size;
-	uint32_t config_id;
-	uint32_t value;
-	uint8_t text[CB_CMOS_MAX_TEXT_LENGTH];
+	u32 tag;
+	u32 size;
+	u32 config_id;
+	u32 value;
+	u8 text[CB_CMOS_MAX_TEXT_LENGTH];
 };
 
 #define CB_TAG_OPTION_DEFAULTS 0x00cb
 #define CB_CMOS_IMAGE_BUFFER_SIZE 128
 struct cb_cmos_defaults {
-	uint32_t tag;
-	uint32_t size;
-	uint32_t name_length;
-	uint8_t name[CB_CMOS_MAX_NAME_LENGTH];
-	uint8_t default_set[CB_CMOS_IMAGE_BUFFER_SIZE];
+	u32 tag;
+	u32 size;
+	u32 name_length;
+	u8 name[CB_CMOS_MAX_NAME_LENGTH];
+	u8 default_set[CB_CMOS_IMAGE_BUFFER_SIZE];
 };
 
 #define CB_TAG_OPTION_CHECKSUM 0x00cc
 #define CB_CHECKSUM_NONE	0
 #define CB_CHECKSUM_PCBIOS	1
 struct	cb_cmos_checksum {
-	uint32_t tag;
-	uint32_t size;
-	uint32_t range_start;
-	uint32_t range_end;
-	uint32_t location;
-	uint32_t type;
+	u32 tag;
+	u32 size;
+	u32 range_start;
+	u32 range_end;
+	u32 location;
+	u32 type;
 };
 
 unsigned short ipchksum(const void *vptr, unsigned long nbytes);
 /* Helpful inlines */
 
-static inline uint64_t cb_unpack64(struct cbuint64 val)
+static inline u64 cb_unpack64(struct cbuint64 val)
 {
-	return (((uint64_t) val.hi) << 32) | val.lo;
+	return (((u64) val.hi) << 32) | val.lo;
 }
 
-static inline uint16_t cb_checksum(const void *ptr, unsigned len)
+static inline u16 cb_checksum(const void *ptr, unsigned len)
 {
-	return ipchksum((uint8_t *)ptr, len);
+	return ipchksum((u8 *)ptr, len);
 }
 
 static inline const char *cb_mb_vendor_string(const struct cb_mainboard *cbm)
@@ -306,11 +306,11 @@ struct sysinfo_t {
 	} memrange[SYSINFO_MAX_MEM_RANGES];
 
 	struct cb_cmos_option_table *option_table;
-	uint32_t cmos_range_start;
-	uint32_t cmos_range_end;
-	uint32_t cmos_checksum_location;
-	uint32_t vbnv_start;
-	uint32_t vbnv_size;
+	u32 cmos_range_start;
+	u32 cmos_range_end;
+	u32 cmos_checksum_location;
+	u32 vbnv_start;
+	u32 vbnv_size;
 
 	char *version;
 	char *extra_version;
@@ -337,9 +337,9 @@ struct sysinfo_t {
 
 	/* these are chromeos specific and may or may not be valid. */
 	void	*vboot_handoff;
-	uint32_t	vboot_handoff_size;
+	u32	vboot_handoff_size;
 	void	*vdat_addr;
-	uint32_t	vdat_size;
+	u32	vdat_size;
 
 	void	*tstamp_table;
 	void	*cbmem_cons;
@@ -355,7 +355,7 @@ extern struct sysinfo_t lib_sysinfo;
 	(((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0]))
 
 #define MEM_RANGE_PTR(_rec, _idx) \
-	(void *)(((uint8_t *) (_rec)) + sizeof(*(_rec)) \
+	(void *)(((u8 *) (_rec)) + sizeof(*(_rec)) \
 		+ (sizeof((_rec)->map[0]) * (_idx)))
 
 int get_coreboot_info(struct sysinfo_t *info);

+ 2 - 2
sys/include/cursor.h

@@ -11,6 +11,6 @@
 struct	Cursor
 {
 	Point	offset;
-	uint8_t	clr[2*16];
-	uint8_t	set[2*16];
+	u8	clr[2*16];
+	u8	set[2*16];
 };

+ 6 - 6
sys/include/disk.h

@@ -25,8 +25,8 @@ enum {
 };
 
 char*	scsierror(int, int);
-int		scsicmd(Scsi*, uint8_t*, int, void*, int, int);
-int		scsi(Scsi*, uint8_t*, int, void*, int, int);
+int		scsicmd(Scsi*, u8*, int, void*, int, int);
+int		scsi(Scsi*, u8*, int, void*, int, int);
 Scsi*		openscsi(char*);
 void		closescsi(Scsi*);
 int		scsiready(Scsi*);
@@ -44,10 +44,10 @@ struct Disk {
 	int rdonly;
 	int type;
 
-	int64_t secs;
-	int64_t secsize;
-	int64_t size;
-	int64_t offset;	/* within larger disk, perhaps */
+	i64 secs;
+	i64 secsize;
+	i64 size;
+	i64 offset;	/* within larger disk, perhaps */
 	int width;	/* of disk size in bytes as decimal string */
 	int c;
 	int h;

+ 44 - 44
sys/include/draw.h

@@ -150,9 +150,9 @@ enum {
 	XBGR32	= CHAN4(CIgnore, 8, CBlue, 8, CGreen, 8, CRed, 8),
 };
 
-extern	char*	chantostr(char*, uint32_t);
-extern	uint32_t	strtochan(char*);
-extern	int		chantodepth(uint32_t);
+extern	char*	chantostr(char*, u32);
+extern	u32	strtochan(char*);
+extern	int		chantodepth(u32);
 
 struct	Point
 {
@@ -190,15 +190,15 @@ struct Display
 	char		*devdir;
 	char		*windir;
 	char		oldlabel[64];
-	uint32_t		dataqid;
+	u32		dataqid;
 	Image		*white;
 	Image		*black;
 	Image		*opaque;
 	Image		*transparent;
 	Image		*image;
-	uint8_t		*buf;
+	u8		*buf;
 	int		bufsize;
-	uint8_t		*bufp;
+	u8		*bufp;
 	Font		*defaultfont;
 	Subfont		*defaultsubfont;
 	Image		*windows;
@@ -213,7 +213,7 @@ struct Image
 	Rectangle	r;		/* rectangle in data area, local coords */
 	Rectangle 	clipr;		/* clipping region */
 	int		depth;		/* number of bits per pixel */
-	uint32_t		chan;
+	u32		chan;
 	int		repl;		/* flag: data replicates to tile clipr */
 	Screen		*screen;	/* 0 if not a window */
 	Image		*next;	/* next in list of windows */
@@ -221,9 +221,9 @@ struct Image
 
 struct RGB
 {
-	uint32_t	red;
-	uint32_t	green;
-	uint32_t	blue;
+	u32	red;
+	u32	green;
+	u32	blue;
 };
 
 /*
@@ -241,17 +241,17 @@ struct RGB
 struct	Fontchar
 {
 	int		x;		/* left edge of bits */
-	uint8_t		top;		/* first non-zero scan-line */
-	uint8_t		bottom;		/* last non-zero scan-line + 1 */
+	u8		top;		/* first non-zero scan-line */
+	u8		bottom;		/* last non-zero scan-line + 1 */
 	char		left;		/* offset of baseline */
-	uint8_t		width;		/* width of baseline */
+	u8		width;		/* width of baseline */
 };
 
 struct	Subfont
 {
 	char		*name;
-	int16_t		n;		/* number of chars in font */
-	uint8_t		height;		/* height of image */
+	i16		n;		/* number of chars in font */
+	u8		height;		/* height of image */
 	char		ascent;		/* top of image to baseline */
 	Fontchar 	*info;		/* n+1 character descriptors */
 	Image		*bits;		/* of font */
@@ -286,16 +286,16 @@ struct Cachefont
 
 struct Cacheinfo
 {
-	uint16_t		x;		/* left edge of bits */
-	uint8_t		width;		/* width of baseline */
-	int8_t		left;		/* offset of baseline */
+	u16		x;		/* left edge of bits */
+	u8		width;		/* width of baseline */
+	i8		left;		/* offset of baseline */
 	Rune		value;	/* value of character at this slot in cache */
-	uint16_t		age;
+	u16		age;
 };
 
 struct Cachesubf
 {
-	uint32_t		age;	/* for replacement */
+	u32		age;	/* for replacement */
 	Cachefont	*cf;	/* font info that owns us */
 	Subfont		*f;	/* attached subfont */
 };
@@ -304,11 +304,11 @@ struct Font
 {
 	char		*name;
 	Display		*display;
-	int16_t		height;	/* max height of image, interline spacing */
-	int16_t		ascent;	/* top of image to baseline */
-	int16_t		width;	/* widest so far; used in caching only */
-	int16_t		nsub;	/* number of subfonts */
-	uint32_t		age;	/* increasing counter; used for LRU */
+	i16		height;	/* max height of image, interline spacing */
+	i16		ascent;	/* top of image to baseline */
+	i16		width;	/* widest so far; used in caching only */
+	i16		nsub;	/* number of subfonts */
+	u32		age;	/* increasing counter; used for LRU */
 	int		maxdepth;	/* maximum depth of all loaded subfonts */
 	int		ncache;	/* size of cache */
 	int		nsubf;	/* size of subfont list */
@@ -329,11 +329,11 @@ extern int		mousescrollsize(int);
 /*
  * Image management
  */
-extern Image*	_allocimage(Image*, Display*, Rectangle, uint32_t, int,
-				 uint32_t, int, int);
-extern Image*	allocimage(Display*, Rectangle, uint32_t, int,
-				uint32_t);
-extern uint8_t*	bufimage(Display*, int);
+extern Image*	_allocimage(Image*, Display*, Rectangle, u32, int,
+				 u32, int, int);
+extern Image*	allocimage(Display*, Rectangle, u32, int,
+				u32);
+extern u8 *	bufimage(Display*, int);
 extern int	bytesperline(Rectangle, int);
 extern void	closedisplay(Display*);
 extern void	drawerror(Display*, char*);
@@ -346,36 +346,36 @@ extern int	initdraw(void(*)(Display*, char*), char*, char*);
 extern int	newwindow(char*);
 extern Display*	initdisplay(char*, char*,
 				   void(*)(Display*, char*));
-extern int	loadimage(Image*, Rectangle, uint8_t*, int);
-extern int	cloadimage(Image*, Rectangle, uint8_t*, int);
+extern int	loadimage(Image*, Rectangle, u8*, int);
+extern int	cloadimage(Image*, Rectangle, u8*, int);
 extern int	getwindow(Display*, int);
 extern int	gengetwindow(Display*, char*, Image**, Screen**, int);
 extern Image* readimage(Display*, int, int);
 extern Image* creadimage(Display*, int, int);
-extern int	unloadimage(Image*, Rectangle, uint8_t*, int);
+extern int	unloadimage(Image*, Rectangle, u8*, int);
 extern int	wordsperline(Rectangle, int);
 extern int	writeimage(int, Image*, int);
 extern Image*	namedimage(Display*, char*);
 extern int	nameimage(Image*, char*, int);
-extern Image* allocimagemix(Display*, uint32_t, uint32_t);
+extern Image* allocimagemix(Display*, u32, u32);
 
 /*
  * Colors
  */
 extern	void	readcolmap(Display*, RGB*);
 extern	void	writecolmap(Display*, RGB*);
-extern	uint32_t	setalpha(uint32_t, uint8_t);
+extern	u32	setalpha(u32, u8);
 
 /*
  * Windows
  */
 extern Screen*	allocscreen(Image*, Image*, int);
-extern Image*	_allocwindow(Image*, Screen*, Rectangle, int, uint32_t);
-extern Image*	allocwindow(Screen*, Rectangle, int, uint32_t);
+extern Image*	_allocwindow(Image*, Screen*, Rectangle, int, u32);
+extern Image*	allocwindow(Screen*, Rectangle, int, u32);
 extern void	bottomnwindows(Image**, int);
 extern void	bottomwindow(Image*);
 extern int	freescreen(Screen*);
-extern Screen*	publicscreen(Display*, int, uint32_t);
+extern Screen*	publicscreen(Display*, int, u32);
 extern void	topnwindows(Image**, int);
 extern void	topwindow(Image*);
 extern int	originwindow(Image*, Point, Point);
@@ -478,7 +478,7 @@ extern Font*	opendefaultfont(Display*);
 extern Font*	buildfont(Display*, char*, char*);
 extern void	freefont(Font*);
 extern Font*	mkfont(Subfont*, Rune);
-extern int	cachechars(Font*, char**, Rune**, uint16_t*, int,
+extern int	cachechars(Font*, char**, Rune**, u16*, int,
 			     int*,
 			     char**);
 extern void	agefont(Font*);
@@ -491,7 +491,7 @@ extern void	freesubfont(Subfont*);
 extern Subfont*	readsubfont(Display*, char*, int, int);
 extern Subfont*	readsubfonti(Display*, char*, int, Image*, int);
 extern int	writesubfont(int, Subfont*);
-extern void	_unpackinfo(Fontchar*, uint8_t*, int);
+extern void	_unpackinfo(Fontchar*, u8*, int);
 extern Point	stringsize(Font*, char*);
 extern int	stringwidth(Font*, char*);
 extern int	stringnwidth(Font*, char*, int);
@@ -505,12 +505,12 @@ extern Subfont*	_getsubfont(Display*, char*);
 extern Subfont*	getdefont(Display*);
 extern void		lockdisplay(Display*);
 extern void	unlockdisplay(Display*);
-extern int		drawlsetrefresh(uint32_t, int, void*, void*);
+extern int		drawlsetrefresh(u32, int, void*, void*);
 
 /*
  * Predefined
  */
-extern	uint8_t	defontdata[];
+extern	u8	defontdata[];
 extern	int		sizeofdefont;
 extern	Point		ZP;
 extern	Rectangle	ZR;
@@ -539,10 +539,10 @@ extern	void	_setdrawop(Display*, Drawop);
 #define	NMEM	1024		/* window size */
 #define	NDUMP	128		/* maximum length of dump */
 #define	NCBLOCK	6000		/* size of compressed blocks */
-extern	void	_twiddlecompressed(uint8_t*, int);
+extern	void	_twiddlecompressed(u8*, int);
 extern	int	_compblocksize(Rectangle, int);
 
 /* XXX backwards helps; should go */
 // extern	int		log2[];	/* was used by libmemlayer/line.c */
-extern	uint32_t	drawld2chan[];
+extern	u32	drawld2chan[];
 extern	void		drawsetdebug(int);

+ 53 - 53
sys/include/elf.h

@@ -11,82 +11,82 @@
  *	Definitions needed for accessing ELF headers
  */
 typedef struct {
-	uint8_t		ident[16];	/* ident bytes */
-	uint16_t	type;		/* file type */
-	uint16_t	machine;	/* target machine */
-	uint32_t	version;	/* file version */
-	uint64_t	elfentry;	/* start address */
-	uint64_t	phoff;		/* phdr file offset */
-	uint64_t	shoff;		/* shdr file offset */
-	uint32_t	flags;		/* file flags */
-	uint16_t	ehsize;		/* sizeof ehdr */
-	uint16_t	phentsize;	/* sizeof phdr */
-	uint16_t	phnum;		/* number phdrs */
-	uint16_t	shentsize;	/* sizeof shdr */
-	uint16_t	shnum;		/* number shdrs */
-	uint16_t	shstrndx;	/* shdr string index */
+	u8		ident[16];	/* ident bytes */
+	u16	type;		/* file type */
+	u16	machine;	/* target machine */
+	u32	version;	/* file version */
+	u64	elfentry;	/* start address */
+	u64	phoff;		/* phdr file offset */
+	u64	shoff;		/* shdr file offset */
+	u32	flags;		/* file flags */
+	u16	ehsize;		/* sizeof ehdr */
+	u16	phentsize;	/* sizeof phdr */
+	u16	phnum;		/* number phdrs */
+	u16	shentsize;	/* sizeof shdr */
+	u16	shnum;		/* number shdrs */
+	u16	shstrndx;	/* shdr string index */
 } E64hdr;
 
 typedef struct {
 	int		type;		/* entry type */
-	uint32_t	offset;		/* file offset */
-	uint32_t	vaddr;		/* virtual address */
-	uint32_t	paddr;		/* physical address */
+	u32	offset;		/* file offset */
+	u32	vaddr;		/* virtual address */
+	u32	paddr;		/* physical address */
 	int		filesz;		/* file size */
-	uint32_t	memsz;		/* memory size */
+	u32	memsz;		/* memory size */
 	int		flags;		/* entry flags */
 	int		align;		/* memory/file alignment */
 } Phdr;
 
 typedef struct {
-	uint32_t	type;		/* entry type */
-	uint32_t	flags;		/* entry flags */
-	uint64_t	offset;		/* file offset */
-	uint64_t	vaddr;		/* virtual address */
-	uint64_t	paddr;		/* physical address */
-	uint64_t	filesz;		/* file size */
-	uint64_t	memsz;		/* memory size */
-	uint64_t	align;		/* memory/file alignment */
+	u32	type;		/* entry type */
+	u32	flags;		/* entry flags */
+	u64	offset;		/* file offset */
+	u64	vaddr;		/* virtual address */
+	u64	paddr;		/* physical address */
+	u64	filesz;		/* file size */
+	u64	memsz;		/* memory size */
+	u64	align;		/* memory/file alignment */
 } P64hdr;
 
 typedef struct {
-	uint32_t	name;		/* section name */
-	uint32_t	type;		/* SHT_... */
-	uint32_t	flags;		/* SHF_... */
-	uint32_t	addr;		/* virtual address */
-	uint32_t	offset;		/* file offset */
-	uint32_t	size;		/* section size */
-	uint32_t	link;		/* misc info */
-	uint32_t	info;		/* misc info */
-	uint32_t	addralign;	/* memory alignment */
-	uint32_t	entsize;	/* entry size if table */
+	u32	name;		/* section name */
+	u32	type;		/* SHT_... */
+	u32	flags;		/* SHF_... */
+	u32	addr;		/* virtual address */
+	u32	offset;		/* file offset */
+	u32	size;		/* section size */
+	u32	link;		/* misc info */
+	u32	info;		/* misc info */
+	u32	addralign;	/* memory alignment */
+	u32	entsize;	/* entry size if table */
 } Shdr;
 
 typedef struct {
-	uint32_t	name;		/* section name */
-	uint32_t	type;		/* SHT_... */
-	uint64_t	flags;		/* SHF_... */
-	uint64_t	addr;		/* virtual address */
-	uint64_t	offset;		/* file offset */
-	uint64_t	size;		/* section size */
-	uint32_t	link;		/* misc info */
-	uint32_t	info;		/* misc info */
-	uint64_t	addralign;	/* memory alignment */
-	uint64_t	entsize;	/* entry size if table */
+	u32	name;		/* section name */
+	u32	type;		/* SHT_... */
+	u64	flags;		/* SHF_... */
+	u64	addr;		/* virtual address */
+	u64	offset;		/* file offset */
+	u64	size;		/* section size */
+	u32	link;		/* misc info */
+	u32	info;		/* misc info */
+	u64	addralign;	/* memory alignment */
+	u64	entsize;	/* entry size if table */
 } S64hdr;
 
 typedef struct {
-	uint32_t	st_name;	/* Symbol name */
-	uint8_t		st_info;	/* Type and Binding attributes */
-	uint8_t		st_other;	/* Reserved */
-	uint16_t	st_shndx;	/* Section table index */
-	uint64_t	st_value;	/* Symbol value */
-	uint64_t	st_size;	/* Size of object (e.g., common) */
+	u32	st_name;	/* Symbol name */
+	u8		st_info;	/* Type and Binding attributes */
+	u8		st_other;	/* Reserved */
+	u16	st_shndx;	/* Section table index */
+	u64	st_value;	/* Symbol value */
+	u64	st_size;	/* Size of object (e.g., common) */
 } E64Sym;
 
 
 typedef struct Sym {
-	int64_t		value;
+	i64		value;
 	uint		sig;
 	char		type;
 	char		*name;

+ 10 - 10
sys/include/event.h

@@ -28,7 +28,7 @@ struct	Mouse
 {
 	int	buttons;	/* bit array: LMR=124 */
 	Point	xy;
-	uint32_t	msec;
+	u32	msec;
 };
 
 struct	Event
@@ -37,7 +37,7 @@ struct	Event
 	Mouse	mouse;
 	int	n;		/* number of characters in message */
 	void	*v;		/* data unpacked by general event-handling function */
-	uint8_t	data[EMAXMSG];	/* message from an arbitrary file descriptor */
+	u8	data[EMAXMSG];	/* message from an arbitrary file descriptor */
 };
 
 struct Menu
@@ -50,16 +50,16 @@ struct Menu
 /*
  * Events
  */
-extern void	 einit(uint32_t);
-extern uint32_t	 estart(uint32_t, int, int);
-extern uint32_t	 estartfn(uint32_t, int, int,
-				 int (*fn)(int, Event*, uint8_t*, int));
-extern uint32_t	 etimer(uint32_t, int);
-extern uint32_t	 event(Event*);
-extern uint32_t	 eread(uint32_t, Event*);
+extern void	 einit(u32);
+extern u32	 estart(u32, int, int);
+extern u32	 estartfn(u32, int, int,
+				 int (*fn)(int, Event*, u8*, int));
+extern u32	 etimer(u32, int);
+extern u32	 event(Event*);
+extern u32	 eread(u32, Event*);
 extern Mouse	 emouse(void);
 extern int	 ekbd(void);
-extern int	 ecanread(uint32_t);
+extern int	 ecanread(u32);
 extern int	 ecanmouse(void);
 extern int	 ecankbd(void);
 extern void	 eresized(int);	/* supplied by user */

+ 26 - 26
sys/include/fcall.h

@@ -15,16 +15,16 @@
 typedef
 struct	Fcall
 {
-	uint8_t	type;
-	uint32_t	fid;
-	uint16_t	tag;
+	u8	type;
+	u32	fid;
+	u16	tag;
 	union {
 		struct {
-			uint32_t	msize;		/* Tversion, Rversion */
+			u32	msize;		/* Tversion, Rversion */
 			char	*version;	/* Tversion, Rversion */
 		};
 		struct {
-			uint16_t	oldtag;		/* Tflush */
+			u16	oldtag;		/* Tflush */
 		};
 		struct {
 			char	*ename;		/* Rerror */
@@ -34,38 +34,38 @@ struct	Fcall
 		};
 		struct {
 			Qid	qid;		/* Rattach, Ropen, Rcreate */
-			uint32_t	iounit;		/* Ropen, Rcreate */
+			u32	iounit;		/* Ropen, Rcreate */
 		};
 		struct {
 			Qid	aqid;		/* Rauth */
 		};
 		struct {
-			uint32_t	afid;		/* Tauth, Tattach */
+			u32	afid;		/* Tauth, Tattach */
 			char	*uname;		/* Tauth, Tattach */
 			char	*aname;		/* Tauth, Tattach */
 		};
 		struct {
-			uint32_t	perm;		/* Tcreate */ 
+			u32	perm;		/* Tcreate */ 
 			char	*name;		/* Tcreate */
-			uint8_t	mode;		/* Tcreate, Topen */
+			u8	mode;		/* Tcreate, Topen */
 		};
 		struct {
-			uint32_t	newfid;		/* Twalk */
-			uint16_t	nwname;		/* Twalk */
+			u32	newfid;		/* Twalk */
+			u16	nwname;		/* Twalk */
 			char	*wname[MAXWELEM];	/* Twalk */
 		};
 		struct {
-			uint16_t	nwqid;		/* Rwalk */
+			u16	nwqid;		/* Rwalk */
 			Qid	wqid[MAXWELEM];		/* Rwalk */
 		};
 		struct {
-			int64_t	offset;		/* Tread, Twrite */
-			uint32_t	count;		/* Tread, Twrite, Rread */
+			i64	offset;		/* Tread, Twrite */
+			u32	count;		/* Tread, Twrite, Rread */
 			char	*data;		/* Twrite, Rread */
 		};
 		struct {
-			uint16_t	nstat;		/* Twstat, Rstat */
-			uint8_t	*stat;		/* Twstat, Rstat */
+			u16	nstat;		/* Twstat, Rstat */
+			u8	*stat;		/* Twstat, Rstat */
 		};
 	};
 } Fcall;
@@ -74,8 +74,8 @@ struct	Fcall
 #define	GBIT8(p)	((p)[0])
 #define	GBIT16(p)	((p)[0]|((p)[1]<<8))
 #define	GBIT32(p)	((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24))
-#define	GBIT64(p)	((uint32_t)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
-				((int64_t)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
+#define	GBIT64(p)	((u32)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
+				((i64)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
 
 #define	PBIT8(p,v)	(p)[0]=(v)
 #define	PBIT16(p,v)	(p)[0]=(v);(p)[1]=(v)>>8
@@ -93,8 +93,8 @@ struct	Fcall
 /* The count, however, excludes itself; total size is BIT16SZ+count */
 #define STATFIXLEN	(BIT16SZ+QIDSZ+5*BIT16SZ+4*BIT32SZ+1*BIT64SZ)	/* amount of fixed length data in a stat buffer */
 
-#define	NOTAG		(uint16_t)~0U	/* Dummy tag */
-#define	NOFID		(uint32_t)~0U	/* Dummy fid */
+#define	NOTAG		(u16)~0U	/* Dummy tag */
+#define	NOFID		(u32)~0U	/* Dummy fid */
 #define	IOHDRSZ		24	/* ample room for Twrite/Rread header (iounit) */
 
 // 9P2000.L, for some reason, lets callers closely tune what comes from a gettattr.
@@ -167,14 +167,14 @@ enum
 	Rreaddir
 };
 
-uint	convM2S(uint8_t*, uint, Fcall*);
-uint	convS2M(Fcall*, uint8_t*, uint);
+uint	convM2S(u8*, uint, Fcall*);
+uint	convS2M(Fcall*, u8*, uint);
 uint	sizeS2M(Fcall*);
 
-int	statcheck(uint8_t *abuf, uint nbuf);
-uint	convM2D(uint8_t*, uint, Dir*, char*);
-uint	convLM2D(uint8_t*, uint, Dir*);
-uint	convD2M(Dir*, uint8_t*, uint);
+int	statcheck(u8 *abuf, uint nbuf);
+uint	convM2D(u8*, uint, Dir*, char*);
+uint	convLM2D(u8*, uint, Dir*);
+uint	convD2M(Dir*, u8*, uint);
 uint	sizeD2M(Dir*);
 
 int	fcallfmt(Fmt*);

+ 7 - 7
sys/include/flate.h

@@ -29,21 +29,21 @@ int	deflate(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, voi
 int	inflateinit(void);
 int	inflate(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
 
-int	inflateblock(uint8_t *dst, int dsize, uint8_t *src, int ssize);
-int	deflateblock(uint8_t *dst, int dsize, uint8_t *src, int ssize,
+int	inflateblock(u8 *dst, int dsize, u8 *src, int ssize);
+int	deflateblock(u8 *dst, int dsize, u8 *src, int ssize,
 			int level, int debug);
 
 int	deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
 int	inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
 
-int	inflatezlibblock(uint8_t *dst, int dsize, uint8_t *src,
+int	inflatezlibblock(u8 *dst, int dsize, u8 *src,
 			    int ssize);
-int	deflatezlibblock(uint8_t *dst, int dsize, uint8_t *src,
+int	deflatezlibblock(u8 *dst, int dsize, u8 *src,
 			    int ssize, int level, int debug);
 
 char	*flateerr(int err);
 
-uint32_t	*mkcrctab(uint32_t);
-uint32_t	blockcrc(uint32_t *tab, uint32_t crc, void *buf, int n);
+u32	*mkcrctab(u32);
+u32	blockcrc(u32 *tab, u32 crc, void *buf, int n);
 
-uint32_t	adler32(uint32_t adler, void *buf, int n);
+u32	adler32(u32 adler, void *buf, int n);

+ 23 - 23
sys/include/frame.h

@@ -24,13 +24,13 @@ enum{
 
 struct Frbox
 {
-	int32_t		wid;		/* in pixels */
-	int32_t		nrune;		/* <0 ==> negate and treat as break char */
+	i32		wid;		/* in pixels */
+	i32		nrune;		/* <0 ==> negate and treat as break char */
 	union{
-		uint8_t	*ptr;
+		u8	*ptr;
 		struct{
-			int16_t	bc;	/* break char */
-			int16_t	minwid;
+			i16	bc;	/* break char */
+			i16	minwid;
 		};
 	};
 };
@@ -45,32 +45,32 @@ struct Frame
 	Rectangle	entire;		/* of full frame */
 	void			(*scroll)(Frame*, int);	/* scroll function provided by application */
 	Frbox		*box;
-	uint32_t		p0, p1;		/* selection */
-	uint16_t		nbox, nalloc;
-	uint16_t		maxtab;		/* max size of tab, in pixels */
-	uint16_t		nchars;		/* # runes in frame */
-	uint16_t		nlines;		/* # lines with text */
-	uint16_t		maxlines;	/* total # lines in frame */
-	uint16_t		lastlinefull;	/* last line fills frame */
-	uint16_t		modified;	/* changed since frselect() */
+	u32		p0, p1;		/* selection */
+	u16		nbox, nalloc;
+	u16		maxtab;		/* max size of tab, in pixels */
+	u16		nchars;		/* # runes in frame */
+	u16		nlines;		/* # lines with text */
+	u16		maxlines;	/* total # lines in frame */
+	u16		lastlinefull;	/* last line fills frame */
+	u16		modified;	/* changed since frselect() */
 	Image		*tick;	/* typing tick */
 	Image		*tickback;	/* saved image under tick */
 	int			ticked;	/* flag: is tick onscreen? */
 };
 
-uint32_t	frcharofpt(Frame*, Point);
-Point	frptofchar(Frame*, uint32_t);
-int	frdelete(Frame*, uint32_t, uint32_t);
-void	frinsert(Frame*, Rune*, Rune*, uint32_t);
+u32	frcharofpt(Frame*, Point);
+Point	frptofchar(Frame*, u32);
+int	frdelete(Frame*, u32, u32);
+void	frinsert(Frame*, Rune*, Rune*, u32);
 void	frselect(Frame*, Mousectl*);
 void	frselectpaint(Frame*, Point, Point, Image*);
-void	frdrawsel(Frame*, Point, uint32_t, uint32_t, int);
-Point frdrawsel0(Frame*, Point, uint32_t, uint32_t, Image*, Image*);
+void	frdrawsel(Frame*, Point, u32, u32, int);
+Point frdrawsel0(Frame*, Point, u32, u32, Image*, Image*);
 void	frinit(Frame*, Rectangle, Font*, Image*, Image**);
 void	frsetrects(Frame*, Rectangle, Image*);
 void	frclear(Frame*, int);
 
-uint8_t	*_frallocstr(Frame*, unsigned);
+u8	*_frallocstr(Frame*, unsigned);
 void	_frinsure(Frame*, int, unsigned);
 Point	_frdraw(Frame*, Point);
 void	_frgrowbox(Frame*, int);
@@ -78,7 +78,7 @@ void	_frfreebox(Frame*, int, int);
 void	_frmergebox(Frame*, int);
 void	_frdelbox(Frame*, int, int);
 void	_frsplitbox(Frame*, int, int);
-int	_frfindbox(Frame*, int, uint32_t, uint32_t);
+int	_frfindbox(Frame*, int, u32, u32);
 void	_frclosebox(Frame*, int, int);
 int	_frcanfit(Frame*, Point, Frbox*);
 void	_frcklinewrap(Frame*, Point*, Frbox*);
@@ -89,8 +89,8 @@ int	_frnewwid0(Frame*, Point, Frbox*);
 void	_frclean(Frame*, Point, int, int);
 void	_frdrawtext(Frame*, Point, Image*, Image*);
 void	_fraddbox(Frame*, int, int);
-Point	_frptofcharptb(Frame*, uint32_t, Point, int);
-Point	_frptofcharnb(Frame*, uint32_t, int);
+Point	_frptofcharptb(Frame*, u32, Point, int);
+Point	_frptofcharnb(Frame*, u32, int);
 int	_frstrlen(Frame*, int);
 void	frtick(Frame*, Point, int);
 void	frinittick(Frame*);

+ 5 - 5
sys/include/hashmap.h

@@ -4,8 +4,8 @@ typedef struct Hashtable Hashtable;
 typedef struct Hashmap Hashmap;
 
 struct Hashentry {
-	uint64_t key;
-	uint64_t val;
+	u64 key;
+	u64 val;
 };
 
 struct Hashtable {
@@ -22,7 +22,7 @@ struct Hashmap {
 
 int hmapinit(Hashmap *ht);
 int hmapfree(Hashmap *ht);
-int hmapdel(Hashmap *ht, uint64_t key, uint64_t *valp);
-int hmapget(Hashmap *ht, uint64_t key, uint64_t *valp);
-int hmapput(Hashmap *ht, uint64_t key, uint64_t val);
+int hmapdel(Hashmap *ht, u64 key, u64 *valp);
+int hmapget(Hashmap *ht, u64 key, u64 *valp);
+int hmapput(Hashmap *ht, u64 key, u64 val);
 int hmapstats(Hashmap *ht, size_t *lens, size_t nlens);

+ 21 - 21
sys/include/html.h

@@ -9,8 +9,8 @@
 
 
 /* UTILS */
-extern uint8_t*	fromStr(Rune* buf, int n, int chset);
-extern Rune*	toStr(uint8_t* buf, int n, int chset);
+extern u8 *	fromStr(Rune* buf, int n, int chset);
+extern Rune*	toStr(u8 * buf, int n, int chset);
 
 /* Common LEX and BUILD enums */
 
@@ -130,8 +130,8 @@ enum {
 
 struct Align
 {
-	uint8_t	halign;		/* one of ALnone, ALleft, etc. */
-	uint8_t	valign;		/* one of ALnone, ALtop, etc. */
+	u8	halign;		/* one of ALnone, ALleft, etc. */
+	u8	valign;		/* one of ALnone, ALtop, etc. */
 };
 
 /*
@@ -202,15 +202,15 @@ struct Itext
 	Rune*	s;		/* the characters */
 	int	fnt;		/* style*NumSize+size (see font stuff, below) */
 	int	fg;		/* Pixel (color) for text */
-	uint8_t	voff; /* Voffbias+vertical offset from baseline, in pixels (+ve == down) */
-	uint8_t	ul;		/* ULnone, ULunder, or ULmid */
+	u8	voff; /* Voffbias+vertical offset from baseline, in pixels (+ve == down) */
+	u8	ul;		/* ULnone, ULunder, or ULmid */
 };
 
 struct Irule
 {
 	Item;			/* (with tag ==Iruletag) */
-	uint8_t	align;		/* alignment spec */
-	uint8_t	noshade;	/* if true, don't shade */
+	u8	align;		/* alignment spec */
+	u8	noshade;	/* if true, don't shade */
 	int	size;		/* size attr (rule height) */
 	int	color;		/* color attr */
 	Dimen	wspec;		/* width spec */
@@ -226,10 +226,10 @@ struct Iimage
 	Rune*	altrep;		/* alternate representation, in absence of image */
 	Map*	map;		/* if non-nil, client side map */
 	int	ctlid;		/* if animated */
-	uint8_t	align;		/* vertical alignment */
-	uint8_t	hspace;		/* in pixels; buffer space on each side */
-	uint8_t	vspace;		/* in pixels; buffer space on top and bottom */
-	uint8_t	border;		/* in pixels: border width to draw around image */
+	u8	align;		/* vertical alignment */
+	u8	hspace;		/* in pixels; buffer space on each side */
+	u8	vspace;		/* in pixels; buffer space on top and bottom */
+	u8	border;		/* in pixels: border width to draw around image */
 	Iimage*	nextimage;	/* next in list of document's images */
 	void*	aux;
 };
@@ -256,8 +256,8 @@ struct Ifloat
 	Item*	item;		/* table or image item that floats */
 	int	x;		/* x coord of top (from right, if ALright) */
 	int	y;		/* y coord of top */
-	uint8_t	side;		/* margin it floats to: ALleft or ALright */
-	uint8_t	infloats;	/* true if this has been added to a lay.floats */
+	u8	side;		/* margin it floats to: ALleft or ALright */
+	u8	infloats;	/* true if this has been added to a lay.floats */
 	Ifloat*	nextfloat;	/* in list of floats */
 };
 
@@ -351,7 +351,7 @@ struct Formfield
 	int	maxlength;	/* maxlength attr */
 	int	rows;		/* rows attr */
 	int	cols;		/* cols attr */
-	uint8_t	flags;		/* FFchecked, etc. */
+	u8	flags;		/* FFchecked, etc. */
 	Option*	options;	/* for Fselect fields */
 	Item*	image;		/* image item, for Fimage fields */
 	int	ctlid;		/* identifies control for this field in layout */
@@ -412,14 +412,14 @@ struct Table
 	int	cellpadding;	/* cellpadding attr */
 	Background background;	/* table background */
 	Item*	caption;	/* linked list of Items, giving caption */
-	uint8_t	caption_place;	/* ALtop or ALbottom */
+	u8	caption_place;	/* ALtop or ALbottom */
 	Lay*	caption_lay;	/* layout of caption */
 	int	totw;		/* total width */
 	int	toth;		/* total height */
 	int	caph;		/* caption height */
 	int	availw;		/* used for previous 3 sizes */
 	Token*	tabletok;	/* token that started the table */
-	uint8_t	flags;		/* Lchanged, perhaps */
+	u8	flags;		/* Lchanged, perhaps */
 };
 
 
@@ -440,7 +440,7 @@ struct Tablerow
 	Align	align;
 	Background background;
 	Point	pos;
-	uint8_t	flags;		/* 0 or TFparsing */
+	u8	flags;		/* 0 or TFparsing */
 };
 
 /*
@@ -460,7 +460,7 @@ struct Tablecell
 	int	rowspan;	/* number of rows spanned by this cell */
 	int	colspan;	/* number of cols spanned by this cell */
 	Align	align;		/* alignment spec */
-	uint8_t	flags;		/* TFparsing, TFnowrap, TFisth */
+	u8	flags;		/* TFparsing, TFnowrap, TFisth */
 	Dimen	wspec;		/* suggested width */
 	int	hspec;		/* suggested height */
 	Background background;	/* cell background */
@@ -617,7 +617,7 @@ extern int	dimenkind(Dimen d);
 extern int	dimenspec(Dimen d);
 extern void	freedocinfo(Docinfo* d);
 extern void	freeitems(Item* ithead);
-extern Item*	parsehtml(uint8_t* data, int datalen, Rune* src,
+extern Item*	parsehtml(u8 * data, int datalen, Rune* src,
 			      int mtype, int chset, Docinfo** pdi);
 extern void	printitems(Item* items, char* msg);
 extern int	targetid(Rune* s);
@@ -636,4 +636,4 @@ extern int	dbgbuild;
  * emalloc should zero its memory.
  */
 extern void*	emalloc(unsigned long);
-extern void*	erealloc(void* p, uint32_t size);
+extern void*	erealloc(void* p, u32 size);

+ 24 - 24
sys/include/httpd.h

@@ -100,8 +100,8 @@ struct HSPairs
 struct HRange
 {
 	int		suffix;			/* is this a suffix request? */
-	uint32_t		start;
-	uint32_t		stop;			/* ~0UL -> not given */
+	u32		start;
+	u32		stop;			/* ~0UL -> not given */
 	HRange		*next;
 };
 
@@ -134,14 +134,14 @@ enum
 struct Hio {
 	Hio		*hh; /* next lower layer Hio, or nil if reads from fd */
 	int		fd;		/* associated file descriptor */
-	uint32_t		seek;		/* of start */
-	uint8_t		state;		/* state of the file */
-	uint8_t		xferenc;	/* chunked transfer encoding state */
-	uint8_t		*pos;		/* current position in the buffer */
-	uint8_t		*stop;		/* last character active in the buffer */
-	uint8_t		*start;		/* start of data buffer */
-	uint32_t		bodylen;	/* remaining length of message body */
-	uint8_t		buf[Hsize+32];
+	u32		seek;		/* of start */
+	u8		state;		/* state of the file */
+	u8		xferenc;	/* chunked transfer encoding state */
+	u8		*pos;		/* current position in the buffer */
+	u8		*stop;		/* last character active in the buffer */
+	u8		*start;		/* start of data buffer */
+	u32		bodylen;	/* remaining length of message body */
+	u8		buf[Hsize+32];
 };
 
 /*
@@ -164,11 +164,11 @@ struct HttpReq
 struct HttpHead
 {
 	int	closeit;	/* http1.1 close connection after this request? */
-	uint8_t	persist;	/* http/1.1 requests a persistent connection */
+	u8	persist;	/* http/1.1 requests a persistent connection */
 
-	uint8_t	expectcont;	/* expect a 100-continue */
-	uint8_t	expectother; /* expect anything else; should reject with ExpectFail */
-	uint32_t	contlen;	/* if != ~0UL, length of included message body */
+	u8	expectcont;	/* expect a 100-continue */
+	u8	expectother; /* expect anything else; should reject with ExpectFail */
+	u32	contlen;	/* if != ~0UL, length of included message body */
 	HFields	*transenc;  /* if present, encoding of included message body */
 	char	*client;
 	char	*host;
@@ -176,9 +176,9 @@ struct HttpHead
 	HContent *oklang;
 	HContent *oktype;
 	HContent *okchar;
-	uint32_t	ifmodsince;
-	uint32_t	ifunmodsince;
-	uint32_t	ifrangedate;
+	u32	ifmodsince;
+	u32	ifunmodsince;
+	u32	ifrangedate;
 	HETag	*ifmatch;
 	HETag	*ifnomatch;
 	HETag	*ifrangeetag;
@@ -211,11 +211,11 @@ struct HConnect
 
 	Bin	*bin;
 
-	uint32_t	reqtime;		/* time at start of request */
+	u32	reqtime;		/* time at start of request */
 	char	xferbuf[HBufSize]; /* buffer for making up or transferring data */
-	uint8_t	header[HBufSize + 2];	/* room for \n\0 */
-	uint8_t	*hpos;
-	uint8_t	*hstop;
+	u8	header[HBufSize + 2];	/* room for \n\0 */
+	u8	*hpos;
+	u8	*hstop;
 	Hio	hin;
 	Hio	hout;
 };
@@ -230,12 +230,12 @@ extern	Htmlesc		htmlesc[];
 /*
  * .+2,/^$/ | sort -bd +1
  */
-void			*halloc(HConnect *c, uint32_t size);
-Hio			*hbodypush(Hio *hh, uint32_t len, HFields *te);
+void			*halloc(HConnect *c, u32 size);
+Hio			*hbodypush(Hio *hh, u32 len, HFields *te);
 int			hbuflen(Hio *h, void *p);
 int			hcheckcontent(HContent*, HContent*, char*, int);
 void			hclose(Hio*);
-uint32_t			hdate2sec(char*);
+u32			hdate2sec(char*);
 int			hdatefmt(Fmt*);
 int			hfail(HConnect*, int, ...);
 int			hflush(Hio*);

+ 53 - 53
sys/include/ip.h

@@ -34,11 +34,11 @@ struct Iplifc
 	Iplifc	*next;
 
 	/* per address on the ip interface */
-	uint8_t	ip[IPaddrlen];
-	uint8_t	mask[IPaddrlen];
-	uint8_t	net[IPaddrlen];		/* ip & mask */
-	uint32_t	preflt;			/* preferred lifetime */
-	uint32_t	validlt;		/* valid lifetime */
+	u8	ip[IPaddrlen];
+	u8	mask[IPaddrlen];
+	u8	net[IPaddrlen];		/* ip & mask */
+	u32	preflt;			/* preferred lifetime */
+	u32	validlt;		/* valid lifetime */
 };
 
 /* default values, one per stack */
@@ -64,13 +64,13 @@ struct Ipifc
 	/* per ip interface */
 	int	index;			/* number of interface in ipifc dir */
 	char	dev[64];
-	uint8_t	sendra6;		/* on == send router adv */
-	uint8_t	recvra6;		/* on == rcv router adv */
+	u8	sendra6;		/* on == send router adv */
+	u8	recvra6;		/* on == rcv router adv */
 	int	mtu;
-	uint32_t	pktin;
-	uint32_t	pktout;
-	uint32_t	errin;
-	uint32_t	errout;
+	u32	pktin;
+	u32	pktout;
+	u32	errin;
+	u32	errout;
 	Ipv6rp	rp;
 };
 
@@ -126,13 +126,13 @@ enum {
 /* V6 header on the wire */
 typedef struct Ip6hdr Ip6hdr;
 struct Ip6hdr {
-	uint8_t	vcf[4];		/* version:4, traffic class:8, flow label:20 */
-	uint8_t	ploadlen[2];	/* payload length: packet length - 40 */
-	uint8_t	proto;		/* next header type */
-	uint8_t	ttl;		/* hop limit */
-	uint8_t	src[IPaddrlen];	/* source address */
-	uint8_t	dst[IPaddrlen];	/* destination address */
-	uint8_t	payload[];
+	u8	vcf[4];		/* version:4, traffic class:8, flow label:20 */
+	u8	ploadlen[2];	/* payload length: packet length - 40 */
+	u8	proto;		/* next header type */
+	u8	ttl;		/* hop limit */
+	u8	src[IPaddrlen];	/* source address */
+	u8	dst[IPaddrlen];	/* destination address */
+	u8	payload[];
 };
 
 /*
@@ -140,9 +140,9 @@ struct Ip6hdr {
  */
 typedef struct Icmp6hdr Icmp6hdr;
 struct Icmp6hdr {
-	uint8_t	_0_[8];
-	uint8_t	laddr[IPaddrlen];	/* local address */
-	uint8_t	raddr[IPaddrlen];	/* remote address */
+	u8	_0_[8];
+	u8	laddr[IPaddrlen];	/* local address */
+	u8	raddr[IPaddrlen];	/* remote address */
 };
 
 /*
@@ -156,50 +156,50 @@ enum
 typedef struct Udphdr Udphdr;
 struct Udphdr
 {
-	uint8_t	raddr[IPaddrlen];	/* V6 remote address */
-	uint8_t	laddr[IPaddrlen];	/* V6 local address */
-	uint8_t	ifcaddr[IPaddrlen];	/* V6 ifc addr msg was received on */
-	uint8_t	rport[2];		/* remote port */
-	uint8_t	lport[2];		/* local port */
+	u8	raddr[IPaddrlen];	/* V6 remote address */
+	u8	laddr[IPaddrlen];	/* V6 local address */
+	u8	ifcaddr[IPaddrlen];	/* V6 ifc addr msg was received on */
+	u8	rport[2];		/* remote port */
+	u8	lport[2];		/* local port */
 };
 
-uint8_t*	defmask(uint8_t*);
-void	maskip(uint8_t*, uint8_t*, uint8_t*);
+u8 *	defmask(u8*);
+void	maskip(u8*, u8*, u8*);
 int	eipfmt(Fmt*);
-int	isv4(uint8_t*);
-int64_t	parseip(uint8_t*, char*);
-int64_t	parseipmask(uint8_t*, char*);
-char*	v4parseip(uint8_t*, char*);
-char*	v4parsecidr(uint8_t*, uint8_t*, char*);
-int	parseether(uint8_t*, char*);
-int	myipaddr(uint8_t*, char*);
-int	myetheraddr(uint8_t*, char*);
-int	equivip4(uint8_t*, uint8_t*);
-int	equivip6(uint8_t*, uint8_t*);
+int	isv4(u8*);
+i64	parseip(u8*, char*);
+i64	parseipmask(u8*, char*);
+char*	v4parseip(u8*, char*);
+char*	v4parsecidr(u8*, u8*, char*);
+int	parseether(u8*, char*);
+int	myipaddr(u8*, char*);
+int	myetheraddr(u8*, char*);
+int	equivip4(u8*, u8*);
+int	equivip6(u8*, u8*);
 
 Ipifc*	readipifc(char*, Ipifc*, int);
 
-void	hnputv(void*, uint64_t);
+void	hnputv(void*, u64);
 void	hnputl(void*, uint);
-void	hnputs(void*, uint16_t);
-uint64_t	nhgetv(void*);
+void	hnputs(void*, u16);
+u64	nhgetv(void*);
 uint	nhgetl(void*);
-uint16_t	nhgets(void*);
-uint16_t	ptclbsum(uint8_t*, int);
+u16	nhgets(void*);
+u16	ptclbsum(u8*, int);
 
-int	v6tov4(uint8_t*, uint8_t*);
-void	v4tov6(uint8_t*, uint8_t*);
+int	v6tov4(u8*, u8*);
+void	v4tov6(u8*, u8*);
 
 #define	ipcmp(x, y) memcmp(x, y, IPaddrlen)
 #define	ipmove(x, y) memmove(x, y, IPaddrlen)
 
-extern uint8_t IPv4bcast[IPaddrlen];
-extern uint8_t IPv4bcastobs[IPaddrlen];
-extern uint8_t IPv4allsys[IPaddrlen];
-extern uint8_t IPv4allrouter[IPaddrlen];
-extern uint8_t IPnoaddr[IPaddrlen];
-extern uint8_t v4prefix[IPaddrlen];
-extern uint8_t IPallbits[IPaddrlen];
+extern u8 IPv4bcast[IPaddrlen];
+extern u8 IPv4bcastobs[IPaddrlen];
+extern u8 IPv4allsys[IPaddrlen];
+extern u8 IPv4allrouter[IPaddrlen];
+extern u8 IPnoaddr[IPaddrlen];
+extern u8 v4prefix[IPaddrlen];
+extern u8 IPallbits[IPaddrlen];
 
-#define CLASS(p) ((*(uint8_t*)(p))>>6)
+#define CLASS(p) ((*(u8*)(p))>>6)
 

+ 24 - 24
sys/include/jay.h

@@ -14,38 +14,38 @@ enum wtype{
 
 struct Jayconfig{
 	// Task Panel Config
-	uint32_t taskPanelColor;
+	u32 taskPanelColor;
 
 	// Main Menu Config
-	uint32_t mainMenuColor;
-	uint32_t mainMenuHooverColor;
+	u32 mainMenuColor;
+	u32 mainMenuHooverColor;
 
 	// Window Config
-	uint32_t windowTitleColor;
-	uint32_t windowTitleFontColor;
-	uint32_t windowBackgroundColor;
-	uint32_t windowInTopBorder;
-	uint32_t windowInBottomBorder;
-	uint32_t windowSelectedColor;
-	uint32_t windowScrollBarFrontColor;
-	uint32_t windowTextCursorColor;
-	uint32_t windowBackTextColor;
-	uint32_t windowFrontTextColor;
+	u32 windowTitleColor;
+	u32 windowTitleFontColor;
+	u32 windowBackgroundColor;
+	u32 windowInTopBorder;
+	u32 windowInBottomBorder;
+	u32 windowSelectedColor;
+	u32 windowScrollBarFrontColor;
+	u32 windowTextCursorColor;
+	u32 windowBackTextColor;
+	u32 windowFrontTextColor;
 
 	//Background
-	uint32_t backgroundColor;
+	u32 backgroundColor;
 	char *backgroundimgpath;
 
 	//Menu
-	uint32_t menuBackColor;
-	uint32_t menuHighColor;
-	uint32_t menuBorderColor;
-	uint32_t menuTextColor;
-	uint32_t menuSelTextColor;
+	u32 menuBackColor;
+	u32 menuHighColor;
+	u32 menuBorderColor;
+	u32 menuTextColor;
+	u32 menuSelTextColor;
 
   //Widgets
-  uint32_t mainBackColor;
-  uint32_t mainTextColor;
+  u32 mainBackColor;
+  u32 mainTextColor;
   char *fontPath;
 
   unsigned int doubleclickTime;
@@ -115,7 +115,7 @@ struct Border{
 
 struct Panel {
   Widget *w;
-  uint32_t backColor;
+  u32 backColor;
   WListElement *l;
 };
 
@@ -125,8 +125,8 @@ struct Label {
   Font *f;
 
   Border border;
-  uint32_t backColor;
-  uint32_t textColor;
+  u32 backColor;
+  u32 textColor;
 
   void (*setText)(Label *l, const char *text);
   char * (*gettext)(Label *l);

+ 94 - 94
sys/include/libc.h

@@ -15,12 +15,12 @@
 /*
  * mem routines
  */
-extern	void*	memccpy(void*, const void*, int, uint32_t);
+extern	void*	memccpy(void*, const void*, int, u32);
 extern	void*	memset(void*, int, size_t);
-extern	int	memcmp(const void*, const void*, uint32_t);
+extern	int	memcmp(const void*, const void*, u32);
 extern	void*	memcpy(void*, const void*, size_t);
 extern	void*	memmove(void*, const void*, size_t);
-extern	void*	memchr(const void*, int, uint32_t);
+extern	void*	memchr(const void*, int, u32);
 
 /*
  * string routines
@@ -33,9 +33,9 @@ extern	char*	strecpy(char*, char *, const char*);
 extern	char*	strdup(const char*);
 extern	size_t	strlcat(char *, const char *, size_t);
 extern	size_t	strlcpy(char *, const char *, size_t);
-extern	char*	strncat(char*, const char*, int32_t);
-extern	char*	strncpy(char*, const char*, uint32_t);
-extern	int	strncmp(const char*, const char*, int32_t);
+extern	char*	strncat(char*, const char*, i32);
+extern	char*	strncpy(char*, const char*, u32);
+extern	int	strncmp(const char*, const char*, i32);
 extern	char*	strpbrk(const char*, const char*);
 extern	char*	strrchr(const char*, int);
 extern	char*	strtok(char*, char*);
@@ -67,7 +67,7 @@ extern	int	runelen(Rune);
 extern	int	runenlen(const Rune*, int);
 extern	int	fullrune(const char*, int);
 extern	int	utflen(const char*);
-extern	int	utfnlen(const char*, int32_t);
+extern	int	utfnlen(const char*, i32);
 extern	char*	utfrune(const char*, Rune);
 extern	char*	utfrrune(const char*, Rune);
 extern	char*	utfutf(const char*, const char*);
@@ -77,13 +77,13 @@ extern	Rune*	runestrcat(Rune*, const Rune*);
 extern	Rune*	runestrchr(const Rune*, Rune);
 extern	int	runestrcmp(const Rune*, const Rune*);
 extern	Rune*	runestrcpy(Rune*, const Rune*);
-extern	Rune*	runestrncpy(Rune*, const Rune*, int32_t);
+extern	Rune*	runestrncpy(Rune*, const Rune*, i32);
 extern	Rune*	runestrecpy(Rune*, Rune*, const Rune*);
 extern	Rune*	runestrdup(const Rune*);
-extern	Rune*	runestrncat(Rune*, const Rune*, int32_t);
-extern	int	runestrncmp(const Rune*, const Rune*, int32_t);
+extern	Rune*	runestrncat(Rune*, const Rune*, i32);
+extern	int	runestrncmp(const Rune*, const Rune*, i32);
 extern	Rune*	runestrrchr(const Rune*, Rune);
-extern	int32_t	runestrlen(const Rune*);
+extern	i32	runestrlen(const Rune*);
 extern	Rune*	runestrstr(const Rune*, const Rune*);
 
 extern	Rune	tolowerrune(Rune);
@@ -102,11 +102,11 @@ extern	int	isupperrune(Rune);
  * malloc
  */
 extern	void*	malloc(size_t);
-extern	void*	mallocz(uint32_t, int);
+extern	void*	mallocz(u32, int);
 extern	void	free(void*);
-extern	uint32_t	msize(void*);
-extern	void*	mallocalign(uint32_t, uint32_t, int32_t, uint32_t);
-extern	void*	calloc(uint32_t, size_t);
+extern	u32	msize(void*);
+extern	void*	mallocalign(u32, u32, i32, u32);
+extern	void*	calloc(u32, size_t);
 extern	void*	realloc(void*, size_t);
 void	setmalloctag(void*, uintptr_t);
 void	setrealloctag(void*, uintptr_t);
@@ -119,7 +119,7 @@ void*	malloctopoolblock(void*);
  */
 typedef struct Fmt	Fmt;
 struct Fmt{
-	uint8_t	runes;			/* output buffer is runes or chars? */
+	u8	runes;			/* output buffer is runes or chars? */
 	void	*start;			/* of buffer */
 	void	*to;			/* current place in the buffer */
 	void	*stop;			/* end of the buffer; overwritten if flush fails */
@@ -130,7 +130,7 @@ struct Fmt{
 	int	r;			/* % format Rune */
 	int	width;
 	int	prec;
-	uint32_t	flags;
+	u32	flags;
 };
 
 enum{
@@ -209,28 +209,28 @@ extern	int	needsrcquote(int);
 /*
  * random number
  */
-extern	void	srand(int32_t);
+extern	void	srand(i32);
 extern	int	rand(void);
 extern	int	nrand(int);
-extern	int32_t	lrand(void);
-extern	int32_t	lnrand(int32_t);
+extern	i32	lrand(void);
+extern	i32	lnrand(i32);
 extern	double	frand(void);
-extern	uint32_t	truerand(void);			/* uses /dev/random */
-extern	uint32_t	ntruerand(uint32_t);		/* uses /dev/random */
+extern	u32	truerand(void);			/* uses /dev/random */
+extern	u32	ntruerand(u32);		/* uses /dev/random */
 
 /*
  * math
  */
-extern	uint32_t	getfcr(void);
-extern	void	setfsr(uint32_t);
-extern	uint32_t	getfsr(void);
-extern	void	setfcr(uint32_t);
+extern	u32	getfcr(void);
+extern	void	setfsr(u32);
+extern	u32	getfsr(void);
+extern	void	setfcr(u32);
 extern	double	NaN(void);
 extern	double	Inf(int);
 extern	int	isNaN(double);
 extern	int	isInf(double, int);
-extern	uint32_t	umuldiv(uint32_t, uint32_t, uint32_t);
-extern	int32_t	muldiv(int32_t, int32_t, int32_t);
+extern	u32	umuldiv(u32, u32, u32);
+extern	i32	muldiv(i32, i32, i32);
 
 extern	double	pow(double, double);
 extern	double	atan2(double, double);
@@ -276,16 +276,16 @@ struct Tm
 	int	tzoff;
 } Tm;
 
-extern	Tm*	gmtime(int32_t);
-extern	Tm*	localtime(int32_t);
+extern	Tm*	gmtime(i32);
+extern	Tm*	localtime(i32);
 extern	char*	asctime(Tm*);
-extern	char*	ctime(int32_t);
+extern	char*	ctime(i32);
 extern	double	cputime(void);
-extern	int32_t	times(int32_t*);
-extern	int32_t	tm2sec(Tm*);
-extern	int64_t	nsec(void);
+extern	i32	times(i32*);
+extern	i32	tm2sec(Tm*);
+extern	i64	nsec(void);
 
-extern	void	cycles(uint64_t*);	/* 64-bit value of the cycle counter if there is one, 0 if there isn't */
+extern	void	cycles(u64*);	/* 64-bit value of the cycle counter if there is one, 0 if there isn't */
 
 /*
  * one-of-a-kind
@@ -303,18 +303,18 @@ extern	void	atexitdont(void(*)(void));
 extern	int	atnotify(int(*)(void*, char*), int);
 extern	double	atof(const char*);
 extern	int	atoi(const char*);
-extern	int32_t	atol(const char*);
-extern	int64_t	atoll(const char*);
+extern	i32	atol(const char*);
+extern	i64	atoll(const char*);
 extern	double	charstod(int(*)(void*), void*);
 extern	char*	cleanname(char*);
 extern	int	decrypt(void*, void*, int);
 extern	int	encrypt(void*, void*, int);
-extern	int	dec64(uint8_t*, int, const char*, int);
-extern	int	enc64(char*, int, const uint8_t*, int);
-extern	int	dec32(uint8_t*, int, const char*, int);
-extern	int	enc32(char*, int, const uint8_t*, int);
-extern	int	dec16(uint8_t*, int, const char*, int);
-extern	int	enc16(char*, int, const uint8_t*, int);
+extern	int	dec64(u8*, int, const char*, int);
+extern	int	enc64(char*, int, const u8*, int);
+extern	int	dec32(u8*, int, const char*, int);
+extern	int	enc32(char*, int, const u8*, int);
+extern	int	dec16(u8*, int, const char*, int);
+extern	int	enc16(char*, int, const u8*, int);
 extern	int	encodefmt(Fmt*);
 extern	void	exits(const char*);
 extern	double	frexp(double, int*);
@@ -325,7 +325,7 @@ extern	int	gettokens(char *, char **, int, const char *);
 extern	char*	getuser(void);
 extern	char*	getwd(char*, int);
 extern	int	iounit(int);
-extern	int32_t	labs(int32_t);
+extern	i32	labs(i32);
 extern	double	ldexp(double, int);
 extern	void	longjmp(jmp_buf, int);
 extern	char*	mktemp(char*);
@@ -336,36 +336,36 @@ extern	void	perror(const char*);
 extern	int	postnote(int, int, const char *);
 extern	double	pow10(int);
 extern	int	putenv(const char*, const char*);
-extern	void	qsort(void*, int32_t, int32_t,
+extern	void	qsort(void*, i32, i32,
 				int (*)(const void*, const void*));
 extern	int	setjmp(jmp_buf) __attribute__((returns_twice));;
 extern	double	strtod(const char*, char**);
-extern	int32_t	strtol(const char*, char**, int);
-extern	uint32_t	strtoul(const char*, char**, int);
-extern	int64_t	strtoll(const char*, char**, int);
-extern	uint64_t	strtoull(const char*, char**, int);
+extern	i32	strtol(const char*, char**, int);
+extern	u32	strtoul(const char*, char**, int);
+extern	i64	strtoll(const char*, char**, int);
+extern	u64	strtoull(const char*, char**, int);
 extern	void	sysfatal(const char*, ...);
 extern	void	syslog(int, const char*, const char*, ...);
-extern	int32_t	time(int32_t*);
+extern	i32	time(i32*);
 extern	int	tolower(int);
 extern	int	toupper(int);
 
 /*
  * atomic
  */
-int32_t	ainc(int32_t*);
-int32_t	adec(int32_t*);
-int	cas32(uint32_t*, uint32_t, uint32_t);
+i32	ainc(i32*);
+i32	adec(i32*);
+int	cas32(u32*, u32, u32);
 int	casp(void**, void*, void*);
-int	casl(uint32_t*, uint32_t, uint32_t);
+int	casl(u32*, u32, u32);
 
 /*
  *  synchronization
  */
 typedef
 struct Lock {
-	int32_t	key;
-	int32_t	sem;
+	i32	key;
+	i32	sem;
 } Lock;
 
 extern int	_tas(int*);
@@ -549,22 +549,22 @@ enum
 typedef
 struct Qid
 {
-	uint64_t	path;
-	uint32_t	vers;
-	uint8_t	type;
+	u64	path;
+	u32	vers;
+	u8	type;
 } Qid;
 
 typedef
 struct Dir {
 	/* system-modified data */
-	uint16_t	type;	/* server type */
+	u16	type;	/* server type */
 	uint	dev;	/* server subtype */
 	/* file data */
 	Qid	qid;	/* unique id from server */
-	uint32_t	mode;	/* permissions */
-	uint32_t	atime;	/* last read time */
-	uint32_t	mtime;	/* last write time */
-	int64_t	length;	/* file length */
+	u32	mode;	/* permissions */
+	u32	atime;	/* last read time */
+	u32	mtime;	/* last write time */
+	i64	length;	/* file length */
 	char	*name;	/* last element of path */
 	char	*uid;	/* owner name */
 	char	*gid;	/* group name */
@@ -576,7 +576,7 @@ typedef
 struct Waitmsg
 {
 	int	pid;		/* of loved one */
-	uint32_t	time[3];	/* of loved one & descendants */
+	u32	time[3];	/* of loved one & descendants */
 	char	*msg;
 } Waitmsg;
 
@@ -584,20 +584,20 @@ typedef
 struct IOchunk
 {
 	void	*addr;
-	uint32_t	len;
+	u32	len;
 } IOchunk;
 
 extern	void	_exits(const char*);
 
 extern	void	abort(void);
 extern	int	access(const char*, int);
-extern	int64_t	alarm(uint64_t);
+extern	i64	alarm(u64);
 extern	int	await(char*, int);
 extern	int	bind(const char*, const char*, int);
 extern	int	brk(void*);
 extern	int	chdir(const char*);
 extern	int	close(int);
-extern	int	create(const char*, int, uint32_t);
+extern	int	create(const char*, int, u32);
 extern	int	dup(int, int);
 extern	char*	errno2str(uint errno);
 extern	int	errstr(char*, uint);
@@ -606,8 +606,8 @@ extern	int	execl(const char*, ...);
 extern	int	fork(void);
 extern	int	rfork(int);
 extern	int	fauth(int, const char*);
-extern	int	fstat(int, uint8_t*, int);
-extern	int	fwstat(int, uint8_t*, int);
+extern	int	fstat(int, u8*, int);
+extern	int	fwstat(int, u8*, int);
 extern	int	fversion(int, int, char*, int);
 extern	int	mount(int, int, const char*, int, const char*, int);
 extern	int	unmount(const char*, const char*);
@@ -617,42 +617,42 @@ extern	int	open(const char*, int);
 extern	int	fd2path(int, char*, int);
 // extern	int	fdflush(int);
 extern	int	pipe(int*);
-extern	int32_t	pread(int, void*, int32_t, int64_t);
-extern	int32_t read(int, void*, int32_t);
-extern	int32_t	preadv(int, IOchunk*, int, int64_t);
-extern	int32_t	pwrite(int, const void*, int32_t, int64_t);
-extern	int32_t write(int, const void*, int32_t);
-extern	int32_t	pwritev(int, IOchunk*, int, int64_t);
-extern	int32_t	r0(void);
-extern	int32_t	readn(int, void*, int32_t);
-extern	int32_t	readv(int, IOchunk*, int);
+extern	i32	pread(int, void*, i32, i64);
+extern	i32 read(int, void*, i32);
+extern	i32	preadv(int, IOchunk*, int, i64);
+extern	i32	pwrite(int, const void*, i32, i64);
+extern	i32 write(int, const void*, i32);
+extern	i32	pwritev(int, IOchunk*, int, i64);
+extern	i32	r0(void);
+extern	i32	readn(int, void*, i32);
+extern	i32	readv(int, IOchunk*, int);
 extern	int	remove(const char*);
-extern	void*	sbrk(uint32_t);
-extern	int32_t	oseek(int, int32_t, int);
-extern	int64_t	seek(int, int64_t, int);
-extern	void*	segattach(int, const char*, void*, uint32_t);
+extern	void*	sbrk(u32);
+extern	i32	oseek(int, i32, int);
+extern	i64	seek(int, i64, int);
+extern	void*	segattach(int, const char*, void*, u32);
 extern	void*	segbrk(void*, void*);
 extern	int	segdetach(void*);
-extern	int	segflush(void*, uint32_t);
-extern	int	segfree(void*, uint32_t);
-extern	int	semacquire(int32_t*, int);
-extern	int32_t	semrelease(int32_t*, int32_t);
-extern	int	sleep(int32_t);
-extern	int	stat(const char*, uint8_t*, int);
-extern	int	tsemacquire(int32_t*, uint64_t);
+extern	int	segflush(void*, u32);
+extern	int	segfree(void*, u32);
+extern	int	semacquire(i32*, int);
+extern	i32	semrelease(i32*, i32);
+extern	int	sleep(i32);
+extern	int	stat(const char*, u8*, int);
+extern	int	tsemacquire(i32*, u64);
 extern	Waitmsg*	wait(void);
 extern	int	waitpid(void);
-extern	int32_t	writev(int, IOchunk*, int);
-extern	int	wstat(const char*, uint8_t*, int);
+extern	i32	writev(int, IOchunk*, int);
+extern	int	wstat(const char*, u8*, int);
 extern	void*	rendezvous(void*, void*);
 
 extern	Dir*	dirstat(const char*);
 extern	Dir*	dirfstat(int);
 extern	int	dirwstat(const char*, Dir*);
 extern	int	dirfwstat(int, Dir*);
-extern	int32_t	dirread(int, Dir**);
+extern	i32	dirread(int, Dir**);
 extern	void	nulldir(Dir*);
-extern	int32_t	dirreadall(int, Dir**);
+extern	i32	dirreadall(int, Dir**);
 extern	int	getpid(void);
 extern	int	getppid(void);
 extern	void	rerrstr(char*, uint);

+ 114 - 114
sys/include/libsec.h

@@ -21,32 +21,32 @@ enum
 typedef struct AESstate AESstate;
 struct AESstate
 {
-	uint32_t	setup;
+	u32	setup;
 	int	rounds;
 	int	keybytes;
 	uint	ctrsz;
-	uint8_t	key[AESmaxkey];			/* unexpanded key */
-	uint32_t	ekey[4*(AESmaxrounds + 1)];	/* encryption key */
-	uint32_t	dkey[4*(AESmaxrounds + 1)];	/* decryption key */
-	uint8_t	ivec[AESbsize];			/* initialization vector */
-	uint8_t	mackey[3 * AESbsize];		/* 3 XCBC mac 96 keys */
+	u8	key[AESmaxkey];			/* unexpanded key */
+	u32	ekey[4*(AESmaxrounds + 1)];	/* encryption key */
+	u32	dkey[4*(AESmaxrounds + 1)];	/* decryption key */
+	u8	ivec[AESbsize];			/* initialization vector */
+	u8	mackey[3 * AESbsize];		/* 3 XCBC mac 96 keys */
 };
 
 /* block ciphers */
-void	aes_encrypt(uint32_t rk[], int Nr, uint8_t pt[16],
-			uint8_t ct[16]);
-void	aes_decrypt(uint32_t rk[], int Nr, uint8_t ct[16],
-			uint8_t pt[16]);
-
-void	setupAESstate(AESstate *s, uint8_t key[], int keybytes,
-			  uint8_t *ivec);
-void	aesCBCencrypt(uint8_t *p, int len, AESstate *s);
-void	aesCBCdecrypt(uint8_t *p, int len, AESstate *s);
-void	aesCTRdecrypt(uint8_t *p, int len, AESstate *s);
-void	aesCTRencrypt(uint8_t *p, int len, AESstate *s);
+void	aes_encrypt(u32 rk[], int Nr, u8 pt[16],
+			u8 ct[16]);
+void	aes_decrypt(u32 rk[], int Nr, u8 ct[16],
+			u8 pt[16]);
+
+void	setupAESstate(AESstate *s, u8 key[], int keybytes,
+			  u8 *ivec);
+void	aesCBCencrypt(u8 *p, int len, AESstate *s);
+void	aesCBCdecrypt(u8 *p, int len, AESstate *s);
+void	aesCTRdecrypt(u8 *p, int len, AESstate *s);
+void	aesCTRencrypt(u8 *p, int len, AESstate *s);
 
 void	setupAESXCBCstate(AESstate *s);
-uint8_t*	aesXCBCmac(uint8_t *p, int len, AESstate *s);
+u8 *	aesXCBCmac(u8 *p, int len, AESstate *s);
 
 /*
  * Blowfish Definitions
@@ -62,21 +62,21 @@ enum
 typedef struct BFstate BFstate;
 struct BFstate
 {
-	uint32_t	setup;
+	u32	setup;
 
-	uint8_t	key[56];
-	uint8_t	ivec[8];
+	u8	key[56];
+	u8	ivec[8];
 
-	uint32_t 	pbox[BFrounds+2];
-	uint32_t	sbox[1024];
+	u32 	pbox[BFrounds+2];
+	u32	sbox[1024];
 };
 
-void	setupBFstate(BFstate *s, uint8_t key[], int keybytes,
-			 uint8_t *ivec);
-void	bfCBCencrypt(uint8_t*, int, BFstate*);
-void	bfCBCdecrypt(uint8_t*, int, BFstate*);
-void	bfECBencrypt(uint8_t*, int, BFstate*);
-void	bfECBdecrypt(uint8_t*, int, BFstate*);
+void	setupBFstate(BFstate *s, u8 key[], int keybytes,
+			 u8 *ivec);
+void	bfCBCencrypt(u8*, int, BFstate*);
+void	bfCBCdecrypt(u8*, int, BFstate*);
+void	bfECBencrypt(u8*, int, BFstate*);
+void	bfECBdecrypt(u8*, int, BFstate*);
 
 /*
  * DES definitions
@@ -91,24 +91,24 @@ enum
 typedef struct DESstate DESstate;
 struct DESstate
 {
-	uint32_t	setup;
-	uint8_t	key[8];		/* unexpanded key */
-	uint32_t	expanded[32];	/* expanded key */
-	uint8_t	ivec[8];	/* initialization vector */
+	u32	setup;
+	u8	key[8];		/* unexpanded key */
+	u32	expanded[32];	/* expanded key */
+	u8	ivec[8];	/* initialization vector */
 };
 
-void	setupDESstate(DESstate *s, uint8_t key[8], uint8_t *ivec);
-void	des_key_setup(uint8_t[8], uint32_t[32]);
-void	block_cipher(uint32_t*, uint8_t*, int);
-void	desCBCencrypt(uint8_t*, int, DESstate*);
-void	desCBCdecrypt(uint8_t*, int, DESstate*);
-void	desECBencrypt(uint8_t*, int, DESstate*);
-void	desECBdecrypt(uint8_t*, int, DESstate*);
+void	setupDESstate(DESstate *s, u8 key[8], u8 *ivec);
+void	des_key_setup(u8[8], u32[32]);
+void	block_cipher(u32*, u8*, int);
+void	desCBCencrypt(u8*, int, DESstate*);
+void	desCBCdecrypt(u8*, int, DESstate*);
+void	desECBencrypt(u8*, int, DESstate*);
+void	desECBdecrypt(u8*, int, DESstate*);
 
 /* for backward compatibility with 7-byte DES key format */
-void	des56to64(uint8_t *k56, uint8_t *k64);
-void	des64to56(uint8_t *k64, uint8_t *k56);
-void	key_setup(uint8_t[7], uint32_t[32]);
+void	des56to64(u8 *k56, u8 *k64);
+void	des64to56(u8 *k64, u8 *k56);
+void	key_setup(u8[7], u32[32]);
 
 /* triple des encrypt/decrypt orderings */
 enum {
@@ -123,18 +123,18 @@ enum {
 typedef struct DES3state DES3state;
 struct DES3state
 {
-	uint32_t	setup;
-	uint8_t	key[3][8];		/* unexpanded key */
-	uint32_t	expanded[3][32];	/* expanded key */
-	uint8_t	ivec[8];		/* initialization vector */
+	u32	setup;
+	u8	key[3][8];		/* unexpanded key */
+	u32	expanded[3][32];	/* expanded key */
+	u8	ivec[8];		/* initialization vector */
 };
 
-void	setupDES3state(DES3state *s, uint8_t key[3][8], uint8_t *ivec);
-void	triple_block_cipher(uint32_t keys[3][32], uint8_t*, int);
-void	des3CBCencrypt(uint8_t*, int, DES3state*);
-void	des3CBCdecrypt(uint8_t*, int, DES3state*);
-void	des3ECBencrypt(uint8_t*, int, DES3state*);
-void	des3ECBdecrypt(uint8_t*, int, DES3state*);
+void	setupDES3state(DES3state *s, u8 key[3][8], u8 *ivec);
+void	triple_block_cipher(u32 keys[3][32], u8*, int);
+void	des3CBCencrypt(u8*, int, DES3state*);
+void	des3CBCdecrypt(u8*, int, DES3state*);
+void	des3ECBencrypt(u8*, int, DES3state*);
+void	des3ECBdecrypt(u8*, int, DES3state*);
 
 /*
  * digests
@@ -157,12 +157,12 @@ enum
 typedef struct DigestState DigestState;
 struct DigestState
 {
-	uint64_t	len;
+	u64	len;
 	union {
-		uint32_t	state[8];
-		uint64_t	bstate[8];
+		u32	state[8];
+		u64	bstate[8];
 	};
-	uint8_t	buf[256];
+	u8	buf[256];
 	int	blen;
 	char	malloced;
 	char	seeded;
@@ -177,35 +177,35 @@ typedef struct DigestState MD5state;
 typedef struct DigestState MD4state;
 typedef struct DigestState AEShstate;
 
-DigestState*	md4(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	md5(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha1(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_224(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_256(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_384(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_512(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	aes(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	hmac_x(uint8_t *p, uint32_t len, uint8_t *key,
-			   uint32_t klen,
-			uint8_t *digest, DigestState *s,
-			DigestState*(*x)(uint8_t*, uint32_t, uint8_t*, DigestState*),
-			int xlen);
-DigestState*	hmac_md5(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			     uint8_t*,
+DigestState*	md4(u8*, u32, u8*, DigestState*);
+DigestState*	md5(u8*, u32, u8*, DigestState*);
+DigestState*	sha1(u8*, u32, u8*, DigestState*);
+DigestState*	sha2_224(u8*, u32, u8*, DigestState*);
+DigestState*	sha2_256(u8*, u32, u8*, DigestState*);
+DigestState*	sha2_384(u8*, u32, u8*, DigestState*);
+DigestState*	sha2_512(u8*, u32, u8*, DigestState*);
+DigestState*	aes(u8*, u32, u8*, DigestState*);
+DigestState*	hmac_x(u8 *p, u32 len, u8 *key,
+			   u32 klen,
+			   u8 *digest, DigestState *s,
+			   DigestState*(*x)(u8*, u32, u8*, DigestState*),
+			   int xlen);
+DigestState*	hmac_md5(u8*, u32, u8*, u32,
+			     u8*,
 			     DigestState*);
-DigestState*	hmac_sha1(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			      uint8_t*,
+DigestState*	hmac_sha1(u8*, u32, u8*, u32,
+			      u8*,
 			      DigestState*);
-DigestState*	hmac_sha2_224(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_256(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_384(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_512(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_aes(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			     uint8_t*,
+DigestState*	hmac_sha2_224(u8*, u32, u8*, u32,
+				  u8*, DigestState*);
+DigestState*	hmac_sha2_256(u8*, u32, u8*, u32,
+				  u8*, DigestState*);
+DigestState*	hmac_sha2_384(u8*, u32, u8*, u32,
+				  u8*, DigestState*);
+DigestState*	hmac_sha2_512(u8*, u32, u8*, u32,
+				  u8*, DigestState*);
+DigestState*	hmac_aes(u8*, u32, u8*, u32,
+			     u8*,
 			     DigestState*);
 char*		md5pickle(MD5state*);
 MD5state*	md5unpickle(char*);
@@ -215,10 +215,10 @@ SHA1state*	sha1unpickle(char*);
 /*
  * random number generation
  */
-void	genrandom(uint8_t *buf, int nbytes);
-void	prng(uint8_t *buf, int nbytes);
-uint32_t	fastrand(void);
-uint32_t	nfastrand(uint32_t);
+void	genrandom(u8 *buf, int nbytes);
+void	prng(u8 *buf, int nbytes);
+u32	fastrand(void);
+u32	nfastrand(u32);
 
 /*
  * primes
@@ -226,7 +226,7 @@ uint32_t	nfastrand(uint32_t);
 void	genprime(mpint *p, int n, int accuracy); /* generate n-bit probable prime */
 void	gensafeprime(mpint *p, mpint *alpha, int n, int accuracy); /* prime & generator */
 void	genstrongprime(mpint *p, int n, int accuracy); /* generate n-bit strong prime */
-void	DSAprimes(mpint *q, mpint *p, uint8_t seed[SHA1dlen]);
+void	DSAprimes(mpint *q, mpint *p, u8 seed[SHA1dlen]);
 int	probably_prime(mpint *n, int nrep);	/* miller-rabin test */
 int	smallprimetest(mpint *p);  /* returns -1 if not prime, 0 otherwise */
 
@@ -236,13 +236,13 @@ int	smallprimetest(mpint *p);  /* returns -1 if not prime, 0 otherwise */
 typedef struct RC4state RC4state;
 struct RC4state
 {
-	 uint8_t	state[256];
-	 uint8_t	x;
-	 uint8_t	y;
+	 u8	state[256];
+	 u8	x;
+	 u8	y;
 };
 
-void	setupRC4state(RC4state*, uint8_t*, int);
-void	rc4(RC4state*, uint8_t*, int);
+void	setupRC4state(RC4state*, u8*, int);
+void	rc4(RC4state*, u8*, int);
 void	rc4skip(RC4state*, int);
 void	rc4back(RC4state*, int);
 
@@ -277,7 +277,7 @@ struct RSApriv
 
 struct PEMChain{
 	PEMChain*next;
-	uint8_t	*pem;
+	u8	*pem;
 	int	pemlen;
 };
 
@@ -290,20 +290,20 @@ void		rsapubfree(RSApub*);
 RSApriv*	rsaprivalloc(void);
 void		rsaprivfree(RSApriv*);
 RSApub*		rsaprivtopub(RSApriv*);
-RSApub*		X509toRSApub(uint8_t*, int, char*, int);
-uint8_t*		RSApubtoasn1(RSApub*, int*);
-RSApub*		asn1toRSApub(uint8_t*, int);
-RSApriv*	asn1toRSApriv(uint8_t*, int);
-void		asn1dump(uint8_t *der, int len);
-uint8_t*		decodePEM(char *s, char *type, int *len,
+RSApub*		X509toRSApub(u8*, int, char*, int);
+u8 *		RSApubtoasn1(RSApub*, int*);
+RSApub*		asn1toRSApub(u8*, int);
+RSApriv*	asn1toRSApriv(u8*, int);
+void		asn1dump(u8 *der, int len);
+u8 *		decodePEM(char *s, char *type, int *len,
 				  char **new_s);
 PEMChain*	decodepemchain(char *s, char *type);
-uint8_t*		X509gen(RSApriv *priv, char *subj,
-				uint32_t valid[2],
-			      int *certlen);
-uint8_t*		X509req(RSApriv *priv, char *subj, int *certlen);
-char*		X509verify(uint8_t *cert, int ncert, RSApub *pk);
-void		X509dump(uint8_t *cert, int ncert);
+u8 *		X509gen(RSApriv *priv, char *subj,
+				u32 valid[2],
+				int *certlen);
+u8 *		X509req(RSApriv *priv, char *subj, int *certlen);
+char*		X509verify(u8 *cert, int ncert, RSApub *pk);
+void		X509dump(u8 *cert, int ncert);
 
 
 
@@ -387,26 +387,26 @@ void		dsaprivfree(DSApriv*);
 DSAsig*		dsasigalloc(void);
 void		dsasigfree(DSAsig*);
 DSApub*		dsaprivtopub(DSApriv*);
-DSApriv*	asn1toDSApriv(uint8_t*, int);
+DSApriv*	asn1toDSApriv(u8*, int);
 
 /*
  * TLS
  */
 typedef struct Thumbprint{
 	struct Thumbprint *next;
-	uint8_t	sha1[SHA1dlen];
+	u8	sha1[SHA1dlen];
 } Thumbprint;
 
 typedef struct TLSconn{
 	char	dir[40];	/* connection directory */
-	uint8_t	*cert;	/* certificate (local on input, remote on output) */
-	uint8_t	*sessionID;
+	u8	*cert;	/* certificate (local on input, remote on output) */
+	u8	*sessionID;
 	int	certlen;
 	int	sessionIDlen;
 	int	(*trace)(char*fmt, ...);
 	PEMChain*chain;	/* optional extra certificate evidence for servers to present */
 	char	*sessionType;
-	uint8_t	*sessionKey;
+	u8	*sessionKey;
 	int	sessionKeylen;
 	char	*sessionConst;
 } TLSconn;
@@ -418,9 +418,9 @@ int tlsServer(int fd, TLSconn *c);
 /* thumb.c */
 Thumbprint* initThumbprints(char *ok, char *crl);
 void	freeThumbprints(Thumbprint *ok);
-int	okThumbprint(uint8_t *sha1, Thumbprint *ok);
+int	okThumbprint(u8 *sha1, Thumbprint *ok);
 
 /* readcert.c */
-uint8_t	*readcert(char *filename, int *pcertlen);
+u8	*readcert(char *filename, int *pcertlen);
 PEMChain*readcertchain(char *filename);
 

+ 86 - 86
sys/include/mach.h

@@ -137,9 +137,9 @@ struct Map {
 		int		fd;	/* file descriptor */
 		int		inuse;	/* in use - not in use */
 		int		cache;	/* should cache reads? */
-		uint64_t	b;	/* base */
-		uint64_t	e;	/* end */
-		int64_t	f;		/* offset within file */
+		u64	b;	/* base */
+		u64	e;	/* end */
+		i64	f;		/* offset within file */
 	} seg[1];			/* actually n of these */
 };
 
@@ -150,7 +150,7 @@ struct Symbol {
 	void 	*handle;		/* used internally - owning func */
 	struct {
 		char	*name;
-		int64_t	value;		/* address or stack offset */
+		i64	value;		/* address or stack offset */
 		char	type;		/* as in a.out.h */
 		char	class;		/* as above */
 		int	index;		/* in findlocal, globalsym, textsym */
@@ -162,7 +162,7 @@ struct Symbol {
  */
 struct Reglist {
 	char	*rname;			/* register name */
-	int16_t	roffs;			/* offset in u-block */
+	i16	roffs;			/* offset in u-block */
 	char	rflags;			/* INTEGER/FLOAT, WRITABLE */
 	char	rformat;		/* print format: 'x', 'X', 'f', '8', '3', 'Y', 'W' */
 };
@@ -187,17 +187,17 @@ struct Mach{
 	char		*name;
 	int		mtype;		/* machine type code */
 	Reglist 	*reglist;	/* register set */
-	int32_t		regsize;	/* sizeof registers in bytes */
-	int32_t		fpregsize;	/* sizeof fp registers in bytes */
+	i32		regsize;	/* sizeof registers in bytes */
+	i32		fpregsize;	/* sizeof fp registers in bytes */
 	char		*pc;		/* pc name */
 	char		*sp;		/* sp name */
 	char		*link;		/* link register name */
 	char		*sbreg;		/* static base register name */
-	uint64_t	sb;		/* static base register value */
+	u64	sb;		/* static base register value */
 	int		pgsize;		/* page size */
-	uint64_t	kbase;		/* kernel base address */
-	uint64_t	ktmask;		/* ktzero = kbase & ~ktmask */
-	uint64_t	utop;		/* user stack top */
+	u64	kbase;		/* kernel base address */
+	u64	ktmask;		/* ktzero = kbase & ~ktmask */
+	u64	utop;		/* user stack top */
 	int		pcquant;	/* quantization of pc */
 	int		szaddr;		/* sizeof(void*) */
 	int		szreg;		/* sizeof(register) */
@@ -207,27 +207,27 @@ struct Mach{
 
 extern	Mach	*mach;			/* Current machine */
 
-typedef uint64_t	(*Rgetter)(Map*, char*);
-typedef	void		(*Tracer)(Map*, uint64_t, uint64_t, Symbol*);
+typedef u64	(*Rgetter)(Map*, char*);
+typedef	void		(*Tracer)(Map*, u64, u64, Symbol*);
 
 struct	Machdata {		/* Machine-dependent debugger support */
-	uint8_t	bpinst[4];			/* break point instr. */
-	int16_t	bpsize;				/* size of break point instr. */
+	u8	bpinst[4];			/* break point instr. */
+	i16	bpsize;				/* size of break point instr. */
 
-	uint16_t	(*swab)(uint16_t);		/* ushort to local byte order */
-	uint32_t	(*swal)(uint32_t);		/* ulong to local byte order */
-	uint64_t	(*swav)(uint64_t);		/* uvlong to local byte order */
-	int		(*ctrace)(Map*, uint64_t, uint64_t, uint64_t, Tracer); /* C traceback */
-	uint64_t	(*findframe)(Map*, uint64_t, uint64_t, uint64_t,
-				     uint64_t);		/* frame finder */
+	u16	(*swab)(u16);		/* ushort to local byte order */
+	u32	(*swal)(u32);		/* ulong to local byte order */
+	u64	(*swav)(u64);		/* uvlong to local byte order */
+	int		(*ctrace)(Map*, u64, u64, u64, Tracer); /* C traceback */
+	u64	(*findframe)(Map*, u64, u64, u64,
+				     u64);		/* frame finder */
 	char*		(*excep)(Map*, Rgetter);	/* last exception */
-	uint32_t	(*bpfix)(uint64_t);		/* breakpoint fixup */
+	u32	(*bpfix)(u64);		/* breakpoint fixup */
 	int		(*sftos)(char*, int, void*);	/* single precision float */
 	int		(*dftos)(char*, int, void*);	/* double precision float */
-	int		(*foll)(Map*, uint64_t, Rgetter, uint64_t*);	/* follow set */
-	int		(*das)(Map*, uint64_t, char, char*, int);	/* symbolic disassembly */
-	int		(*hexinst)(Map*, uint64_t, char*, int); 	/* hex disassembly */
-	int		(*instsize)(Map*, uint64_t);	/* instruction size */
+	int		(*foll)(Map*, u64, Rgetter, u64*);	/* follow set */
+	int		(*das)(Map*, u64, char, char*, int);	/* symbolic disassembly */
+	int		(*hexinst)(Map*, u64, char*, int); 	/* hex disassembly */
+	int		(*instsize)(Map*, u64);	/* instruction size */
 };
 
 /*
@@ -236,32 +236,32 @@ struct	Machdata {		/* Machine-dependent debugger support */
 typedef struct Fhdr
 {
 	char		*name;		/* identifier of executable */
-	uint8_t		type;		/* file type - see codes above */
-	uint8_t		hdrsz;		/* header size */
-	uint8_t		spare;
-	int32_t		magic;		/* magic number */
-	uint64_t	txtaddr;	/* text address */
-	int64_t		txtoff;		/* start of text in file */
-	uint64_t	dataddr;	/* start of data segment */
-	int64_t		datoff;		/* offset to data seg in file */
-	int64_t		symoff;		/* offset of symbol table in file */
-	uint64_t	entry;		/* entry point */
-	int64_t		sppcoff;	/* offset of sp-pc table in file */
-	int64_t		lnpcoff;	/* offset of line number-pc table in file */
-	int32_t		txtsz;		/* text size */
-	int32_t		datsz;		/* size of data seg */
-	int32_t		bsssz;		/* size of bss */
-	int32_t		symsz;		/* size of symbol table */
-	int32_t		sppcsz;		/* size of sp-pc table */
-	int32_t		lnpcsz;		/* size of line number-pc table */
+	u8		type;		/* file type - see codes above */
+	u8		hdrsz;		/* header size */
+	u8		spare;
+	i32		magic;		/* magic number */
+	u64	txtaddr;	/* text address */
+	i64		txtoff;		/* start of text in file */
+	u64	dataddr;	/* start of data segment */
+	i64		datoff;		/* offset to data seg in file */
+	i64		symoff;		/* offset of symbol table in file */
+	u64	entry;		/* entry point */
+	i64		sppcoff;	/* offset of sp-pc table in file */
+	i64		lnpcoff;	/* offset of line number-pc table in file */
+	i32		txtsz;		/* text size */
+	i32		datsz;		/* size of data seg */
+	i32		bsssz;		/* size of bss */
+	i32		symsz;		/* size of symbol table */
+	i32		sppcsz;		/* size of sp-pc table */
+	i32		lnpcsz;		/* size of line number-pc table */
 
 	// TODO work out which of the above are no longer useful
 	// and which should be uint64
-	int8_t		bigendian;	/* big endian or not */
-	uint64_t	stroff;		/* strtab offset in file */
-	uint64_t	strsz;		/* size of strtab seg */
-	uint16_t	bssidx;		/* index of bss section */	
-	uint16_t	dbglineidx;	/* index of debug_line section */
+	i8		bigendian;	/* big endian or not */
+	u64	stroff;		/* strtab offset in file */
+	u64	strsz;		/* size of strtab seg */
+	u16	bssidx;		/* index of bss section */	
+	u16	dbglineidx;	/* index of debug_line section */
 } Fhdr;
 
 extern	int	asstype;	/* dissembler type - machdata.c */
@@ -271,42 +271,42 @@ Map*		attachproc(int, int, int, Fhdr*);
 int		beieee80ftos(char*, int, void*);
 int		beieeesftos(char*, int, void*);
 int		beieeedftos(char*, int, void*);
-uint16_t	beswab(uint16_t);
-uint32_t	beswal(uint32_t);
-uint64_t	beswav(uint64_t);
-uint64_t	ciscframe(Map*, uint64_t, uint64_t, uint64_t, uint64_t);
-int		cisctrace(Map*, uint64_t, uint64_t, uint64_t, Tracer);
+u16	beswab(u16);
+u32	beswal(u32);
+u64	beswav(u64);
+u64	ciscframe(Map*, u64, u64, u64, u64);
+int		cisctrace(Map*, u64, u64, u64, Tracer);
 int		crackhdr(int fd, Fhdr*);
-uint64_t	file2pc(char*, int32_t);
-int		fileelem(Sym**, uint8_t *, char*, int);
-int32_t		fileline(char*, int, uint64_t);
+u64	file2pc(char*, i32);
+int		fileelem(Sym**, u8 *, char*, int);
+i32		fileline(char*, int, u64);
 int		filesym(int, char*, int);
 int		findlocal(Symbol*, char*, Symbol*);
 int		findseg(Map*, char*);
-int		findsym(uint64_t, int, Symbol *);
-int		fnbound(uint64_t, uint64_t*);
+int		findsym(u64, int, Symbol *);
+int		fnbound(u64, u64*);
 int		fpformat(Map*, Reglist*, char*, int, int);
-int		get1(Map*, uint64_t, uint8_t*, int);
-int		get2(Map*, uint64_t, uint16_t*);
-int		get4(Map*, uint64_t, uint32_t*);
-int		get8(Map*, uint64_t, uint64_t*);
-int		geta(Map*, uint64_t, uint64_t*);
+int		get1(Map*, u64, u8*, int);
+int		get2(Map*, u64, u16*);
+int		get4(Map*, u64, u32*);
+int		get8(Map*, u64, u64*);
+int		geta(Map*, u64, u64*);
 int		getauto(Symbol*, int, int, Symbol*);
 Sym*		getsym(int);
 int		globalsym(Symbol *, int);
-char*		_hexify(char*, uint32_t, int);
-int		ieeesftos(char*, int, uint32_t);
-int		ieeedftos(char*, int, uint32_t, uint32_t);
+char*		_hexify(char*, u32, int);
+int		ieeesftos(char*, int, u32);
+int		ieeedftos(char*, int, u32, u32);
 int		isar(Biobuf*);
 int		leieee80ftos(char*, int, void*);
 int		leieeesftos(char*, int, void*);
 int		leieeedftos(char*, int, void*);
-uint16_t	leswab(uint16_t);
-uint32_t	leswal(uint32_t);
-uint64_t	leswav(uint64_t);
-uint64_t	line2addr(int32_t, uint64_t, uint64_t);
+u16	leswab(u16);
+u32	leswal(u32);
+u64	leswav(u64);
+u64	line2addr(i32, u64, u64);
 Map*		loadmap(Map*, int, Fhdr*);
-int		localaddr(Map*, char*, char*, uint64_t*, Rgetter);
+int		localaddr(Map*, char*, char*, u64*, Rgetter);
 int		localsym(Symbol*, int);
 int		lookup(char*, char*, Symbol*);
 void		machbytype(int);
@@ -315,21 +315,21 @@ int		nextar(Biobuf*, int, char*);
 Map*		newmap(Map*, int);
 void		objtraverse(void(*)(Sym*, void*), void*);
 int		objtype(Biobuf*, char**);
-uint64_t	pc2sp(uint64_t);
-int32_t		pc2line(uint64_t);
-int		put1(Map*, uint64_t, uint8_t*, int);
-int		put2(Map*, uint64_t, uint16_t);
-int		put4(Map*, uint64_t, uint32_t);
-int		put8(Map*, uint64_t, uint64_t);
-int		puta(Map*, uint64_t, uint64_t);
-int		readar(Biobuf*, int, int64_t, int);
+u64	pc2sp(u64);
+i32		pc2line(u64);
+int		put1(Map*, u64, u8*, int);
+int		put2(Map*, u64, u16);
+int		put4(Map*, u64, u32);
+int		put8(Map*, u64, u64);
+int		puta(Map*, u64, u64);
+int		readar(Biobuf*, int, i64, int);
 int		readobj(Biobuf*, int);
-uint64_t	riscframe(Map*, uint64_t, uint64_t, uint64_t, uint64_t);
-int		risctrace(Map*, uint64_t, uint64_t, uint64_t, Tracer);
-int		setmap(Map*, int, uint64_t, uint64_t, int64_t, char*);
-Sym*		symbase(int32_t*);
+u64	riscframe(Map*, u64, u64, u64, u64);
+int		risctrace(Map*, u64, u64, u64, Tracer);
+int		setmap(Map*, int, u64, u64, i64, char*);
+Sym*		symbase(i32*);
 int		syminit(int, Fhdr*);
-int		symoff(char*, int, uint64_t, int);
-void		textseg(uint64_t, Fhdr*);
+int		symoff(char*, int, u64, int);
+void		textseg(u64, Fhdr*);
 int		textsym(Symbol*, int);
 void		unusemap(Map*, int);

+ 24 - 24
sys/include/memdraw.h

@@ -26,8 +26,8 @@ typedef struct	Memdrawparam	Memdrawparam;
 
 struct Memdata
 {
-	uint32_t	*base;	/* allocated data pointer */
-	uint8_t	*bdata;	/* pointer to first byte of actual data; word-aligned */
+	u32	*base;	/* allocated data pointer */
+	u8	*bdata;	/* pointer to first byte of actual data; word-aligned */
 	int		ref;		/* number of Memimages using this data */
 	void*	imref;
 	int		allocd;	/* is this malloc'd? */
@@ -48,14 +48,14 @@ struct Memimage
 	Rectangle	clipr;		/* clipping region */
 	int		depth;	/* number of bits of storage per pixel */
 	int		nchan;	/* number of channels */
-	uint32_t	chan;	/* channel descriptions */
+	u32	chan;	/* channel descriptions */
 	Memcmap	*cmap;
 
 	Memdata	*data;	/* pointer to data; shared by windows in this image */
 	int		zero;		/* data->bdata+zero==&byte containing (0,0) */
-	uint32_t	width;	/* width in words of a single scan line */
+	u32	width;	/* width in words of a single scan line */
 	Memlayer	*layer;	/* nil if not a layer*/
-	uint32_t	flags;
+	u32	flags;
 
 	int		shift[NChan];
 	int		mask[NChan];
@@ -64,8 +64,8 @@ struct Memimage
 
 struct Memcmap
 {
-	uint8_t	cmap2rgb[3*256];
-	uint8_t	rgb2cmap[16*16*16];
+	u8	cmap2rgb[3*256];
+	u8	rgb2cmap[16*16*16];
 };
 
 /*
@@ -83,8 +83,8 @@ struct Memcmap
 struct	Memsubfont
 {
 	char		*name;
-	int16_t	n;		/* number of chars in font */
-	uint8_t	height;		/* height of bitmap */
+	i16	n;		/* number of chars in font */
+	u8	height;		/* height of bitmap */
 	char	ascent;		/* top of bitmap to baseline */
 	Fontchar *info;		/* n+1 character descriptors */
 	Memimage	*bits;		/* of font */
@@ -110,32 +110,32 @@ struct	Memdrawparam
 	Rectangle mr;
 	int op;
 
-	uint32_t state;
-	uint32_t mval;	/* if Simplemask, the mask pixel in mask format */
-	uint32_t mrgba;	/* mval in rgba */
-	uint32_t sval;	/* if Simplesrc, the source pixel in src format */
-	uint32_t srgba;	/* sval in rgba */
-	uint32_t sdval;	/* sval in dst format */
+	u32 state;
+	u32 mval;	/* if Simplemask, the mask pixel in mask format */
+	u32 mrgba;	/* mval in rgba */
+	u32 sval;	/* if Simplesrc, the source pixel in src format */
+	u32 srgba;	/* sval in rgba */
+	u32 sdval;	/* sval in dst format */
 };
 
 /*
  * Memimage management
  */
 
-extern Memimage*	allocmemimage(Rectangle, uint32_t);
-extern Memimage*	allocmemimaged(Rectangle, uint32_t, Memdata*);
+extern Memimage*	allocmemimage(Rectangle, u32);
+extern Memimage*	allocmemimaged(Rectangle, u32, Memdata*);
 extern Memimage*	readmemimage(int);
 extern Memimage*	creadmemimage(int);
 extern int	writememimage(int, Memimage*);
 extern void	freememimage(Memimage*);
-extern int		loadmemimage(Memimage*, Rectangle, uint8_t*, int);
-extern int		cloadmemimage(Memimage*, Rectangle, uint8_t*, int);
-extern int		unloadmemimage(Memimage*, Rectangle, uint8_t*, int);
-extern uint32_t*	wordaddr(Memimage*, Point);
-extern uint8_t*	byteaddr(Memimage*, Point);
+extern int		loadmemimage(Memimage*, Rectangle, u8*, int);
+extern int		cloadmemimage(Memimage*, Rectangle, u8*, int);
+extern int		unloadmemimage(Memimage*, Rectangle, u8*, int);
+extern u32 *	wordaddr(Memimage*, Point);
+extern u8 *	byteaddr(Memimage*, Point);
 extern int		drawclip(Memimage*, Rectangle*, Memimage*, Point*, Memimage*, Point*, Rectangle*, Rectangle*);
-extern void	memfillcolor(Memimage*, uint32_t);
-extern int		memsetchan(Memimage*, uint32_t);
+extern void	memfillcolor(Memimage*, u32);
+extern int		memsetchan(Memimage*, u32);
 
 /*
  * Graphics

+ 3 - 3
sys/include/memlayer.h

@@ -35,14 +35,14 @@ struct Memlayer
 /*
  * These functions accept local coordinates
  */
-int			memload(Memimage*, Rectangle, uint8_t*, int, int);
-int			memunload(Memimage*, Rectangle, uint8_t*, int);
+int			memload(Memimage*, Rectangle, u8*, int, int);
+int			memunload(Memimage*, Rectangle, u8*, int);
 
 /*
  * All these functions accept screen coordinates, not local ones.
  */
 void			_memlayerop(void (*fn)(Memimage*, Rectangle, Rectangle, void*, int), Memimage*, Rectangle, Rectangle, void*);
-Memimage*	memlalloc(Memscreen*, Rectangle, Refreshfn, void*, uint32_t);
+Memimage*	memlalloc(Memscreen*, Rectangle, Refreshfn, void*, u32);
 void			memldelete(Memimage*);
 void			memlfree(Memimage*);
 void			memltofront(Memimage*);

+ 4 - 3
sys/include/mouse.h

@@ -20,7 +20,7 @@ struct	Mouse
 {
 	int	buttons;	/* bit array: LMR=124 */
 	Point	xy;
-	uint32_t	msec;
+	u32	msec;
 };
 
 struct Mousectl
@@ -28,7 +28,7 @@ struct Mousectl
 	//Mouse;
 	int	buttons;	/* bit array: LMR=124 */
 	Point	xy;
-	uint32_t	msec;
+	u32	msec;
 	Channel	*c;	/* chan(Mouse) */
 	Channel	*resizec;	/* chan(int)[2] */
 			/* buffered in case client is waiting for a mouse action before handling resize */
@@ -58,4 +58,5 @@ extern void		setcursor(Mousectl*, Cursor*);
 extern void		drawgetrect(Rectangle, int);
 extern Rectangle	getrect(int, Mousectl*);
 extern int	 		menuhit(int, Mousectl*, Menu*, Screen*);
-extern void setmenucolor(uint32_t backcolor, uint32_t highcolor, uint32_t bordercolor, uint32_t textcolor, uint32_t seltextcolor);
+extern void setmenucolor(u32 backcolor, u32 highcolor, u32 bordercolor,
+			 u32 textcolor, u32 seltextcolor);

+ 9 - 9
sys/include/mp.h

@@ -44,24 +44,24 @@ mpint*	mpcopy(mpint *b);
 void	mpassign(mpint *old, mpint *new);
 
 /* random bits */
-mpint*	mprand(int bits, void (*gen)(uint8_t*, int), mpint *b);
+mpint*	mprand(int bits, void (*gen)(u8*, int), mpint *b);
 
 /* conversion */
 mpint*	strtomp(char*, char**, int, mpint*);	/* ascii */
 int	mpfmt(Fmt*);
 char*	mptoa(mpint*, int, char*, int);
-mpint*	letomp(uint8_t*, uint, mpint*);	/* byte array, little-endian */
-int	mptole(mpint*, uint8_t*, uint, uint8_t**);
-mpint*	betomp(uint8_t*, uint, mpint*);	/* byte array, little-endian */
-int	mptobe(mpint*, uint8_t*, uint, uint8_t**);
+mpint*	letomp(u8*, uint, mpint*);	/* byte array, little-endian */
+int	mptole(mpint*, u8*, uint, u8**);
+mpint*	betomp(u8*, uint, mpint*);	/* byte array, little-endian */
+int	mptobe(mpint*, u8*, uint, u8**);
 uint	mptoui(mpint*);			/* unsigned int */
 mpint*	uitomp(uint, mpint*);
 int	mptoi(mpint*);			/* int */
 mpint*	itomp(int, mpint*);
-uint64_t	mptouv(mpint*);			/* unsigned vlong */
-mpint*	uvtomp(uint64_t, mpint*);
-int64_t	mptov(mpint*);			/* vlong */
-mpint*	vtomp(int64_t, mpint*);
+u64	mptouv(mpint*);			/* unsigned vlong */
+mpint*	uvtomp(u64, mpint*);
+i64	mptov(mpint*);			/* vlong */
+mpint*	vtomp(i64, mpint*);
 
 /* divide 2 digits by one */
 void	mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);

+ 9 - 9
sys/include/ndb.h

@@ -30,12 +30,12 @@ struct Ndb
 	Ndb		*next;
 
 	Biobufhdr	b;		/* buffered input file */
-	uint8_t		buf[256];	/* and its buffer */
+	u8		buf[256];	/* and its buffer */
 
-	uint32_t		mtime;		/* mtime of db file */
+	u32		mtime;		/* mtime of db file */
 	Qid		qid;		/* qid of db file */
 	char		file[128];/* path name of db file */
-	uint32_t		length;		/* length of db file */
+	u32		length;		/* length of db file */
 
 	int		nohash;		/* don't look for hash files */
 	Ndbhf		*hf;		/* open hash files */
@@ -53,7 +53,7 @@ struct Ndbtuple
 	char		*val;			/* value(s) */
 	Ndbtuple	*entry;			/* next tuple in this entry */
 	Ndbtuple	*line;			/* next tuple on this line */
-	uint32_t		ptr;			/* (for the application - starts 0) */
+	u32		ptr;			/* (for the application - starts 0) */
 	char		valbuf[Ndbvlen];	/* initial allocation for value */
 };
 
@@ -101,8 +101,8 @@ struct Ndbs
 	Ndb	*db;	/* data base file being searched */
 	Ndbhf	*hf;	/* hash file being searched */
 	int	type;
-	uint32_t	ptr;	/* current pointer */
-	uint32_t	ptr1;	/* next pointer */
+	u32	ptr;	/* current pointer */
+	u32	ptr1;	/* next pointer */
 	Ndbtuple *t;	/* last attribute value pair found */
 };
 
@@ -116,13 +116,13 @@ struct Ndbs
 /*
  *  macros for packing and unpacking pointers
  */
-#define NDBPUTP(v,a) { (a)[0] = (uint8_t)v; (a)[1] = (uint8_t)(v)>>8; (a)[2] = (uint8_t)(v)>>16; }
+#define NDBPUTP(v,a) { (a)[0] = (u8)v; (a)[1] = (u8)(v)>>8; (a)[2] = (u8)(v)>>16; }
 #define NDBGETP(a) ((a)[0] | ((a)[1]<<8) | ((a)[2]<<16))
 
 /*
  *  macros for packing and unpacking unsigned longs
  */
-#define NDBPUTUL(v,a) { (a)[0] = (uint8_t)v; (a)[1] = (uint8_t)(v)>>8; (a)[2] = (uint8_t)(v)>>16; (a)[3] = (uint8_t)(v)>>24; }
+#define NDBPUTUL(v,a) { (a)[0] = (u8)v; (a)[1] = (u8)(v)>>8; (a)[2] = (u8)(v)>>16; (a)[3] = (u8)(v)>>24; }
 #define NDBGETUL(a) ((a)[0] | ((a)[1]<<8) | ((a)[2]<<16) | ((a)[3]<<24))
 
 #define NDB_IPlen 16
@@ -144,7 +144,7 @@ Ndbtuple*	ndbgetval(Ndb*, Ndbs*, char*, char*, char*, char*);
 char*		ndbgetvalue(Ndb*, Ndbs*, char*, char*, char*,
 				   Ndbtuple**);
 Ndbtuple*	ndbfindattr(Ndbtuple*, Ndbtuple*, char*);
-uint32_t		ndbhash(char*, int);
+u32		ndbhash(char*, int);
 Ndbtuple*	ndbipinfo(Ndb*, char*, char*, char**, int);
 Ndbtuple*	ndblookval(Ndbtuple*, Ndbtuple*, char*, char*);
 Ndbtuple*	ndbnew(char*, char*);

+ 108 - 108
sys/include/nfs3.h

@@ -75,10 +75,10 @@ struct NfsMount3TMnt {
 struct NfsMount3RMnt {
 	NfsMount3Call call;
 	uint status;
-	uint8_t *handle;
+	u8 *handle;
 	uint len;
-	uint32_t *auth;
-	uint32_t nauth;
+	u32 *auth;
+	u32 nauth;
 };
 
 struct NfsMount3TDump {
@@ -92,8 +92,8 @@ struct NfsMount3Entry {
 
 struct NfsMount3RDump {
 	NfsMount3Call call;
-	uint8_t *data;
-	uint32_t count;
+	u8 *data;
+	u32 count;
 };
 
 struct NfsMount3TUmnt {
@@ -108,7 +108,7 @@ struct NfsMount3RUmnt {
 struct NfsMount3Export {
 	char *path;
 	char **g;
-	uint32_t ng;
+	u32 ng;
 };
 
 struct NfsMount3TUmntall {
@@ -125,17 +125,17 @@ struct NfsMount3TExport {
 
 struct NfsMount3RExport {
 	NfsMount3Call call;
-	uint8_t *data;
-	uint32_t count;
+	u8 *data;
+	u32 count;
 };
 
-uint nfsMount3ExportGroupSize(uint8_t*);
+uint nfsMount3ExportGroupSize(u8*);
 uint nfsMount3ExportSize(NfsMount3Export*);
-int nfsMount3ExportPack(uint8_t*, uint8_t*, uint8_t**, NfsMount3Export*);
-int nfsMount3ExportUnpack(uint8_t*, uint8_t*, uint8_t**, char**, char***,
+int nfsMount3ExportPack(u8*, u8*, u8**, NfsMount3Export*);
+int nfsMount3ExportUnpack(u8*, u8*, u8**, char**, char***,
 			  NfsMount3Export*);
-int nfsMount3EntryPack(uint8_t*, uint8_t*, uint8_t**, NfsMount3Entry*);
-int nfsMount3EntryUnpack(uint8_t*, uint8_t*, uint8_t**, NfsMount3Entry*);
+int nfsMount3EntryPack(u8*, u8*, u8**, NfsMount3Entry*);
+int nfsMount3EntryUnpack(u8*, u8*, u8**, NfsMount3Entry*);
 uint nfsMount3EntrySize(NfsMount3Entry*);
 
 extern SunProg nfsMount3Prog;
@@ -347,34 +347,34 @@ struct Nfs3Call {
 };
 
 struct Nfs3Handle {
-	uint8_t h[Nfs3MaxHandleSize];
-	uint32_t len;
+	u8 h[Nfs3MaxHandleSize];
+	u32 len;
 };
 
 struct Nfs3Time {
-	uint32_t sec;
-	uint32_t nsec;
+	u32 sec;
+	u32 nsec;
 };
 
 struct Nfs3Attr {
 	Nfs3FileType type;
-	uint32_t mode;
-	uint32_t nlink;
-	uint32_t uid;
-	uint32_t gid;
-	uint64_t size;
-	uint64_t used;
-	uint32_t major;
-	uint32_t minor;
-	uint64_t fsid;
-	uint64_t fileid;
+	u32 mode;
+	u32 nlink;
+	u32 uid;
+	u32 gid;
+	u64 size;
+	u64 used;
+	u32 major;
+	u32 minor;
+	u64 fsid;
+	u64 fileid;
 	Nfs3Time atime;
 	Nfs3Time mtime;
 	Nfs3Time ctime;
 };
 
 struct Nfs3WccAttr {
-	uint64_t size;
+	u64 size;
 	Nfs3Time mtime;
 	Nfs3Time ctime;
 };
@@ -388,13 +388,13 @@ struct Nfs3Wcc {
 
 struct Nfs3SetAttr {
 	u1int setMode;
-	uint32_t mode;
+	u32 mode;
 	u1int setUid;
-	uint32_t uid;
+	u32 uid;
 	u1int setGid;
-	uint32_t gid;
+	u32 gid;
 	u1int setSize;
-	uint64_t size;
+	u64 size;
 	Nfs3SetTime setAtime;
 	Nfs3Time atime;
 	Nfs3SetTime setMtime;
@@ -453,7 +453,7 @@ struct Nfs3RLookup {
 struct Nfs3TAccess {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint32_t access;
+	u32 access;
 };
 
 struct Nfs3RAccess {
@@ -461,7 +461,7 @@ struct Nfs3RAccess {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint32_t access;
+	u32 access;
 };
 
 struct Nfs3TReadlink {
@@ -480,8 +480,8 @@ struct Nfs3RReadlink {
 struct Nfs3TRead {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint64_t offset;
-	uint32_t count;
+	u64 offset;
+	u32 count;
 };
 
 struct Nfs3RRead {
@@ -489,29 +489,29 @@ struct Nfs3RRead {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint32_t count;
+	u32 count;
 	u1int eof;
-	uint8_t *data;
-	uint32_t ndata;
+	u8 *data;
+	u32 ndata;
 };
 
 struct Nfs3TWrite {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint64_t offset;
-	uint32_t count;
+	u64 offset;
+	u32 count;
 	Nfs3Sync stable;
-	uint8_t *data;
-	uint32_t ndata;
+	u8 *data;
+	u32 ndata;
 };
 
 struct Nfs3RWrite {
 	Nfs3Call call;
 	Nfs3Status status;
 	Nfs3Wcc wcc;
-	uint32_t count;
+	u32 count;
 	Nfs3Sync committed;
-	uint8_t verf[Nfs3WriteVerfSize];
+	u8 verf[Nfs3WriteVerfSize];
 };
 
 struct Nfs3TCreate {
@@ -520,7 +520,7 @@ struct Nfs3TCreate {
 	char *name;
 	Nfs3Create mode;
 	Nfs3SetAttr attr;
-	uint8_t verf[Nfs3CreateVerfSize];
+	u8 verf[Nfs3CreateVerfSize];
 };
 
 struct Nfs3RCreate {
@@ -574,8 +574,8 @@ struct Nfs3TMknod {
 	char *name;
 	Nfs3FileType type;
 	Nfs3SetAttr attr;
-	uint32_t major;
-	uint32_t minor;
+	u32 major;
+	u32 minor;
 };
 
 struct Nfs3RMknod {
@@ -651,9 +651,9 @@ struct Nfs3RLink {
 struct Nfs3TReadDir {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint64_t cookie;
-	uint8_t verf[Nfs3CookieVerfSize];
-	uint32_t count;
+	u64 cookie;
+	u8 verf[Nfs3CookieVerfSize];
+	u32 count;
 };
 
 struct Nfs3RReadDir {
@@ -661,25 +661,25 @@ struct Nfs3RReadDir {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint8_t verf[Nfs3CookieVerfSize];
-	uint8_t *data;
-	uint32_t count;
+	u8 verf[Nfs3CookieVerfSize];
+	u8 *data;
+	u32 count;
 	u1int eof;
 };
 
 struct Nfs3TReadDirPlus {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint64_t cookie;
-	uint8_t verf[Nfs3CookieVerfSize];
-	uint32_t dirCount;
-	uint32_t maxCount;
+	u64 cookie;
+	u8 verf[Nfs3CookieVerfSize];
+	u32 dirCount;
+	u32 maxCount;
 };
 
 struct Nfs3Entry {
-	uint64_t fileid;
+	u64 fileid;
 	char *name;
-	uint64_t cookie;
+	u64 cookie;
 	u1int haveAttr;
 	Nfs3Attr attr;
 	u1int haveHandle;
@@ -691,9 +691,9 @@ struct Nfs3RReadDirPlus {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint8_t verf[Nfs3CookieVerfSize];
-	uint8_t *data;
-	uint32_t count;
+	u8 verf[Nfs3CookieVerfSize];
+	u8 *data;
+	u32 count;
 	u1int eof;
 };
 
@@ -707,13 +707,13 @@ struct Nfs3RFsStat {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint64_t totalBytes;
-	uint64_t freeBytes;
-	uint64_t availBytes;
-	uint64_t totalFiles;
-	uint64_t freeFiles;
-	uint64_t availFiles;
-	uint32_t invarSec;
+	u64 totalBytes;
+	u64 freeBytes;
+	u64 availBytes;
+	u64 totalFiles;
+	u64 freeFiles;
+	u64 availFiles;
+	u32 invarSec;
 };
 
 struct Nfs3TFsInfo {
@@ -726,16 +726,16 @@ struct Nfs3RFsInfo {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint32_t readMax;
-	uint32_t readPref;
-	uint32_t readMult;
-	uint32_t writeMax;
-	uint32_t writePref;
-	uint32_t writeMult;
-	uint32_t readDirPref;
-	uint64_t maxFileSize;
+	u32 readMax;
+	u32 readPref;
+	u32 readMult;
+	u32 writeMax;
+	u32 writePref;
+	u32 writeMult;
+	u32 readDirPref;
+	u64 maxFileSize;
 	Nfs3Time timePrec;
-	uint32_t flags;
+	u32 flags;
 };
 
 struct Nfs3TPathconf {
@@ -748,8 +748,8 @@ struct Nfs3RPathconf {
 	Nfs3Status status;
 	u1int haveAttr;
 	Nfs3Attr attr;
-	uint32_t maxLink;
-	uint32_t maxName;
+	u32 maxLink;
+	u32 maxName;
 	u1int noTrunc;
 	u1int chownRestricted;
 	u1int caseInsensitive;
@@ -759,15 +759,15 @@ struct Nfs3RPathconf {
 struct Nfs3TCommit {
 	Nfs3Call call;
 	Nfs3Handle handle;
-	uint64_t offset;
-	uint32_t count;
+	u64 offset;
+	u32 count;
 };
 
 struct Nfs3RCommit {
 	Nfs3Call call;
 	Nfs3Status status;
 	Nfs3Wcc wcc;
-	uint8_t verf[Nfs3WriteVerfSize];
+	u8 verf[Nfs3WriteVerfSize];
 };
 
 char *nfs3StatusStr(Nfs3Status);
@@ -776,44 +776,44 @@ char *nfs3SetTimeStr(Nfs3SetTime);
 char *nfs3SyncStr(Nfs3Sync);
 
 void nfs3HandlePrint(Fmt*, Nfs3Handle*);
-uint32_t nfs3HandleSize(Nfs3Handle*);
-int nfs3HandlePack(uint8_t*, uint8_t*, uint8_t**, Nfs3Handle*);
-int nfs3HandleUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Handle*);
+u32 nfs3HandleSize(Nfs3Handle*);
+int nfs3HandlePack(u8*, u8*, u8**, Nfs3Handle*);
+int nfs3HandleUnpack(u8*, u8*, u8**, Nfs3Handle*);
 
 void nfs3TimePrint(Fmt*, Nfs3Time*);
-uint32_t nfs3TimeSize(Nfs3Time*);
-int nfs3TimePack(uint8_t*, uint8_t*, uint8_t**, Nfs3Time*);
-int nfs3TimeUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Time*);
+u32 nfs3TimeSize(Nfs3Time*);
+int nfs3TimePack(u8*, u8*, u8**, Nfs3Time*);
+int nfs3TimeUnpack(u8*, u8*, u8**, Nfs3Time*);
 
 void nfs3AttrPrint(Fmt*, Nfs3Attr*);
-uint32_t nfs3AttrSize(Nfs3Attr*);
-int nfs3AttrPack(uint8_t*, uint8_t*, uint8_t**, Nfs3Attr*);
-int nfs3AttrUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Attr*);
+u32 nfs3AttrSize(Nfs3Attr*);
+int nfs3AttrPack(u8*, u8*, u8**, Nfs3Attr*);
+int nfs3AttrUnpack(u8*, u8*, u8**, Nfs3Attr*);
 
 void nfs3WccAttrPrint(Fmt*, Nfs3WccAttr*);
-uint32_t nfs3WccAttrSize(Nfs3WccAttr*);
-int nfs3WccAttrPack(uint8_t*, uint8_t*, uint8_t**, Nfs3WccAttr*);
-int nfs3WccAttrUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3WccAttr*);
+u32 nfs3WccAttrSize(Nfs3WccAttr*);
+int nfs3WccAttrPack(u8*, u8*, u8**, Nfs3WccAttr*);
+int nfs3WccAttrUnpack(u8*, u8*, u8**, Nfs3WccAttr*);
 
 void nfs3WccPrint(Fmt*, Nfs3Wcc*);
-uint32_t nfs3WccSize(Nfs3Wcc*);
-int nfs3WccPack(uint8_t*, uint8_t*, uint8_t**, Nfs3Wcc*);
-int nfs3WccUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Wcc*);
+u32 nfs3WccSize(Nfs3Wcc*);
+int nfs3WccPack(u8*, u8*, u8**, Nfs3Wcc*);
+int nfs3WccUnpack(u8*, u8*, u8**, Nfs3Wcc*);
 
 void nfs3SetAttrPrint(Fmt*, Nfs3SetAttr*);
-uint32_t nfs3SetAttrSize(Nfs3SetAttr*);
-int nfs3SetAttrPack(uint8_t*, uint8_t*, uint8_t**, Nfs3SetAttr*);
-int nfs3SetAttrUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3SetAttr*);
+u32 nfs3SetAttrSize(Nfs3SetAttr*);
+int nfs3SetAttrPack(u8*, u8*, u8**, Nfs3SetAttr*);
+int nfs3SetAttrUnpack(u8*, u8*, u8**, Nfs3SetAttr*);
 
 extern SunProg nfs3Prog;
 
 void nfs3EntryPrint(Fmt*, Nfs3Entry*);
-uint32_t nfs3EntrySize(Nfs3Entry*);
-int nfs3EntryPack(uint8_t*, uint8_t*, uint8_t**, Nfs3Entry*);
-int nfs3EntryUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Entry*);
+u32 nfs3EntrySize(Nfs3Entry*);
+int nfs3EntryPack(u8*, u8*, u8**, Nfs3Entry*);
+int nfs3EntryUnpack(u8*, u8*, u8**, Nfs3Entry*);
 
 void nfs3EntryPlusPrint(Fmt*, Nfs3Entry*);
-uint32_t nfs3EntryPlusSize(Nfs3Entry*);
-int nfs3EntryPlusPack(uint8_t*, uint8_t*, uint8_t**, Nfs3Entry*);
-int nfs3EntryPlusUnpack(uint8_t*, uint8_t*, uint8_t**, Nfs3Entry*);
+u32 nfs3EntryPlusSize(Nfs3Entry*);
+int nfs3EntryPlusPack(u8*, u8*, u8**, Nfs3Entry*);
+int nfs3EntryPlusUnpack(u8*, u8*, u8**, Nfs3Entry*);
 

+ 1 - 1
sys/include/oprofile.h

@@ -107,7 +107,7 @@ void oprofile_write_reserve(struct op_entry *entry,
 			    Ureg *regs,
 			    unsigned long pc, int code, int size);
 int oprofile_add_data(struct op_entry *entry, unsigned long val);
-int oprofile_add_data64(struct op_entry *entry, uint64_t val);
+int oprofile_add_data64(struct op_entry *entry, u64 val);
 int oprofile_write_commit(struct op_entry *entry);
 
 void oprofile_perf_exit(void);

+ 41 - 41
sys/include/oventi.h

@@ -90,28 +90,28 @@ enum {
 };
 
 struct VtRoot {
-	uint16_t version;
+	u16 version;
 	char name[128];
 	char type[128];
-	uint8_t score[VtScoreSize];	/* to a Dir block */
-	uint16_t blockSize;		/* maximum block size */
-	uint8_t prev[VtScoreSize];	/* last root block */
+	u8 score[VtScoreSize];	/* to a Dir block */
+	u16 blockSize;		/* maximum block size */
+	u8 prev[VtScoreSize];	/* last root block */
 };
 
 struct VtEntry {
-	uint32_t gen;			/* generation number */
-	uint16_t psize;			/* pointer block size */
-	uint16_t dsize;			/* data block size */
-	uint8_t depth;			/* unpacked from flags */
-	uint8_t flags;
-	uint64_t size;
-	uint8_t score[VtScoreSize];
+	u32 gen;			/* generation number */
+	u16 psize;			/* pointer block size */
+	u16 dsize;			/* data block size */
+	u8 depth;			/* unpacked from flags */
+	u8 flags;
+	u64 size;
+	u8 score[VtScoreSize];
 };
 
 struct VtServerVtbl {
-	Packet *(*read)(VtSession*, uint8_t score[VtScoreSize], int type,
+	Packet *(*read)(VtSession*, u8 score[VtScoreSize], int type,
 			int n);
-	int (*write)(VtSession*, uint8_t score[VtScoreSize], int type,
+	int (*write)(VtSession*, u8 score[VtScoreSize], int type,
 		     Packet *p);
 	void (*closing)(VtSession*, int clean);
 	void (*sync)(VtSession*);
@@ -125,7 +125,7 @@ enum {
 };
 
 /* score of zero length block */
-extern uint8_t vtZeroScore[VtScoreSize];	
+extern u8 vtZeroScore[VtScoreSize];	
 
 /* both sides */
 void vtAttach(void);
@@ -168,24 +168,24 @@ int vtRedial(VtSession*, char *server);
 VtSession *vtStdioServer(char *server);
 int vtPing(VtSession *s);
 int vtSetUid(VtSession*, char *uid);
-int vtRead(VtSession*, uint8_t score[VtScoreSize], int type, uint8_t *buf,
+int vtRead(VtSession*, u8 score[VtScoreSize], int type, u8 *buf,
 	   int n);
-int vtWrite(VtSession*, uint8_t score[VtScoreSize], int type, uint8_t *buf,
+int vtWrite(VtSession*, u8 score[VtScoreSize], int type, u8 *buf,
 	    int n);
-Packet *vtReadPacket(VtSession*, uint8_t score[VtScoreSize], int type,
+Packet *vtReadPacket(VtSession*, u8 score[VtScoreSize], int type,
 		     int n);
-int vtWritePacket(VtSession*, uint8_t score[VtScoreSize], int type,
+int vtWritePacket(VtSession*, u8 score[VtScoreSize], int type,
 		  Packet *p);
 int vtSync(VtSession *s);
 
-int vtZeroExtend(int type, uint8_t *buf, int n, int nn);
-int vtZeroTruncate(int type, uint8_t *buf, int n);
-int vtParseScore(char*, uint, uint8_t[VtScoreSize]);
+int vtZeroExtend(int type, u8 *buf, int n, int nn);
+int vtZeroTruncate(int type, u8 *buf, int n);
+int vtParseScore(char*, uint, u8[VtScoreSize]);
 
-void vtRootPack(VtRoot*, uint8_t*);
-int vtRootUnpack(VtRoot*, uint8_t*);
-void vtEntryPack(VtEntry*, uint8_t*, int index);
-int vtEntryUnpack(VtEntry*, uint8_t*, int index);
+void vtRootPack(VtRoot*, u8*);
+int vtRootUnpack(VtRoot*, u8*);
+void vtEntryPack(VtEntry*, u8*, int index);
+int vtEntryUnpack(VtEntry*, u8*, int index);
 
 /* server side */
 VtSession *vtServerAlloc(VtServerVtbl*);
@@ -196,31 +196,31 @@ int vtExport(VtSession *s);
 VtSha1* vtSha1Alloc(void);
 void vtSha1Free(VtSha1*);
 void vtSha1Init(VtSha1*);
-void vtSha1Update(VtSha1*, uint8_t *, int n);
-void vtSha1Final(VtSha1*, uint8_t sha1[VtScoreSize]);
-void vtSha1(uint8_t score[VtScoreSize], uint8_t *, int);
-int vtSha1Check(uint8_t score[VtScoreSize], uint8_t *, int);
+void vtSha1Update(VtSha1*, u8 *, int n);
+void vtSha1Final(VtSha1*, u8 sha1[VtScoreSize]);
+void vtSha1(u8 score[VtScoreSize], u8 *, int);
+int vtSha1Check(u8 score[VtScoreSize], u8 *, int);
 int vtScoreFmt(Fmt *fmt);
 
 /* Packet */
 Packet *packetAlloc(void);
 void packetFree(Packet*);
-Packet *packetForeign(uint8_t *buf, int n, void (*free)(void *a), void *a);
+Packet *packetForeign(u8 *buf, int n, void (*free)(void *a), void *a);
 Packet *packetDup(Packet*, int offset, int n);
 Packet *packetSplit(Packet*, int n);
-int packetConsume(Packet*, uint8_t *buf, int n);
+int packetConsume(Packet*, u8 *buf, int n);
 int packetTrim(Packet*, int offset, int n);
-uint8_t *packetHeader(Packet*, int n);
-uint8_t *packetTrailer(Packet*, int n);
-int packetPrefix(Packet*, uint8_t *buf, int n);
-int packetAppend(Packet*, uint8_t *buf, int n);
+u8 *packetHeader(Packet*, int n);
+u8 *packetTrailer(Packet*, int n);
+int packetPrefix(Packet*, u8 *buf, int n);
+int packetAppend(Packet*, u8 *buf, int n);
 int packetConcat(Packet*, Packet*);
-uint8_t *packetPeek(Packet*, uint8_t *buf, int offset, int n);
-int packetCopy(Packet*, uint8_t *buf, int offset, int n);
+u8 *packetPeek(Packet*, u8 *buf, int offset, int n);
+int packetCopy(Packet*, u8 *buf, int offset, int n);
 int packetFragments(Packet*, IOchunk*, int nio, int offset);
 int packetSize(Packet*);
 int packetAllocatedSize(Packet*);
-void packetSha1(Packet*, uint8_t sha1[VtScoreSize]);
+void packetSha1(Packet*, u8 sha1[VtScoreSize]);
 int packetCompact(Packet*);
 int packetCmp(Packet*, Packet*);
 void packetStats(void);
@@ -260,9 +260,9 @@ int vtWakeupAll(VtRendez*);
 
 /* fd functions - really network (socket) functions */
 void vtFdClose(int);
-int vtFdRead(int, uint8_t*, int);
-int vtFdReadFully(int, uint8_t*, int);
-int vtFdWrite(int, uint8_t*, int);
+int vtFdRead(int, u8*, int);
+int vtFdReadFully(int, u8*, int);
+int vtFdWrite(int, u8*, int);
 
 /*
  * formatting

+ 13 - 13
sys/include/pool.h

@@ -10,20 +10,20 @@
 typedef struct Pool Pool;
 struct Pool {
 	char*	name;
-	uint32_t	maxsize;
+	u32	maxsize;
 
-	uint32_t	cursize;
-	uint32_t	curfree;
-	uint32_t	curalloc;
+	u32	cursize;
+	u32	curfree;
+	u32	curalloc;
 
-	uint32_t	minarena;	/* smallest size of new arena */
-	uint32_t	quantum;	/* allocated blocks should be multiple of */
-	uint32_t	minblock;	/* smallest newly allocated block */
+	u32	minarena;	/* smallest size of new arena */
+	u32	quantum;	/* allocated blocks should be multiple of */
+	u32	minblock;	/* smallest newly allocated block */
 
 	void*	freeroot;	/* actually Free* */
 	void*	arenalist;	/* actually Arena* */
 
-	void*	(*alloc)(uint32_t);
+	void*	(*alloc)(u32);
 	int	(*merge)(void*, void*);
 	void	(*move)(void* from, void* to);
 
@@ -40,12 +40,12 @@ struct Pool {
 	void*	private;
 };
 
-extern void*	poolalloc(Pool*, uint32_t);
-extern void*	poolallocalign(Pool*, uint32_t, uint32_t, int32_t,
-				   uint32_t);
+extern void*	poolalloc(Pool*, u32);
+extern void*	poolallocalign(Pool*, u32, u32, i32,
+				   u32);
 extern void	poolfree(Pool*, void*);
-extern uint32_t	poolmsize(Pool*, void*);
-extern void*	poolrealloc(Pool*, void*, uint32_t);
+extern u32	poolmsize(Pool*, void*);
+extern void*	poolrealloc(Pool*, void*, u32);
 extern void	poolcheck(Pool*);
 extern int	poolcompact(Pool*);
 extern void	poolblockcheck(Pool*, void*);

+ 15 - 11
sys/include/rijndael.h

@@ -21,10 +21,10 @@ typedef struct rijndaelCtx rijndaelCtx;
 
 struct rijndaelCtx
 {
-	uint32_t		k_len;
+	u32		k_len;
 	int				decrypt;
-	uint32_t		e_key[64];
-	uint32_t		d_key[64];
+	u32		e_key[64];
+	u32		d_key[64];
 };
 
 
@@ -34,14 +34,18 @@ struct rijndaelCtx
 /* require endian conversions for big-endian architectures			*/
 
 rijndaelCtx *
-			rijndael_set_key(rijndaelCtx *, const uint32_t *, const uint32_t, int);
-void		rijndael_encrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
-void		rijndael_decrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
+			rijndael_set_key(rijndaelCtx *, const u32 *,
+					 const u32, int);
+void		rijndael_encrypt(rijndaelCtx *, const u32 *, u32 *);
+void		rijndael_decrypt(rijndaelCtx *, const u32 *, u32 *);
 
 /* conventional interface */
 
-void		aes_set_key(rijndaelCtx *ctx, const uint8_t *key, unsigned keybits, int enc);
-void		aes_ecb_encrypt(rijndaelCtx *ctx, uint8_t *data, unsigned len);
-void		aes_ecb_decrypt(rijndaelCtx *ctx, uint8_t *data, unsigned len);
-void		aes_cbc_encrypt(rijndaelCtx *ctx, uint8_t *iva, uint8_t *data, unsigned len);
-void		aes_cbc_decrypt(rijndaelCtx *ctx, uint8_t *iva, uint8_t *data, unsigned len);
+void		aes_set_key(rijndaelCtx *ctx, const u8 *key,
+				unsigned keybits, int enc);
+void		aes_ecb_encrypt(rijndaelCtx *ctx, u8 *data, unsigned len);
+void		aes_ecb_decrypt(rijndaelCtx *ctx, u8 *data, unsigned len);
+void		aes_cbc_encrypt(rijndaelCtx *ctx, u8 *iva, u8 *data,
+				    unsigned len);
+void		aes_cbc_decrypt(rijndaelCtx *ctx, u8 *iva, u8 *data,
+				    unsigned len);

+ 14 - 14
sys/include/sha2.h

@@ -61,34 +61,34 @@ typedef SHA512Ctx SHA384Ctx;
 
 struct SHA256Ctx
 {
-	uint32_t		state[8];
-	uint64_t		bitcount;
-	uint8_t		buffer[SHA256BlockLength];
+	u32		state[8];
+	u64		bitcount;
+	u8		buffer[SHA256BlockLength];
 };
 
 
 
 struct SHA512Ctx
 {
-	uint64_t		state[8];
-	uint64_t		bitcount[2];
-	uint8_t		buffer[SHA512_block_length];
+	u64		state[8];
+	u64		bitcount[2];
+	u8		buffer[SHA512_block_length];
 };
 
 
 void		SHA224_Init(SHA224Ctx *);
-void		SHA224_Update(SHA224Ctx *, const uint8_t *, size_t);
-void		SHA224_Final(uint8_t[SHA224DigestLength], SHA224Ctx *);
+void		SHA224_Update(SHA224Ctx *, const u8 *, size_t);
+void		SHA224_Final(u8[SHA224DigestLength], SHA224Ctx *);
 
 void		SHA256_Init(SHA256Ctx *);
-void		SHA256_Update(SHA256Ctx *, const uint8_t *, size_t);
-void		SHA256_Final(uint8_t[SHA256DigestLength], SHA256Ctx *);
+void		SHA256_Update(SHA256Ctx *, const u8 *, size_t);
+void		SHA256_Final(u8[SHA256DigestLength], SHA256Ctx *);
 
 void		SHA384_Init(SHA384Ctx *);
-void		SHA384_Update(SHA384Ctx *, const uint8_t *, size_t);
-void		SHA384_Final(uint8_t[SHA384DigestLength], SHA384Ctx *);
+void		SHA384_Update(SHA384Ctx *, const u8 *, size_t);
+void		SHA384_Final(u8[SHA384DigestLength], SHA384Ctx *);
 
 void		SHA512_Init(SHA512Ctx *);
-void		SHA512_Update(SHA512Ctx *, const uint8_t *, size_t);
-void		SHA512_Final(uint8_t[SHA512DigestLength], SHA512Ctx *);
+void		SHA512_Update(SHA512Ctx *, const u8 *, size_t);
+void		SHA512_Final(u8[SHA512DigestLength], SHA512Ctx *);
 

+ 7 - 7
sys/include/stdio.h

@@ -39,10 +39,10 @@ typedef struct{
 	char *rp;	/* read pointer (or write end-of-buffer) */
 	char *wp;	/* write pointer (or read end-of-buffer) */
 	char *lp;	/* actual write pointer used when line-buffering */
-	int32_t bufl;	/* actual length of buffer */
+	i32 bufl;	/* actual length of buffer */
 	char unbuf[1];	/* tiny buffer for unbuffered io (used for ungetc?) */
 }FILE;
-typedef int32_t fpos_t;
+typedef i32 fpos_t;
 #ifndef NULL
 #define	NULL	((void*)0)
 #endif
@@ -75,7 +75,7 @@ FILE *fopen(const char *, const char *);
 FILE *fdopen(const int, const char *);
 FILE *freopen(const char *, const char *, FILE *);
 void setbuf(FILE *, char *);
-int setvbuf(FILE *, char *, int, int32_t);
+int setvbuf(FILE *, char *, int, i32);
 int fprintf(FILE *, const char *, ...);
 int fscanf(FILE *, const char *, ...);
 int printf(const char *, ...);
@@ -105,13 +105,13 @@ int putchar(int);
 #define	putchar(c)	putc(c, stdout)
 int puts(const char *);
 int ungetc(int, FILE *);
-int32_t fread(void *, int32_t, int32_t, FILE *);
-int32_t fwrite(const void *, int32_t, int32_t, FILE *);
+i32 fread(void *, i32, i32, FILE *);
+i32 fwrite(const void *, i32, i32, FILE *);
 int fgetpos(FILE *, fpos_t *);
-int fseek(FILE *, int32_t, int);
+int fseek(FILE *, i32, int);
 int fseeko(FILE *, long long, int);
 int fsetpos(FILE *, const fpos_t *);
-int32_t ftell(FILE *);
+i32 ftell(FILE *);
 long long ftello(FILE *);
 void rewind(FILE *);
 void clearerr(FILE *);

+ 66 - 66
sys/include/sunrpc.h

@@ -12,7 +12,7 @@
  */
 
 
-typedef uint8_t u1int;
+typedef u8 u1int;
 
 typedef struct SunAuthInfo SunAuthInfo;
 typedef struct SunAuthUnix SunAuthUnix;
@@ -56,43 +56,43 @@ typedef enum {
 struct SunAuthInfo
 {
 	uint flavor;
-	uint8_t *data;
+	u8 *data;
 	uint ndata;
 };
 
 struct SunAuthUnix
 {
-	uint32_t stamp;
+	u32 stamp;
 	char *sysname;
-	uint32_t uid;
-	uint32_t gid;
-	uint32_t g[16];
-	uint32_t ng;
+	u32 uid;
+	u32 gid;
+	u32 g[16];
+	u32 ng;
 };
 
 struct SunRpc
 {
-	uint32_t xid;
+	u32 xid;
 	uint iscall;
 
 	/*
 	 * only sent on wire in call
 	 * caller fills in for the reply unpackers.
 	 */
-	uint32_t proc;
+	u32 proc;
 
 	/* call */
 	// uint proc;
-	uint32_t prog, vers;
+	u32 prog, vers;
 	SunAuthInfo cred;
 	SunAuthInfo verf;
-	uint8_t *data;
+	u8 *data;
 	uint ndata;
 
 	/* reply */
-	uint32_t status;
+	u32 status;
 	// SunAuthInfo verf;
-	uint32_t low, high;
+	u32 low, high;
 	// uchar *data;
 	// uint ndata;
 };
@@ -113,42 +113,42 @@ void sunErrstr(SunStatus);
 
 void sunRpcPrint(Fmt*, SunRpc*);
 uint sunRpcSize(SunRpc*);
-SunStatus sunRpcPack(uint8_t*, uint8_t*, uint8_t**, SunRpc*);
-SunStatus sunRpcUnpack(uint8_t*, uint8_t*, uint8_t**, SunRpc*);
+SunStatus sunRpcPack(u8*, u8*, u8**, SunRpc*);
+SunStatus sunRpcUnpack(u8*, u8*, u8**, SunRpc*);
 
 void sunAuthInfoPrint(Fmt*, SunAuthInfo*);
 uint sunAuthInfoSize(SunAuthInfo*);
-int sunAuthInfoPack(uint8_t*, uint8_t*, uint8_t**, SunAuthInfo*);
-int sunAuthInfoUnpack(uint8_t*, uint8_t*, uint8_t**, SunAuthInfo*);
+int sunAuthInfoPack(u8*, u8*, u8**, SunAuthInfo*);
+int sunAuthInfoUnpack(u8*, u8*, u8**, SunAuthInfo*);
 
 void sunAuthUnixPrint(Fmt*, SunAuthUnix*);
 uint sunAuthUnixSize(SunAuthUnix*);
-int sunAuthUnixPack(uint8_t*, uint8_t*, uint8_t**, SunAuthUnix*);
-int sunAuthUnixUnpack(uint8_t*, uint8_t*, uint8_t**, SunAuthUnix*);
+int sunAuthUnixPack(u8*, u8*, u8**, SunAuthUnix*);
+int sunAuthUnixUnpack(u8*, u8*, u8**, SunAuthUnix*);
 
-int sunEnumPack(uint8_t*, uint8_t*, uint8_t**, int*);
-int sunEnumUnpack(uint8_t*, uint8_t*, uint8_t**, int*);
-int sunUint1Pack(uint8_t*, uint8_t*, uint8_t**, u1int*);
-int sunUint1Unpack(uint8_t*, uint8_t*, uint8_t**, u1int*);
+int sunEnumPack(u8*, u8*, u8**, int*);
+int sunEnumUnpack(u8*, u8*, u8**, int*);
+int sunUint1Pack(u8*, u8*, u8**, u1int*);
+int sunUint1Unpack(u8*, u8*, u8**, u1int*);
 
-int sunStringPack(uint8_t*, uint8_t*, uint8_t**, char**, uint32_t);
-int sunStringUnpack(uint8_t*, uint8_t*, uint8_t**, char**, uint32_t);
+int sunStringPack(u8*, u8*, u8**, char**, u32);
+int sunStringUnpack(u8*, u8*, u8**, char**, u32);
 uint sunStringSize(char*);
 
-int sunUint32Pack(uint8_t*, uint8_t*, uint8_t**, uint32_t*);
-int sunUint32Unpack(uint8_t*, uint8_t*, uint8_t**, uint32_t*);
-int sunUint64Pack(uint8_t*, uint8_t*, uint8_t**, uint64_t*);
-int sunUint64Unpack(uint8_t*, uint8_t*, uint8_t**, uint64_t*);
+int sunUint32Pack(u8*, u8*, u8**, u32*);
+int sunUint32Unpack(u8*, u8*, u8**, u32*);
+int sunUint64Pack(u8*, u8*, u8**, u64*);
+int sunUint64Unpack(u8*, u8*, u8**, u64*);
 
-int sunVarOpaquePack(uint8_t*, uint8_t*, uint8_t**, uint8_t**, uint32_t*,
-		     uint32_t);
-int sunVarOpaqueUnpack(uint8_t*, uint8_t*, uint8_t**, uint8_t**, uint32_t*,
-		       uint32_t);
-uint sunVarOpaqueSize(uint32_t);
+int sunVarOpaquePack(u8*, u8*, u8**, u8**, u32*,
+		     u32);
+int sunVarOpaqueUnpack(u8*, u8*, u8**, u8**, u32*,
+		       u32);
+uint sunVarOpaqueSize(u32);
 
-int sunFixedOpaquePack(uint8_t*, uint8_t*, uint8_t**, uint8_t*, uint32_t);
-int sunFixedOpaqueUnpack(uint8_t*, uint8_t*, uint8_t**, uint8_t*, uint32_t);
-uint sunFixedOpaqueSize(uint32_t);
+int sunFixedOpaquePack(u8*, u8*, u8**, u8*, u32);
+int sunFixedOpaqueUnpack(u8*, u8*, u8**, u8*, u32);
+uint sunFixedOpaqueSize(u32);
 
 /*
  * Sun RPC Program
@@ -165,17 +165,17 @@ struct SunProg
 
 struct SunProc
 {
-	int (*pack)(uint8_t*, uint8_t*, uint8_t**, SunCall*);
-	int (*unpack)(uint8_t*, uint8_t*, uint8_t**, SunCall*);
+	int (*pack)(u8*, u8*, u8**, SunCall*);
+	int (*unpack)(u8*, u8*, u8**, SunCall*);
 	uint (*size)(SunCall*);
 	void (*fmt)(Fmt*, SunCall*);
 	uint sizeoftype;
 };
 
-SunStatus sunCallPack(SunProg*, uint8_t*, uint8_t*, uint8_t**, SunCall*);
-SunStatus sunCallUnpack(SunProg*, uint8_t*, uint8_t*, uint8_t**, SunCall*);
-SunStatus sunCallUnpackAlloc(SunProg*, SunCallType, uint8_t*, uint8_t*,
-			     uint8_t**, SunCall**);
+SunStatus sunCallPack(SunProg*, u8*, u8*, u8**, SunCall*);
+SunStatus sunCallUnpack(SunProg*, u8*, u8*, u8**, SunCall*);
+SunStatus sunCallUnpackAlloc(SunProg*, SunCallType, u8*, u8*,
+			     u8**, SunCall**);
 uint sunCallSize(SunProg*, SunCall*);
 void sunCallSetup(SunCall*, SunProg*, uint);
 
@@ -201,7 +201,7 @@ enum
 
 struct SunMsg
 {
-	uint8_t *data;
+	u8 *data;
 	int count;
 	SunSrv *srv;
 	SunRpc rpc;
@@ -251,14 +251,14 @@ struct SunClient
 	int		fd;
 	int		chatty;
 	int		needcount;
-	uint32_t	maxwait;
-	uint32_t	xidgen;
+	u32	maxwait;
+	u32	xidgen;
 	int		nsend;
 	int		nresend;
 	struct {
-		uint32_t min;
-		uint32_t max;
-		uint32_t avg;
+		u32 min;
+		u32 max;
+		u32 avg;
 	} rtt;
 	Channel	*dying;
 	Channel	*rpcchan;
@@ -273,9 +273,9 @@ struct SunClient
 
 SunClient	*sunDial(char*);
 
-int	sunClientRpc(SunClient*, uint32_t, SunCall*, SunCall*, uint8_t**);
+int	sunClientRpc(SunClient*, u32, SunCall*, SunCall*, u8**);
 void	sunClientClose(SunClient*);
-void	sunClientFlushRpc(SunClient*, uint32_t);
+void	sunClientFlushRpc(SunClient*, u32);
 void	sunClientProg(SunClient*, SunProg*);
 
 
@@ -283,8 +283,8 @@ void	sunClientProg(SunClient*, SunProg*);
  * Provided by callers.
  * Should remove dependence on this, but hard.
  */
-void	*emalloc(uint32_t);
-void *erealloc(void*, uint32_t);
+void	*emalloc(u32);
+void *erealloc(void*, u32);
 
 
 /*
@@ -331,10 +331,10 @@ enum
 };
 
 struct PortMap {
-	uint32_t prog;
-	uint32_t vers;
-	uint32_t prot;
-	uint32_t port;
+	u32 prog;
+	u32 vers;
+	u32 prot;
+	u32 port;
 };
 
 struct PortTNull {
@@ -372,7 +372,7 @@ struct PortTGetport {
 
 struct PortRGetport {
 	SunCall call;
-	uint32_t port;
+	u32 port;
 };
 
 struct PortTDump {
@@ -387,18 +387,18 @@ struct PortRDump {
 
 struct PortTCallit {
 	SunCall call;
-	uint32_t prog;
-	uint32_t vers;
-	uint32_t proc;
-	uint8_t *data;
-	uint32_t count;
+	u32 prog;
+	u32 vers;
+	u32 proc;
+	u8 *data;
+	u32 count;
 };
 
 struct PortRCallit {
 	SunCall call;
-	uint32_t port;
-	uint8_t *data;
-	uint32_t count;
+	u32 port;
+	u8 *data;
+	u32 count;
 };
 
 extern SunProg portProg;

+ 12 - 12
sys/include/thread.h

@@ -33,7 +33,7 @@ struct Channel {
 	volatile Alt **qentry;	/* Receivers/senders waiting (malloc) */
 	volatile int nentry;	/* # of entries malloc-ed */
 	volatile int closed;	/* channel is closed */
-	uint8_t	v[1];		/* Array of s values in the channel */
+	u8	v[1];		/* Array of s values in the channel */
 };
 
 
@@ -60,7 +60,7 @@ struct Alt {
 };
 
 struct Ref {
-	int32_t	ref;
+	i32	ref;
 };
 
 int	alt(Alt alts[]);
@@ -70,14 +70,14 @@ Channel*chancreate(int elemsize, int bufsize);
 int	chaninit(Channel *c, int elemsize, int elemcnt);
 void	chanfree(Channel *c);
 int	chanprint(Channel *, char *, ...);
-int32_t	decref(Ref *r);			/* returns 0 iff value is now zero */
+i32	decref(Ref *r);			/* returns 0 iff value is now zero */
 void	incref(Ref *r);
 int	nbrecv(Channel *c, void *v);
 void*	nbrecvp(Channel *c);
-uint32_t	nbrecvul(Channel *c);
+u32	nbrecvul(Channel *c);
 int	nbsend(Channel *c, void *v);
 int	nbsendp(Channel *c, void *v);
-int	nbsendul(Channel *c, uint32_t v);
+int	nbsendul(Channel *c, u32 v);
 void	needstack(int);
 int	proccreate(void (*f)(void *arg), void *arg, uint stacksize);
 int	procrfork(void (*f)(void *arg), void *arg, uint stacksize, int flag);
@@ -86,10 +86,10 @@ void	procexec(Channel *, char *, char *[]);
 void	procexecl(Channel *, char *, ...);
 int	recv(Channel *c, void *v);
 void*	recvp(Channel *c);
-uint32_t	recvul(Channel *c);
+u32	recvul(Channel *c);
 int	send(Channel *c, void *v);
 int	sendp(Channel *c, void *v);
-int	sendul(Channel *c, uint32_t v);
+int	sendul(Channel *c, u32 v);
 int	threadcreate(void (*f)(void *arg), void *arg, uint stacksize);
 void**	threaddata(void);
 void	threadexits(char *);
@@ -125,10 +125,10 @@ void	iointerrupt(Ioproc*);
 int	ioclose(Ioproc*, int);
 int	iodial(Ioproc*, char*, char*, char*, int*);
 int	ioopen(Ioproc*, char*, int);
-int32_t	ioread(Ioproc*, int, void*, int32_t);
-int32_t	ioreadn(Ioproc*, int, void*, int32_t);
-int32_t	iowrite(Ioproc*, int, void*, int32_t);
-int	iosleep(Ioproc*, int32_t);
+i32	ioread(Ioproc*, int, void*, i32);
+i32	ioreadn(Ioproc*, int, void*, i32);
+i32	iowrite(Ioproc*, int, void*, i32);
+int	iosleep(Ioproc*, i32);
 
-int32_t	iocall(Ioproc*, int32_t (*)(va_list*), ...);
+i32	iocall(Ioproc*, i32 (*)(va_list*), ...);
 void	ioret(Ioproc*, int);

+ 8 - 8
sys/include/tos.h

@@ -19,16 +19,16 @@ struct Tos {
 		Plink	*next;	/* known to be 4(ptr) */
 		Plink	*last;
 		Plink	*first;
-		uint32_t	pid;
-		uint32_t	what;
+		u32	pid;
+		u32	what;
 	} prof;
-	uint64_t	cyclefreq;	/* cycle clock frequency if there is one, 0 otherwise */
-	int64_t	kcycles;	/* cycles spent in kernel */
-	int64_t	pcycles;	/* cycles spent in process (kernel + user) */
-	uint32_t	nixpid;		/* might as well put the pid here */
-	uint32_t	clock;
+	u64	cyclefreq;	/* cycle clock frequency if there is one, 0 otherwise */
+	i64	kcycles;	/* cycles spent in kernel */
+	i64	pcycles;	/* cycles spent in process (kernel + user) */
+	u32	nixpid;		/* might as well put the pid here */
+	u32	clock;
 	/* scratch space for kernel use (e.g., mips fp delay-slot execution) */
-	uint32_t	kscr[4];
+	u32	kscr[4];
 
 	/*
 	 * Fields below are not available on Plan 9 kernels.

+ 4 - 4
sys/include/trace.h

@@ -28,8 +28,8 @@ typedef enum Tevent {
 
 typedef struct Traceevent	Traceevent;
 struct Traceevent {
-	uint32_t	pid;	
-	uint32_t	etype;	/* Event type */
-	int64_t	time;	/* time stamp  */
-	uint32_t	core;	/* core number */
+	u32	pid;	
+	u32	etype;	/* Event type */
+	i64	time;	/* time stamp  */
+	u32	core;	/* core number */
 };

+ 4 - 4
sys/include/usb/audio.h

@@ -69,7 +69,7 @@ enum {
 	maxpkt_only = 0x80,	/* packets must be padded to max size */
 };
 
-typedef uint8_t byte;
+typedef u8 byte;
 
 extern int setrec;
 extern int verbose;
@@ -83,9 +83,9 @@ void	audio_interface(Dev *d, Desc *dd);
 void	setalt(Dev *d, int endpt, int value);
 int	getalt(Dev *d, int endpt);
 int	setspeed(int rec, int speed);
-int	setcontrol(int rec, char *name, int32_t *value);
-int	getspecialcontrol(int rec, int ctl, int req, int32_t *value);
-int	getcontrol(int rec, char *name, int32_t *value);
+int	setcontrol(int rec, char *name, i32 *value);
+int	getspecialcontrol(int rec, int ctl, int req, i32 *value);
+int	getcontrol(int rec, char *name, i32 *value);
 int	findalt(int rec, int nchan, int res, int speed);
 void	getcontrols(void);
 void	serve(void *);

+ 6 - 6
sys/include/usb/audioctl.h

@@ -17,11 +17,11 @@ typedef struct Audiocontrol Audiocontrol;
 
 struct Audiocontrol {
 	char	*name;
-	uint8_t	readable;
-	uint8_t	settable;
-	uint8_t	chans;		/* 0 is master, non-zero is bitmap */
-	int32_t	value[8];	/* 0 is master; value[0] == Undef -> all values Undef */
-	int32_t	min, max, step;
+	u8	readable;
+	u8	settable;
+	u8	chans;		/* 0 is master, non-zero is bitmap */
+	i32	value[8];	/* 0 is master; value[0] == Undef -> all values Undef */
+	i32	min, max, step;
 };
 
 extern Audiocontrol controls[2][Ncontrol];
@@ -32,6 +32,6 @@ extern int selectorid[2];
 extern int mixerid[2];
 extern int buttonendpt;
 
-int	ctlparse(char *s, Audiocontrol *c, int32_t *v);
+int	ctlparse(char *s, Audiocontrol *c, i32 *v);
 void	ctlevent(void);
 

+ 11 - 11
sys/include/usb/ether.h

@@ -43,8 +43,8 @@ struct Buf
 {
 	int	type;
 	int	ndata;
-	uint8_t*	rp;
-	uint8_t	data[Hdrsize+Maxpkt];
+	u8 *	rp;
+	u8	data[Hdrsize+Maxpkt];
 };
 
 struct Conn
@@ -60,11 +60,11 @@ struct Conn
 struct Etherops
 {
 	int	(*init)(Ether*, int *epin, int *epout);
-	int32_t	(*bread)(Ether*, Buf*);
-	int32_t	(*bwrite)(Ether*, Buf*);
+	i32	(*bread)(Ether*, Buf*);
+	i32	(*bwrite)(Ether*, Buf*);
 	int	(*ctl)(Ether*, char*);
 	int	(*promiscuous)(Ether*, int);
-	int	(*multicast)(Ether*, uint8_t*, int);
+	int	(*multicast)(Ether*, u8*, int);
 	char*	(*seprintstats)(char*, char*, Ether*);
 	void	(*free)(Ether*);
 	int	bufsize;
@@ -86,7 +86,7 @@ struct Ether
 	Ref	prom;			/* nb. of promiscuous conns */
 	int	exiting;			/* shutting down */
 	int	wrexited;			/* write process died */
-	uint8_t	addr[Eaddrlen];		/* mac */
+	u8	addr[Eaddrlen];		/* mac */
 	int	nconns;			/* nb. of entries used in... */
 	Conn*	conns[Nconns];		/* connections */
 	int	nabufs;			/* nb. of allocated buffers */
@@ -114,17 +114,17 @@ struct Cinfo
 
 struct Etherpkt
 {
-	uint8_t d[Eaddrlen];
-	uint8_t s[Eaddrlen];
-	uint8_t type[2];
-	uint8_t data[1500];
+	u8 d[Eaddrlen];
+	u8 s[Eaddrlen];
+	u8 type[2];
+	u8 data[1500];
 };
 
 int	ethermain(Dev *dev, int argc, char **argv);
 int	asixreset(Ether*);
 int smscreset(Ether*);
 int	cdcreset(Ether*);
-int	parseaddr(uint8_t *m, char *s);
+int	parseaddr(u8 *m, char *s);
 void	dumpframe(char *tag, void *p, int n);
 
 extern Cinfo cinfo[];

+ 4 - 4
sys/include/usb/hid.h

@@ -79,7 +79,7 @@ enum{
 struct Chain {
 	int	b;			/* offset start in bits, (first full) */
 	int	e;			/* offset end in bits (first empty) */
-	uint8_t	buf[MaxChLen];
+	u8	buf[MaxChLen];
 };
 
 #define MSK(nbits)		((1UL << (nbits)) - 1)
@@ -97,8 +97,8 @@ enum {
 };
 
 struct HidInterface {
-	uint32_t	v[MaxVals];	/* one ulong per val should be enough */
-	uint8_t	kind[MaxVals];
+	u32	v[MaxVals];	/* one ulong per val should be enough */
+	u8	kind[MaxVals];
 	int	nbits;
 	int	count;
 };
@@ -138,4 +138,4 @@ enum {
 void	dumpreport(HidRepTempl *templ);
 int	hidifcval(HidRepTempl *templ, int kind, int n);
 int	parsereport(HidRepTempl *templ, Chain *rep);
-int	parsereportdesc(HidRepTempl *temp, uint8_t *repdesc, int repsz);
+int	parsereportdesc(HidRepTempl *temp, u8 *repdesc, int repsz);

+ 54 - 54
sys/include/usb/scsireq.h

@@ -27,24 +27,24 @@ enum {					/* fundamental constants/defaults */
 };
 
 typedef struct {
-	uint8_t	*p;
-	int32_t	count;
-	uint8_t	write;
+	u8	*p;
+	i32	count;
+	u8	write;
 } ScsiPtr;
 
 typedef struct {
 	int	flags;
 	char	*unit;			/* unit directory */
 	int	lun;
-	uint32_t	lbsize;
-	uint64_t	offset;			/* in blocks of lbsize bytes */
+	u32	lbsize;
+	u64	offset;			/* in blocks of lbsize bytes */
 	int	fd;
 	Umsc	*umsc;			/* lun */
 	ScsiPtr	cmd;
 	ScsiPtr	data;
 	int	status;			/* returned status */
-	uint8_t	sense[MaxDirData];	/* returned sense data */
-	uint8_t	inquiry[MaxDirData];	/* returned inquiry data */
+	u8	sense[MaxDirData];	/* returned sense data */
+	u8	inquiry[MaxDirData];	/* returned inquiry data */
 	int	readblock;		/* flag: read a block since open */
 } ScsiReq;
 
@@ -119,65 +119,65 @@ enum {
 	Devjuke,
 };
 
-/* p arguments should be of type uint8_t* */
-#define GETBELONG(p) ((uint32_t)(p)[0]<<24 | (uint32_t)(p)[1]<<16 | (p)[2]<<8 | (p)[3])
+/* p arguments should be of type u8* */
+#define GETBELONG(p) ((u32)(p)[0]<<24 | (u32)(p)[1]<<16 | (p)[2]<<8 | (p)[3])
 #define PUTBELONG(p, ul) ((p)[0] = (ul)>>24, (p)[1] = (ul)>>16, \
 			  (p)[2] = (ul)>>8,  (p)[3] = (ul))
-#define GETBE24(p)	((uint32_t)(p)[0]<<16 | (p)[1]<<8 | (p)[2])
+#define GETBE24(p)	((u32)(p)[0]<<16 | (p)[1]<<8 | (p)[2])
 #define PUTBE24(p, ul)	((p)[0] = (ul)>>16, (p)[1] = (ul)>>8, (p)[2] = (ul))
 
-int32_t	SRready(ScsiReq*);
-int32_t	SRrewind(ScsiReq*);
-int32_t	SRreqsense(ScsiReq*);
-int32_t	SRformat(ScsiReq*);
-int32_t	SRrblimits(ScsiReq*, uint8_t*);
-int32_t	SRread(ScsiReq*, void*, int32_t);
-int32_t	SRwrite(ScsiReq*, void*, int32_t);
-int32_t	SRseek(ScsiReq*, int32_t, int);
-int32_t	SRfilemark(ScsiReq*, uint32_t);
-int32_t	SRspace(ScsiReq*, uint8_t, int32_t);
-int32_t	SRinquiry(ScsiReq*);
-int32_t	SRmodeselect6(ScsiReq*, uint8_t*, int32_t);
-int32_t	SRmodeselect10(ScsiReq*, uint8_t*, int32_t);
-int32_t	SRmodesense6(ScsiReq*, uint8_t, uint8_t*, int32_t);
-int32_t	SRmodesense10(ScsiReq*, uint8_t, uint8_t*, int32_t);
-int32_t	SRstart(ScsiReq*, uint8_t);
-int32_t	SRrcapacity(ScsiReq*, uint8_t*);
-int32_t	SRrcapacity16(ScsiReq*, uint8_t*);
-
-int32_t	SRblank(ScsiReq*, uint8_t, uint8_t);	/* MMC CD-R/CD-RW commands */
-int32_t	SRsynccache(ScsiReq*);
-int32_t	SRTOC(ScsiReq*, void*, int, uint8_t, uint8_t);
-int32_t	SRrdiscinfo(ScsiReq*, void*, int);
-int32_t	SRrtrackinfo(ScsiReq*, void*, int, int);
-
-int32_t	SRcdpause(ScsiReq*, int);		/* MMC CD audio commands */
-int32_t	SRcdstop(ScsiReq*);
-int32_t	SRcdload(ScsiReq*, int, int);
-int32_t	SRcdplay(ScsiReq*, int, int32_t, int32_t);
-int32_t	SRcdstatus(ScsiReq*, uint8_t*, int);
-int32_t	SRgetconf(ScsiReq*, uint8_t*, int);
+i32	SRready(ScsiReq*);
+i32	SRrewind(ScsiReq*);
+i32	SRreqsense(ScsiReq*);
+i32	SRformat(ScsiReq*);
+i32	SRrblimits(ScsiReq*, u8*);
+i32	SRread(ScsiReq*, void*, i32);
+i32	SRwrite(ScsiReq*, void*, i32);
+i32	SRseek(ScsiReq*, i32, int);
+i32	SRfilemark(ScsiReq*, u32);
+i32	SRspace(ScsiReq*, u8, i32);
+i32	SRinquiry(ScsiReq*);
+i32	SRmodeselect6(ScsiReq*, u8*, i32);
+i32	SRmodeselect10(ScsiReq*, u8*, i32);
+i32	SRmodesense6(ScsiReq*, u8, u8*, i32);
+i32	SRmodesense10(ScsiReq*, u8, u8*, i32);
+i32	SRstart(ScsiReq*, u8);
+i32	SRrcapacity(ScsiReq*, u8*);
+i32	SRrcapacity16(ScsiReq*, u8*);
+
+i32	SRblank(ScsiReq*, u8, u8);	/* MMC CD-R/CD-RW commands */
+i32	SRsynccache(ScsiReq*);
+i32	SRTOC(ScsiReq*, void*, int, u8, u8);
+i32	SRrdiscinfo(ScsiReq*, void*, int);
+i32	SRrtrackinfo(ScsiReq*, void*, int, int);
+
+i32	SRcdpause(ScsiReq*, int);		/* MMC CD audio commands */
+i32	SRcdstop(ScsiReq*);
+i32	SRcdload(ScsiReq*, int, int);
+i32	SRcdplay(ScsiReq*, int, i32, i32);
+i32	SRcdstatus(ScsiReq*, u8*, int);
+i32	SRgetconf(ScsiReq*, u8*, int);
 
 /*	old CD-R/CD-RW commands */
-int32_t	SRfwaddr(ScsiReq*, uint8_t, uint8_t, uint8_t, uint8_t*);
-int32_t	SRtreserve(ScsiReq*, int32_t);
-int32_t	SRtinfo(ScsiReq*, uint8_t, uint8_t*);
-int32_t	SRwtrack(ScsiReq*, void*, int32_t, uint8_t, uint8_t);
-int32_t	SRmload(ScsiReq*, uint8_t);
-int32_t	SRfixation(ScsiReq*, uint8_t);
-
-int32_t	SReinitialise(ScsiReq*);		/* CHANGER commands */
-int32_t	SRestatus(ScsiReq*, uint8_t, uint8_t*, int);
-int32_t	SRmmove(ScsiReq*, int, int, int, int);
-
-int32_t	SRrequest(ScsiReq*);
+i32	SRfwaddr(ScsiReq*, u8, u8, u8, u8*);
+i32	SRtreserve(ScsiReq*, i32);
+i32	SRtinfo(ScsiReq*, u8, u8*);
+i32	SRwtrack(ScsiReq*, void*, i32, u8, u8);
+i32	SRmload(ScsiReq*, u8);
+i32	SRfixation(ScsiReq*, u8);
+
+i32	SReinitialise(ScsiReq*);		/* CHANGER commands */
+i32	SRestatus(ScsiReq*, u8, u8*, int);
+i32	SRmmove(ScsiReq*, int, int, int, int);
+
+i32	SRrequest(ScsiReq*);
 int	SRclose(ScsiReq*);
 int	SRopenraw(ScsiReq*, char*);
 int	SRopen(ScsiReq*, char*);
 
 void	makesense(ScsiReq*);
 
-int32_t	umsrequest(struct Umsc*, ScsiPtr*, ScsiPtr*, int*);
+i32	umsrequest(struct Umsc*, ScsiPtr*, ScsiPtr*, int*);
 
 void	scsidebug(int);
 

+ 5 - 5
sys/include/usb/serial.h

@@ -22,8 +22,8 @@ struct Serialops {
 	int	(*modemctl)(Serialport*, int);
 	int	(*setbreak)(Serialport*, int);
 	int	(*readstatus)(Serialport*);
-	int	(*wait4data)(Serialport*, uint8_t *, int);
-	int	(*wait4write)(Serialport*, uint8_t *, int);
+	int	(*wait4data)(Serialport*, u8 *, int);
+	int	(*wait4write)(Serialport*, u8 *, int);
 };
 
 enum {
@@ -43,7 +43,7 @@ struct Serialport {
 	Dev	*epout;
 
 	Usbfs	fs;
-	uint8_t	ctlstate;
+	u8	ctlstate;
 
 	/* serial parameters */
 	uint	baud;
@@ -60,7 +60,7 @@ struct Serialport {
 	int	dtr;
 	int	rlsd;
 
-	int64_t	timer;
+	i64	timer;
 	int	blocked;	/* for sw flow ctl. BUG: not implemented yet */
 	int	nbreakerr;
 	int	ring;
@@ -75,7 +75,7 @@ struct Serialport {
 	Channel *gotdata;
 	Channel *readc;		/* to uncouple reads, only used in ftdi... */
 	int	ndata;
-	uint8_t	data[DataBufSz];
+	u8	data[DataBufSz];
 };
 
 struct Serial {

+ 9 - 9
sys/include/usb/ums.h

@@ -60,16 +60,16 @@ enum
 struct Umsc
 {
 	ScsiReq	ScsiReq;
-	uint64_t	blocks;
-	int64_t	capacity;
+	u64	blocks;
+	i64	capacity;
 
 	/* from setup */
 	char	*bufp;
 	long	off;		/* offset within a block */
 	long	nb;		/* byte count */
 
-	uint8_t 	rawcmd[16];
-	uint8_t	phase;
+	u8 	rawcmd[16];
+	u8	phase;
 	char	*inq;
 	Ums	*ums;
 	Usbfs	fs;
@@ -83,7 +83,7 @@ struct Ums
 	Dev	*epin;
 	Dev	*epout;
 	Umsc	*lun;
-	uint8_t	maxlun;
+	u8	maxlun;
 	int	seq;
 	int	nerrs;
 	int	wrongresidues;
@@ -97,9 +97,9 @@ struct Cbw
 	char	signature[4];		/* "USBC" */
 	long	tag;
 	long	datalen;
-	uint8_t	flags;
-	uint8_t	lun;
-	uint8_t	len;
+	u8	flags;
+	u8	lun;
+	u8	len;
 	char	command[16];
 };
 
@@ -108,7 +108,7 @@ struct Csw
 	char	signature[4];		/* "USBS" */
 	long	tag;
 	long	dataresidue;
-	uint8_t	status;
+	u8	status;
 };
 
 

+ 53 - 52
sys/include/usb/usb.h

@@ -190,7 +190,7 @@ struct Dev
  */
 struct Usbdev
 {
-	uint32_t	csp;		/* USB class/subclass/proto */
+	u32	csp;		/* USB class/subclass/proto */
 	int	vid;		/* vendor id */
 	int	did;		/* product (device) id */
 	int	dno;		/* device release number */
@@ -209,10 +209,10 @@ struct Usbdev
 
 struct Ep
 {
-	uint8_t	addr;		/* endpt address, 0-15 (|0x80 if Ein) */
-	uint8_t	dir;		/* direction, Ein/Eout */
-	uint8_t	type;		/* Econtrol, Eiso, Ebulk, Eintr */
-	uint8_t	isotype;		/* Eunknown, Easync, Eadapt, Esync */
+	u8	addr;		/* endpt address, 0-15 (|0x80 if Ein) */
+	u8	dir;		/* direction, Ein/Eout */
+	u8	type;		/* Econtrol, Eiso, Ebulk, Eintr */
+	u8	isotype;		/* Eunknown, Easync, Eadapt, Esync */
 	int	id;
 	int	maxpkt;		/* max. packet size */
 	int	ntds;		/* nb. of Tds per µframe */
@@ -230,7 +230,7 @@ struct Altc
 struct Iface
 {
 	int 	id;		/* interface number */
-	uint32_t	csp;		/* USB class/subclass/proto */
+	u32	csp;		/* USB class/subclass/proto */
 	Altc*	altc[Naltc];
 	Ep*	ep[Nep];
 	void*	aux;		/* for the driver program */
@@ -252,9 +252,9 @@ struct Conf
  */
 struct DDesc
 {
-	uint8_t	bLength;
-	uint8_t	bDescriptorType;
-	uint8_t	bbytes[1];
+	u8	bLength;
+	u8	bDescriptorType;
+	u8	bbytes[1];
 	/* extra bytes allocated here to keep the rest of it */
 };
 
@@ -272,55 +272,55 @@ struct Desc
  */
 struct DDev
 {
-	uint8_t	bLength;
-	uint8_t	bDescriptorType;
-	uint8_t	bcdUSB[2];
-	uint8_t	bDevClass;
-	uint8_t	bDevSubClass;
-	uint8_t	bDevProtocol;
-	uint8_t	bMaxPacketSize0;
-	uint8_t	idVendor[2];
-	uint8_t	idProduct[2];
-	uint8_t	bcdDev[2];
-	uint8_t	iManufacturer;
-	uint8_t	iProduct;
-	uint8_t	iSerialNumber;
-	uint8_t	bNumConfigurations;
+	u8	bLength;
+	u8	bDescriptorType;
+	u8	bcdUSB[2];
+	u8	bDevClass;
+	u8	bDevSubClass;
+	u8	bDevProtocol;
+	u8	bMaxPacketSize0;
+	u8	idVendor[2];
+	u8	idProduct[2];
+	u8	bcdDev[2];
+	u8	iManufacturer;
+	u8	iProduct;
+	u8	iSerialNumber;
+	u8	bNumConfigurations;
 };
 
 struct DConf
 {
-	uint8_t	bLength;
-	uint8_t	bDescriptorType;
-	uint8_t	wTotalLength[2];
-	uint8_t	bNumInterfaces;
-	uint8_t	bConfigurationValue;
-	uint8_t	iConfiguration;
-	uint8_t	bmAttributes;
-	uint8_t	MaxPower;
+	u8	bLength;
+	u8	bDescriptorType;
+	u8	wTotalLength[2];
+	u8	bNumInterfaces;
+	u8	bConfigurationValue;
+	u8	iConfiguration;
+	u8	bmAttributes;
+	u8	MaxPower;
 };
 
 struct DIface
 {
-	uint8_t	bLength;
-	uint8_t	bDescriptorType;
-	uint8_t	bInterfaceNumber;
-	uint8_t	bAlternateSetting;
-	uint8_t	bNumEndpoints;
-	uint8_t	bInterfaceClass;
-	uint8_t	bInterfaceSubClass;
-	uint8_t	bInterfaceProtocol;
-	uint8_t	iInterface;
+	u8	bLength;
+	u8	bDescriptorType;
+	u8	bInterfaceNumber;
+	u8	bAlternateSetting;
+	u8	bNumEndpoints;
+	u8	bInterfaceClass;
+	u8	bInterfaceSubClass;
+	u8	bInterfaceProtocol;
+	u8	iInterface;
 };
 
 struct DEp
 {
-	uint8_t	bLength;
-	uint8_t	bDescriptorType;
-	uint8_t	bEndpointAddress;
-	uint8_t	bmAttributes;
-	uint8_t	wMaxPacketSize[2];
-	uint8_t	bInterval;
+	u8	bLength;
+	u8	bDescriptorType;
+	u8	bEndpointAddress;
+	u8	bmAttributes;
+	u8	wMaxPacketSize[2];
+	u8	bInterval;
 };
 
 #define Class(csp)	((csp) & 0xff)
@@ -336,7 +336,7 @@ struct DEp
  * The use of macros is a puzzle given the Ken C toolchain's inlining at link time
  * abilities, but ...
  */
-static inline void PUT4(uint8_t *p, uint32_t v)
+static inline void PUT4(u8 *p, u32 v)
 {
 	(p)[0] = (v);
 	(p)[1] = (v)>>8;
@@ -352,7 +352,7 @@ char*	classname(int c);
 void	closedev(Dev *d);
 int	configdev(Dev *d);
 int	devctl(Dev *dev, char *fmt, ...);
-void*	emallocz(uint32_t size, int zero);
+void*	emallocz(u32 size, int zero);
 char*	estrdup(char *s);
 int	matchdevcsp(char *info, void *a);
 int	finddevs(int (*matchf)(char*,void*), void *farg, char** dirs, int ndirs);
@@ -363,12 +363,13 @@ char*	loaddevstr(Dev *d, int sid);
 Dev*	opendev(char *fn);
 int	opendevdata(Dev *d, int mode);
 Dev*	openep(Dev *d, int id);
-int	parseconf(Usbdev *d, Conf *c, uint8_t *b, int n);
-int	parsedesc(Usbdev *d, Conf *c, uint8_t *b, int n);
-int	parsedev(Dev *xd, uint8_t *b, int n);
+int	parseconf(Usbdev *d, Conf *c, u8 *b, int n);
+int	parsedesc(Usbdev *d, Conf *c, u8 *b, int n);
+int	parsedev(Dev *xd, u8 *b, int n);
 void	startdevs(char *args, char *argv[], int argc, int (*mf)(char*,void*), void*ma, int (*df)(Dev*,int,char**));
 int	unstall(Dev *dev, Dev *ep, int dir);
-int	usbcmd(Dev *d, int type, int req, int value, int index, uint8_t *data, int count);
+int	usbcmd(Dev *d, int type, int req, int value, int index, u8 *data,
+		  int count);
 
 
 extern int usbdebug;	/* more messages for bigger values */

+ 5 - 5
sys/include/usb/usbfs.h

@@ -32,7 +32,7 @@ struct Fid
 struct Usbfs
 {
 	char	name[Namesz];
-	uint64_t	qid;
+	u64	qid;
 	Dev*	dev;
 	void*	aux;
 
@@ -40,18 +40,18 @@ struct Usbfs
 	void	(*clone)(Usbfs *fs, Fid *of, Fid *nf);
 	void	(*clunk)(Usbfs *fs, Fid *f);
 	int	(*open)(Usbfs *fs, Fid *f, int mode);
-	int32_t	(*read)(Usbfs *fs, Fid *f, void *data, int32_t count, int64_t offset);
-	int32_t	(*write)(Usbfs *fs, Fid*f, void *data, int32_t count, int64_t offset);
+	i32	(*read)(Usbfs *fs, Fid *f, void *data, i32 count, i64 offset);
+	i32	(*write)(Usbfs *fs, Fid*f, void *data, i32 count, i64 offset);
 	int	(*stat)(Usbfs *fs, Qid q, Dir *d);
 	void	(*end)(Usbfs *fs);
 };
 
 typedef int (*Dirgen)(Usbfs*, Qid, int, Dir*, void*);
 
-int32_t	usbreadbuf(void *data, int32_t count, int64_t offset, void *buf, int32_t n);
+i32	usbreadbuf(void *data, i32 count, i64 offset, void *buf, i32 n);
 void	usbfsadd(Usbfs *dfs);
 void	usbfsdel(Usbfs *dfs);
-int	usbdirread(Usbfs*f, Qid q, char *data, int32_t cnt, int64_t off, Dirgen gen, void *arg);
+int	usbdirread(Usbfs*f, Qid q, char *data, i32 cnt, i64 off, Dirgen gen, void *arg);
 void	usbfsinit(char* srv, char *mnt, Usbfs *f, int flag);
 
 void	usbfsdirdump(void);

+ 71 - 71
sys/include/venti.h

@@ -21,26 +21,26 @@ enum
 typedef struct Packet Packet;
 
 Packet*	packetalloc(void);
-void	packetappend(Packet*, uint8_t *buf, int n);
+void	packetappend(Packet*, u8 *buf, int n);
 uint	packetasize(Packet*);
 int	packetcmp(Packet*, Packet*);
 int	packetcompact(Packet*);
 void	packetconcat(Packet*, Packet*);
-int	packetconsume(Packet*, uint8_t *buf, int n);
-int	packetcopy(Packet*, uint8_t *buf, int offset, int n);
+int	packetconsume(Packet*, u8 *buf, int n);
+int	packetcopy(Packet*, u8 *buf, int offset, int n);
 Packet*	packetdup(Packet*, int offset, int n);
-Packet*	packetforeign(uint8_t *buf, int n, void (*free)(void *a),
+Packet*	packetforeign(u8 *buf, int n, void (*free)(void *a),
 			     void *a);
 int	packetfragments(Packet*, IOchunk*, int nio, int offset);
 void	packetfree(Packet*);
-uint8_t*	packetheader(Packet*, int n);
-uint8_t*	packetpeek(Packet*, uint8_t *buf, int offset, int n);
-void	packetprefix(Packet*, uint8_t *buf, int n);
-void	packetsha1(Packet*, uint8_t sha1[20]);
+u8 *	packetheader(Packet*, int n);
+u8 *	packetpeek(Packet*, u8 *buf, int offset, int n);
+void	packetprefix(Packet*, u8 *buf, int n);
+void	packetsha1(Packet*, u8 sha1[20]);
 uint	packetsize(Packet*);
 Packet*	packetsplit(Packet*, int n);
 void	packetstats(void);
-uint8_t*	packettrailer(Packet*, int n);
+u8 *	packettrailer(Packet*, int n);
 int	packettrim(Packet*, int offset, int n);
 
 /* XXX should be own library? */
@@ -149,25 +149,25 @@ enum
 };
 struct VtEntry
 {
-	uint32_t	gen;			/* generation number */
-	uint16_t	psize;			/* pointer block size */
-	uint16_t	dsize;			/* data block size */
-	uint8_t	type;
-	uint8_t	flags;
-	uint64_t	size;
-	uint8_t	score[VtScoreSize];
+	u32	gen;			/* generation number */
+	u16	psize;			/* pointer block size */
+	u16	dsize;			/* data block size */
+	u8	type;
+	u8	flags;
+	u64	size;
+	u8	score[VtScoreSize];
 };
 
-void vtentrypack(VtEntry*, uint8_t*, int index);
-int vtentryunpack(VtEntry*, uint8_t*, int index);
+void vtentrypack(VtEntry*, u8*, int index);
+int vtentryunpack(VtEntry*, u8*, int index);
 
 struct VtRoot
 {
 	char	name[128];
 	char	type[128];
-	uint8_t	score[VtScoreSize];	/* to a Dir block */
-	uint16_t	blocksize;		/* maximum block size */
-	uint8_t	prev[VtScoreSize];	/* last root block */
+	u8	score[VtScoreSize];	/* to a Dir block */
+	u16	blocksize;		/* maximum block size */
+	u8	prev[VtScoreSize];	/* last root block */
 };
 
 enum
@@ -176,24 +176,24 @@ enum
 	VtRootVersion = 2
 };
 
-void vtrootpack(VtRoot*, uint8_t*);
-int vtrootunpack(VtRoot*, uint8_t*);
+void vtrootpack(VtRoot*, u8*);
+int vtrootunpack(VtRoot*, u8*);
 
 /*
  * score of zero length block
  */
-extern uint8_t vtzeroscore[VtScoreSize];
+extern u8 vtzeroscore[VtScoreSize];
 
 /*
  * zero extend and truncate blocks
  */
-void vtzeroextend(int type, uint8_t *buf, uint n, uint nn);
-uint vtzerotruncate(int type, uint8_t *buf, uint n);
+void vtzeroextend(int type, u8 *buf, uint n, uint nn);
+uint vtzerotruncate(int type, u8 *buf, uint n);
 
 /*
  * parse score: mungs s
  */
-int vtparsescore(char *s, char **prefix, uint8_t[VtScoreSize]);
+int vtparsescore(char *s, char **prefix, u8[VtScoreSize]);
 
 /*
  * formatting
@@ -277,26 +277,26 @@ enum
 
 struct VtFcall
 {
-	uint8_t	msgtype;
-	uint8_t	tag;
+	u8	msgtype;
+	u8	tag;
 
 	char	*error;		/* Rerror */
 
 	char	*version;	/* Thello */
 	char	*uid;		/* Thello */
-	uint8_t	strength;	/* Thello */
-	uint8_t	*crypto;	/* Thello */
+	u8	strength;	/* Thello */
+	u8	*crypto;	/* Thello */
 	uint	ncrypto;	/* Thello */
-	uint8_t	*codec;		/* Thello */
+	u8	*codec;		/* Thello */
 	uint	ncodec;		/* Thello */
 	char	*sid;		/* Rhello */
-	uint8_t	rcrypto;	/* Rhello */
-	uint8_t	rcodec;		/* Rhello */
-	uint8_t	*auth;		/* TauthX, RauthX */
+	u8	rcrypto;	/* Rhello */
+	u8	rcodec;		/* Rhello */
+	u8	*auth;		/* TauthX, RauthX */
 	uint	nauth;		/* TauthX, RauthX */
-	uint8_t	score[VtScoreSize];	/* Tread, Rwrite */
-	uint8_t	blocktype;	/* Tread, Twrite */
-	uint16_t	count;		/* Tread */
+	u8	score[VtScoreSize];	/* Tread, Rwrite */
+	u8	blocktype;	/* Tread, Twrite */
+	u16	count;		/* Tread */
 	Packet	*data;		/* Rread, Twrite */
 };
 
@@ -373,13 +373,13 @@ void	vtsendproc(void*);	/* VtConn */
 
 int	vtconnect(VtConn*);
 int	vthello(VtConn*);
-int	vtread(VtConn*, uint8_t score[VtScoreSize], uint type,
-		  uint8_t *buf, int n);
-int	vtwrite(VtConn*, uint8_t score[VtScoreSize], uint type,
-		   uint8_t *buf, int n);
-Packet*	vtreadpacket(VtConn*, uint8_t score[VtScoreSize], uint type,
+int	vtread(VtConn*, u8 score[VtScoreSize], uint type,
+		  u8 *buf, int n);
+int	vtwrite(VtConn*, u8 score[VtScoreSize], uint type,
+		   u8 *buf, int n);
+Packet*	vtreadpacket(VtConn*, u8 score[VtScoreSize], uint type,
 			    int n);
-int	vtwritepacket(VtConn*, uint8_t score[VtScoreSize], uint type,
+int	vtwritepacket(VtConn*, u8 score[VtScoreSize], uint type,
 			 Packet *p);
 int	vtsync(VtConn*);
 int	vtping(VtConn*);
@@ -400,35 +400,35 @@ struct VtBlock
 	VtCache	*c;
 	QLock	lk;
 
-	uint8_t	*data;
-	uint8_t	score[VtScoreSize];
-	uint8_t	type;			/* BtXXX */
+	u8	*data;
+	u8	score[VtScoreSize];
+	u8	type;			/* BtXXX */
 
 	/* internal to cache */
 	int	nlock;
 	int	iostate;
 	int	ref;
-	uint32_t	heap;
+	u32	heap;
 	VtBlock	*next;
 	VtBlock	**prev;
-	uint32_t	used;
-	uint32_t	used2;
-	uint32_t	addr;
+	u32	used;
+	u32	used2;
+	u32	addr;
 	uintptr	pc;
 };
 
-uint32_t	vtglobaltolocal(uint8_t[VtScoreSize]);
-void	vtlocaltoglobal(uint32_t, uint8_t[VtScoreSize]);
+u32	vtglobaltolocal(u8[VtScoreSize]);
+void	vtlocaltoglobal(u32, u8[VtScoreSize]);
 
-VtCache*vtcachealloc(VtConn*, int blocksize, uint32_t nblocks);
+VtCache*vtcachealloc(VtConn*, int blocksize, u32 nblocks);
 void	vtcachefree(VtCache*);
-VtBlock*vtcachelocal(VtCache*, uint32_t addr, int type);
-VtBlock*vtcacheglobal(VtCache*, uint8_t[VtScoreSize], int type);
+VtBlock*vtcachelocal(VtCache*, u32 addr, int type);
+VtBlock*vtcacheglobal(VtCache*, u8[VtScoreSize], int type);
 VtBlock*vtcacheallocblock(VtCache*, int type);
 void	vtcachesetwrite(VtCache*,
-	int(*)(VtConn*, uint8_t[VtScoreSize], uint, uint8_t*, int));
+	int(*)(VtConn*, u8[VtScoreSize], uint, u8*, int));
 void	vtblockput(VtBlock*);
-uint32_t	vtcacheblocksize(VtCache*);
+u32	vtcacheblocksize(VtCache*);
 int	vtblockwrite(VtBlock*);
 VtBlock*vtblockcopy(VtBlock*);
 void	vtblockduplock(VtBlock*);
@@ -446,18 +446,18 @@ struct VtFile
 	int	ref;
 	int	local;
 	VtBlock	*b;			/* block containing this file */
-	uint8_t	score[VtScoreSize];	/* score of block containing this file */
+	u8	score[VtScoreSize];	/* score of block containing this file */
 
 /* immutable */
 	VtCache	*c;
 	int	mode;
-	uint32_t	gen;
+	u32	gen;
 	int	dsize;
 	int	psize;
 	int	dir;
 	VtFile	*parent;
 	int	epb;			/* entries per block in parent */
-	uint32_t	offset; 		/* entry offset in parent */
+	u32	offset; 		/* entry offset in parent */
 };
 
 enum
@@ -467,30 +467,30 @@ enum
 	VtORDWR
 };
 
-VtBlock*vtfileblock(VtFile*, uint32_t, int mode);
-int	vtfileblockscore(VtFile*, uint32_t, uint8_t[VtScoreSize]);
+VtBlock*vtfileblock(VtFile*, u32, int mode);
+int	vtfileblockscore(VtFile*, u32, u8[VtScoreSize]);
 void	vtfileclose(VtFile*);
 VtFile*	_vtfilecreate(VtFile*, int offset, int psize, int dsize, int dir);
 VtFile*	vtfilecreate(VtFile*, int psize, int dsize, int dir);
 VtFile*	vtfilecreateroot(VtCache*, int psize, int dsize, int type);
 int	vtfileflush(VtFile*);
-int	vtfileflushbefore(VtFile*, uint64_t);
-uint32_t	vtfilegetdirsize(VtFile*);
+int	vtfileflushbefore(VtFile*, u64);
+u32	vtfilegetdirsize(VtFile*);
 int	vtfilegetentry(VtFile*, VtEntry*);
-uint64_t	vtfilegetsize(VtFile*);
+u64	vtfilegetsize(VtFile*);
 void	vtfileincref(VtFile*);
 int	vtfilelock2(VtFile*, VtFile*, int);
 int	vtfilelock(VtFile*, int);
-VtFile*	vtfileopen(VtFile*, uint32_t, int);
+VtFile*	vtfileopen(VtFile*, u32, int);
 VtFile*	vtfileopenroot(VtCache*, VtEntry*);
-int32_t	vtfileread(VtFile*, void*, int32_t, int64_t);
+i32	vtfileread(VtFile*, void*, i32, i64);
 int	vtfileremove(VtFile*);
-int	vtfilesetdirsize(VtFile*, uint32_t);
+int	vtfilesetdirsize(VtFile*, u32);
 int	vtfilesetentry(VtFile*, VtEntry*);
-int	vtfilesetsize(VtFile*, uint64_t);
+int	vtfilesetsize(VtFile*, u64);
 int	vtfiletruncate(VtFile*);
 void	vtfileunlock(VtFile*);
-int32_t	vtfilewrite(VtFile*, void*, int32_t, int64_t);
+i32	vtfilewrite(VtFile*, void*, i32, i64);
 
 int	vttimefmt(Fmt*);
 

+ 2 - 2
sys/include/virtio_9p.h

@@ -31,8 +31,8 @@
 
 struct virtio_9p_config {
 	/* length of the tag name */
-	uint16_t tag_len;
+	u16 tag_len;
 	/* non-NULL terminated tag name */
-	uint8_t tag[0];
+	u8 tag[0];
 } __attribute__((packed));
 

+ 21 - 21
sys/include/virtio_blk.h

@@ -49,37 +49,37 @@
 
 struct virtio_blk_config {
 	/* The capacity (in 512-byte sectors). */
-	uint64_t capacity;
+	u64 capacity;
 	/* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
-	uint32_t size_max;
+	u32 size_max;
 	/* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
-	uint32_t seg_max;
+	u32 seg_max;
 	/* geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
 	struct virtio_blk_geometry {
-		uint16_t cylinders;
-		uint8_t heads;
-		uint8_t sectors;
+		u16 cylinders;
+		u8 heads;
+		u8 sectors;
 	} geometry;
 
 	/* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
-	uint32_t blk_size;
+	u32 blk_size;
 
 	/* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY  */
 	/* exponent for physical block per logical block. */
-	uint8_t physical_block_exp;
+	u8 physical_block_exp;
 	/* alignment offset in logical blocks. */
-	uint8_t alignment_offset;
+	u8 alignment_offset;
 	/* minimum I/O size without performance penalty in logical blocks. */
-	uint16_t min_io_size;
+	u16 min_io_size;
 	/* optimal sustained I/O size in logical blocks. */
-	uint32_t opt_io_size;
+	u32 opt_io_size;
 
 	/* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
-	uint8_t wce;
-	uint8_t unused;
+	u8 wce;
+	u8 unused;
 
 	/* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
-	uint16_t num_queues;
+	u16 num_queues;
 } __attribute__((packed));
 
 /*
@@ -120,19 +120,19 @@ struct virtio_blk_config {
  */
 struct virtio_blk_outhdr {
 	/* VIRTIO_BLK_T* */
-	uint32_t type;
+	u32 type;
 	/* io priority. */
-	uint32_t ioprio;
+	u32 ioprio;
 	/* Sector (ie. 512 byte offset) */
-	uint64_t sector;
+	u64 sector;
 };
 
 #ifndef VIRTIO_BLK_NO_LEGACY
 struct virtio_scsi_inhdr {
-	uint32_t errors;
-	uint32_t data_len;
-	uint32_t sense_len;
-	uint32_t residual;
+	u32 errors;
+	u32 data_len;
+	u32 sense_len;
+	u32 residual;
 };
 #endif /* !VIRTIO_BLK_NO_LEGACY */
 

+ 8 - 8
sys/include/virtio_console.h

@@ -35,17 +35,17 @@
 #define VIRTIO_CONSOLE_F_MULTIPORT 1	/* Does host provide multiple ports? */
 #define VIRTIO_CONSOLE_F_EMERG_WRITE 2 /* Does host support emergency write? */
 
-#define VIRTIO_CONSOLE_BAD_ID		(~(uint32_t)0)
+#define VIRTIO_CONSOLE_BAD_ID		(~(u32)0)
 
 struct virtio_console_config {
 	/* colums of the screens */
-	uint16_t cols;
+	u16 cols;
 	/* rows of the screens */
-	uint16_t rows;
+	u16 rows;
 	/* max. number of ports this device can hold */
-	uint32_t max_nr_ports;
+	u32 max_nr_ports;
 	/* emergency write register */
-	uint32_t emerg_wr;
+	u32 emerg_wr;
 } __attribute__((packed));
 
 /*
@@ -53,9 +53,9 @@ struct virtio_console_config {
  * particular port.
  */
 struct virtio_console_control {
-	uint32_t id;		/* Port number */
-	uint16_t event;	/* The kind of control event (see below) */
-	uint16_t value;	/* Extra information for the key */
+	u32 id;		/* Port number */
+	u16 event;	/* The kind of control event (see below) */
+	u16 value;	/* Extra information for the key */
 };
 
 /* Some events for control messages */

+ 19 - 19
sys/include/virtio_lib.h

@@ -18,12 +18,12 @@ struct virtq;
 typedef struct vqctl		// per-device control structure
 {
 	Pcidev *pci;			// PCI device descriptor
-	uint32_t port;			// base I/O port for the legacy port-based interface
-	uint32_t feat;			// host features
-	uint32_t nqs;			// virt queues count
+	u32 port;			// base I/O port for the legacy port-based interface
+	u32 feat;			// host features
+	u32 nqs;			// virt queues count
 	struct virtq **vqs;		// virt queues descriptors
-	uint32_t dcfglen;		// device config area length
-	uint32_t dcfgoff;		// device config area offset (20 or 24)
+	u32 dcfglen;		// device config area length
+	u32 dcfgoff;		// device config area offset (20 or 24)
 	long dcmtime;			// device config area modification time
 	char devname[32];		// device name to show in port and interrupt allocations
 } Vqctl;
@@ -37,9 +37,9 @@ typedef struct rock {
 
 typedef struct virtq {
 	struct vring vr;			// vring descriptor per spec
-	uint8_t *vq;				// vring data shared between host and guest
-	uint16_t lastused;
-	uint16_t waiting;
+	u8 *vq;				// vring data shared between host and guest
+	u16 lastused;
+	u16 waiting;
 	Lock l;
 	uint free;
 	uint nfree;
@@ -51,11 +51,11 @@ typedef struct virtq {
 
 // Common virtqueue functions and macros.
 
-int getdescr(Virtq *q, int n, uint16_t *descr);
+int getdescr(Virtq *q, int n, u16 *descr);
 
-int queuedescr(Virtq *q, int n, uint16_t *descr);
+int queuedescr(Virtq *q, int n, u16 *descr);
 
-void reldescr(Virtq *q, int n, uint16_t *descr);
+void reldescr(Virtq *q, int n, u16 *descr);
 
 int initvdevs(Vqctl **vcs);
 
@@ -63,15 +63,15 @@ int vqalloc(Virtq **pq, int qs);
 
 void finalinitvdev(Vqctl *vc);
 
-int readvdevcfg(Vqctl *vc, void *va, int32_t n, int64_t offset);
+int readvdevcfg(Vqctl *vc, void *va, i32 n, i64 offset);
 
-Vqctl *vdevbyidx(uint32_t idx);
+Vqctl *vdevbyidx(u32 idx);
 
-uint32_t vdevfeat(Vqctl *vc, uint32_t(*ffltr)(uint32_t));
+u32 vdevfeat(Vqctl *vc, u32(*ffltr)(u32));
 
-uint32_t getvdevnum(void);
+u32 getvdevnum(void);
 
-uint32_t getvdevsbypciid(int pciid, Vqctl **vqs, uint32_t n);
+u32 getvdevsbypciid(int pciid, Vqctl **vqs, u32 n);
 
 static inline struct vring_desc * q2descr(Virtq *q, int i) { return q->vr.desc + i; }
 
@@ -82,15 +82,15 @@ static inline struct vring_desc * q2descr(Virtq *q, int i) { return q->vr.desc +
 
 // Extract QID type
 
-#define TYPE(q)			((uint32_t)(q).path & 0x0F)
+#define TYPE(q)			((u32)(q).path & 0x0F)
 
 // Extract device index
 
-#define DEV(q)			((uint32_t)(((q).path >> 4) & 0x0FFF))
+#define DEV(q)			((u32)(((q).path >> 4) & 0x0FFF))
 
 // Extract queue index
 
-#define VQ(q)			((uint32_t)(((q).path >> 16) & 0x0FFFF))
+#define VQ(q)			((u32)(((q).path >> 16) & 0x0FFFF))
 
 // Construct a non-queue aware QID (to address a per-device file)
 

+ 24 - 24
sys/include/virtio_net.h

@@ -59,16 +59,16 @@
 
 struct virtio_net_config {
 	/* The config defining mac address (if VIRTIO_NET_F_MAC) */
-	uint8_t mac[ETH_ALEN];
+	u8 mac[ETH_ALEN];
 	/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
-	uint16_t status;
+	u16 status;
 	/* Maximum number of each of transmit and receive queues;
 	 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
 	 * Legal values are between 1 and 0x8000
 	 */
-	uint16_t max_virtqueue_pairs;
+	u16 max_virtqueue_pairs;
 	/* Default maximum transmit unit advice */
-	uint16_t mtu;
+	u16 mtu;
 } __attribute__((packed));
 
 /*
@@ -81,18 +81,18 @@ struct virtio_net_config {
 struct virtio_net_hdr_v1 {
 #define VIRTIO_NET_HDR_F_NEEDS_CSUM	1	/* Use csum_start, csum_offset */
 #define VIRTIO_NET_HDR_F_DATA_VALID	2	/* Csum is valid */
-	uint8_t flags;
+	u8 flags;
 #define VIRTIO_NET_HDR_GSO_NONE		0	/* Not a GSO frame */
 #define VIRTIO_NET_HDR_GSO_TCPV4	1	/* GSO frame, IPv4 TCP (TSO) */
 #define VIRTIO_NET_HDR_GSO_UDP		3	/* GSO frame, IPv4 UDP (UFO) */
 #define VIRTIO_NET_HDR_GSO_TCPV6	4	/* GSO frame, IPv6 TCP */
 #define VIRTIO_NET_HDR_GSO_ECN		0x80	/* TCP has ECN set */
-	uint8_t gso_type;
-	uint16_t hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
-	uint16_t gso_size;	/* Bytes to append to hdr_len per frame */
-	uint16_t csum_start;	/* Position to start checksumming from */
-	uint16_t csum_offset;	/* Offset after that to place checksum */
-	uint16_t num_buffers;	/* Number of merged rx buffers */
+	u8 gso_type;
+	u16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
+	u16 gso_size;	/* Bytes to append to hdr_len per frame */
+	u16 csum_start;	/* Position to start checksumming from */
+	u16 csum_offset;	/* Offset after that to place checksum */
+	u16 num_buffers;	/* Number of merged rx buffers */
 };
 
 #ifndef VIRTIO_NET_NO_LEGACY
@@ -102,20 +102,20 @@ struct virtio_net_hdr_v1 {
  * specify GSO or CSUM features, you can simply ignore the header. */
 struct virtio_net_hdr {
 	/* See VIRTIO_NET_HDR_F_* */
-	uint8_t flags;
+	u8 flags;
 	/* See VIRTIO_NET_HDR_GSO_* */
-	uint8_t gso_type;
-	uint16_t hdr_len;		/* Ethernet + IP + tcp/udp hdrs */
-	uint16_t gso_size;		/* Bytes to append to hdr_len per frame */
-	uint16_t csum_start;	/* Position to start checksumming from */
-	uint16_t csum_offset;	/* Offset after that to place checksum */
+	u8 gso_type;
+	u16 hdr_len;		/* Ethernet + IP + tcp/udp hdrs */
+	u16 gso_size;		/* Bytes to append to hdr_len per frame */
+	u16 csum_start;	/* Position to start checksumming from */
+	u16 csum_offset;	/* Offset after that to place checksum */
 };
 
 /* This is the version of the header to use when the MRG_RXBUF
  * feature has been negotiated. */
 struct virtio_net_hdr_mrg_rxbuf {
 	struct virtio_net_hdr hdr;
-	uint16_t num_buffers;	/* Number of merged rx buffers */
+	u16 num_buffers;	/* Number of merged rx buffers */
 };
 #endif /* ...VIRTIO_NET_NO_LEGACY */
 
@@ -127,11 +127,11 @@ struct virtio_net_hdr_mrg_rxbuf {
  * command goes in between.
  */
 struct virtio_net_ctrl_hdr {
-	uint8_t class;
-	uint8_t cmd;
+	u8 class;
+	u8 cmd;
 } __attribute__((packed));
 
-typedef uint8_t virtio_net_ctrl_ack;
+typedef u8 virtio_net_ctrl_ack;
 
 #define VIRTIO_NET_OK     0
 #define VIRTIO_NET_ERR    1
@@ -171,8 +171,8 @@ typedef uint8_t virtio_net_ctrl_ack;
  * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
  */
 struct virtio_net_ctrl_mac {
-	uint32_t entries;
-	uint8_t macs[][ETH_ALEN];
+	u32 entries;
+	u8 macs[][ETH_ALEN];
 } __attribute__((packed));
 
 #define VIRTIO_NET_CTRL_MAC    1
@@ -215,7 +215,7 @@ struct virtio_net_ctrl_mac {
  * specified.
  */
 struct virtio_net_ctrl_mq {
-	uint16_t virtqueue_pairs;
+	u16 virtqueue_pairs;
 };
 
 #define VIRTIO_NET_CTRL_MQ   4

+ 29 - 29
sys/include/virtio_pci.h

@@ -111,51 +111,51 @@
 
 /* This is the PCI capability header: */
 struct virtio_pci_cap {
-	uint8_t cap_vndr;		/* Generic PCI field: PCI_CAP_ID_VNDR */
-	uint8_t cap_next;		/* Generic PCI field: next ptr. */
-	uint8_t cap_len;		/* Generic PCI field: capability length */
-	uint8_t cfg_type;		/* Identifies the structure. */
-	uint8_t bar;		/* Where to find it. */
-	uint8_t padding[3];	/* Pad to full dword. */
-	uint32_t offset;		/* Offset within bar. */
-	uint32_t length;		/* Length of the structure, in bytes. */
+	u8 cap_vndr;		/* Generic PCI field: PCI_CAP_ID_VNDR */
+	u8 cap_next;		/* Generic PCI field: next ptr. */
+	u8 cap_len;		/* Generic PCI field: capability length */
+	u8 cfg_type;		/* Identifies the structure. */
+	u8 bar;		/* Where to find it. */
+	u8 padding[3];	/* Pad to full dword. */
+	u32 offset;		/* Offset within bar. */
+	u32 length;		/* Length of the structure, in bytes. */
 };
 
 struct virtio_pci_notify_cap {
 	struct virtio_pci_cap cap;
-	uint32_t notify_off_multiplier;	/* Multiplier for queue_notify_off. */
+	u32 notify_off_multiplier;	/* Multiplier for queue_notify_off. */
 };
 
 /* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */
 struct virtio_pci_common_cfg {
 	/* About the whole device. */
-	uint32_t device_feature_select;	/* read-write */
-	uint32_t device_feature;		/* read-only */
-	uint32_t guest_feature_select;	/* read-write */
-	uint32_t guest_feature;		/* read-write */
-	uint16_t msix_config;		/* read-write */
-	uint16_t num_queues;		/* read-only */
-	uint8_t device_status;		/* read-write */
-	uint8_t config_generation;		/* read-only */
+	u32 device_feature_select;	/* read-write */
+	u32 device_feature;		/* read-only */
+	u32 guest_feature_select;	/* read-write */
+	u32 guest_feature;		/* read-write */
+	u16 msix_config;		/* read-write */
+	u16 num_queues;		/* read-only */
+	u8 device_status;		/* read-write */
+	u8 config_generation;		/* read-only */
 
 	/* About a specific virtqueue. */
-	uint16_t queue_select;		/* read-write */
-	uint16_t queue_size;		/* read-write, power of 2. */
-	uint16_t queue_msix_vector;	/* read-write */
-	uint16_t queue_enable;		/* read-write */
-	uint16_t queue_notify_off;	/* read-only */
-	uint32_t queue_desc_lo;		/* read-write */
-	uint32_t queue_desc_hi;		/* read-write */
-	uint32_t queue_avail_lo;		/* read-write */
-	uint32_t queue_avail_hi;		/* read-write */
-	uint32_t queue_used_lo;		/* read-write */
-	uint32_t queue_used_hi;		/* read-write */
+	u16 queue_select;		/* read-write */
+	u16 queue_size;		/* read-write, power of 2. */
+	u16 queue_msix_vector;	/* read-write */
+	u16 queue_enable;		/* read-write */
+	u16 queue_notify_off;	/* read-only */
+	u32 queue_desc_lo;		/* read-write */
+	u32 queue_desc_hi;		/* read-write */
+	u32 queue_avail_lo;		/* read-write */
+	u32 queue_avail_hi;		/* read-write */
+	u32 queue_used_lo;		/* read-write */
+	u32 queue_used_hi;		/* read-write */
 };
 
 /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
 struct virtio_pci_cfg_cap {
 	struct virtio_pci_cap cap;
-	uint8_t pci_cfg_data[4]; /* Data for BAR access. */
+	u8 pci_cfg_data[4]; /* Data for BAR access. */
 };
 
 /* Macro versions of offsets for the Old Timers! */

+ 29 - 29
sys/include/virtio_ring.h

@@ -60,35 +60,35 @@
  * These can chain together via "next". */
 struct vring_desc {
         /* Address (guest-physical). */
-        uint64_t addr;
+        u64 addr;
         /* Length. */
-        uint32_t len;
+        u32 len;
         /* The flags as indicated above. */
-        uint16_t flags;
+        u16 flags;
         /* We chain unused descriptors via this, too */
-        uint16_t next;
+        u16 next;
 };
 
 struct vring_avail {
-        uint16_t flags;
-        uint16_t idx;
-        uint16_t ring[];
-        /* Only if VIRTIO_RING_F_EVENT_IDX: uint16_t used_event; */
+        u16 flags;
+        u16 idx;
+        u16 ring[];
+        /* Only if VIRTIO_RING_F_EVENT_IDX: u16 used_event; */
 };
 
-/* uint32_t is used here for ids for padding reasons. */
+/* u32 is used here for ids for padding reasons. */
 struct vring_used_elem {
         /* Index of start of used descriptor chain. */
-        uint32_t id;
+        u32 id;
         /* Total length of the descriptor chain which was written to. */
-        uint32_t len;
+        u32 len;
 };
 
 struct vring_used {
-        uint16_t flags;
-        uint16_t idx;
+        u16 flags;
+        u16 idx;
         struct vring_used_elem ring[];
-        /* Only if VIRTIO_RING_F_EVENT_IDX: uint16_t avail_event; */
+        /* Only if VIRTIO_RING_F_EVENT_IDX: u16 avail_event; */
 };
 
 struct vring {
@@ -107,19 +107,19 @@ struct vring {
  *      struct vring_desc desc[num];
  *
  *      // A ring of available descriptor heads with free-running index.
- *      uint16_t avail_flags;
- *      uint16_t avail_idx;
- *      uint16_t available[num];
- *      uint16_t used_event_idx; // Only if VIRTIO_RING_F_EVENT_IDX
+ *      u16 avail_flags;
+ *      u16 avail_idx;
+ *      u16 available[num];
+ *      u16 used_event_idx; // Only if VIRTIO_RING_F_EVENT_IDX
  *
  *      // Padding to the next align boundary.
  *      char pad[];
  *
  *      // A ring of used descriptor heads with free-running index.
- *      uint16_t used_flags;
- *      uint16_t used_idx;
+ *      u16 used_flags;
+ *      u16 used_idx;
  *      struct vring_used_elem used[num];
- *      uint16_t avail_event_idx; // Only if VIRTIO_RING_F_EVENT_IDX
+ *      u16 avail_event_idx; // Only if VIRTIO_RING_F_EVENT_IDX
  * };
  * Note: for virtio PCI, align is 4096.
  */
@@ -129,32 +129,32 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
         vr->num = num;
         vr->desc = p;
         vr->avail = p + num*sizeof(struct vring_desc);
-        vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(uint16_t)
+        vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(u16)
                               + align-1)
                             & ~(align - 1));
 }
 
 static inline unsigned vring_size(unsigned int num, unsigned long align)
 {
-        return ((sizeof(struct vring_desc)*num + sizeof(uint16_t)*(3+num)
+        return ((sizeof(struct vring_desc)*num + sizeof(u16)*(3+num)
                  + align - 1) & ~(align - 1))
-                + sizeof(uint16_t)*3 + sizeof(struct vring_used_elem)*num;
+                + sizeof(u16)*3 + sizeof(struct vring_used_elem)*num;
 }
 
-static inline int vring_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old_idx)
+static inline int vring_need_event(u16 event_idx, u16 new_idx, u16 old_idx)
 {
-         return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old_idx);
+         return (u16)(new_idx - event_idx - 1) < (u16)(new_idx - old_idx);
 }
 
 /* Get location of event indices (only with VIRTIO_RING_F_EVENT_IDX) */
-static inline uint16_t *vring_used_event(struct vring *vr)
+static inline u16 *vring_used_event(struct vring *vr)
 {
         /* For backwards compat, used event index is at *end* of avail ring. */
         return &vr->avail->ring[vr->num];
 }
 
-static inline uint16_t *vring_avail_event(struct vring *vr)
+static inline u16 *vring_avail_event(struct vring *vr)
 {
         /* For backwards compat, avail event index is at *end* of used ring. */
-        return (uint16_t *)&vr->used->ring[vr->num];
+        return (u16 *)&vr->used->ring[vr->num];
 }

+ 2 - 2
sys/src/9/386/ether8169.c

@@ -344,7 +344,7 @@ static Ctlr *rtl8169ctlrtail;
 #define csr8r(c, r) (inb((c)->port + (r)))
 #define csr16r(c, r) (ins((c)->port + (r)))
 #define csr32r(c, r) (inl((c)->port + (r)))
-#define csr8w(c, r, b) (outb((c)->port + (r), (uint8_t)(b)))
+#define csr8w(c, r, b) (outb((c)->port + (r), (u8)(b)))
 #define csr16w(c, r, w) (outs((c)->port + (r), (u16)(w)))
 #define csr32w(c, r, l) (outl((c)->port + (r), (u32)(l)))
 
@@ -926,7 +926,7 @@ rtl8169attach(Ether *edev)
 	}
 	qunlock(&ctlr->alock);
 
-	/* Don't wait int32_t for link to be ready. */
+	/* Don't wait i32 for link to be ready. */
 	for(timeo = 0; timeo < 10; timeo++){
 		if(miistatus(ctlr->mii) == 0)
 			break;

+ 1 - 1
sys/src/9/aarch64/cpu.json

@@ -15,7 +15,7 @@
 			"Config": {
 				"Code": [
 					"int cpuserver = 1;",
-					"uint32_t kerndate = 1;"
+					"u32 kerndate = 1;"
 				],
 				"NoDev": [
 					"arch",

+ 1 - 1
sys/src/9/amd64/acore.c

@@ -135,7 +135,7 @@ void
 actouser(void)
 {
 #if 0
-	void xactouser(uint64_t);
+	void xactouser(u64);
 	Ureg *u;
 
 	acfpusysprocsetup(m->proc);

+ 1 - 1
sys/src/9/amd64/acpi.h

@@ -512,7 +512,7 @@ struct DevScope {
 	int *paths;
 };
 /*
- * The device scope is basic tbdf as uint32_t. There is a special value
+ * The device scope is basic tbdf as u32. There is a special value
  * that means "everything" and if we see that we set "all" in the Drhd.
  */
 struct Drhd {

+ 1 - 1
sys/src/9/amd64/build.json

@@ -17,7 +17,7 @@
 			"Config": {
 				"Code": [
 					"int cpuserver = 1;",
-					"uint32_t kerndate = 1;"
+					"u32 kerndate = 1;"
 				],
 				"#Dev": "devs are in order of initialisation",
 				"Dev": [

+ 5 - 5
sys/src/9/amd64/dat.h

@@ -364,17 +364,17 @@ struct Sys {
 
 	alignas(4096) Mach *machptr[MACHMAX];
 
-	uint64_t pmstart; /* physical memory */
-	uint64_t pmend;	  /* total span */
+	u64 pmstart; /* physical memory */
+	u64 pmend;	  /* total span */
 
-	uint64_t epoch; /* crude time synchronisation */
+	u64 epoch; /* crude time synchronisation */
 
 	int nc[NIXROLES]; /* number of online processors */
 	int nmach;
 	int load;
-	uint64_t ticks; /* of the clock since boot time */
+	u64 ticks; /* of the clock since boot time */
 
-	uint64_t cyclefreq; /* Frequency of user readable cycle counter (mach 0) */
+	u64 cyclefreq; /* Frequency of user readable cycle counter (mach 0) */
 
 	uint pgszlg2[NPGSZ];  /* per Mach or per Sys? */
 	uint pgszmask[NPGSZ]; /* Per sys -aki */

+ 1 - 1
sys/src/9/amd64/devvga.c

@@ -266,7 +266,7 @@ vgactl(Cmdbuf *cb)
 {
 	int align, i, size, x, y, z;
 	char *chanstr, *p;
-	uint32_t chan;
+	u32 chan;
 	Cmdtab *ct;
 	VGAscr *scr;
 	extern VGAdev *vgadev[];

+ 2 - 2
sys/src/9/amd64/ether8139.c

@@ -227,8 +227,8 @@ static Ctlr *ctlrtail;
 #define csr16r(c, r) (ins((c)->port + (r)))
 #define csr32r(c, r) (inl((c)->port + (r)))
 #define csr8w(c, r, b) (outb((c)->port + (r), (int)(b)))
-#define csr16w(c, r, w) (outs((c)->port + (r), (uint16_t)(w)))
-#define csr32w(c, r, l) (outl((c)->port + (r), (uint32_t)(l)))
+#define csr16w(c, r, w) (outs((c)->port + (r), (u16)(w)))
+#define csr32w(c, r, l) (outl((c)->port + (r), (u32)(l)))
 
 static void
 rtl8139promiscuous(void *arg, int on)

+ 14 - 14
sys/src/9/amd64/etherbcm.c.NO

@@ -36,10 +36,10 @@ struct Ctlr {
 	Ether	*ether;
 	Ctlr	*next;
 	Pcidev	*pdev;
-	uint32_t	*nic, *status;
+	u32	*nic, *status;
 
-	uint32_t	*recvret, *recvprod, *sendr;
-	uint32_t	port;
+	u32	*recvret, *recvprod, *sendr;
+	u32	port;
 	uint	recvreti, recvprodi, sendri, sendcleani;
 	Block	**sends;
 	Block	**rxs;
@@ -245,8 +245,8 @@ cname(Ctlr *c)
 	return cttab[c->type].name;
 }
 
-static int32_t
-bcmifstat(Ether *edev, void *a, int32_t n, uint32_t offset)
+static i32
+bcmifstat(Ether *edev, void *a, i32 n, u32 offset)
 {
 	char *s, *p, *e;
 	Ctlr *c;
@@ -396,7 +396,7 @@ static int
 replenish(Ctlr *ctlr)
 {
 	uint incr;
-	uint32_t *next;
+	u32 *next;
 	Block *bp;
 	
 	incr = (ctlr->recvprodi + 1) & (RxProdRingLen - 1);
@@ -425,7 +425,7 @@ static void
 bcmreceive(Ether *edev)
 {
 	uint len;
-	uint32_t *pkt;
+	u32 *pkt;
 	Ctlr *ctlr;
 	Block *bp;
 	
@@ -468,7 +468,7 @@ static void
 bcmtransmit(Ether *edev)
 {
 	uint incr;
-	uint32_t *next;
+	u32 *next;
 	Ctlr *ctlr;
 	Block *bp;
 	
@@ -524,7 +524,7 @@ bcmerror(Ether *edev)
 static void
 bcminterrupt(Ureg*u, void *arg)
 {
-	uint32_t status, tag, dummy;
+	u32 status, tag, dummy;
 	Ether *edev;
 	Ctlr *ctlr;
 	
@@ -557,10 +557,10 @@ mem32w(Ctlr *c, uint r, uint v)
 	pcicfgw32(c->pdev, MemwindData, v);
 }
 
-static uint32_t
+static u32
 mem32r(Ctlr *c, uint r)
 {
-	uint32_t v;
+	u32 v;
 
 	pcicfgw32(c->pdev, Memwind, r);
 	v = pcicfgr32(c->pdev, MemwindData);
@@ -586,7 +586,7 @@ static int
 bcminit(Ether *edev)
 {
 	uint i;
-	uint32_t j;
+	u32 j;
 	Ctlr *ctlr;
 	
 	ctlr = edev->ctlr;
@@ -813,7 +813,7 @@ bcmpci(void)
 		ctlr->port = p->mem[0].bar & ~0x0F;
 		mem = vmap(ctlr->port, p->mem[0].size);
 		if(mem == nil) {
-			print("bcm: can't map %#p\n", (uint64_t)ctlr->port);
+			print("bcm: can't map %#p\n", (u64)ctlr->port);
 			free(ctlr);
 			continue;
 		}
@@ -843,7 +843,7 @@ bcmpromiscuous(void* arg, int on)
 }
 
 static void
-bcmmulticast(void*v, uint8_t*u, int i)
+bcmmulticast(void*v, u8*u, int i)
 {
 }
 

+ 2 - 2
sys/src/9/amd64/fns.h

@@ -22,8 +22,8 @@ void actouser(void);
 void runacore(void);
 void aamloop(int);
 Dirtab *addarchfile(char *, int,
-		    int32_t (*)(Chan *, void *, int32_t, int64_t),
-		    int32_t (*)(Chan *, void *, int32_t, int64_t));
+		    i32 (*)(Chan *, void *, i32, i64),
+		    i32 (*)(Chan *, void *, i32, i64));
 void acmmuswitch(void);
 void acmodeset(int);
 void archfmtinstall(void);

+ 1 - 1
sys/src/9/amd64/l64v.S

@@ -400,7 +400,7 @@ fas64:
 	RET
 
 // %rdi:&key, %esi:old, %edx:new
-// int	cas32(void* %rdi, uint32_t %esi, uint32_t %edx);
+// int	cas32(void* %rdi, u32 %esi, u32 %edx);
 .global cas32
 cas32:
 	movl	%esi, %eax

+ 1 - 1
sys/src/9/amd64/main.c

@@ -221,7 +221,7 @@ extern int num_cpus;
 void
 squidboy(Mach *mach)
 {
-	// FIX QEMU. extern int64_t hz;
+	// FIX QEMU. extern i64 hz;
 	i64 hz;
 
 	sys->machptr[mach->machno] = mach;

+ 12 - 12
sys/src/9/amd64/root/cpu.c

@@ -527,7 +527,7 @@ netkeysrvauth(int fd, char *user)
 }
 
 static void
-mksecret(char *t, uint8_t *f)
+mksecret(char *t, u8 *f)
 {
 	sprint(t, "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
 	       f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9]);
@@ -539,8 +539,8 @@ mksecret(char *t, uint8_t *f)
 static int
 p9auth(int fd)
 {
-	uint8_t key[16];
-	uint8_t digest[SHA1dlen];
+	u8 key[16];
+	u8 digest[SHA1dlen];
 	char fromclientsecret[21];
 	char fromserversecret[21];
 	int i;
@@ -597,7 +597,7 @@ chuid(char *to)
 {
 	int fd, r;
 	char *cap, *p;
-	uint8_t hash[SHA1dlen];
+	u8 hash[SHA1dlen];
 
 	if((fd = open("#¤/caphash", OWRITE)) < 0){
 		werrstr("open #¤/caphash: %r");
@@ -606,7 +606,7 @@ chuid(char *to)
 
 	cap = smprint("%s@Why can't we all just get along?", to);
 	p = strrchr(cap, '@');
-	hmac_sha1((uint8_t *)cap, p - cap, (uint8_t *)p + 1, strlen(p + 1), hash,
+	hmac_sha1((u8 *)cap, p - cap, (u8 *)p + 1, strlen(p + 1), hash,
 		  nil);
 	if(write(fd, hash, SHA1dlen) < 0){
 		free(cap);
@@ -670,7 +670,7 @@ srvnoauth(int fd, char *user)
 }
 
 void
-loghex(uint8_t *p, int n)
+loghex(u8 *p, int n)
 {
 	char buf[100];
 	int i;
@@ -683,8 +683,8 @@ loghex(uint8_t *p, int n)
 static int
 srvp9auth(int fd, char *user)
 {
-	uint8_t key[16];
-	uint8_t digest[SHA1dlen];
+	u8 key[16];
+	u8 digest[SHA1dlen];
 	char fromclientsecret[21];
 	char fromserversecret[21];
 	int i;
@@ -848,7 +848,7 @@ struct {
 int
 fsreply(int fd, Fcall *f)
 {
-	uint8_t buf[IOHDRSZ + Maxfdata];
+	u8 buf[IOHDRSZ + Maxfdata];
 	int n;
 
 	if(dbg)
@@ -936,7 +936,7 @@ int
 fsstat(int fd, Fid *fid, Fcall *f)
 {
 	Dir d;
-	uint8_t statbuf[256];
+	u8 statbuf[256];
 
 	memset(&d, 0, sizeof(d));
 	d.name = fstab[fid->file].name;
@@ -955,7 +955,7 @@ int
 fsread(int fd, Fid *fid, Fcall *f)
 {
 	Dir d;
-	uint8_t buf[256];
+	u8 buf[256];
 	Request *rp;
 
 	switch(fid->file){
@@ -1000,7 +1000,7 @@ char Enotdir[] = "not a directory";
 void
 notefs(int fd)
 {
-	uint8_t buf[IOHDRSZ + Maxfdata];
+	u8 buf[IOHDRSZ + Maxfdata];
 	int i, n, ncpunote;
 	Fcall f;
 	Qid wqid[MAXWELEM];

+ 2 - 2
sys/src/9/amd64/sdata.c

@@ -505,9 +505,9 @@ ataready(int cmdport, int ctlport, int dev, int reset, int ready, int micro)
 
 /*
 static int
-atacsf(Drive* drive, int64_t csf, int supported)
+atacsf(Drive* drive, i64 csf, int supported)
 {
-	uint16_t *info;
+	u16 *info;
 	int cmdset, i, x;
 
 	if(supported)

Some files were not shown because too many files changed in this diff