Mac OS X Reference Library Apple Developer
Search

RootDomain.h

Includes:
<IOKit/IOService.h>
<IOKit/pwr_mgt/IOPM.h>
"IOKit/pwr_mgt/IOPMPrivate.h"

Overview

Use the links in the table of contents to the left to access the documentation.



Functions

copyPMSetting

Copy the current value for a PM setting. Returns an OSNumber or OSData depending on the setting.

registerPMSettingController(const OSSymbol *, IOPMSettingControllerCallback, OSObject *, uintptr_t, OSObject **)

Register for callbacks on changes to certain PM settings.

registerPMSettingController(const OSSymbol *, uint32_t, IOPMSettingControllerCallback, OSObject *, uintptr_t, OSObject **)

Register for callbacks on changes to certain PM settings.

systemPowerEventOccurred

Other drivers may inform IOPMrootDomain of system PM events


copyPMSetting


Copy the current value for a PM setting. Returns an OSNumber or OSData depending on the setting.


OSObject * copyPMSetting(
    OSSymbol *whichSetting );  
Parameters
whichSetting

Name of the desired setting.

Return Value

OSObject value if valid, NULL otherwise.


registerPMSettingController(const OSSymbol *, IOPMSettingControllerCallback, OSObject *, uintptr_t, OSObject **)


Register for callbacks on changes to certain PM settings.


IOReturn registerPMSettingController( 
    const OSSymbol *settings[], 
    IOPMSettingControllerCallback callout, 
    OSObject *target, 
    uintptr_t refcon, 
    OSObject **handle);  // out param 
Parameters
settings

NULL terminated array of C strings, each string for a PM setting that the caller is interested in and wants to get callbacks for.

callout

C function ptr or member function cast as such.

target

The target of the callback, usually 'this'

refcon

Will be passed to caller in callback; for caller's use.

handle

Caller should keep the OSObject * returned here. If non-NULL, handle will have a retain count of 1 on return. To deregister, pass to unregisterPMSettingController()

Return Value

kIOReturnSuccess on success.


registerPMSettingController(const OSSymbol *, uint32_t, IOPMSettingControllerCallback, OSObject *, uintptr_t, OSObject **)


Register for callbacks on changes to certain PM settings.


IOReturn registerPMSettingController( 
    const OSSymbol *settings[], 
    uint32_t supportedPowerSources, 
    IOPMSettingControllerCallback callout, 
    OSObject *target, 
    uintptr_t refcon, 
    OSObject **handle);  // out param 
Parameters
settings

NULL terminated array of C strings, each string for a PM setting that the caller is interested in and wants to get callbacks for.

supportedPowerSources

bitfield indicating which power sources these settings are supported for (kIOPMSupportedOnAC, etc.)

callout

C function ptr or member function cast as such.

target

The target of the callback, usually 'this'

refcon

Will be passed to caller in callback; for caller's use.

handle

Caller should keep the OSObject * returned here. If non-NULL, handle will have a retain count of 1 on return. To deregister, pass to unregisterPMSettingController()

Return Value

kIOReturnSuccess on success.


systemPowerEventOccurred


Other drivers may inform IOPMrootDomain of system PM events


IOReturn systemPowerEventOccurred( 
    const OSSymbol *event, 
    uint32_t intValue );  
Parameters
event

An OSSymbol describing the type of power event.

value

A 32-bit integer value associated with the event.

shouldUpdate

indicates whether the root domain should send a notification to interested parties. Pass false if you're calling systemPowerEventOccurred several times in succession; and pass true only on the last invocatino.

Return Value

kIOReturnSuccess on success

Discussion

systemPowerEventOccurred is a richer alternative to receivePowerNotification() Only Apple-owned kexts should have reason to call systemPowerEventOccurred.

 

Did this document help you? Yes It's good, but... Not helpful...

Last Updated: 2010-07-29