Training
×

System Calls: Interrupts

The SetRtInterruptHandler system call is used to establish an entry in the Interrupt Descriptor Table.
The source of the interrupt must be identified when setting up an interrupt handler so INtime knows which IDT slot is to receive the handler address. This is specified by the wLevel parameter. For legacy-style interrupts (using a PCI) , wLevel can be IRQ0_LEVEL to IRQ15_LEVEL. For PCI based systems using MSI, wLevel is determined by scanning the hardware of the system (discussed later in this chapter).
The byMaxInt parameter specifies the relation between the interrupt handler and its interrupt thread:
0     no interrupt thread, the handler is on its own.
1     the current thread becomes interrupt thread; when the thread
     is processing an interrupt signal, the interrupt is disabled.
>1     the current thread becomes an interrupt thread;
     when the thread is processing an interrupt signal,
     the interrupt remains enabled until there are as many signals pending as this value.
 
Use the ResetRtInterruptHandler system call to remove a handler from the IDT and disable the interrupt level.
An interrupt thread waits for a signal from its interrupt handler by the WaitForRtInterrupt function.