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

1992/0114/port/sysproc.c (diff list | history)

1992/0111/sys/src/9/port/sysproc.c:259,2651992/0114/sys/src/9/port/sysproc.c:259,265 (short | long | prev | next)
1990/0227    
	 * Build the stack segment, putting it in kernel virtual for the moment 
	 */ 
1991/0523    
	if(spage > TSTKSIZ) 
1991/0709    
		errors("too many arguments"); 
1992/0114    
		error(Enovmem); 
1991/0522    
 
1991/0705    
	  
	p->seg[ESEG] = newseg(SG_STACK, TSTKTOP-USTKSIZE, USTKSIZE/BY2PG); 
1992/0111/sys/src/9/port/sysproc.c:528,5341992/0114/sys/src/9/port/sysproc.c:528,534
1991/0705    
				switch(s->type&SG_TYPE) { 
				case SG_TEXT: 
				case SG_DATA: 
					errors("bad segment type"); 
1992/0114    
					error(Ebadarg); 
1991/0705    
				default: 
					return ibrk(arg[1], i); 
				} 
1992/0111/sys/src/9/port/sysproc.c:535,5411992/0114/sys/src/9/port/sysproc.c:535,541
1991/0705    
			} 
		} 
 
	errors("not in address space"); 
1992/0114    
	error(Ebadarg); 
1990/0227    
} 
1991/0606    
 
1991/0605    
long 
1992/0111/sys/src/9/port/sysproc.c:560,5711992/0114/sys/src/9/port/sysproc.c:560,571
1991/0705    
			qunlock(&s->lk); 
		} 
 
	errors("not in address space"); 
1992/0114    
	error(Ebadarg); 
1991/0705    
 
found: 
	if((ulong)arg >= s->base && (ulong)arg < s->top) { 
		qunlock(&s->lk); 
		errors("illegal address"); 
1992/0114    
		error(Ebadarg); 
1991/0705    
	} 
	u->p->seg[i] = 0; 
	qunlock(&s->lk); 
1992/0111/sys/src/9/port/sysproc.c:585,5971992/0114/sys/src/9/port/sysproc.c:585,597
1991/0706    
	from = PGROUND(arg[0]); 
	s = seg(u->p, from, 1); 
1991/0705    
	if(s == 0) 
		errors("not in address space"); 
1992/0114    
		error(Ebadarg); 
1991/0705    
 
1991/0712    
	pages = (arg[1]+BY2PG-1)/BY2PG; 
1991/0705    
 
1991/0712    
	if(from+pages*BY2PG > s->top) { 
1991/0705    
		qunlock(&s->lk); 
		errors("segment too short"); 
1992/0114    
		error(Ebadarg); 
1991/0705    
	} 
 
1991/0712    
	mfreeseg(s, from, pages); 


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