upas/fs: remove more debugging crap
This commit is contained in:
parent
75bca30647
commit
4b08ef2c55
4 changed files with 1 additions and 54 deletions
|
@ -1,40 +0,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;
|
|
||||||
}
|
|
|
@ -133,21 +133,13 @@ static Hash *htab[Hsize];
|
||||||
static Fcall rhdr;
|
static Fcall rhdr;
|
||||||
static Fcall thdr;
|
static Fcall thdr;
|
||||||
static Fid *fids;
|
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
|
void
|
||||||
sanemsg(Message *m)
|
sanemsg(Message *m)
|
||||||
{
|
{
|
||||||
if(bos == 0)
|
|
||||||
bos = absbos();
|
|
||||||
assert(m->refs < 100);
|
|
||||||
validgptr(m->whole);
|
|
||||||
if(debug)
|
if(debug)
|
||||||
poolcheck(mainmem);
|
poolcheck(mainmem);
|
||||||
validgptr(m);
|
assert(m->refs < 100);
|
||||||
assert(m->next != m);
|
assert(m->next != m);
|
||||||
if(m->end < m->start)
|
if(m->end < m->start)
|
||||||
abort();
|
abort();
|
||||||
|
|
|
@ -483,8 +483,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
||||||
int i, i0, n;
|
int i, i0, n;
|
||||||
uintptr a;
|
uintptr a;
|
||||||
|
|
||||||
/*sanembmsg(mb, m); /* fails with pop but i want this debugging for now */
|
|
||||||
|
|
||||||
/* parse mime headers */
|
/* parse mime headers */
|
||||||
p = m->header;
|
p = m->header;
|
||||||
i0 = 0;
|
i0 = 0;
|
||||||
|
@ -514,7 +512,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(s);
|
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 */
|
/* the blank line isn't really part of the body or header */
|
||||||
if(justmime){
|
if(justmime){
|
||||||
m->mhend = p;
|
m->mhend = p;
|
||||||
|
@ -541,7 +538,6 @@ parseheaders(Mailbox *mb, Message *m, int addfrom, int justmime)
|
||||||
* adding the unix header all the time screws up mime-attached
|
* adding the unix header all the time screws up mime-attached
|
||||||
* rfc822 messages.
|
* rfc822 messages.
|
||||||
*/
|
*/
|
||||||
/*sanembmsg(mb, m); /* fails with pop but i want this debugging for now */
|
|
||||||
if(!addfrom && !m->unixfrom)
|
if(!addfrom && !m->unixfrom)
|
||||||
m->unixheader = nil;
|
m->unixheader = nil;
|
||||||
else if(m->unixheader == nil){
|
else if(m->unixheader == nil){
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
TARG= fs\
|
TARG= fs\
|
||||||
|
|
||||||
OFILES=\
|
OFILES=\
|
||||||
bos.$O\
|
|
||||||
cache.$O\
|
cache.$O\
|
||||||
fs.$O\
|
fs.$O\
|
||||||
header.$O\
|
header.$O\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue