void GenerateInterrupt(void) { /* * Generate 1 interrupt on the master controller * (how do devices normally 'detect' the hardware? and * how can this VDD find a spare interrupt to 'install' * the device?). */ if (/*InterruptAcknowleged*/TRUE) { /* * Set to FALSE FIRST to avoid race conditions */ InterruptAcknowleged = FALSE; dprintf2(("Generating interrupt")); VDDSimulateInterrupt(ICA_MASTER, SB_INTERRUPT, 1); } else { dprintf1(("Missed interrupt !")); } /* * Set the status to see if more apps will work */ WriteStatus = 0xFF; }
void _cdecl interrupt_thread(void *arg) { while(1) { if(WaitForSingleObject(interrupt_event,INFINITE)!=WAIT_OBJECT_0) break; if((uart_ier_reg&pending_interrupts) != 0) { lprintf(LOG_DEBUG,"VDDSimulateInterrupt (pending: %02X) - IER: %02X" ,pending_interrupts, uart_ier_reg); VDDSimulateInterrupt(ICA_MASTER, uart_irq, /* count: */1); } #if 0 /* "Real 16550s should always reassert * this interrupt whenever the transmitter is idle and * the interrupt is enabled." */ if(pending_interrupts==0 && uart_ier_reg&UART_IER_TX_EMPTY) pending_interrupts|=UART_IER_TX_EMPTY; #endif } }