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

1991/0913/pc/main.c (diff list | history)

1991/0912/sys/src/9/pc/main.c:222,2461991/0913/sys/src/9/pc/main.c:222,265 (short | long | prev | next)
1991/0809    
	conf.nhard = 1; 
1991/0711    
} 
 
1991/0716    
/* 
1991/0906    
 *  math coprocessor error 
 */ 
void 
1991/0912    
matherror1(Ureg *ur) 
1991/0913    
char *mathmsg[] = 
1991/0906    
{ 
1991/0912    
print("matherror1\n"); 
1991/0907    
	pexit("Math error", 0); 
1991/0906    
} 
1991/0913    
	"invalid", 
	"denormalized", 
	"div-by-zero", 
	"overflow", 
	"underflow", 
	"precision", 
	"stack", 
	"error", 
}; 
1991/0906    
 
/* 
1991/0912    
 *  math coprocessor error 
 */ 
void 
matherror2(Ureg *ur) 
1991/0913    
matherror(Ureg *ur) 
1991/0912    
{ 
	outb(0xF0, 0xFF);	/* bad craziness */ 
print("matherror2\n"); 
	pexit("Math error", 0); 
1991/0913    
	ulong status; 
	int i; 
	char *msg; 
	char note[ERRLEN]; 
 
	/* 
	 *  a write cycle to port 0xF0 clears the interrupt latch attached 
	 *  to the error# line from the 387 
	 */ 
	outb(0xF0, 0xFF); 
 
	status = fpstatus() & 0xffff; 
	msg = "unknown"; 
	for(i = 0; i < 8; i++) 
		if((1<<i) & status){ 
			msg = mathmsg[i]; 
			break; 
		} 
	sprint(note, "math: %s, status 0x%ux, pc 0x%lux", msg, status, ur->pc); 
	postnote(u->p, 1, note, NDebug); 
1991/0912    
} 
 
/* 
1991/0912/sys/src/9/pc/main.c:270,2761991/0913/sys/src/9/pc/main.c:289,294
1991/0906    
void 
mathover(Ureg *ur) 
{ 
1991/0912    
print("mathover\n"); 
1991/0907    
	pexit("Math overrun", 0); 
1991/0906    
} 
 
1991/0912/sys/src/9/pc/main.c:277,2841991/0913/sys/src/9/pc/main.c:295,302
1991/0906    
void 
mathinit(void) 
{ 
1991/0912    
	setvec(Matherr1vec, matherror1); 
	setvec(Matherr2vec, matherror2); 
1991/0913    
	setvec(Matherr1vec, matherror); 
	setvec(Matherr2vec, matherror); 
1991/0906    
	setvec(Mathemuvec, mathemu); 
	setvec(Mathovervec, mathover); 
} 
1991/0912/sys/src/9/pc/main.c:320,3381991/0913/sys/src/9/pc/main.c:338,343
1991/0712    
} 
 
1991/0906    
/* 
 *  make noise, blink lights 
 */ 
1991/0716    
void 
buzz(int f, int d) 
1991/0712    
{ 
1991/0716    
} 
1991/0712    
                 
1991/0716    
void 
lights(int val) 
{ 
1991/0702    
} 
1991/0803    
                 
/* 
 *  special stuff for 80c51 power management and headland system controller 
 */ 
enum 
1991/0912/sys/src/9/pc/main.c:443,4501991/0913/sys/src/9/pc/main.c:448,455
1991/0803    
} 
 
/* 
 *  control power to the serial line 
 *	onoff == 0 means turn power on 
1991/0913    
 *  power to serial port 
 *	onoff == 0 means on 
1991/0803    
 *	onoff == 1 means off 
 */ 
int 
1991/0912/sys/src/9/pc/main.c:453,4661991/0913/sys/src/9/pc/main.c:458,483
1991/0803    
	return pmuwrbit(1, onoff, 6); 
} 
 
int 
owl(int onoff) 
1991/0913    
void 
buzz(int f, int d) 
1991/0803    
{ 
	return pmuwrbit(0, onoff, 4); 
1991/0913    
	static Rendez br; 
	static QLock bl; 
 
	qlock(&bl); 
	pmuwrbit(0, 0, 6); 
	tsleep(&br, return0, 0, d); 
	pmuwrbit(0, 1, 6); 
	qunlock(&bl); 
1991/0803    
} 
 
int 
mail(int onoff) 
1991/0913    
void 
lights(int val) 
1991/0803    
{ 
	return pmuwrbit(0, onoff, 1); 
1991/0913    
	static QLock ll; 
 
	qlock(&ll); 
	pmuwrbit(0, (val&1), 4);		/* owl */ 
	pmuwrbit(0, ((val>>1)&1), 1);		/* mail */ 
	qunlock(&ll); 
1991/0803    
} 


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