From 37f55a7f9b16e97656d226f173c7b19d89f2a268 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 12 Jan 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-01-12 --- gnot/bbmalloc.c | 14 ++++++++++++++ port/devarp.c | 2 +- port/devip.c | 2 +- port/deviproute.c | 4 ++-- port/devlance.c | 2 +- port/devmnt.c | 2 +- port/error.h | 8 +++++--- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/gnot/bbmalloc.c b/gnot/bbmalloc.c index 30f1edb78c60bf8a6b928554a959d8c6992e5b0b..07be0b53cd669fd4d67b9787db2a73dfe4785644 100644 --- a/gnot/bbmalloc.c +++ b/gnot/bbmalloc.c @@ -63,9 +63,23 @@ bbfree(void *p, int n) splx(s); } +void * +flushvirtpage(void *p) +{ + flushcpucache(); +} + void * bbdflush(void *p, int n) { flushcpucache(); return (void *)(((ulong)p)); } + +int +bbonstack(void) +{ + if(u) + return 1; + return 0; +} diff --git a/port/devarp.c b/port/devarp.c index 8aff786363bd08590ba96528fadd37ff6b2a4bd6..243c70f13ab33b4361c1f1ec30e6e8d5254fae73 100644 --- a/port/devarp.c +++ b/port/devarp.c @@ -244,7 +244,7 @@ arpwrite(Chan *c, char *a, long n, ulong offset) error(Ebadarg); if(arpdelete(field[1]) < 0) - error(Eaddrnotfound); + error(Ebadaddr); } case arpdataqid: if(n != sizeof(Arpentry)) diff --git a/port/devip.c b/port/devip.c index b4fa571a2bb7481eba60d54fbdc0eb5d9c6ece8d..aaf9ea270654a5689f8de82273f23d240f29860d 100644 --- a/port/devip.c +++ b/port/devip.c @@ -624,7 +624,7 @@ iplisten(Chan *c) if((s->stproto == &tcpinfo && s->tcpctl.state != Listen) || (s->stproto == &ilinfo && s->ilctl.state != Illistening)) - errors("not announced"); + error(Enolisten); qlock(&s->listenq); if(waserror()) { diff --git a/port/deviproute.c b/port/deviproute.c index b9bc97b790fd272991c67f32a617bda698a67954..e0ea9297f88875f03f8a4204293cfca9ebabe0f8 100644 --- a/port/deviproute.c +++ b/port/deviproute.c @@ -97,7 +97,7 @@ ipaddroute(ulong dst, ulong mask, ulong gate) * filter out impossible requests */ if((dst&mask) != dst) - errors("bad ip route"); + error(Ebadaddr); /* * see if we already have a route for @@ -118,7 +118,7 @@ ipaddroute(ulong dst, ulong mask, ulong gate) } if(free == 0){ unlock(&iprtab); - errors("no free ip routes"); + error(Enoroute); } /* diff --git a/port/devlance.c b/port/devlance.c index 4743cc47b4d36c3dd3a8c6d25939ed8f710316e0..d65ca52355f1f3b85004e5cb8fd8c2a9252323c1 100644 --- a/port/devlance.c +++ b/port/devlance.c @@ -654,7 +654,7 @@ lanceclonecon(Chan *c) qunlock(e); return e - l.e; } - errors("no unused lance channels"); + error(Enodev); } /* diff --git a/port/devmnt.c b/port/devmnt.c index 95d656bfca060e873572dab8954c1eeb2e6a98da..fa36707b410c8367ef7d59e4a4631c60b6eb19e2 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -480,7 +480,7 @@ mountrpc(Mnt *m, Mntrpc *r) r->reply.tag = 0; /* safety check */ mountio(m, r); if(r->reply.type == Rerror) - errors(r->reply.ename); + error(r->reply.ename); if(r->reply.type == Rflush) error(Eintr); diff --git a/port/error.h b/port/error.h index 47ed50b146892757e07bb52905eed3f0565c3569..dd3e0bea7d327fd8b35c6ad7195552e19986b245 100644 --- a/port/error.h +++ b/port/error.h @@ -23,10 +23,14 @@ extern char Enobitstore[]; /* out of bitmap storage */ extern char Ebadfont[]; /* unallocated font */ extern char Enofont[]; /* out of font descriptors */ extern char Eauth[]; /* authentication failure */ -extern char Eaddrnotfound[]; /* network address not found */ +extern char Ebadaddr[]; /* bad network address */ extern char Emsgsize[]; /* message is too big for protocol */ extern char Enetbusy[]; /* network device is busy or allocated */ +extern char Enoproto[]; /* network protocol not supported */ +extern char Enoport[]; /* network port not available */ +extern char Enoroute[]; /* no free routes */ extern char Enoifc[]; /* bad interface or no free interface slots */ +extern char Enolisten[]; /* not announced */ extern char Ehungup[]; /* write to hungup stream */ extern char Enodev[]; /* no free devices */ extern char Enoenv[]; /* no free environment resources */ @@ -62,11 +66,9 @@ extern char Ebadcnt[]; /* read count greater than requested */ extern char Enovmem[]; /* virtual memory allocation failed */ extern char Enoasync[]; /* out of async stream modules */ extern char Enopipe[]; /* out of pipes */ -extern char Enoport[]; /* network port not available */ extern char Enetunreach[]; /* network unreachable */ extern char Etimedout[]; /* connection timed out */ extern char Econrefused[]; /* connection refused */ -extern char Enoproto[]; /* network protocol not supported */ extern char Eprotonosup[]; /* operation not supported by network protocol */ extern char Eisstream[]; /* seek on a stream */ extern char Enofilsys[]; /* out of filsys resources */