plan 9 kernel history: overview | file list | diff list

1990/08272/port/stream.c (diff list | history)

1990/0801/sys/src/9/port/stream.c:48,531990/08272/sys/src/9/port/stream.c:48,58 (short | long | prev | next)
1990/0227    
/* 
 *  The block classes.  There are Nclass block sizes, each with its own free list. 
 *  All are ialloced at qinit() time. 
1990/08272    
 * 
 *  NOTE: to help the mappings on the IO2 and IO3 boards, the data pointed 
 *	  to by a block must not cross a 4k boundary.  Therefore: 
 *	  1) all the following block sizes divide evenly into 4k 
 *	  2) all the blocks are ialloc'd to not cross 4k boundaries 
1990/0227    
 */ 
typedef struct { 
	int	size; 
1990/0801/sys/src/9/port/stream.c:57,641990/08272/sys/src/9/port/stream.c:62,69
1990/0227    
} Bclass; 
Bclass bclass[Nclass]={ 
	{ 0 }, 
1990/0321    
	{ 68 }, 
	{ 260 }, 
1990/08272    
	{ 64 }, 
	{ 256 }, 
1990/0409    
	{ 4096 }, 
1990/0227    
}; 
 
1990/0801/sys/src/9/port/stream.c:133,1401990/08272/sys/src/9/port/stream.c:138,150
1990/0227    
			n = n/2; 
		bcp = &bclass[class]; 
		for(i = 0; i < n; i++) { 
1990/08272    
			/* 
			 *  The i == 0 means that each allocation range 
			 *  starts on a page boundary.  This makes sure 
			 *  no block crosses a page boundary. 
			 */ 
1990/0227    
			if(bcp->size) 
				bp->base = (uchar *)ialloc(bcp->size, 0); 
1990/08272    
				bp->base = (uchar *)ialloc(bcp->size, i == 0); 
1990/0227    
			bp->lim = bp->base + bcp->size; 
			bp->flags = class; 
			freeb(bp); 


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