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

1991/0322/gnot/trap.c (diff list | history)

1991/0322/sys/src/9/gnot/trap.c:8,151991/0503/sys/src/9/gnot/trap.c:8,15 (short | long | prev | next)
1990/0513    
#include	"errno.h" 
1990/03091    
 
void	notify(Ureg*); 
void	noted(Ureg**); 
void	rfnote(Ureg**); 
1991/0503    
void	noted(Ureg*); 
void	rfnote(Ureg*); 
1990/03091    
 
char *regname[]={ 
	"R0", 
1991/0322/sys/src/9/gnot/trap.c:156,1611991/0503/sys/src/9/gnot/trap.c:156,163
1990/03091    
	if(!u->notified){ 
		if(!u->notify) 
			goto Die; 
1991/0503    
		u->svvo = ur->vo; 
		u->svsr = ur->sr; 
1990/0816    
		sp = ur->usp; 
1990/03091    
		sp -= sizeof(Ureg); 
		u->ureg = (void*)sp; 
1991/0322/sys/src/9/gnot/trap.c:179,1861991/0503/sys/src/9/gnot/trap.c:181,197
1990/03091    
 * Return user to state before notify() 
 */ 
void 
noted(Ureg **urp) 
1991/0503    
noted(Ureg *ur) 
1990/03091    
{ 
1991/0503    
	Ureg *nur; 
 
	nur = u->ureg; 
	validaddr(nur->pc, 1, 0); 
	validaddr(nur->usp, BY2WD, 0); 
	if(nur->sr!=u->svsr || nur->vo!=u->svvo){ 
		pprint("bad noted ureg sr %ux vo %ux\n", nur->sr, nur->vo); 
		pexit("Suicide", 0); 
	} 
1990/03091    
	lock(&u->p->debug); 
1990/0619    
	if(!u->notified){ 
		unlock(&u->p->debug); 
1991/0322/sys/src/9/gnot/trap.c:187,1961991/0503/sys/src/9/gnot/trap.c:198,207
1990/0619    
		return; 
	} 
1990/03091    
	u->notified = 0; 
1991/0318    
	memmove(*urp, u->ureg, sizeof(Ureg)); 
1991/0503    
	memmove(ur, u->ureg, sizeof(Ureg)); 
1990/03091    
	unlock(&u->p->debug); 
	splhi(); 
	rfnote(urp); 
1991/0503    
	rfnote(ur); 
1990/03091    
} 
 
#undef	CHDIR	/* BUG */ 
1991/0322/sys/src/9/gnot/trap.c:288,2941991/0503/sys/src/9/gnot/trap.c:299,305
1990/03091    
	u->nerrlab = 0; 
	u->p->insyscall = 0; 
	if(r0 == NOTED)	/* ugly hack */ 
		noted(&aur);	/* doesn't return */ 
1991/0503    
		noted(aur);	/* doesn't return */ 
1990/03091    
	if(u->nnote){ 
		ur->r0 = ret; 
		notify(ur); 


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