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

1991/0712/port/sysproc.c (diff list | history)

1991/0710/sys/src/9/port/sysproc.c:517,5231991/0712/sys/src/9/port/sysproc.c:517,523 (short | long | prev | next)
1991/0705    
syssegfree(ulong *arg) 
{ 
	Segment *s; 
	ulong from, len; 
1991/0712    
	ulong from, pages; 
1991/0705    
 
1991/0706    
	from = PGROUND(arg[0]); 
	s = seg(u->p, from, 1); 
1991/0710/sys/src/9/port/sysproc.c:524,5371991/0712/sys/src/9/port/sysproc.c:524,537
1991/0705    
	if(s == 0) 
		errors("not in address space"); 
 
1991/0706    
	len = arg[1]; 
1991/0712    
	pages = (arg[1]+BY2PG-1)/BY2PG; 
1991/0705    
 
	if(from+len > s->top) { 
1991/0712    
	if(from+pages*BY2PG > s->top) { 
1991/0705    
		qunlock(&s->lk); 
		errors("segment too short"); 
	} 
 
	mfreeseg(s, from, len); 
1991/0712    
	mfreeseg(s, from, pages); 
1991/0705    
	qunlock(&s->lk); 
 
	return 0; 


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