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

1991/0726/port/segment.c (diff list | history)

1991/0724/sys/src/9/port/segment.c:94,1131991/0726/sys/src/9/port/segment.c:94,119 (short | long | prev | next)
1991/0705    
	Pte **pp, **emap; 
	Image *i; 
 
	if(s && decref(s) == 0) { 
1991/0726    
	if(s == 0) 
		return; 
 
	i = s->image; 
	if(i && i->s == s && s->ref == 1){ 
		lock(i); 
		if(s->ref == 1) 
			i->s = 0; 
		unlock(i); 
	} 
 
	if(decref(s) == 0) { 
		if(i) 
			putimage(i); 
 
1991/0705    
		emap = &s->map[SEGMAPSIZE]; 
		for(pp = s->map; pp < emap; pp++) 
			if(*pp) 
				freepte(s, *pp); 
 
		if(i = s->image) { 
			lock(i); 
			if(i->s == s) 
				i->s = 0; 
			unlock(i); 
			putimage(i); 
		} 
                 
		lock(&segalloc); 
		s->next = segalloc.free;		 
		segalloc.free = s; 
1991/0724/sys/src/9/port/segment.c:395,4041991/0726/sys/src/9/port/segment.c:401,410
1991/0705    
					goto done; 
				j++; 
			} 
			j = 0; 
		} 
		else 
			pages -= PTEMAPMEM/BY2PG; 
1991/0726    
			pages -= PTEPERTAB-j; 
		j = 0; 
1991/0705    
	} 
done: 
	flushmmu(); 


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