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,291990/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    
	Nin=		64,	/* Blocks in the input ring */ 
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,5941990/0322/sys/src/9/gnot/devincon.c:587,594
1990/0312    
inconkproc(void *arg) 
{ 
	Incon *ip; 
1990/0315    
	Block *bp; 
	int i; 
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,6281990/0322/sys/src/9/gnot/devincon.c:619,639
1990/0312    
		} 
 
		/* 
1990/0315    
		 *  send blocks upstream and stage new blocks 
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){ 
			PUTNEXT(ip->rq, ip->inb[ip->ri]); 
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; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)