Browse Source

Removed ifndef _MPINT from libsec.h

This is not Harvey style. Removing it implies add #include <mp.h> before each #include <libsec.h>

Signed-off-by: fuchicar <rafita.fernandez@gmail.com>
fuchicar 7 years ago
parent
commit
e82d7a20e8
68 changed files with 218 additions and 164 deletions
  1. 0 4
      sys/include/libsec.h
  2. 1 0
      sys/src/9/port/devcap.c
  3. 1 0
      sys/src/9/port/devssl.c
  4. 1 0
      sys/src/9/port/devtls.c
  5. 2 1
      sys/src/cmd/auth/as.c
  6. 4 2
      sys/src/cmd/auth/cron.c
  7. 2 0
      sys/src/cmd/auth/netkey.c
  8. 5 4
      sys/src/cmd/cpu.c
  9. 4 3
      sys/src/cmd/disk/9660/boot.c
  10. 4 4
      sys/src/cmd/disk/9660/cdrdwr.c
  11. 1 0
      sys/src/cmd/disk/9660/conform.c
  12. 4 4
      sys/src/cmd/disk/9660/direc.c
  13. 4 3
      sys/src/cmd/disk/9660/dump.c
  14. 12 11
      sys/src/cmd/disk/9660/dump9660.c
  15. 4 3
      sys/src/cmd/disk/9660/ichar.c
  16. 5 5
      sys/src/cmd/disk/9660/jchar.c
  17. 2 1
      sys/src/cmd/disk/9660/path.c
  18. 1 0
      sys/src/cmd/disk/9660/plan9.c
  19. 1 1
      sys/src/cmd/disk/9660/rune.c
  20. 18 18
      sys/src/cmd/disk/9660/sysuse.c
  21. 1 0
      sys/src/cmd/disk/9660/unix.c
  22. 2 1
      sys/src/cmd/disk/9660/util.c
  23. 3 2
      sys/src/cmd/disk/9660/write.c
  24. 15 14
      sys/src/cmd/exportfs/exportfs.c
  25. 9 9
      sys/src/cmd/hget.c
  26. 1 0
      sys/src/cmd/import.c
  27. 1 0
      sys/src/cmd/ip/ftpd.c
  28. 10 9
      sys/src/cmd/ip/snoopy/main.c
  29. 7 6
      sys/src/cmd/ip/snoopy/ospf.c
  30. 13 12
      sys/src/cmd/ip/snoopy/ppp.c
  31. 3 2
      sys/src/cmd/ip/telnetd.c
  32. 1 0
      sys/src/cmd/lnfs.c
  33. 1 0
      sys/src/cmd/md5sum.c
  34. 2 1
      sys/src/cmd/screenlock.c
  35. 1 0
      sys/src/cmd/sha1sum.c
  36. 2 1
      sys/src/cmd/unlnfs.c
  37. 4 3
      sys/src/cmd/venti/copy.c
  38. 2 2
      sys/src/cmd/venti/devnull.c
  39. 1 1
      sys/src/cmd/venti/randtest.c
  40. 1 0
      sys/src/cmd/venti/read.c
  41. 4 4
      sys/src/cmd/venti/ro.c
  42. 1 0
      sys/src/cmd/venti/root.c
  43. 1 0
      sys/src/cmd/venti/srv/stdinc.h
  44. 1 0
      sys/src/cmd/venti/write.c
  45. 1 1
      sys/src/cmd/vnc/auth.c
  46. 1 0
      sys/src/cmd/vnc/vncv.c
  47. 1 0
      sys/src/libhttpd/parse.c
  48. 1 0
      sys/src/liboventi/plan9-sha1.c
  49. 1 0
      sys/src/libsec/port/crypt.c
  50. 1 0
      sys/src/libsec/port/des.c
  51. 1 0
      sys/src/libsec/port/desmodes.c
  52. 3 2
      sys/src/libsec/port/fastrand.c
  53. 1 0
      sys/src/libsec/port/hmac.c
  54. 1 0
      sys/src/libsec/port/md4.c
  55. 1 0
      sys/src/libsec/port/md5.c
  56. 1 0
      sys/src/libsec/port/md5block.c
  57. 1 0
      sys/src/libsec/port/md5pickle.c
  58. 2 1
      sys/src/libsec/port/nfastrand.c
  59. 1 0
      sys/src/libsec/port/rc4.c
  60. 1 0
      sys/src/libsec/port/sha1.c
  61. 1 0
      sys/src/libsec/port/sha1pickle.c
  62. 1 0
      sys/src/libsec/port/sha2_128.c
  63. 1 0
      sys/src/libsec/port/sha2_64.c
  64. 1 0
      sys/src/libsec/port/sha2test.c
  65. 1 0
      sys/src/libsec/port/tsmemcmp.c
  66. 1 0
      sys/src/libusb/audio/audiofs.c
  67. 5 5
      sys/src/libventi/debugpacket.c
  68. 25 24
      sys/src/libventi/packet.c

+ 0 - 4
sys/include/libsec.h

@@ -7,10 +7,6 @@
  * in the LICENSE file.
  */
 
-#ifndef _MPINT
-typedef struct mpint mpint;
-#endif
-
 /*
  * AES definitions
  */

+ 1 - 0
sys/src/9/port/devcap.c

@@ -14,6 +14,7 @@
 #include	"fns.h"
 #include	"../port/error.h"
 
+#include <mp.h>
 #include	<libsec.h>
 
 enum

+ 1 - 0
sys/src/9/port/devssl.c

@@ -17,6 +17,7 @@
 #include	"fns.h"
 #include	"../port/error.h"
 
+#include <mp.h>
 #include	<libsec.h>
 
 #define NOSPOOKS 1

+ 1 - 0
sys/src/9/port/devtls.c

@@ -17,6 +17,7 @@
 #include	"fns.h"
 #include	"../port/error.h"
 
+#include <mp.h>
 #include	<libsec.h>
 
 typedef struct OneWay	OneWay;

+ 2 - 1
sys/src/cmd/auth/as.c

@@ -15,6 +15,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <auth.h>
 #include "authcmdlib.h"
@@ -124,7 +125,7 @@ initcap(void)
 }
 
 /*
- *  create a change uid capability 
+ *  create a change uid capability
  */
 char*
 mkcap(char *from, char *to)

+ 4 - 2
sys/src/cmd/auth/cron.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <auth.h>
 #include "authcmdlib.h"
@@ -86,7 +87,8 @@ int
 sleepuntil(uint32_t tm)
 {
 	uint32_t now = time(0);
-	
+
+
 	if (now < tm)
 		return sleep((tm - now)*1000);
 
@@ -687,7 +689,7 @@ initcap(void)
 }
 
 /*
- *  create a change uid capability 
+ *  create a change uid capability
  */
 char*
 mkcap(char *from, char *to)

+ 2 - 0
sys/src/cmd/auth/netkey.c

@@ -9,6 +9,8 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
+#include <libsec.h>
 #include <authsrv.h>
 #include <bio.h>
 #include "authcmdlib.h"

+ 5 - 4
sys/src/cmd/cpu.c

