Open topic with navigation
Interrupt Functions
The following functions are available to manage RTX interrupt services.
Attaching Functions
-
RtAttachInterrupt
can attach an Interrupt Service Thread (IST) and/or an Interrupt Service Routine (ISR) to a specified
interrupt. Interrupts may be either line-based or message-based (MSI/MSI-X).
You can also share interrupts exclusively attached within the RTSS environment
with this call. Use RtAttachInterrupt
when attaching an RTSS process to an interrupt.
- RtAttachInterruptVectorEx can attach
an Interrupt Service Thread (IST) and/or an Interrupt Service Routine (ISR) to a specified interrupt.
You can also share interrupts exclusively attached within either the RTSS
or Win32 environments (but not both) with this call. Use RtAttachInterruptVectorEx
when attaching a Win32 process to an interrupt.
- RtAttachInterruptVector
attaches an Interrupt Service Thread (IST) to a specified interrupt. You can use RtAttachInterruptVector
when attaching a Win32 process to an interrupt, however, RtAttachInterruptVectorEx
contains more functionality and is preferable to RtAttachInterruptVector
when attaching Win32 processes.
Releasing Functions
- RtReleaseInterrupt
releases an interrupt previously attached with RtAttachInterrupt.
Like RtAttachInterrupt, RTReleaseInterrupt is only supported
in the RTSS environment.
- RtReleaseInterruptVector
releases an interrupt previously attached with RtAttachInterruptVectorEx
or RtAttachInterruptVector. This
API can be called in RTSS or Windows environments.
Other Functions
- RtQueryPciMsiCapability
allows a user to query a PCI device and determine if the device has MSI
or MSI-X capability. RtQueryPciMsiCapability
is only supported in the RTSS environment.
- RtDisableInterrupts,
under the Win32 environment, disables interrupt handling for all interrupts
attached to a process. In the RTSS environment, all interrupts are disabled
at the processor level.
- RtEnableInterrupts enables all interrupts
disabled by RtDisableInterrupts.
Programming Considerations
General Programming Considerations
- As with any thread, an interrupt thread can be
preempted at any time by a thread that runs at a higher thread priority
level.
- In dedicated environments, IRQ affinity is set
at attach time.
- Time slicing effects the execution of ISTs if
there is a time quantum set for the IST.
- Interrupt processing can be disabled for the set
of interrupts attached to the RTX process by raising the thread priority
level of the currently executing thread. The level must be higher than
all of the thread priority levels specified for the RTSS Interrupt Service
Threads (ISTs). An interrupt handler that signals an object may satisfy the wait
conditions of a higher priority thread. Resuming the higher priority thread
will delay the completion of the interrupt handler and delay the time
at which the interrupt source will be unmasked. High priority threads
never mask timer interrupts; thus, the timer interrupt is effectively
the highest priority interrupt. To mask timer interrupts, use RtDisableInterrupts.
Win32 Environment Programming Considerations
All processing in the RTSS environment takes priority over all processing
in the Win32 environment. Therefore, any time-critical interrupt processing
that must be accomplished should be done with a handler running an RTSS
process, rather than a Win32 process. In the Win32 environment, the Windows
scheduler services RTX interrupt threads. This can lead to non-deterministic
scheduling latencies for the handling thread to receive and process the
interrupt.
Also, remember to use RtAttachInterruptVectorEx
or RtAttachInterruptVector when
attaching Win32 processes. RtAttachInterrupt
is not supported in the Win32 environment.
Examples
For an example of using RtAttachInterrupt,
see the IntelPro1000 topic.
For an example of using RtAttachInterruptVector,
see the Interrupt
Management and Port I/O Calls Programming Example topic.