/*---------------------------------------------------------------------------*/ void pc_kbd_isr (void) { u8 key ; /* Get key */ key = readKeyPress () ; kbd_isr (key) ; sendEOI () ; } /* End of Function pc_kbd_isr() */
void ArchInterrupts::EndOfInterrupt(uint16 number) { sendEOI(number); }
void interrupt idio16_setidioflag(...) { idio16_isr_idioflag = 1; /* indicate an interrupt has occurred */ outportb(idiobaseadd+1,0x00); sendEOI(); } /* end setiiroflag */
/***************************************************************************** * FUNCTION: interrupt_test -- local routine * *****************************************************************************/ unsigned int idio16_interrupt_test(unsigned int baddress, unsigned int IRQNumber,int df, unsigned char RelayOffset) { char ch; int i,int_mask; unsigned long count; void (interrupt far *oldisr)(); int out; int flag = 0; idiobaseadd=baddress; delay(100); //inportb(baddress+1); if(!df){ outportb(baddress+1,0x00); //clear pending interrupt initirq(IRQNumber,idio16_setidioflag); sendEOI(); outportb(baddress + RelayOffset,0x04); /* Write data to the relay outputs. */ //inportb(baddress+1); outportb(baddress+1,0x00); //clear pending interrupt outportb(baddress+2,0x00); //disable interrupt //inportb(baddress+1); outportb(baddress+1,0x00); // Clear the interrupt. inportb(baddress+2); //Read to enable interrupts. Writing disables idio16_isr_idioflag = 0; delay(10); out = 0xFF; for(i = 0; i < 8; i++){ out = out - (1<<i); outportb(baddress + RelayOffset,out); //generate interrupt delay(500); if (!idio16_isr_idioflag) flag++;//passed = FALSE; idio16_isr_idioflag = 0; } //inportb(baddress+1); outportb(baddress+1,0x00); // Clear the interrupt. outportb(baddress+2,0x00); //disable interrupt //inportb(baddress+1); outportb(baddress+1,0x00); // Clear the interrupt. sendEOI(); //clear interrupt to allow next one restoreirq(IRQNumber); }else{ textcolor(LIGHTGRAY); cprintf("INTERRUPT TEST\n\r"); cprintf("Relay 0 1 2 3 4 5 6 7\n\r"); while(!kbhit()){ out = 0xff; outportb(baddress+1,0x00); //clear pending interrupt initirq(IRQNumber,idio16_setidioflag); sendEOI(); outportb(baddress + RelayOffset,out); /* Write data to the relay outputs. */ outportb(baddress+1,0x00); //clear pending interrupt outportb(baddress+2,0x00); //disable interrupt outportb(baddress+1,0x00); // Clear the interrupt. inportb(baddress+2); //Read to enable interrupts. Writing disables idio16_isr_idioflag = 0; delay(10); gotoxy(3,wherey()); for(i = 0; i < 8; i++){ out = out - (1<<i); outportb(baddress + RelayOffset,out); //generate interrupt delay(500); if (!idio16_isr_idioflag) { flag++;//how many times did we get no IRQ textcolor(RED); cprintf("%-9s", "NoIRQ"); }else{ textcolor(GREEN); cprintf("%-9s", "IRQ"); } idio16_isr_idioflag = 0; }//end for (8 bits) outportb(baddress+1,0x00); // Clear the interrupt. outportb(baddress+2,0x00); //disable interrupt outportb(baddress+1,0x00); // Clear the interrupt. sendEOI(); //clear interrupt to allow next one restoreirq(IRQNumber); }// end while !kbhit() printf("\n"); getch(); } return flag; } /* end interrupt_test */
/*---------------------------------------------------------------------------*/ void serial_isr (void) { ns16550_isr() ; sendEOI() ; } /* End of Function serial_isr() */
/*---------------------------------------------------------------------------*/ void clock_isr (void) { timer_tic() ; sendEOI() ; } /* End of Function clock_isr() */