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

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

1991/0710/sys/src/9/gnot/trap.c:8,141991/0717/sys/src/9/gnot/trap.c:8,14 (short | long | prev | next)
1990/0513    
#include	"errno.h" 
1990/03091    
 
void	notify(Ureg*); 
1991/0503    
void	noted(Ureg*); 
1991/0717    
void	noted(Ureg*, ulong); 
1991/0503    
void	rfnote(Ureg*); 
1990/03091    
 
char *regname[]={ 
1991/0710/sys/src/9/gnot/trap.c:174,1791991/0717/sys/src/9/gnot/trap.c:174,180
1990/03091    
		ur->pc = (ulong)u->notify; 
		u->notified = 1; 
		u->nnote--; 
1991/0717    
		memmove(&u->lastnote, &u->note[0], sizeof(Note)); 
1991/0318    
		memmove(&u->note[0], &u->note[1], u->nnote*sizeof(Note)); 
1990/03091    
	} 
	unlock(&u->p->debug); 
1991/0710/sys/src/9/gnot/trap.c:183,1891991/0717/sys/src/9/gnot/trap.c:184,190
1990/03091    
 * Return user to state before notify() 
 */ 
void 
1991/0503    
noted(Ureg *ur) 
1991/0717    
noted(Ureg *ur, ulong arg0) 
1990/03091    
{ 
1991/0503    
	Ureg *nur; 
 
1991/0710/sys/src/9/gnot/trap.c:201,2091991/0717/sys/src/9/gnot/trap.c:202,227
1990/0619    
	} 
1990/03091    
	u->notified = 0; 
1991/0503    
	memmove(ur, u->ureg, sizeof(Ureg)); 
1990/03091    
	unlock(&u->p->debug); 
	splhi(); 
1991/0503    
	rfnote(ur); 
1991/0717    
	ur->r0 = -1;	/* return error from the interrupted call */ 
	switch(arg0){ 
	case NCONT: 
		splhi(); 
		unlock(&u->p->debug); 
		rfnote(ur); 
		break; 
		/* never returns */ 
 
	default: 
		pprint("unknown noted arg 0x%lux\n", arg0); 
		u->lastnote.flag = NDebug; 
		/* fall through */ 
		 
	case NTERM: 
		if(u->lastnote.flag == NDebug) 
			pprint("suicide: %s\n", u->lastnote.msg); 
		unlock(&u->p->debug); 
		pexit(u->lastnote.msg, u->lastnote.flag!=NDebug); 
	} 
1990/03091    
} 
 
#undef	CHDIR	/* BUG */ 
1991/0710/sys/src/9/gnot/trap.c:316,3221991/0717/sys/src/9/gnot/trap.c:334,340
1990/03091    
	u->p->insyscall = 0; 
1991/0705    
 
	if(r0 == NOTED)		/* ugly hack */ 
1991/0503    
		noted(aur);	/* doesn't return */ 
1991/0717    
		noted(aur, *(ulong*)(sp+BY2WD));	/* 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)