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

1992/0116/ss/bbmalloc.c (diff list | history)

1991/0723/sys/src/9/ss/bbmalloc.c:7,271992/0116/sys/src/9/ss/bbmalloc.c:7,12 (short | long | prev | next)
1991/0723    
 
/* 
 * Allocate memory for use in kernel bitblts. 
 * The allocated memory must have a flushed instruction 
 * cache, and the data cache must be flushed by bbdflush(). 
 * To avoid the need for frequent cache flushes, the memory 
 * is allocated out of an arena, and the i-cache is only 
 * flushed when it has to be reused.  By returning an 
 * address in non-cached space, the need for flushing the 
 * d-cache is avoided. 
 * 
 * Currently, the only kernel users of bitblt are devbit, 
 * print, and the cursor stuff in devbit.  The cursor 
 * can get drawn at clock interrupt time, so it might need 
 * to bbmalloc while another bitblt is going on. 
 * 
 * This code will have to be interlocked if we ever get 
 * a multiprocessor with a bitmapped display. 
 */ 
 
/* a 0->3 bitblt can take 900 words */ 
1991/0723/sys/src/9/ss/bbmalloc.c:48,571992/0116/sys/src/9/ss/bbmalloc.c:33,38
1991/0723    
		ans = bbcur; 
	bbcur = ans + nw; 
	splx(s); 
/* 
	if(ans == bbarena) 
		icflush(ans, sizeof(bbarena)); 
*/ 
	bblast = ans; 
	ans = (void *)ans; 
	return ans; 
1991/0723/sys/src/9/ss/bbmalloc.c:66,731992/0116/sys/src/9/ss/bbmalloc.c:47,56
1991/0723    
		bbcur = (ulong *)(((char *)bblast) + n); 
} 
 
void * 
bbdflush(void *p, int n) 
1992/0116    
int 
bbonstack(void) 
1991/0723    
{ 
	return p; 
1992/0116    
	if(u) 
		return 1; 
	return 0; 
1991/0723    
} 


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