diff options
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | emu/port/devsrv.c | 27 | ||||
| -rw-r--r-- | include/version.h | 2 | ||||
| -rw-r--r-- | os/port/devsrv.c | 27 | ||||
| -rw-r--r-- | utils/qc/peep.c | 3 |
5 files changed, 42 insertions, 19 deletions
@@ -1,3 +1,5 @@ +20110402 + revision to devsrv.c change [issue 244] to avoid two calls to delwaiting 20110330 call strtol not atoi for hex numbers [issue 255, mechiel] 20110329 diff --git a/emu/port/devsrv.c b/emu/port/devsrv.c index cef59c05..f619183d 100644 --- a/emu/port/devsrv.c +++ b/emu/port/devsrv.c @@ -594,23 +594,27 @@ srvread(Chan *c, void *va, long count, vlong offset) req.t3 = rc; csend(rd, &req); - wait.fid = c->fid; - wait.rc = rc; - wait.wc = nil; - addwaiting(sp, &wait); - h = heap(dev.Rread); r = H2D(Sys_Rread *, h); ptradd(h); if(waserror()){ ptrdel(h); destroy(r); - delwaiting(&wait); nexterror(); } + wait.fid = c->fid; + wait.rc = rc; + wait.wc = nil; + addwaiting(sp, &wait); + if(waserror()){ + delwaiting(&wait); + nexterror(); + } crecv(rc, r); + poperror(); delwaiting(&wait); + if(r->t1 != H) error(string2c(r->t1)); @@ -694,19 +698,24 @@ srvwrite(Chan *c, void *va, long count, vlong offset) w = H2D(Sys_Rwrite *, h); ptradd(h); + if(waserror()){ + ptrdel(h); + destroy(w); + nexterror(); + } + wait.fid = c->fid; wait.rc = nil; wait.wc = wc; addwaiting(sp, &wait); - if(waserror()){ delwaiting(&wait); - ptrdel(h); - destroy(w); nexterror(); } crecv(wc, w); + poperror(); delwaiting(&wait); + if(w->t1 != H) error(string2c(w->t1)); poperror(); diff --git a/include/version.h b/include/version.h index 2a0fb5e3..8dc0abc6 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -#define VERSION "Fourth Edition (20110330)" +#define VERSION "Fourth Edition (20110402)" diff --git a/os/port/devsrv.c b/os/port/devsrv.c index cd806052..cf58484a 100644 --- a/os/port/devsrv.c +++ b/os/port/devsrv.c @@ -597,23 +597,27 @@ srvread(Chan *c, void *va, long count, vlong offset) req.t3 = rc; csend(rd, &req); - wait.fid = c->fid; - wait.rc = rc; - wait.wc = nil; - addwaiting(sp, &wait); - h = heap(dev.Rread); r = H2D(Sys_Rread *, h); ptradd(h); if(waserror()){ ptrdel(h); destroy(r); - delwaiting(&wait); nexterror(); } + wait.fid = c->fid; + wait.rc = rc; + wait.wc = nil; + addwaiting(sp, &wait); + if(waserror()){ + delwaiting(&wait); + nexterror(); + } crecv(rc, r); + poperror(); delwaiting(&wait); + if(r->t1 != H) error(string2c(r->t1)); @@ -697,19 +701,24 @@ srvwrite(Chan *c, void *va, long count, vlong offset) w = H2D(Sys_Rwrite *, h); ptradd(h); + if(waserror()){ + ptrdel(h); + destroy(w); + nexterror(); + } + wait.fid = c->fid; wait.rc = nil; wait.wc = wc; addwaiting(sp, &wait); - if(waserror()){ delwaiting(&wait); - ptrdel(h); - destroy(w); nexterror(); } crecv(wc, w); + poperror(); delwaiting(&wait); + if(w->t1 != H) error(string2c(w->t1)); poperror(); diff --git a/utils/qc/peep.c b/utils/qc/peep.c index 278ce8b7..89fc431a 100644 --- a/utils/qc/peep.c +++ b/utils/qc/peep.c @@ -319,6 +319,7 @@ uniqs(Reg *r) * if the system forces R0 to be zero, * convert references to $0 to references to R0. */ +int regzer(Adr *a) { if(R0ISZERO) { @@ -333,6 +334,7 @@ regzer(Adr *a) return 0; } +int regtyp(Adr *a) { @@ -526,6 +528,7 @@ copyprop(Reg *r0) return copy1(v1, v2, r0->s1, 0); } +int copy1(Adr *v1, Adr *v2, Reg *r, int f) { int t; |
