Wait for a hardware interrupt
#include <sys/neutrino.h> int InterruptWait( int flags, const uint64_t * timeout ); int InterruptWait_r( int flags, const uint64_t * timeout );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
These kernel calls wait for a hardware interrupt. The calling thread should have attached a handler to the interrupt, by calling InterruptAttach() or InterruptAttachEvent(). The call to InterruptWait() or InterruptWait_r() blocks waiting for an interrupt handler to return an event with notification type SIGEV_INTR (i.e. a hardware interrupt).
The InterruptWait() and InterruptWait_r() functions are identical except in the way they indicate errors. See the Returns section for details.
If the notification event occurs before InterruptWait() is called, a pending flag is set. When InterruptWait() is called, the flag is checked; if set, it's cleared and the call immediately returns with success.
On a multicore system, a thread that calls InterruptWait() runs on any CPU, limited only by the scheduler and the runmask.
The only difference between these functions is the way they indicate errors:
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
InterruptAttach(), InterruptAttachEvent(), TimerTimeout()
Writing an Interrupt Handler chapter of the Neutrino Programmer's Guide
Interrupts chapter of Getting Started with QNX Neutrino