@@ -19,6 +19,7 @@
 #include <bio.h>
 #include <auth.h>
 #include <fcall.h>
+#include <mp.h>
 #include <libsec.h>
 
 #define	Maxfdata 8192
@@ -239,7 +240,7 @@ main(int argc, char **argv)
 	/* start up a process to pass aint32_t notes */
 	lclnoteproc(data);
 
-	/* 
+	/*
 	 *  Wait for the other end to execute and start our file service
 	 *  of /mnt/term
 	 */
@@ -331,7 +332,7 @@ old9p(int fd)
 		close(fd);
 		close(p[0]);
 	}
-	return p[1];	
+	return p[1];
 }
 
 /* Invoked with stdin, stdout and stderr connected to the network connection */
@@ -483,7 +484,7 @@ readstr(int fd, char *str, int len)
 
 	while(len) {
 		n = read(fd, str, 1);
-		if(n < 0) 
+		if(n < 0)
 			return -1;
 		if(*str == '\0')
 			return 0;
@@ -763,7 +764,7 @@ rmtnoteproc(void)
 			syslog(0, "cpu", "cpu -R: can't open %s", rmtnotefile);
 			_exits(0);
 		}
-	
+
 		for(;;){
 			n = read(fd, buf, sizeof(buf)-1);
 			if(n <= 0){

+ 4 - 3
sys/src/cmd/disk/9660/boot.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -51,7 +52,7 @@ g% cdsector 3149 | xd -b	# 0x0c4d
                                                     55 aa - magic
 
 0000020  88    - 88 = bootable
-            03   - 3 = 2.88MB diskette 
+            03   - 3 = 2.88MB diskette
                00 00 - load segment 0 means default 0x7C0
                      00  - system type (byte 5 of boot image)
                         00 - unused (0)
@@ -67,13 +68,13 @@ g% cdsector `{h2d 0c4e} | xd -b
 1+0 records out
 0000000  eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
 0000010  00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
-0000020  00 00 00 00 00 16 1f 66 6a 00 51 50 06 53 
+0000020  00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
                                           31 c0
 
 FREEBSD
 0000000  eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
 0000010  00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
-0000020  00 00 00 00 00 16 1f 66 6a 00 51 50 06 53 
+0000020  00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
                                           31 c0
 
 DOS 5

+ 4 - 4
sys/src/cmd/disk/9660/cdrdwr.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -135,7 +136,7 @@ opencd(char *file, Cdinfo info)
 	}
 
 	/* lowercase because of isostring */
-	if(strstr(cd->iso.systemid, "iso9660") == nil 
+	if(strstr(cd->iso.systemid, "iso9660") == nil
 	&& strstr(cd->iso.systemid, "utf8") == nil) {
 		werrstr("unknown systemid %s", cd->iso.systemid);
 		free(cd);
@@ -143,7 +144,7 @@ opencd(char *file, Cdinfo info)
 		close(xfd);
 		return nil;
 	}
-	
+
 	if(strstr(cd->iso.systemid, "plan 9"))
 		cd->flags |= CDplan9;
 	if(strstr(cd->iso.systemid, "iso9660"))
@@ -324,7 +325,7 @@ parsedesc(Voldesc *v, Cvoldesc *cv, char *(*string)(uint8_t*, int))
 	v->biblio = string(cv->biblio, sizeof cv->biblio);
 	v->notice = string(cv->notice, sizeof cv->notice);
 }
-	
+
 static int
 readisodesc(Cdimg *cd, Voldesc *v)
 {
@@ -678,4 +679,3 @@ Clinelen(Cdimg *cd)
 {
 	return Blinelen(&cd->brd);
 }
-

+ 1 - 0
sys/src/cmd/disk/9660/conform.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <ctype.h>
 #include "iso9660.h"

+ 4 - 4
sys/src/cmd/disk/9660/direc.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -95,9 +96,9 @@ walkdirec(Direc *d, char *name)
  * Add the file ``name'' with attributes d to the
  * directory ``root''.  Name may contain multiple
  * elements; all but the last must exist already.
- * 
+ *
  * The child lists are kept sorted by utfname.
- */	
+ */
 Direc*
 adddirec(Direc *root, char *name, XDir *d)
 {
@@ -139,7 +140,7 @@ adddirec(Direc *root, char *name, XDir *d)
 	return nd;
 }
 
-/* 
+/*
  * Copy the tree src into dst.
  */
 void
@@ -228,4 +229,3 @@ dsort(Direc *d, int (*cmp)(const void*, const void*))
 	for(i=0; i<n; i++)
 		dsort(&d->child[i], cmp);
 }
-

+ 4 - 3
sys/src/cmd/disk/9660/dump.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <ctype.h>
 #include "iso9660.h"
@@ -358,7 +359,7 @@ adddumpdir(Direc *root, uint32_t now, XDir *dir)
 	Tm tm;
 
 	tm = *localtime(now);
-	
+
 	sprint(buf, "%d", tm.year+1900);
 	if((dyear = walkdirec(root, buf)) == nil) {
 		dyear = adddirec(root, buf, dir);
@@ -416,7 +417,7 @@ hasdump(Cdimg *cd)
 	}
 	return 0;
 }
-	
+
 Direc
 readdumpdirs(Cdimg *cd, XDir *dir, char *(*cvt)(uint8_t*, int))
 {
@@ -511,7 +512,7 @@ readdumpconform(Cdimg *cd)
 			if(tokenize(p, f, 2) != 2 || (f[0][0] != 'D' && f[0][0] != 'F')
 			|| strlen(f[0]) != 7 || !isalldigit(f[0]+1))
 				break;
-	
+
 			addtx(atom(f[1]), atom(f[0]));
 		}
 	}

+ 12 - 11
sys/src/cmd/disk/9660/dump9660.c

@@ -11,6 +11,7 @@
 #include <libc.h>
 #include <bio.h>
 #include <disk.h>
+#include <mp.h>
 #include <libsec.h>
 #include "iso9660.h"
 
@@ -202,7 +203,7 @@ main(int argc, char **argv)
 			Cwseek(cd, (int64_t)cd->nextblock * Blocksize);
 			goto Dofix;
 		}
-	
+
 		dumpname = adddumpdir(&idumproot, now, &dir);
 		/* note that we assume all names are conforming and thus sorted */
 		if(cd->flags & CDjoliet) {
@@ -273,14 +274,14 @@ main(int argc, char **argv)
 		 * Write incremental _conform.map block.
 		 */
 		wrconform(cd, cd->nconform, &cblock, &clength);
-	
+
 		/* jump here if we're just fixing up the cd */
 Dofix:
 		/*
-		 * Write null dump header block; everything after this will be 
+		 * Write null dump header block; everything after this will be
 		 * overwritten at the next dump.  Because of this, it needs to be
 		 * reconstructable.  We reconstruct the _conform.map and dump trees
-		 * from the header blocks in dump.c, and we reconstruct the path 
+		 * from the header blocks in dump.c, and we reconstruct the path
 		 * tables by walking the cd.
 		 */
 		newnull = Cputdumpblock(cd);
@@ -294,12 +295,12 @@ Dofix:
 	dir.mode = 0444;
 	if(cd->flags & (CDconform|CDjoliet)) {
 		if(!mk9660 && cd->nconform == 0){
-			block = cblock;	
+			block = cblock;
 			length = clength;
 		}else
 			wrconform(cd, 0, &block, &length);
 
-		if(mk9660) 
+		if(mk9660)
 {
 			idumproot = iroot;
 			jdumproot = jroot;
@@ -355,7 +356,7 @@ Dofix:
 				copybutname(r, &jroot);
 			}
 		}
-	
+
 		writedumpdirs(cd, &idumproot, Cputisodir);
 		if(cd->flags & CDjoliet)
 			writedumpdirs(cd, &jdumproot, Cputjolietdir);
@@ -370,7 +371,7 @@ Dofix:
 			setvolsize(cd, cd->jolietsvd, cd->nextblock);
 		}
 	}
-	writepathtables(cd);	
+	writepathtables(cd);
 
 	if(!mk9660){
 		/*
@@ -381,16 +382,16 @@ Dofix:
 		if(cd->nulldump && maxsize && Cwoffset(cd) > maxsize){
 			fprint(2, "too big; writing old tree back\n");
 			status = "cd too big; aborted";
-	
+
 			rmdumpdir(&idumproot, dumpname);
 			rmdumpdir(&jdumproot, dumpname);
-	
+
 			cd->nextblock = cd->nulldump+1;
 			cd->nulldump = 0;
 			Cwseek(cd, (int64_t)cd->nextblock * Blocksize);
 			goto Dofix;
 		}
-	
+
 		/*
 		 * Write old null header block; this commits all our changes.
 		 */

+ 4 - 3
sys/src/cmd/disk/9660/ichar.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <ctype.h>
 
@@ -41,7 +42,7 @@ isostring(uint8_t *buf, int len)
 	return q;
 }
 
-int 
+int
 isisofrog(char c)
 {
 	if(c >= '0' && c <= '9')
@@ -95,7 +96,7 @@ isbadiso9660(char *s)
 
 /*
  * ISO9660 name comparison
- * 
+ *
  * The standard algorithm is as follows:
  *   Take the filenames without extensions, pad the shorter with 0x20s (spaces),
  *   and do strcmp.  If they are equal, go on.
@@ -179,7 +180,7 @@ Cputisopvd(Cdimg *cd, Cdinfo info)
 		strcat(buf, "iso9660");
 	else
 		strcat(buf, "utf8");
-	
+
 	struprcpy(buf, buf);
 	Cputs(cd, buf, 32);
 

+ 5 - 5
sys/src/cmd/disk/9660/jchar.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -35,15 +36,15 @@ jolietstring(uint8_t *buf, int len)
 }
 
 /*
- * Joliet name validity check 
- * 
+ * Joliet name validity check
+ *
  * Joliet names have length at most 128 bytes (64 runes),
  * and cannot contain '*', '/', ':', ';', '?', or '\'.
  */
 int
 isjolietfrog(Rune r)
 {
-	return r==L'*' || r==L'/' || r==L':' 
+	return r==L'*' || r==L'/' || r==L':'
 		|| r==';' || r=='?' || r=='\\';
 }
 
@@ -67,7 +68,7 @@ isbadjoliet(char *s)
  * The standard algorithm is the ISO9660 algorithm but
  * on the encoded Runes.  Runes are encoded in big endian
  * format, so we can just use runecmp.
- * 
+ *
  * Padding is with zeros, but that still doesn't affect us.
  */
 
@@ -144,4 +145,3 @@ Cputjolietsvd(Cdimg *cd, Cdinfo info)
 	Cputc(cd, 1);				/* file structure version */
 	Cpadblock(cd);
 }
-

+ 2 - 1
sys/src/cmd/disk/9660/path.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -18,7 +19,7 @@
  * Add the requisite path tables to the CD image.
  * They get put on the end once everything else is done.
  * We use the path table itself as a queue in the breadth-first
- * traversal of the tree.  
+ * traversal of the tree.
  *
  * The only problem with this is that the path table does not
  * store the lengths of the directories.  So we keep an explicit

+ 1 - 0
sys/src/cmd/disk/9660/plan9.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <disk.h>
 #include "iso9660.h"

+ 1 - 1
sys/src/cmd/disk/9660/rune.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -45,4 +46,3 @@ runecmp(Rune *s, Rune *t)
 		s++, t++;
 	return *s - *t;
 }
-

+ 18 - 18
sys/src/cmd/disk/9660/sysuse.c

@@ -18,6 +18,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include "iso9660.h"
 
@@ -52,11 +53,11 @@ setcelen(Cdimg *cd, int64_t woffset, uint32_t len)
  * Rock Ridge data is put into little blockettes, which can be
  * at most 256 bytes including a one-byte length.  Some number
  * of blockettes get packed together into a normal 2048-byte block.
- * Blockettes cannot cross block boundaries. 
+ * Blockettes cannot cross block boundaries.
  *
- * A Cbuf is a blockette buffer.  Len contains 
+ * A Cbuf is a blockette buffer.  Len contains
  * the length of the buffer written so far, and we can
- * write up to 254-28.  
+ * write up to 254-28.
  *
  * We only have one active Cbuf at a time; cdimg.rrcontin is the byte
  * offset of the beginning of that Cbuf.
@@ -103,7 +104,7 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
 
 	/*
 	 * the current blockette is full; update cd->rrcontin and then
- 	 * write a CE record to finish it.  Unfortunately we need to 
+ 	 * write a CE record to finish it.  Unfortunately we need to
 	 * figure out which block will be next before we write the CE.
 	 */
 	end = Cwoffset(cd)+28;
@@ -143,13 +144,13 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
 
 	return cn;
 }
-	
+
 /*
  * Put down the name, but we might need to break it
  * into chunks so that each chunk fits in 254-28-5 bytes.
  * What a crock.
  *
- * The new Plan 9 format uses strings of this form too, 
+ * The new Plan 9 format uses strings of this form too,
  * since they're already there.
  */
 Cbuf*
@@ -221,7 +222,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
 		what |= RR_SL;
 
 	m = CputsuspRR(cd, what, 0);
-	cp = ensurespace(cd, m, cp, &cn, dowrite);	
+	cp = ensurespace(cd, m, cp, &cn, dowrite);
 	CputsuspRR(cd, what, dowrite);
 
 	if(what & RR_PX) {
@@ -245,7 +246,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
 
 	/*
 	 * Put down the symbolic link.  This is even more of a crock.
-	 * Not only are the individual elements potentially split, 
+	 * Not only are the individual elements potentially split,
 	 * but the whole path itself can be split across SL blocks.
 	 * To keep the code simple as possible (really), we write
 	 * only one element per SL block, wasting 6 bytes per element.
@@ -394,7 +395,7 @@ CputsuspSP(Cdimg *cd, int dowrite)
 {
 	assert(cd!=0);
 
-	if(dowrite) { 
+	if(dowrite) {
 chat("writing SUSP SP record\n");
 		Cputc(cd, 'S');           /* SP field marker */
 		Cputc(cd, 'P');
@@ -418,7 +419,7 @@ CputsuspST(Cdimg *cd, int dowrite)
 		Cputc(cd, 'S');           /* ST field marker */
 		Cputc(cd, 'T');
 		Cputc(cd, 4);             /* Length          */
-		Cputc(cd, 1);             /* Version         */	
+		Cputc(cd, 1);             /* Version         */
 	}
 	return 4;
 }
@@ -496,7 +497,7 @@ CputrripPX(Cdimg *cd, Direc *d, int dot, int dowrite)
 		Cputc(cd, 'X');
 		Cputc(cd, 36);              /* Length          */
 		Cputc(cd, 1);               /* Version         */
-	
+
 		Cputn(cd, mode(d, dot), 4); /* POSIX File mode */
 		Cputn(cd, nlink(d), 4);     /* POSIX st_nlink  */
 		Cputn(cd, d?d->uidno:0, 4);  /* POSIX st_uid    */
@@ -526,7 +527,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
 		Cputc(cd, 5+7*length);		/* Length		 */
 		Cputc(cd, 1);				/* Version		 */
 		Cputc(cd, type);					/* Flags (types)	 */
-	
+
 		if (type & TFcreation)
 			Cputdate(cd, d?d->ctime:0);
 		if (type & TFmodify)
@@ -535,7 +536,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
 			Cputdate(cd, d?d->atime:0);
 		if (type & TFattributes)
 			Cputdate(cd, d?d->ctime:0);
-	
+
 	//	if (type & TFbackup)
 	//		Cputdate(cd, 0);
 	//	if (type & TFexpiration)
@@ -578,7 +579,7 @@ static int32_t
 mode(Direc *d, int dot)
 {
 	int32_t mode;
-	
+
 	if (!d)
 		return 0;
 
@@ -594,13 +595,13 @@ mode(Direc *d, int dot)
 		mode = S_IFDIR | (0755);
 
 	mode &= POSIXMODEMASK;
-		
+
 	/* Botch: not all POSIX types supported yet */
 	assert(mode & (S_IFDIR|S_IFREG));
 
-chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name); 
+chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name);
 
-	return mode;		
+	return mode;
 }
 
 static int32_t
@@ -622,4 +623,3 @@ nlink(Direc *d)   /* Trump up the nlink field for POSIX compliance */
 
 	return n;
 }
-

+ 1 - 0
sys/src/cmd/disk/9660/unix.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <libproto.h>
 #include <ctype.h>

+ 2 - 1
sys/src/cmd/disk/9660/util.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 #include <ctype.h>
 
@@ -48,7 +49,7 @@ atom(char *str)
 {
 	uint h;
 	Stringtab *tab;
-	
+
 	h = hash(str) % nelem(stab);
 	for(tab=stab[h]; tab; tab=tab->link)
 		if(strcmp(str, tab->str) == 0)

+ 3 - 2
sys/src/cmd/disk/9660/write.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "iso9660.h"
@@ -101,7 +102,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
 		start += blocksize-start%blocksize;
 
 	Cwseek(cd, (int64_t)start * Blocksize);
-	
+
 	s = md5(nil, 0, nil, nil);
 	length = 0;
 	while((n = Bread(b, buf, sizeof buf)) > 0) {
@@ -134,7 +135,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
 }
 
 /*
- * Write a directory tree.  We work from the leaves, 
+ * Write a directory tree.  We work from the leaves,
  * and patch the dotdot pointers afterward.
  */
 static void

+ 15 - 14
sys/src/cmd/exportfs/exportfs.c

@@ -14,6 +14,7 @@
 #include <libc.h>
 #include <auth.h>
 #include <fcall.h>
+#include <mp.h>
 #include <libsec.h>
 #define Extern
 #include "exportfs.h"
@@ -215,7 +216,7 @@ main(int argc, char **argv)
 		remote = na;
 		if((fd = dial(netmkaddr(na, 0, "importfs"), 0, 0, 0)) < 0)
 			sysfatal("can't dial %s: %r", na);
-	
+
 		ai = auth_proxy(fd, auth_getkey, "proto=p9any role=client %s", keyspec);
 		if(ai == nil)
 			sysfatal("%r: %s", na);
@@ -316,12 +317,12 @@ main(int argc, char **argv)
 			if (n == 0)
 				fatal("connection closed while reading arguments\n");
 
-			if (*p == '\n') 
+			if (*p == '\n')
 				*p = '\0';
 			if (*p++ == '\0')
 				break;
 		}
-		
+
 		if (tokenize(buf, args, nelem(args)) != 2)
 			fatal("impo arguments invalid: impo%s...\n", buf);
 
@@ -355,7 +356,7 @@ main(int argc, char **argv)
 		for(i = 0; i < 4; i++)
 			key[i+12] = rand();
 
-		if (initial) 
+		if (initial)
 			fatal("Protocol botch: old import\n");
 		if(readn(netfd, key, 4) != 4)
 			fatal("can't read key part; %r\n");
@@ -373,7 +374,7 @@ main(int argc, char **argv)
 
 		switch (encproto) {
 		case Encssl:
-			netfd = pushssl(netfd, ealgs, fromserversecret, 
+			netfd = pushssl(netfd, ealgs, fromserversecret,
 						fromclientsecret, nil);
 			break;
 		case Enctls:
@@ -385,7 +386,7 @@ main(int argc, char **argv)
 			fatal("can't establish ssl connection: %r");
 	}
 	else if (filterp) {
-		if (initial) 
+		if (initial)
 			fatal("Protocol botch: don't know how to deal with this\n");
 		netfd = filter(netfd, filterp);
 	}
@@ -397,7 +398,7 @@ main(int argc, char **argv)
 		r = getsbuf();
 		if(r == 0)
 			fatal("Out of service buffers");
-			
+
 		n = localread9pmsg(netfd, r->buf, messagesize, &initial);
 		if(n <= 0)
 			fatal(nil);
@@ -411,7 +412,7 @@ main(int argc, char **argv)
 }
 
 /*
- * WARNING: Replace this with the original version as soon as all 
+ * WARNING: Replace this with the original version as soon as all
  * _old_ imports have been replaced with negotiating imports.  Also
  * cpu relies on this (which needs to be fixed!) -- pb.
  */
@@ -461,7 +462,7 @@ reply(Fcall *r, Fcall *t, char *err)
 		t->type = Rerror;
 		t->ename = err;
 	}
-	else 
+	else
 		t->type = r->type + 1;
 
 	DEBUG(DFD, "\t%F\n", t);
@@ -519,7 +520,7 @@ freefid(int nr)
 		l = &f->next;
 	}
 
-	return 0;	
+	return 0;
 }
 
 Fid *
@@ -552,7 +553,7 @@ newfid(int nr)
 	new->fid = -1;
 	new->mid = 0;
 
-	return new;	
+	return new;
 }
 
 Fsrpc *
@@ -857,7 +858,7 @@ fatal(char *s, ...)
 		postnote(PNPROC, m->pid, "kill");
 
 	DEBUG(DFD, "%s\n", buf);
-	if (s) 
+	if (s)
 		sysfatal("%s", buf);	/* caution: buf could contain '%' */
 	else
 		exits(nil);
@@ -908,7 +909,7 @@ filter(int fd, char *cmd)
 	if ((s = strchr(newport, '\n')) != nil)
 		*s = '\0';
 
-	if ((nb = write(fd, newport, len)) < 0) 
+	if ((nb = write(fd, newport, len)) < 0)
 		sysfatal("getport; cannot write port; %r");
 	assert(nb == len);
 
@@ -940,7 +941,7 @@ filter(int fd, char *cmd)
 		close(fd);
 		close(p[0]);
 	}
-	return p[1];	
+	return p[1];
 }
 
 static void

+ 9 - 9
sys/src/cmd/hget.c

@@ -12,6 +12,7 @@
 #include <ctype.h>
 #include <bio.h>
 #include <ip.h>
+#include <mp.h>
 #include <libsec.h>
 #include <auth.h>
 
@@ -154,7 +155,7 @@ main(int argc, char **argv)
 		else
 			p = seprint(p, e, "%s", t);
 		u.postbody = postbody;
-		
+
 		break;
 	default:
 		usage();
@@ -170,7 +171,7 @@ main(int argc, char **argv)
 	if(argc != 1)
 		usage();
 
-	
+
 	out.fd = 1;
 	out.written = 0;
 	out.offset = 0;
@@ -240,7 +241,7 @@ crackurl(URL *u, char *s)
 		u->page = nil;
 	}
 
-	/* get type */ 
+	/* get type */
 	for(p = s; *p; p++){
 		if(*p == '/'){
 			p = s;
@@ -290,7 +291,7 @@ crackurl(URL *u, char *s)
 	if(p = strchr(u->host, ':')) {
 		*p++ = 0;
 		u->port = p;
-	} else 
+	} else
 		u->port = method[u->method].name;
 
 	if(*(u->host) == 0){
@@ -427,7 +428,7 @@ dohttp(URL *u, URL *px, Range *r, Out *out, int32_t mtime)
 				cfd = -1;
 			}
 		}
-			
+
 		dfprint(fd, "\r\n", u->host);
 		if(u->postbody)
 			dfprint(fd,	"%s", u->postbody);
@@ -500,7 +501,7 @@ dohttp(URL *u, URL *px, Range *r, Out *out, int32_t mtime)
 
 		case 503:	/* Service unavailable */
 			sysfatal("Service unavailable");
-		
+
 		default:
 			sysfatal("Unknown response code %d", code);
 		}
@@ -893,7 +894,7 @@ doftp(URL *u, URL *px, Range *r, Out *out, int32_t mtime)
 		close(ctl);
 		return Eof;
 	}
-		
+
 	/* first try passive mode, then active */
 	data = passive(ctl, u);
 	if(data < 0){
@@ -1209,7 +1210,7 @@ active(int ctl, URL *u)
 	}
 	close(afd);
 	close(lcfd);
-	
+
 	return dfd;
 }
 
@@ -1486,4 +1487,3 @@ output(Out *out, char *buf, int nb)
 	}
 	return n + d;
 }
-

+ 1 - 0
sys/src/cmd/import.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <auth.h>
+#include <mp.h>
 #include <libsec.h>
 
 enum {

+ 1 - 0
sys/src/cmd/ip/ftpd.c

@@ -12,6 +12,7 @@
 #include <bio.h>
 #include <auth.h>
 #include <ip.h>
+#include <mp.h>
 #include <libsec.h>
 #include <String.h>
 

+ 10 - 9
sys/src/cmd/ip/snoopy/main.c

@@ -15,6 +15,7 @@
 #include <ip.h>
 #include <bio.h>
 #include <fcall.h>
+#include <mp.h>
 #include <libsec.h>
 #include <ndb.h>
 #include "dat.h"
@@ -301,7 +302,7 @@ struct pcap_pkthdr {
 };
 
 /*
- *  pcap trace header 
+ *  pcap trace header
  */
 void
 pcaphdr(void)
@@ -311,7 +312,7 @@ pcaphdr(void)
 	hdr.magic = TCPDUMP_MAGIC;
 	hdr.version_major = PCAP_VERSION_MAJOR;
 	hdr.version_minor = PCAP_VERSION_MINOR;
-  
+
 	hdr.thiszone = 0;
 	hdr.snaplen = 1500;
 	hdr.sigfigs = 0;
@@ -681,7 +682,7 @@ _compile(Filter *f, Proto *last)
 	case '=':
 		if(last == nil)
 			sysfatal("internal error: compilewalk: badly formed tree");
-		
+
 		if(last->compile == nil)
 			sysfatal("unknown %s field: %s", f->pr->name, f->s);
 		(*last->compile)(f);
@@ -858,7 +859,7 @@ cat(void)
 {
 	char buf[1024];
 	int n;
-	
+
 	while((n = read(0, buf, sizeof buf)) > 0)
 		write(1, buf, n);
 }
@@ -868,10 +869,10 @@ void
 startmc(void)
 {
 	int p[2];
-	
+
 	if(fd1 == -1)
 		fd1 = dup(1, -1);
-	
+
 	if(pipe(p) < 0)
 		return;
 	switch(fork()){
@@ -910,7 +911,7 @@ printhelp(char *name)
 	Mux *m;
 	Field *f;
 	char fmt[40];
-	
+
 	if(name == nil){
 		print("protocols:\n");
 		startmc();
@@ -919,13 +920,13 @@ printhelp(char *name)
 		stopmc();
 		return;
 	}
-	
+
 	pr = findproto(name);
 	if(pr == nil){
 		print("unknown protocol %s\n", name);
 		return;
 	}
-	
+
 	if(pr->field){
 		print("%s's filter attributes:\n", pr->name);
 		len = 0;

+ 7 - 6
sys/src/cmd/ip/snoopy/ospf.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <ip.h>
+#include <mp.h>
 #include <libsec.h>
 #include "dat.h"
 #include "protos.h"
@@ -31,7 +32,7 @@ struct Ospfpkt
 	uint8_t	auth[8];
 	uint8_t	data[1];
 };
-#define OSPF_HDRSIZE	24	
+#define OSPF_HDRSIZE	24
 
 enum
 {
@@ -71,15 +72,15 @@ ospfauth(Ospfpkt *ospf)
 	case 0:
 		return "no authentication";
 	case 1:
-		sprint(auth, "password(%8.8x %8.8x)", NetL(ospf->auth),	
+		sprint(auth, "password(%8.8x %8.8x)", NetL(ospf->auth),
 			NetL(ospf->auth+4));
 		break;
 	case 2:
-		sprint(auth, "crypto(plen %d id %d dlen %d)", NetS(ospf->auth),	
+		sprint(auth, "crypto(plen %d id %d dlen %d)", NetS(ospf->auth),
 			ospf->auth[2], ospf->auth[3]);
 		break;
 	default:
-		sprint(auth, "auth%d(%8.8x %8.8x)", NetS(ospf->autype), NetL(ospf->auth),	
+		sprint(auth, "auth%d(%8.8x %8.8x)", NetS(ospf->autype), NetL(ospf->auth),
 			NetL(ospf->auth+4));
 	}
 	return auth;
@@ -165,7 +166,7 @@ struct Ospfrt {
 	uint8_t	typ;
 	uint8_t	numtos;
 	uint8_t	metric[2];
-	
+
 };
 
 struct OspfrtLSA {
@@ -357,7 +358,7 @@ p_seprint(Msg *m)
 	x -= OSPF_HDRSIZE;
 
 	p = seprint(p, e, "ver=%d type=%d len=%d r=%V a=%V c=%4.4x %s ",
-		ospf->version, ospf->type, x, 
+		ospf->version, ospf->type, x,
 		ospf->router, ospf->area, NetS(ospf->sum),
 		ospfauth(ospf));
 

+ 13 - 12
sys/src/cmd/ip/snoopy/ppp.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <ip.h>
+#include <mp.h>
 #include <libsec.h>
 #include "dat.h"
 #include "protos.h"
@@ -201,7 +202,7 @@ p_seprint(Msg *m)
 	proto = *m->ps++;
 	if((proto&1) == 0)
 		proto = (proto<<8) | *m->ps++;
-	
+
 	m->p = seprint(m->p, m->e, "pr=%u len=%d", proto, len);
 	demux(p_mux, proto, proto, m, &dump);
 
@@ -393,25 +394,25 @@ seprintipcpopt(char *p, char *e, void *a, int len)
 		default:
 			p = seprint(p, e, " (type=%d len=%d)", o->type, o->len);
 			break;
-		case Oipaddrs:	
+		case Oipaddrs:
 			p = seprint(p, e, " ipaddrs(deprecated)");
 			break;
 		case Oipcompress:
 			p = seprint(p, e, " ipcompress");
 			break;
-		case Oipaddr:	
+		case Oipaddr:
 			p = seprint(p, e, " ipaddr=%V", o->data);
 			break;
-		case Oipdns:	
+		case Oipdns:
 			p = seprint(p, e, " dnsaddr=%V", o->data);
 			break;
-		case Oipwins:	
+		case Oipwins:
 			p = seprint(p, e, " winsaddr=%V", o->data);
 			break;
-		case Oipdns2:	
+		case Oipdns2:
 			p = seprint(p, e, " dns2addr=%V", o->data);
 			break;
-		case Oipwins2:	
+		case Oipwins2:
 			p = seprint(p, e, " wins2addr=%V", o->data);
 			break;
 		}
@@ -439,7 +440,7 @@ p_seprintipcp(Msg *m)
 		m->pe = m->ps+len;
 	else if(m->ps+len > m->pe)
 		return -1;
-		
+
 	p = seprint(p, e, "id=%d code=%d", lcp->id, lcp->code);
 	switch(lcp->code) {
 	default:
@@ -476,13 +477,13 @@ seprintccpopt(char *p, char *e, void *a, int len)
 			p = seprint(p, e, " bad opt len %x", o->type);
 			return p;
 		}
-		
+
 		switch(o->type){
 		default:
 			p = seprint(p, e, " type=%d ", o->type);
 			break;
 		case 0:
-			p = seprint(p, e, " OUI=(%d %.2x%.2x%.2x) ", o->type, 
+			p = seprint(p, e, " OUI=(%d %.2x%.2x%.2x) ", o->type,
 				o->data[0], o->data[1], o->data[2]);
 			break;
 		case 17:
@@ -516,7 +517,7 @@ p_seprintccp(Msg *m)
 		m->pe = m->ps+len;
 	else if(m->ps+len > m->pe)
 		return -1;
-		
+
 	p = seprint(p, e, "id=%d code=%d", lcp->id, lcp->code);
 	switch(lcp->code) {
 	default:
@@ -537,7 +538,7 @@ p_seprintccp(Msg *m)
 		break;
 	}
 	m->p = seprint(p, e, " len=%d", len);
-	
+
 	return 0;
 }
 

+ 3 - 2
sys/src/cmd/ip/telnetd.c

@@ -11,6 +11,7 @@
 #include <libc.h>
 #include <bio.h>
 #include <auth.h>
+#include <mp.h>
 #include <libsec.h>
 
 #include "../ip/telnet.h"
@@ -303,7 +304,7 @@ doauth(char *user)
 	if(noworldonly)
 		return -1;
 	return challuser(user);
-		
+
 }
 
 /*
@@ -336,7 +337,7 @@ fromchild(char *bp, int len)
 /*
  *  Read from the network up to a '\n' or some other break.
  *
- *  If in binary mode, buffer characters but don't 
+ *  If in binary mode, buffer characters but don't
  *
  *  The following characters are special:
  *	'\r\n's and '\r's get turned into '\n's.

+ 1 - 0
sys/src/cmd/lnfs.c

@@ -13,6 +13,7 @@
 #include <auth.h>
 #include <fcall.h>
 #include <String.h>
+#include <mp.h>
 #include <libsec.h>
 
 enum

+ 1 - 0
sys/src/cmd/md5sum.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 

+ 2 - 1
sys/src/cmd/screenlock.c

@@ -10,6 +10,7 @@
 /* screenlock - lock a terminal */
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 #include <draw.h>
 #include <thread.h>
@@ -260,7 +261,7 @@ lockscreen(void)
 	Tm *tm = localtime(time(0));
 	char *s = smprint("user %s at %d:%02.2d", getuser(), tm->hour, tm->min);
 
-	Point p = Pt(r.max.x / 2, r.max.y * 2 / 3); 
+	Point p = Pt(r.max.x / 2, r.max.y * 2 / 3);
 	p = subpt(p, Pt(stringwidth(font, "m") * strlen(s) / 2, 0));
 	screenstring(p, s);
 

+ 1 - 0
sys/src/cmd/sha1sum.c

@@ -13,6 +13,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 

+ 2 - 1
sys/src/cmd/unlnfs.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
+#include <mp.h>
 #include <libsec.h>
 
 enum
@@ -89,7 +90,7 @@ rename(char *d, char *old, char *new)
 		fprint(2, "unlnfs: cannot rename %s to %s: %r\n", p, new);
 	free(p);
 }
-	
+
 void
 int32_t2short(char shortname[ENCLEN+1], char *longname)
 {

+ 4 - 3
sys/src/cmd/venti/copy.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 #include <avl.h>
 #include <bin.h>
@@ -55,7 +56,7 @@ static int
 havevisited(uint8_t score[VtScoreSize], int type)
 {
 	ScoreTree a;
-	
+
 	if(scoretree == nil)
 		return 0;
 	memmove(a.score, score, VtScoreSize);
@@ -95,7 +96,7 @@ walk(uint8_t score[VtScoreSize], uint type, int base)
 
 	if(memcmp(score, vtzeroscore, VtScoreSize) == 0 || memcmp(score, zeroscore, VtScoreSize) == 0)
 		return;
-	
+
 	if(havevisited(score, type)){
 		nskip++;
 		return;
@@ -141,7 +142,7 @@ walk(uint8_t score[VtScoreSize], uint type, int base)
 				continue;
 			walk(e.score, e.type, e.type&VtTypeBaseMask);
 			/*
-			 * Don't repack unless we're rewriting -- some old 
+			 * Don't repack unless we're rewriting -- some old
 			 * vac files have psize==0 and dsize==0, and these
 			 * get rewritten by vtentryunpack to have less strange
 			 * block sizes.  So vtentryunpack; vtentrypack does not

+ 2 - 2
sys/src/cmd/venti/devnull.c

@@ -12,6 +12,7 @@
 #include <libc.h>
 #include <venti.h>
 #include <thread.h>
+#include <mp.h>
 #include <libsec.h>
 
 #ifndef _UNISTD_H_
@@ -40,7 +41,7 @@ threadmain(int argc, char **argv)
 
 	fmtinstall('V', vtscorefmt);
 	fmtinstall('F', vtfcallfmt);
-	
+
 	address = "tcp!*!venti";
 
 	ARGBEGIN{
@@ -83,4 +84,3 @@ threadmain(int argc, char **argv)
 	}
 	threadexitsall(nil);
 }
-

+ 1 - 1
sys/src/cmd/venti/randtest.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 #include <thread.h>
 
@@ -341,4 +342,3 @@ xxxlrand(void)
 
 	return x;
 }
-

+ 1 - 0
sys/src/cmd/venti/read.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 #include <thread.h>
 

+ 4 - 4
sys/src/cmd/venti/ro.c

@@ -12,6 +12,7 @@
 #include <libc.h>
 #include <venti.h>
 #include <thread.h>
+#include <mp.h>
 #include <libsec.h>
 
 #ifndef _UNISTD_H_
@@ -39,7 +40,7 @@ readthread(void *v)
 	VtReq *r;
 	uint8_t *buf;
 	int n;
-	
+
 	r = v;
 	buf = vtmalloc(r->tx.count);
 	if((n=vtread(z, r->tx.score, r->tx.blocktype, buf, r->tx.count)) < 0){
@@ -64,10 +65,10 @@ threadmain(int argc, char **argv)
 
 	fmtinstall('F', vtfcallfmt);
 	fmtinstall('V', vtscorefmt);
-	
+
 	address = "tcp!*!venti";
 	ventiaddress = nil;
-	
+
 	ARGBEGIN{
 	case 'v':
 		verbose++;
@@ -116,4 +117,3 @@ threadmain(int argc, char **argv)
 	}
 	threadexitsall(nil);
 }
-

+ 1 - 0
sys/src/cmd/venti/root.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 #include <thread.h>
 

+ 1 - 0
sys/src/cmd/venti/srv/stdinc.h

@@ -11,6 +11,7 @@
 #include <libc.h>
 #include <venti.h>
 #include <flate.h>
+#include <mp.h>
 #include <libsec.h>
 #include <thread.h>
 #include <httpd.h>

+ 1 - 0
sys/src/cmd/venti/write.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 #include <thread.h>
 

+ 1 - 1
sys/src/cmd/vnc/auth.c

@@ -8,6 +8,7 @@
  */
 
 #include "vnc.h"
+#include <mp.h>
 #include <libsec.h>
 #include <auth.h>
 
@@ -248,4 +249,3 @@ vncsrvauth(Vnc *v)
 
 	return 0;
 }
-

+ 1 - 0
sys/src/cmd/vnc/vncv.c

@@ -9,6 +9,7 @@
 
 #include "vnc.h"
 #include "vncv.h"
+#include <mp.h>
 #include <libsec.h>
 
 char*	encodings = "copyrect hextile corre rre raw mousewarp";

+ 1 - 0
sys/src/libhttpd/parse.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <ctype.h>
+#include <mp.h>
 #include <libsec.h>
 #include <bin.h>
 #include <httpd.h>

+ 1 - 0
sys/src/liboventi/plan9-sha1.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <oventi.h>
+#include <mp.h>
 #include <libsec.h>
 
 extern void vtSha1Block(uint32_t *s, uint8_t *p, uint32_t len);

+ 1 - 0
sys/src/libsec/port/crypt.c

@@ -19,6 +19,7 @@
 #include <u.h>
 #include <libc.h>
 #include <auth.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libsec/port/des.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libsec/port/desmodes.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 3 - 2
sys/src/libsec/port/fastrand.c

@@ -9,9 +9,10 @@
 
 #include	<u.h>
 #include	<libc.h>
+#include <mp.h>
 #include	<libsec.h>
 
-/* 
+/*
  *  use the X917 random number generator to create random
  *  numbers (faster than truerand() but not as random).
  */
@@ -19,7 +20,7 @@ uint32_t
 fastrand(void)
 {
 	uint32_t x;
-	
+
 	genrandom((uint8_t*)&x, sizeof x);
 	return x;
 }

+ 1 - 0
sys/src/libsec/port/hmac.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /* rfc2104 */

+ 1 - 0
sys/src/libsec/port/md4.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libsec/port/md5.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libsec/port/md5block.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libsec/port/md5pickle.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 char*

+ 2 - 1
sys/src/libsec/port/nfastrand.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 #define Maxrand	((1UL<<31)-1)
@@ -17,7 +18,7 @@ uint32_t
 nfastrand(uint32_t n)
 {
 	uint32_t m, r;
-	
+
 	/*
 	 * set m to the maximum multiple of n <= 2^31-1
 	 * so we want a random number < m.

+ 1 - 0
sys/src/libsec/port/rc4.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 void

+ 1 - 0
sys/src/libsec/port/sha1.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 static void encode(uint8_t*, uint32_t*, uint32_t);

+ 1 - 0
sys/src/libsec/port/sha1pickle.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 char*

+ 1 - 0
sys/src/libsec/port/sha2_128.c

@@ -12,6 +12,7 @@
  */
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 static void encode64(uint8_t*, uint64_t*, uint32_t);

+ 1 - 0
sys/src/libsec/port/sha2_64.c

@@ -12,6 +12,7 @@
  */
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 static void encode32(uint8_t*, uint32_t*, uint32_t);

+ 1 - 0
sys/src/libsec/port/sha2test.c

@@ -9,6 +9,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include "libsec.h"
 
 char *tests[] = {

+ 1 - 0
sys/src/libsec/port/tsmemcmp.c

@@ -24,6 +24,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include <mp.h>
 #include <libsec.h>
 
 /*

+ 1 - 0
sys/src/libusb/audio/audiofs.c

@@ -12,6 +12,7 @@
 #include <thread.h>
 #include <auth.h>
 #include <fcall.h>
+#include <mp.h>
 #include <libsec.h>
 #include <usb/usb.h>
 #include <usb/audio.h>

+ 5 - 5
sys/src/libventi/debugpacket.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 
 #define MAGIC 0x54798314
@@ -28,7 +29,7 @@ Packet*
 packetalloc(void)
 {
 	Packet *p;
-	
+
 	p = vtmallocz(sizeof *p);
 	p->free = vtfree;
 	p->arg = nil;
@@ -61,7 +62,7 @@ int
 packetcmp(Packet *p, Packet *q)
 {
 	int i, len;
-	
+
 	NOTFREE(p);
 	NOTFREE(q);
 	len = p->len;
@@ -138,7 +139,7 @@ Packet*
 packetforeign(uint8_t *buf, int n, void (*free)(void*), void *a)
 {
 	Packet *p;
-	
+
 	if(n < 0)
 		abort();
 	p = packetalloc();
@@ -233,7 +234,7 @@ Packet*
 packetsplit(Packet *p, int n)
 {
 	Packet *q;
-	
+
 	NOTFREE(p);
 	q = packetalloc();
 	q->data = vtmalloc(n);
@@ -271,4 +272,3 @@ packettrim(Packet *p, int offset, int n)
 	p->len -= n;
 	return 0;
 }
-

+ 25 - 24
sys/src/libventi/packet.c

@@ -10,6 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <venti.h>
+#include <mp.h>
 #include <libsec.h>
 
 typedef struct Mem Mem;
@@ -44,7 +45,7 @@ enum {
 	FragLocalAlloc,
 	FragGlobal
 };
-	
+
 struct Frag
 {
 	int state;
@@ -64,10 +65,10 @@ struct Packet
 	uint32_t pc;
 
 	Packet *next;
-	
+
 	Frag *first;
 	Frag *last;
-	
+
 	Frag local[NLocalFrag];
 };
 
@@ -89,7 +90,7 @@ static void checkpacket(Packet*);
 #endif
 
 /*
- * the free list is primarily for speed, but it is 
+ * the free list is primarily for speed, but it is
  * also necessary for packetsplit that packets
  * are never freed -- a packet can contain a different
  * packet's local fragments, thanks to packetsplit!
@@ -166,7 +167,7 @@ packetfree(Packet *p)
 
 Packet *
 packetdup(Packet *p, int offset, int n)
-{	
+{
 	Frag *f, *ff;
 	Packet *pp;
 
@@ -188,7 +189,7 @@ packetdup(Packet *p, int offset, int n)
 	/* skip offset */
 	for(f=p->first; offset >= FRAGSIZE(f); f=f->next)
 		offset -= FRAGSIZE(f);
-	
+
 	/* first frag */
 	ff = fragdup(pp, f);
 	ff->rp += offset;
@@ -204,7 +205,7 @@ packetdup(Packet *p, int offset, int n)
 		n -= FRAGSIZE(ff);
 		pp->asize += FRAGASIZE(ff);
 	}
-	
+
 	/* fix up last frag: note n <= 0 */
 	ff->wp += n;
 	ff->next = nil;
@@ -304,7 +305,7 @@ packettrim(Packet *p, int offset, int n)
 		NOTFREE(p);
 		return 0;
 	}
-	
+
 	/* free before offset */
 	for(f=p->first; offset >= FRAGSIZE(f); f=ff) {
 		p->asize -= FRAGASIZE(f);
@@ -350,7 +351,7 @@ packetheader(Packet *p, int n)
 	}
 
 	p->size += n;
-	
+
 	/* try and fix in current frag */
 	f = p->first;
 	if(f != nil) {
@@ -386,7 +387,7 @@ packettrailer(Packet *p, int n)
 	}
 
 	p->size += n;
-	
+
 	/* try and fix in current frag */
 	if(p->first != nil) {
 		f = p->last;
@@ -442,7 +443,7 @@ packetprefix(Packet *p, uint8_t *buf, int n)
 		nn = n;
 		if(nn > MaxFragSize)
 			nn = MaxFragSize;
-		f = fragalloc(p, nn, PEnd, p->first);	
+		f = fragalloc(p, nn, PEnd, p->first);
 		p->asize += FRAGASIZE(f);
 		if(p->first == nil)
 			p->last = f;
@@ -479,7 +480,7 @@ packetappend(Packet *p, uint8_t *buf, int n)
 			n -= nn;
 		}
 	}
-	
+
 	while(n > 0) {
 		nn = n;
 		if(nn > MaxFragSize)
@@ -546,7 +547,7 @@ packetpeek(Packet *p, uint8_t *buf, int offset, int n)
 		werrstr(EPacketSize);
 		return nil;
 	}
-	
+
 	/* skip up to offset */
 	for(f=p->first; offset >= FRAGSIZE(f); f=f->next)
 		offset -= FRAGSIZE(f);
@@ -595,7 +596,7 @@ packetfragments(Packet *p, IOchunk *io, int nio, int offset)
 	NOTFREE(p);
 	if(p->size == 0 || nio <= 0)
 		return 0;
-	
+
 	if(offset < 0 || offset > p->size) {
 		werrstr(EPacketOffset);
 		return -1;
@@ -608,7 +609,7 @@ packetfragments(Packet *p, IOchunk *io, int nio, int offset)
 	eio = io + nio;
 	for(; f != nil && io < eio; f=f->next) {
 		io->addr = f->rp + offset;
-		io->len = f->wp - (f->rp + offset);	
+		io->len = f->wp - (f->rp + offset);
 		offset = 0;
 		size += io->len;
 		io++;
@@ -642,7 +643,7 @@ packetstats(void)
 	nbm = 0;
 	for(m=freelist.bigmem; m; m=m->next)
 		nbm++;
-	
+
 	fprint(2, "packet: %d/%d frag: %d/%d small mem: %d/%d big mem: %d/%d\n",
 		np, freelist.npacket,
 		nf, freelist.nfrag,
@@ -660,7 +661,7 @@ packetsize(Packet *p)
 	if(1) {
 		Frag *f;
 		int size = 0;
-	
+
 		for(f=p->first; f; f=f->next)
 			size += FRAGSIZE(f);
 		if(size != p->size)
@@ -677,7 +678,7 @@ packetasize(Packet *p)
 	if(0) {
 		Frag *f;
 		int asize = 0;
-	
+
 		for(f=p->first; f; f=f->next)
 			asize += FRAGASIZE(f);
 		if(asize != p->asize)
@@ -773,7 +774,7 @@ fragalloc(Packet *p, int n, int pos, Frag *next)
 			goto Found;
 		}
 	}
-	lock(&freelist.lk);	
+	lock(&freelist.lk);
 	f = freelist.frag;
 	if(f != nil)
 		freelist.frag = f->next;
@@ -834,7 +835,7 @@ fragdup(Packet *p, Frag *f)
 	Frag *ff;
 	Mem *m;
 
-	m = f->mem;	
+	m = f->mem;
 
 	/*
 	 * m->rp && m->wp can be out of date when ref == 1
@@ -862,7 +863,7 @@ fragdup(Packet *p, Frag *f)
 		unlock(&m->lk);
 	}
 
-	
+
 	return ff;
 }
 
@@ -886,7 +887,7 @@ fragfree(Frag *f)
 	lock(&freelist.lk);
 	f->next = freelist.frag;
 	freelist.frag = f;
-	unlock(&freelist.lk);	
+	unlock(&freelist.lk);
 }
 
 static Mem *
@@ -924,7 +925,7 @@ memalloc(int n, int pos)
 		m->bp = vtbrk(nn);
 		m->ep = m->bp + nn;
 	}
-	assert(m->ref == 0);	
+	assert(m->ref == 0);
 	m->ref = 1;
 
 	switch(pos) {
@@ -939,7 +940,7 @@ memalloc(int n, int pos)
 		break;
 	case PEnd:
 		m->rp = m->ep - n;
-		break; 
+		break;
 	}
 	/* check we did not blow it */
 	if(m->rp < m->bp)