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

1993/0224/pc/trap.c (diff list | history)

1993/0220/sys/src/9/pc/trap.c:43,491993/0224/sys/src/9/pc/trap.c:43,49 (short | long | prev | next)
1991/0614    
 *  trap/interrupt gates 
1991/0613    
 */ 
1991/0703    
Segdesc ilt[256]; 
1993/0220    
int	badtrap[256]; 
1993/0224    
int badintr[16]; 
1991/0703    
 
1993/0217    
typedef struct Handler	Handler; 
struct Handler 
1993/0220/sys/src/9/pc/trap.c:245,2571993/0224/sys/src/9/pc/trap.c:245,258
1991/0731    
		if(c == Int1vec) 
			outb(Int1ctl, EOI); 
1993/0219    
		outb(Int0ctl, EOI); 
1991/0823    
		if(v != Uart0vec) 
			uartintr0(ur); 
1991/1113    
	} 
 
1993/0217    
	if(v>=256 || (h = halloc.ivec[v]) == 0){ 
1993/0224    
		/* an old 386 generates these fairly often, no idea why */ 
1991/1214    
		if(v == 13) 
			return; 
1993/0224    
 
		/* a processor or coprocessor error */ 
1991/1113    
		if(v <= 16){ 
			if(user){ 
1991/1218    
				sprint(buf, "sys: trap: %s", excname[v]); 
1993/0220/sys/src/9/pc/trap.c:262,2811993/0224/sys/src/9/pc/trap.c:263,289
1991/1113    
				panic("%s pc=0x%lux", excname[v], ur->pc); 
			} 
		} 
1993/0220    
		if(badtrap[v]++ < 10 || (badtrap[v]%1000) == 0) 
			print("bad trap type %d pc=0x%lux: total %d\n", v, ur->pc, 
				badtrap[v]); 
1993/0224    
 
		if(v >= Int0vec || v < Int0vec+16){ 
			/* an unknown interrupts */ 
			v -= Int0vec; 
			if(badintr[v]++ == 0 || (badintr[v]%1000) == 0) 
				print("unknown interrupt %d pc=0x%lux: total %d\n", v, 
					ur->pc, badintr[v]); 
		} else { 
			/* unimplemented traps */ 
			print("illegal trap %d pc=0x%lux\n", v, ur->pc); 
		} 
1992/0918    
		return; 
1991/0731    
	} 
1991/0801    
 
1993/0224    
	/* there may be multiple handlers on one interrupt level */ 
1993/0217    
	do { 
		(*h->r)(ur); 
		h = h->next; 
	} while(h); 
1991/0910    
 
1991/0913    
	/* 
1992/0108    
	 *  check user since syscall does its own notifying 
1991/0913    
	 */ 
1993/0224    
	/* check user since syscall does its own notifying */ 
1992/0104    
	if(user && (u->p->procctl || u->nnote)) 
1991/0910    
		notify(ur); 
1991/0806    
} 


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