void _irqinterrupt(){ int irqn; irqn = get_current_irq(); IRQ_s* tmpHandler; if(irqn>=0) { // switch(irqn){ // case 1: // PIT_handler(); // break; // case 2: // keyboard_isr(); // break; // } tmpHandler = shareHandler[irqn]; if(tmpHandler!=0) { tmpHandler->IRQ_func(); #ifdef DEBUG printf("2 - IRQ_func: %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif while(tmpHandler->next!=NULL) { tmpHandler = tmpHandler->next; #ifdef DEBUG printf("1 - IRQ_func (_prova): %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif if(tmpHandler!=0) tmpHandler->IRQ_func(); } } else printf("irqn: %d\n", irqn); } else printf("IRQ N: %d E' arrivato qualcosa che non so gestire ", irqn); if(irqn<=8) outportb(0x20, MASTER_PORT); else if(irqn<=16){ outportb(0x20, SLAVE_PORT); outportb(0x20, MASTER_PORT); } }
void _irqinterrupt(unsigned int esp){ asm("cli;"); int irqn; irqn = get_current_irq(); IRQ_s* tmpHandler; if(irqn>=0) { tmpHandler = shareHandler[irqn]; if(tmpHandler!=0) { tmpHandler->IRQ_func(); #ifdef DEBUG printf("2 - IRQ_func: %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif while(tmpHandler->next!=NULL) { tmpHandler = tmpHandler->next; #ifdef DEBUG printf("1 - IRQ_func (_prova): %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif if(tmpHandler!=0) tmpHandler->IRQ_func(); } } else printf("irqn: %d\n", irqn); } else printf("IRQ N: %d E' arrivato qualcosa che non so gestire ", irqn); if(irqn<=8 && irqn!=2) outportb(MASTER_PORT, EOI); else if(irqn<=16 || irqn==2){ outportb(SLAVE_PORT, EOI); outportb(MASTER_PORT, EOI); } schedule(); asm("sti;"); return; }
void _irqinterrupt(unsigned int *esp){ int irqn; irqn = get_current_irq(); IRQ_s* tmpHandler; if(irqn>=0) { /*if(irqn==2) { outportb(SLAVE_PORT,GET_IRR_STATUS); irqn = inportb(SLAVE_PORT); irqn = 8 + find_first_bit(irqn); }*/ tmpHandler = shareHandler[irqn]; //printf("Test %d\n", irqn); //while(1); if(tmpHandler!=0) { tmpHandler->IRQ_func(); #ifdef DEBUG printf("2 - IRQ_func: %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif while(tmpHandler->next!=NULL) { tmpHandler = tmpHandler->next; #ifdef DEBUG printf("1 - IRQ_func (_prova): %d, %d\n", tmpHandler->IRQ_func, tmpHandler); #endif if(tmpHandler!=0) tmpHandler->IRQ_func(); } } else printf("irqn: %d\n", irqn); } else printf("IRQ N: %d E' arrivato qualcosa che non so gestire ", irqn); if(irqn<=8 && irqn!=2) outportb(MASTER_PORT, EOI); else if(irqn<=16 || irqn==2){ outportb(SLAVE_PORT, EOI); outportb(MASTER_PORT, EOI); } }