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

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

1991/1214/sys/src/9/gnot/trap.c:153,1651991/1216/sys/src/9/gnot/trap.c:153,165 (short | long | prev | next)
1990/03091    
		return; 
1991/1112    
 
1991/1114    
	s = spllo(); 
1991/1112    
	lock(&u->p->debug); 
1991/1216    
	qlock(&u->p->debug); 
1991/0727    
	u->p->notepending = 0; 
1990/03091    
	if(u->note[0].flag!=NUser && (u->notified || u->notify==0)){ 
		if(u->note[0].flag == NDebug) 
			pprint("suicide: %s\n", u->note[0].msg); 
    Die: 
		unlock(&u->p->debug); 
1991/1216    
		qunlock(&u->p->debug); 
1990/03091    
		pexit(u->note[0].msg, u->note[0].flag!=NDebug); 
	} 
	if(!u->notified){ 
1991/1214/sys/src/9/gnot/trap.c:171,1771991/1216/sys/src/9/gnot/trap.c:171,177
1990/03091    
		sp -= sizeof(Ureg); 
1991/0722    
		if(waserror()){ 
			pprint("suicide: trap in notify\n"); 
			unlock(&u->p->debug); 
1991/1216    
			qunlock(&u->p->debug); 
1991/0722    
			pexit("Suicide", 0); 
		} 
		validaddr((ulong)u->notify, 1, 0); 
1991/1214/sys/src/9/gnot/trap.c:193,1991991/1216/sys/src/9/gnot/trap.c:193,199
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/1216    
	qunlock(&u->p->debug); 
1991/1114    
	splx(s); 
1990/03091    
} 
 
1991/1214/sys/src/9/gnot/trap.c:211,2191991/1216/sys/src/9/gnot/trap.c:211,219
1991/0814    
    Die: 
1991/0503    
		pexit("Suicide", 0); 
	} 
1990/03091    
	lock(&u->p->debug); 
1991/1216    
	qlock(&u->p->debug); 
1990/0619    
	if(!u->notified){ 
		unlock(&u->p->debug); 
1991/1216    
		qunlock(&u->p->debug); 
1991/0814    
		pprint("call to noted() when not notified\n"); 
		goto Die; 
1990/0619    
	} 
1991/1214/sys/src/9/gnot/trap.c:223,2291991/1216/sys/src/9/gnot/trap.c:223,229
1991/0717    
	case NCONT: 
1991/0814    
		if(waserror()){ 
			pprint("suicide: trap in noted\n"); 
			unlock(&u->p->debug); 
1991/1216    
			qunlock(&u->p->debug); 
1991/0814    
			goto Die; 
		} 
		validaddr(nur->pc, 1, 0); 
1991/1214/sys/src/9/gnot/trap.c:230,2361991/1216/sys/src/9/gnot/trap.c:230,236
1991/0814    
		validaddr(nur->usp, BY2WD, 0); 
		poperror(); 
1991/0717    
		splhi(); 
		unlock(&u->p->debug); 
1991/1216    
		qunlock(&u->p->debug); 
1991/0717    
		rfnote(ur); 
		break; 
		/* never returns */ 
1991/1214/sys/src/9/gnot/trap.c:243,2491991/1216/sys/src/9/gnot/trap.c:243,249
1991/0718    
	case NDFLT: 
1991/0717    
		if(u->lastnote.flag == NDebug) 
			pprint("suicide: %s\n", u->lastnote.msg); 
		unlock(&u->p->debug); 
1991/1216    
		qunlock(&u->p->debug); 
1991/0717    
		pexit(u->lastnote.msg, u->lastnote.flag!=NDebug); 
	} 
1990/03091    
} 


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