> I'm writing an ATM adapter driver. I want to ask two questions about set
>the 8259A Interrupt controller.
> 1.Does ddk supplies the function such as disable_irq to mask the 8259A
>interrupt controller? For example: in the linux, we can simply use the
>disable_irq(3) to disable interrupt 3.
On NT/Win2000 you don't directly deal with physical interrupt levels, you
work in terms of the logical IRQL level. Understanding IRQL's is critical
to understanding how to write NT/Win2000 drivers. To synchronize execution
with interrupt code, you use an appropriate function (like maybe
KeSynchronizeExecution) to raise your IRQL level, which may (or may not)
transparently adjust interrupt controller hardware . Also note that IRQL
levels are processor specific, so even if you raise the IRQL of one
processor, another processor may take an interrupt. This means you may need
a spinlock to protect shared data (KeSynchronizeExecution grabs the
interrupt object spinlock). Also, PCI devices sometimes share interrupt
levels, so physically disabling an interrupt levels might be bad for some
As your device is a network device, and your probably writing an NDIS
driver, there is a special set of OS API's for doing all this (many of
these have names that start with Ndis...).
> 2.If ddk doesn't supply this kind of function, can I write the control
>word by using the WRITE_PORT_UCHAR( )?
Absolutely not, some systems don't use 8259A interrupt controllers (like
most multi processor capable systems ). The physical interrupt controller is owned by the OS, and is
only to be fooled with by it's owner.