[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

pmd_handler()

Support function for handling power manager requests to change power mode

Synopsis:

#include <sys/pm.h>

void pmd_handler(pmd_attr_t *pmd);

Arguments:

pmd
Pointer to the pmd_attr_t for the device.

Library:

libpm

Description:

The pmd_handler() function is a support function that the driver calls to perform a power mode change requested by the power manager.

The driver receives these requests via the sigevent supplied to pmd_attach(). If the driver has multiple devices, it must ensure that the this sigevent contains sufficient information to allow the driver's event handler to determine which device is being requested.

The pmd_handler() essentially performs the following steps:

  1. call pmd_lock_exclusive() to prevent access to the pmd_attr_t structure
  2. communicate with the power manager to find out the new mode and flags
  3. set pmd->new_mode and pmd->new_flags as required
  4. call pmd->setpower() to initiate the mode change
  5. call pmd_unlock_exclusive() to unlock the pmd_attr_t.

The setpower() function is expected to call pmd_confirm() when the mode change is completed.

Examples:

For more information, see the device driver chapter.

Classification:

Neutrino

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

See also:

pmd_attr_t, pmd_attach(), pmd_attr_setpower(), pmd_confirm(), pmd_lock_exclusive(), pmd_unlock_exclusive()


[Previous] [Contents] [Next]