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

1992/0802/power/trap.c (diff list | history)

1992/0714/sys/src/9/power/trap.c:75,851992/0802/sys/src/9/power/trap.c:75,85 (short | long | prev | next)
1990/0227    
trap(Ureg *ur) 
{ 
	int ecode; 
	int user; 
	ulong x; 
1992/0802    
	int user, x; 
	ulong fcr31; 
1990/0227    
	char buf[ERRLEN]; 
 
1990/1214    
	SET(x); 
1992/0802    
	SET(fcr31); 
1990/0227    
	ecode = EXCCODE(ur->cause); 
1992/0527    
	LEDON(ecode); 
1990/0227    
	user = ur->status&KUP; 
1992/0714/sys/src/9/power/trap.c:92,1051992/0802/sys/src/9/power/trap.c:92,106
1990/0227    
		if(u && u->p->state==Running){ 
			if(u->p->fpstate == FPactive) { 
				if(ur->cause & INTR3){	/* FP trap */ 
					x = clrfpintr(); 
1992/0802    
					fcr31 = clrfpintr(); 
					if(user && fptrap(ur, fcr31)) 
						goto Return; 
1990/0227    
					ecode = FPEXC; 
1992/0802    
					goto Default; 
1990/0227    
				} 
				savefpregs(&u->fpsave); 
				u->p->fpstate = FPinactive; 
				ur->status &= ~CU1; 
				if(ecode == FPEXC) 
					goto Default; 
			} 
1991/0209    
		} 
		intr(ur); 
1992/0714/sys/src/9/power/trap.c:151,1571992/0802/sys/src/9/power/trap.c:152,158
1990/0227    
		if(user){ 
			spllo(); 
			if(ecode == FPEXC) 
1990/1110    
				sprint(buf, "sys: fp: %s FCR31 %lux", fpexcname(x), x); 
1992/0802    
				sprint(buf, "sys: fp: %s FCR31 %lux", fpexcname(fcr31), fcr31); 
1990/0227    
			else 
1992/0102    
				sprint(buf, "sys: %s", excname[ecode]); 
1991/0425    
 
1992/0714/sys/src/9/power/trap.c:159,1651992/0802/sys/src/9/power/trap.c:160,166
1990/0227    
		}else{ 
			print("%s %s pc=%lux\n", user? "user": "kernel", excname[ecode], ur->pc); 
			if(ecode == FPEXC) 
				print("fp: %s FCR31 %lux\n", fpexcname(x), x); 
1992/0802    
				print("fp: %s FCR31 %lux\n", fpexcname(fcr31), fcr31); 
1990/0227    
			dumpregs(ur); 
			if(m->machno == 0) 
				spllo(); 
1992/0714/sys/src/9/power/trap.c:168,1731992/0802/sys/src/9/power/trap.c:169,175
1990/0227    
	} 
1991/0705    
 
1990/0227    
	splhi(); 
1992/0802    
    Return: 
1991/1114    
	if(user) { 
		notify(ur); 
		if(u->p->fpstate == FPinactive) { 
1992/0714/sys/src/9/power/trap.c:600,6061992/0802/sys/src/9/power/trap.c:602,608
1991/1110    
} 
 
1991/1111    
/* This routine must save the values of registers the user is not permitted to write 
 * from devproc and the restore the saved values before returning 
1992/0802    
 * from devproc and then restore the saved values before returning 
1991/1110    
 */ 
void 
setregisters(Ureg *xp, char *pureg, char *uva, int n) 


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