pic8259.c revision 1
1N/A * Basic support for controlling the 8259 Programmable Interrupt Controllers. 1N/A * Initially written by Michael Brown (mcb30). 1N/A/* Install a handler for the specified IRQ. Address of previous 1N/A * of IRQ will be preserved across call, therefore if the handler does 1N/A * chaining, ensure that either (a) IRQ is disabled before call, or 1N/A * (b) previous_handler points directly to the place that the handler 1N/A * picks up its chain-to address. 1N/A DBG (
"Invalid IRQ number %d\n" );
1N/A DBG (
"Installing handler at %hx:%hx for IRQ %d, leaving %s\n",
1N/A DBG (
"...(previous handler at %hx:%hx)\n",
1N/A/* Remove handler for the specified IRQ. Routine checks that another 1N/A * handler has not been installed that chains to handler before 1N/A * restored to that specified by previously_enabled. 1N/A DBG (
"Invalid IRQ number %d\n" );
1N/A DBG (
"Cannot remove handler for IRQ %d\n" );
1N/A DBG (
"Removing handler for IRQ %d\n",
irq );
1N/A/* Send specific EOI(s). 1N/A DBG (
"Sending specific EOI for IRQ %d\n",
irq );
1N/A/* Dump current 8259 status: enabled IRQs and handler addresses. 1N/A/******************************************************************** 1N/A * UNDI interrupt handling 1N/A * This essentially follows the defintion of the trivial interrupt 1N/A * handler routines. The text is assumed to locate in base memory. 1N/A/* UNDI entry point and irq, used by interrupt handler 1N/A/* Previous trigger count for undi IRQ handler */ 1N/A/* Install the undi IRQ handler. Don't test as UNDI has not be opened. 1N/A DBG (
"Can install undi IRQ handler only once\n" );
1N/A DBG (
"Trivial IRQ handler not in base memory\n" );
1N/A DBG (
"Installing undi IRQ handler on IRQ %d\n",
irq );
1N/A DBG (
"UNDI IRQ handler installed successfully\n" );
1N/A/* Remove the undi IRQ handler. 1N/A DBG (
"Cannot uninstall undi IRQ handler from IRQ %d; " 1N/A "is installed on IRQ %d\n",
irq,
1N/A DBG (
"Sending EOI for unwanted undi IRQ\n" );
1N/A/* Safe method to detect whether or not undi IRQ has been 1N/A * triggered. Using this call avoids potential race conditions. This 1N/A * call will return success only once per trigger. 1N/A /* irq is not used at present, but we have it in the API for 1N/A * future-proofing; in case we want the facility to have 1N/A * multiple undi IRQ handlers installed simultaneously. 1N/A * Avoid compiler warning about unused variable.