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

1993/0210/pc/mmu.c (diff list | history)

1993/0120/sys/src/9/pc/mmu.c:351,3811993/0210/sys/src/9/pc/mmu.c:351,353 (short | long | prev | next)
1992/0929    
	unlock(&isamemalloc); 
	return a; 
1991/0703    
} 
1993/0120    
                 
/* 
 *  mapping for user access to d segment (access to TARGA) 
 */ 
Page* 
dsegalloc(Segment *s, ulong va) 
{ 
	Page *pg; 
                 
	pg = smalloc(sizeof(Page)); 
	memset(pg, 0, sizeof(Page)); 
	pg->va = va; 
	pg->pa = 0xd0000 + (va - s->base); 
	pg->ref = 1; 
	return pg; 
} 
                 
void 
dsegfree(Page *pg) 
{ 
	int x; 
                 
	lock(pg); 
	x = --pg->ref; 
	unlock(pg); 
	if(x <= 0) 
		free(pg); 
} 


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