Get or set a characteristic associated with an interrupt
#include <sys/neutrino.h> int InterruptCharacteristic( int type, int id, unsigned *new, unsigned *old ); int InterruptCharacteristic_r( int type, int id, unsigned *new, unsigned *old );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The InterruptCharacteristic() and InterruptCharacteristic_r() kernel calls set or get a characteristic of an interrupt. These functions are identical except in the way they indicate errors. See the Returns section for details.
The only type currently defined is _NTO_IC_LATENCY. If the new argument is non-NULL, it points to an unsigned that contains the new latency value for the interrupt, in nanoseconds. If the old argument is non-NULL, it's filled in with the old latency value for the interrupt. The default latency value is zero.
In order to set a latency, the calling thread must be in the process that attached to the interrupt.
The id argument can be -1. In this case, you're setting the global latency value for the system. If an interrupt attachment doesn't specify a latency value, the global latency number is used when calculating how deep a sleep state the kernel may use. In order to set the global latency value:
ThreadCtl( _NTO_TCTL_IO, 0 );
0 on success. If an error occurs:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |