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

1991/0112/ss/trap.c (diff list | history)

1991/0110/sys/src/9/ss/trap.c:80,861991/0112/sys/src/9/ss/trap.c:80,85 (short | long | prev | next)
1990/1226    
/*	if(u) 
1990/1223    
		u->p->pc = ur->pc;		/* BUG */ 
	if(user){ 
1990/1227    
		print("user trap: %s pc=0x%lux\n", excname(tbr), ur->pc); 
		sprint(buf, "sys: trap: pc=0x%lux %s", ur->pc, excname(tbr)); 
1990/1223    
		postnote(u->p, 1, buf, NDebug); 
	}else{ 
1991/0110/sys/src/9/ss/trap.c:89,991991/0112/sys/src/9/ss/trap.c:88,95
1990/1226    
for(;;); 
1990/1223    
		exit(); 
	} 
1991/0109    
	if(user && u->nnote){ 
		print("notify %d\n", u->p->pid); 
1991/0112    
	if(user && u->nnote) 
1990/1223    
		notify(ur); 
1991/0109    
		print("notifyed %d\n", u->p->pid); 
	} 
1990/1223    
} 
 
void 
1991/0110/sys/src/9/ss/trap.c:162,1681991/0112/sys/src/9/ss/trap.c:158,164
1990/1223    
	ulong sp; 
 
	lock(&u->p->debug); 
1991/0109    
	if(u->nnote == 0){ 
1991/0112    
	if(u->nnote==0){ 
1990/1223    
		unlock(&u->p->debug); 
		return; 
	} 
1991/0110/sys/src/9/ss/trap.c:188,1931991/0112/sys/src/9/ss/trap.c:184,190
1990/1223    
		*(ulong*)(sp+0*BY2WD) = 0;		/* arg 0 is pc */ 
		ur->usp = sp; 
		ur->pc = (ulong)u->notify; 
1991/0112    
		ur->npc = (ulong)u->notify+4; 
1990/1223    
		u->notified = 1; 
		u->nnote--; 
		memcpy(&u->note[0], &u->note[1], u->nnote*sizeof(Note)); 
1991/0110/sys/src/9/ss/trap.c:208,2131991/0112/sys/src/9/ss/trap.c:205,211
1990/1223    
	} 
	u->notified = 0; 
	memcpy(*urp, u->ureg, sizeof(Ureg)); 
1991/0112    
	(*urp)->r7 = -1;	/* return error from the interrupted call */ 
1990/1223    
	unlock(&u->p->debug); 
	splhi(); 
	rfnote(urp); 
1991/0110/sys/src/9/ss/trap.c:323,3291991/0112/sys/src/9/ss/trap.c:321,326
1990/1226    
execpc(ulong entry) 
{ 
	((Ureg*)UREGADDR)->pc = entry - 4;		/* syscall advances it */ 
	((Ureg*)UREGADDR)->npc = entry; 
1990/1223    
} 
 
#include "errstr.h" 


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