M gnot/trap.c => gnot/trap.c +15 -6
@@ 131,15 131,24 @@ trap(Ureg *ur)
void
dumpstack(void)
{
- ulong l, v;
+ ulong l, v, i;
extern ulong etext;
- if(u)
- for(l=(ulong)&l; l<USERADDR+BY2PG; l+=4){
- v = *(ulong*)l;
- if(KTZERO < v && v < (ulong)&etext)
- print("%lux=%lux\n", l, v);
+ if(u==0)
+ return;
+
+ i = 0;
+ for(l=(ulong)&l; l<USERADDR+BY2PG; l+=4){
+ v = *(ulong*)l;
+ if(KTZERO < v && v < (ulong)&etext){
+ print("%lux\t", v);
+ if(++i == 4){
+ i = 0;
+ print("\n");
+ }
}
+ }
+ print("\n");
}
void
M port/sturp.c => port/sturp.c +20 -4
@@ 572,8 572,15 @@ urpctloput(Urp *up, Queue *q, Block *bp)
switch(bp->type){
case M_CTL:
if(streamparse("break", bp)){
- sendctl(up, BREAK);
- freeb(bp);
+ /*
+ * send a break as part of the data stream
+ */
+ urpstat.output++;
+ bp->wptr = bp->lim;
+ bp->rptr = bp->wptr - 1;
+ *bp->rptr = BREAK;
+ putq(q, bp);
+ output(up);
return;
}
if(streamparse("init", bp)){
@@ 831,11 838,20 @@ sendblock(Urp *up, int bn)
m->rptr = m->lim - 1;
m->wptr = m->lim;
*m->rptr = (bp->flags & S_DELIM) ? BOT : BOTM;
- nbp = m->next = allocb(0);
+ nbp = allocb(0);
nbp->rptr = bp->rptr;
nbp->wptr = bp->wptr;
+ nbp->base = bp->base;
+ nbp->lim = bp->lim;
nbp->flags |= S_DELIM;
- PUTNEXT(q, m);
+ if(bp->type == M_CTL){
+ PUTNEXT(q, nbp);
+ m->flags |= S_DELIM;
+ PUTNEXT(q, m);
+ } else {
+ m->next = nbp;
+ PUTNEXT(q, m);
+ }
/*
* message 2, the block length and the SEQ