| plan 9 kernel history: overview | file list | diff list |
1990/0322/gnot/devincon.c (diff list | history)
| 1990/0321/sys/src/9/gnot/devincon.c:23,29 – 1990/0322/sys/src/9/gnot/devincon.c:23,29 (short | long | prev | next) | ||
| 1990/0312 | Minstation= 2, /* lowest station # to poll */ Maxstation= 15, /* highest station # to poll */ Nincon= 1, /* number of incons */ | |
| 1990/0321 |
| |
| 1990/0322 | Nin= 32, /* Blocks in the input ring */ | |
| 1990/0320 | Bsize= 128, /* size of an input ring block */ | |
| 1990/0321 | Mfifo= 0xff /* a mask, must be 2^n-1, must be > Nin */ | |
| 1990/0312 | }; | |
| 1990/0321/sys/src/9/gnot/devincon.c:587,594 – 1990/0322/sys/src/9/gnot/devincon.c:587,594 | ||
| 1990/0312 | inconkproc(void *arg) { Incon *ip; | |
| 1990/0315 |
| |
| 1990/0322 | Block *bp, *nbp; int i, n; | |
| 1990/0312 | ip = (Incon *)arg; ip->kstarted = 1; | |
| 1990/0321/sys/src/9/gnot/devincon.c:619,628 – 1990/0322/sys/src/9/gnot/devincon.c:619,639 | ||
| 1990/0312 | } /* | |
| 1990/0315 |
| |
| 1990/0322 | * send blocks upstream and stage new blocks. if the block is small * (< 64 bytes) copy into a smaller buffer. | |
| 1990/0312 | */ | |
| 1990/0315 | while(ip->ri != ip->wi){ | |
| 1990/0322 | bp = ip->inb[ip->ri]; n = BLEN(bp); if(n <= 64){ nbp = allocb(n); memcpy(nbp->wptr, bp->rptr, n); nbp->wptr += n; freeb(bp); PUTNEXT(ip->rq, nbp); } else { PUTNEXT(ip->rq, bp); } | |
| 1990/0320 | bp = ip->inb[ip->ri] = allocb(Bsize); | |
| 1990/0315 | bp->wptr += 3; ip->ri = (ip->ri+1)%Nin; | |