irq, tbdf, name);
return;
}
-
- if(tbdf != BUSUNKNOWN && (irq == 0xff || irq == 0)){
- print("intrenable: got unassigned irq %d, tbdf 0x%uX for %s\n",
- irq, tbdf, name);
+ if(tbdf != BUSUNKNOWN && (irq == 0xff || irq == 0))
irq = -1;
- }
+
+ /*
+ * IRQ2 doesn't really exist, it's used to gang the interrupt
+ * controllers together. A device set to IRQ2 will appear on
+ * the second interrupt controller as IRQ9.
+ */
+ if(irq == 2)
+ irq = 9;
if((v = xalloc(sizeof(Vctl))) == nil)
panic("intrenable: out of memory");
Vctl **pv, *v;
int vno;
+ if(irq == 2)
+ irq = 9;
if(arch->intrvecno == nil || (tbdf != BUSUNKNOWN && (irq == 0xff || irq == 0))){
/*
* on APIC machine, irq is pretty meaningless
extern void _forkretiret(void);
extern void _rdmsrinst(void);
extern void _wrmsrinst(void);
+ extern void _peekinst(void);
extern void load_fs(ulong);
extern void load_gs(ulong);
ureg->pc += 2;
return;
}
+ } else if(pc == _peekinst){
+ if(vno == VectorGPF){
+ ureg->pc += 2;
+ return;
+ }
}
}
if(!user){
if(vmapsync(addr))
return;
+ {
+ extern void _peekinst(void);
+ if((void(*)(void))ureg->pc == _peekinst){
+ ureg->pc += 2;
+ return;
+ }
+ }
if(addr >= USTKTOP)
panic("kernel fault: bad address pc=0x%.8lux addr=0x%.8lux", ureg->pc, addr);
if(up == nil)
insyscall = up->insyscall;
up->insyscall = 1;
- n = fault(addr, read);
+ n = fault(addr, ureg->pc, read);
if(n < 0){
if(!user){
dumpregs(ureg);
return 0;
if(up->fpstate == FPactive){
- fpsave(&up->fpsave);
+ fpsave(up->fpsave);
up->fpstate = FPinactive;
}
up->fpstate |= FPillegal;
memmove(cureg, ureg, sizeof(Ureg));
/* return value of syscall in child */
cureg->ax = 0;
-
- /* Things from bottom of syscall which were never executed */
- p->psstate = 0;
- p->insyscall = 0;
}
/* Give enough context in the ureg to produce a kernel stack for