shithub: riscv

Download patch

ref: 4b08ef2c55fb442b90d44793f14e156e4852e80b
parent: 75bca30647aff6589c348a8b7f00d1218da09843
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Mar 14 19:31:10 EDT 2017

upas/fs: remove more debugging crap

--- a/sys/src/cmd/upas/fs/bos.c
+++ /dev/null
@@ -1,40 +1,0 @@
-#include <u.h>
-#include <libc.h>
-#include <bio.h>
-
-/*
- * assume:
- * - the stack segment can't be resized
- * - stacks may not be segattached (by name Stack, anyway)
- * - no thread library
- */
-uintptr
-absbos(void)
-{
-	char buf[64], *f[10], *s, *r;
-	int n;
-	uintptr p, q;
-	Biobuf *b;
-
-	p = 0xd0000000;	/* guess pc kernel */
-	snprint(buf, sizeof buf, "/proc/%ud/segment", getpid());
-	b = Bopen(buf, OREAD);
-	if(b == nil)
-		return p;
-	for(; s = Brdstr(b, '\n', 1); free(s)){
-		if((n = tokenize(s, f, nelem(f))) < 3)
-			continue;
-		if(strcmp(f[0], "Stack") != 0)
-			continue;
-		/*
-		 * addressing from end because segment
-		 * flags could become discontiguous  if
-		 * additional flags are added
-		 */
-		q = strtoull(f[n - 3], &r, 16);
-		if(*r == 0 && (char*)q > end)
-			p = q;
-	}
-	Bterm(b);
-	return p;
-}
--- a/sys/src/cmd/upas/fs/fs.c
+++ b/sys/src/cmd/upas/fs/fs.c
@@ -133,21 +133,13 @@
 static	Fcall	rhdr;
 static	Fcall	thdr;
 static	Fid	*fids;
-static	uintptr	bos = 0xd0000000;		/* pc kernel specific */
 
-#define onstack(x)	((uintptr)(x) >= bos)
-#define intext(x)		((char*)(x) <= end)
-#define validgptr(x)	assert(!onstack(x) && !intext(x))
 void
 sanemsg(Message *m)
 {
-	if(bos == 0)
-		bos = absbos();
-	assert(m->refs < 100);
-	validgptr(m->whole);
 	if(debug)
 		poolcheck(mainmem);
-	validgptr(m);
+	assert(m->refs < 100);
 	assert(m->next != m);
 	if(m->end < m->start)
 		abort();
--- a/sys/src/cmd/upas/fs/mbox.c
+++ b/sys/src/cmd/upas/fs/mbox.c
@@ -483,8 +483,6 @@
 	int i, i0, n;
 	uintptr a;
 
-/*sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
-
 	/* parse mime headers */
 	p = m->header;
 	i0 = 0;
@@ -514,7 +512,6 @@
 			}
 	}
 	free(s);
-/*sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
 	/* the blank line isn't really part of the body or header */
 	if(justmime){
 		m->mhend = p;
@@ -541,7 +538,6 @@
 	 *  adding the unix header all the time screws up mime-attached
 	 *  rfc822 messages.
 	 */
-/*sanembmsg(mb, m);	/* fails with pop but i want this debugging for now */
 	if(!addfrom && !m->unixfrom)
 		m->unixheader = nil;
 	else if(m->unixheader == nil){
--- a/sys/src/cmd/upas/fs/mkfile
+++ b/sys/src/cmd/upas/fs/mkfile
@@ -4,7 +4,6 @@
 TARG=	fs\
 
 OFILES=\
-	bos.$O\
 	cache.$O\
 	fs.$O\
 	header.$O\