void take_ctlr_irq( struct bus_ctlr *ctlr) { int pic = ctlr->sysdep1; if (intpri[pic] == 0) { iunit[pic] = ctlr->unit; ivect[pic] = ctlr->intr; intpri[pic] = (int)ctlr->sysdep; form_pic_mask(); } else { printf("The device below will clobber IRQ %d.\n", pic); printf("You have two devices at the same IRQ. This won't work.\n"); printf("Reconfigure your hardware and try again.\n"); while (1); } }
void take_dev_irq( struct bus_device *dev) { int pic = (int)dev->sysdep1; if (intpri[pic] == 0) { iunit[pic] = dev->unit; ivect[pic] = dev->intr; intpri[pic] = (int)dev->sysdep; form_pic_mask(); } else { printf("The device below will clobber IRQ %d.\n", pic); printf("You have two devices at the same IRQ.\n"); printf("This won't work. Reconfigure your hardware and try again.\n"); printf("%s%d: port = %x, spl = %d, pic = %d.\n", dev->name, dev->unit, dev->address, dev->sysdep, dev->sysdep1); while (1); } }
void clkstart(void) { unsigned char byte; unsigned long s; intpri[0] = SPLHI; form_pic_mask(); s = sploff(); /* disable interrupts */ /* Since we use only timer 0, we program that. * 8254 Manual specifically says you do not need to program * timers you do not use */ outb(pitctl_port, pit0_mode); clknumb = CLKNUM/hz; byte = clknumb; outb(pitctr0_port, byte); byte = clknumb>>8; outb(pitctr0_port, byte); splon(s); /* restore interrupt state */ }