InterruptHookIdle()

Attach an “idle” interrupt handler

Synopsis:

#include <sys/neutrino.h>

int InterruptHookIdle(
    void (*handler)(uint64_t *, struct qtime_entry *),
    unsigned flags );

Arguments:

handler
A pointer to the handler function; see below.
flags
There are currently no flags that apply; specify 0 for this argument.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The InterruptHookIdle() kernel call attaches the specified interrupt handler to the “idle” interrupt, which is called when the system is idle. This is typically used to implement power management features.

The arguments to the handler function are:

uint64_t*
A pointer to the time, in nanoseconds, when the next timer will expire.
struct qtime_entry *
A pointer to the section of the system page with the time information, including the current time of day.

The simplest idle handler consists of a halt instruction.

Blocking states

This call doesn't block.

Returns:

An interrupt function ID, or -1 if an error occurs (errno is set).

Use the returned value with the InterruptDetach() function to detach this interrupt handler.

Errors:

EAGAIN
All kernel interrupt entries are in use.
EPERM
The process doesn't have superuser capabilities.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

InterruptAttach(), InterruptAttachEvent(), InterruptDetach(), InterruptHookTrace()

Writing an Interrupt Handler chapter of the Neutrino Programmer's Guide