[Previous] [Contents] [Next]

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

pmm_mode_change()

Trigger change of power mode on a node

Synopsis:

#include <sys/pmm.h>

int pmm_mode_change(pmm_node_t *node, pm_power_mode_t mode, 
                                           unsigned flags);

Library:

libc

Description:

This call is used to change the power mode of a node:

node
Pointer to the node.
mode
Power mode to be set.
flags
Either 0, or PM_MODE_FORCE.

If there is a policy specific mode_request() function, it calls to check whether the mode change can be allowed.

If the requested change is allowed, the driver responsible for managing the node's power mode is notified, and this call returns EOK.


Note: The power mode change is asynchronous. pmm_mode_wait() is used to wait for the driver to confirm when then mode change is complete.

If an error occurs, it returns -1 and errno is set one of the following:

Returns:

EPERM
Flags contained PM_MODE_REQUEST or PM_MODE_CONFIRM. These flags are reserved for driver use only.
EACCES
The policy mode_request() function did not allow a change to mode.
EINVAL
mode is not a valid power mode.
ESRCH
No driver has registered to manage the power modes for the power manager object, so the power mode can not be changed.

Classification:

QNX Neutrino

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

See also:


[Previous] [Contents] [Next]