Unified · Split
| @@ -1,3 +1,5 @@ | ||
| 1 | +20110402 | |
| 2 | + revision to devsrv.c change [issue 244] to avoid two calls to delwaiting | |
| 1 | 3 | 20110330 |
| 2 | 4 | call strtol not atoi for hex numbers [issue 255, mechiel] |
| 3 | 5 | 20110329 |
| @@ -594,23 +594,27 @@ srvread(Chan *c, void *va, long count, vlong offset) · 593 unmodified lines | ||
| 594 | 594 | req.t3 = rc; |
| 595 | 595 | csend(rd, &req); |
| 596 | 596 | |
| 597 | − wait.fid = c->fid; | |
| 598 | − wait.rc = rc; | |
| 599 | − wait.wc = nil; | |
| 600 | − addwaiting(sp, &wait); | |
| 601 | − | |
| 602 | 597 | h = heap(dev.Rread); |
| 603 | 598 | r = H2D(Sys_Rread *, h); |
| 604 | 599 | ptradd(h); |
| 605 | 600 | if(waserror()){ |
| 606 | 601 | ptrdel(h); |
| 607 | 602 | destroy(r); |
| 608 | − delwaiting(&wait); | |
| 609 | 603 | nexterror(); |
| 610 | 604 | } |
| 611 | 605 | |
| 606 | + wait.fid = c->fid; | |
| 607 | + wait.rc = rc; | |
| 608 | + wait.wc = nil; | |
| 609 | + addwaiting(sp, &wait); | |
| 610 | + if(waserror()){ | |
| 611 | + delwaiting(&wait); | |
| 612 | + nexterror(); | |
| 613 | + } | |
| 612 | 614 | crecv(rc, r); |
| 615 | + poperror(); | |
| 613 | 616 | delwaiting(&wait); |
| 617 | + | |
| 614 | 618 | if(r->t1 != H) |
| 615 | 619 | error(string2c(r->t1)); |
| 616 | 620 | |
| @@ -694,19 +698,24 @@ srvwrite(Chan *c, void *va, long count, vlong offset) · 77 unmodified lines | ||
| 694 | 698 | w = H2D(Sys_Rwrite *, h); |
| 695 | 699 | ptradd(h); |
| 696 | 700 | |
| 701 | + if(waserror()){ | |
| 702 | + ptrdel(h); | |
| 703 | + destroy(w); | |
| 704 | + nexterror(); | |
| 705 | + } | |
| 706 | + | |
| 697 | 707 | wait.fid = c->fid; |
| 698 | 708 | wait.rc = nil; |
| 699 | 709 | wait.wc = wc; |
| 700 | 710 | addwaiting(sp, &wait); |
| 701 | − | |
| 702 | 711 | if(waserror()){ |
| 703 | 712 | delwaiting(&wait); |
| 704 | − ptrdel(h); | |
| 705 | − destroy(w); | |
| 706 | 713 | nexterror(); |
| 707 | 714 | } |
| 708 | 715 | crecv(wc, w); |
| 716 | + poperror(); | |
| 709 | 717 | delwaiting(&wait); |
| 718 | + | |
| 710 | 719 | if(w->t1 != H) |
| 711 | 720 | error(string2c(w->t1)); |
| 712 | 721 | poperror(); |
| @@ -1 +1 @@ | ||
| 1 | −#define VERSION "Fourth Edition (20110330)" | |
| 1 | +#define VERSION "Fourth Edition (20110402)" | |
| @@ -597,23 +597,27 @@ srvread(Chan *c, void *va, long count, vlong offset) · 596 unmodified lines | ||
| 597 | 597 | req.t3 = rc; |
| 598 | 598 | csend(rd, &req); |
| 599 | 599 | |
| 600 | − wait.fid = c->fid; | |
| 601 | − wait.rc = rc; | |
| 602 | − wait.wc = nil; | |
| 603 | − addwaiting(sp, &wait); | |
| 604 | − | |
| 605 | 600 | h = heap(dev.Rread); |
| 606 | 601 | r = H2D(Sys_Rread *, h); |
| 607 | 602 | ptradd(h); |
| 608 | 603 | if(waserror()){ |
| 609 | 604 | ptrdel(h); |
| 610 | 605 | destroy(r); |
| 611 | − delwaiting(&wait); | |
| 612 | 606 | nexterror(); |
| 613 | 607 | } |
| 614 | 608 | |
| 609 | + wait.fid = c->fid; | |
| 610 | + wait.rc = rc; | |
| 611 | + wait.wc = nil; | |
| 612 | + addwaiting(sp, &wait); | |
| 613 | + if(waserror()){ | |
| 614 | + delwaiting(&wait); | |
| 615 | + nexterror(); | |
| 616 | + } | |
| 615 | 617 | crecv(rc, r); |
| 618 | + poperror(); | |
| 616 | 619 | delwaiting(&wait); |
| 620 | + | |
| 617 | 621 | if(r->t1 != H) |
| 618 | 622 | error(string2c(r->t1)); |
| 619 | 623 | |
| @@ -697,19 +701,24 @@ srvwrite(Chan *c, void *va, long count, vlong offset) · 77 unmodified lines | ||
| 697 | 701 | w = H2D(Sys_Rwrite *, h); |
| 698 | 702 | ptradd(h); |
| 699 | 703 | |
| 704 | + if(waserror()){ | |
| 705 | + ptrdel(h); | |
| 706 | + destroy(w); | |
| 707 | + nexterror(); | |
| 708 | + } | |
| 709 | + | |
| 700 | 710 | wait.fid = c->fid; |
| 701 | 711 | wait.rc = nil; |
| 702 | 712 | wait.wc = wc; |
| 703 | 713 | addwaiting(sp, &wait); |
| 704 | − | |
| 705 | 714 | if(waserror()){ |
| 706 | 715 | delwaiting(&wait); |
| 707 | − ptrdel(h); | |
| 708 | − destroy(w); | |
| 709 | 716 | nexterror(); |
| 710 | 717 | } |
| 711 | 718 | crecv(wc, w); |
| 719 | + poperror(); | |
| 712 | 720 | delwaiting(&wait); |
| 721 | + | |
| 713 | 722 | if(w->t1 != H) |
| 714 | 723 | error(string2c(w->t1)); |
| 715 | 724 | poperror(); |
| @@ -319,6 +319,7 @@ uniqs(Reg *r) · 318 unmodified lines | ||
| 319 | 319 | * if the system forces R0 to be zero, |
| 320 | 320 | * convert references to $0 to references to R0. |
| 321 | 321 | */ |
| 322 | +int | |
| 322 | 323 | regzer(Adr *a) |
| 323 | 324 | { |
| 324 | 325 | if(R0ISZERO) { |
| @@ -333,6 +334,7 @@ regzer(Adr *a) · 8 unmodified lines | ||
| 333 | 334 | return 0; |
| 334 | 335 | } |
| 335 | 336 | |
| 337 | +int | |
| 336 | 338 | regtyp(Adr *a) |
| 337 | 339 | { |
| 338 | 340 | |
| @@ -526,6 +528,7 @@ copyprop(Reg *r0) · 187 unmodified lines | ||
| 526 | 528 | return copy1(v1, v2, r0->s1, 0); |
| 527 | 529 | } |
| 528 | 530 | |
| 531 | +int | |
| 529 | 532 | copy1(Adr *v1, Adr *v2, Reg *r, int f) |
| 530 | 533 | { |
| 531 | 534 | int t; |