Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/include/IOKit/pwr_mgt/IOPowerConnection.h

Source at commit 1129 created 12 years 11 months ago.
By meklort, Change options.o so that it reloads the system config as well. Also change it so that it uses that config for variables (NOTE: if the calue exists in chameleonConfig, it's used instead.
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35
36#ifndef _IOKIT_IOPOWERCONNECTION_H
37#define _IOKIT_IOPOWERCONNECTION_H
38
39#include <IOKit/IOService.h>
40#include <IOKit/pwr_mgt/IOPM.h>
41
42class IOPowerConnection : public IOService
43{
44 OSDeclareDefaultStructors(IOPowerConnection)
45
46protected:
47 /*! @field parentKnowsStatetrue: parent knows state of its domain
48used by child */
49 boolstateKnown;
50 /*! @field currentPowerFlagspower flags which describe the current state of the power domain
51used by child */
52 IOPMPowerFlags currentPowerFlags;
53 /*! @field desiredDomainStatestate number which corresponds to the child's desire
54used by parent */
55 unsigned longdesiredDomainState;
56
57 /*! @field requestFlagset to true when desiredDomainState is set */
58 boolrequestFlag;
59
60 /*! @field preventIdleSleepFlagtrue if child has this bit set in its desired state
61used by parent */
62 unsigned longpreventIdleSleepFlag;
63
64 /*! @field preventSystemSleepFlagtrue if child has this bit set in its desired state
65used by parent */
66 unsigned longpreventSystemSleepFlag;
67
68 /*! @field awaitingAcktrue if child has not yet acked our notification
69used by parent */
70 boolawaitingAck;
71
72 /*! @field readyFlagtrue if the child has been added as a power child
73used by parent */
74boolreadyFlag;
75
76public:
77 /*! @function setParentKnowsState
78 @abstract Sets the stateKnown variable.
79 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent now knows its state. */
80 void setParentKnowsState (bool );
81
82 /*! @function setParentCurrentPowerFlags
83 @abstract Sets the currentPowerFlags variable.
84 @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */
85 void setParentCurrentPowerFlags (IOPMPowerFlags );
86
87 /*! @function parentKnowsState
88 @abstract Returns the stateKnown variable. */
89 bool parentKnowsState (void );
90
91 /*! @function parentCurrentPowerFlags
92 @abstract Returns the currentPowerFlags variable. */
93 IOPMPowerFlags parentCurrentPowerFlags (void );
94
95 /*! @function setDesiredDomainState
96 @abstract Sets the desiredDomainState variable.
97 @discussion Called by the parent. */
98 void setDesiredDomainState (unsigned long );
99
100 /*! @function getDesiredDomainState
101 @abstract Returns the desiredDomainState variable.
102 @discussion Called by the parent. */
103 unsigned long getDesiredDomainState ( void );
104
105 /*! @function setChildHasRequestedPower
106 @abstract Set the flag that says that the child has called requestPowerDomainState.
107 @discussion Called by the parent. */
108 void setChildHasRequestedPower ( void );
109
110
111 /*! @function childHasRequestedPower
112 @abstract Return the flag that says whether the child has called requestPowerDomainState.
113 @discussion Called by the PCI Aux Power Supply Driver to see if a device driver
114 is power managed. */
115 bool childHasRequestedPower ( void );
116
117 /*! @function setPreventIdleSleepFlag
118 @abstract Sets the preventIdleSleepFlag variable.
119 @discussion Called by the parent. */
120 void setPreventIdleSleepFlag (unsigned long );
121
122 /*! @function getPreventIdleSleepFlag
123 @abstract Returns the preventIdleSleepFlag variable.
124 @discussion Called by the parent. */
125 bool getPreventIdleSleepFlag ( void );
126
127 /*! @function setPreventSystemSleepFlag
128 @abstract Sets the preventSystemSleepFlag variable.
129 @discussion Called by the parent. */
130 void setPreventSystemSleepFlag (unsigned long );
131
132 /*! @function getPreventSystemSleepFlag
133 @abstract Returns the preventSystemSleepFlag variable.
134 @discussion Called by the parent. */
135 bool getPreventSystemSleepFlag ( void );
136
137 /*! @function setAwaitingAck
138 @abstract Sets the awaitingAck variable.
139 @discussion Called by the parent. */
140 void setAwaitingAck ( bool );
141
142 /*! @function getAwaitingAck
143 @abstract Returns the awaitingAck variable.
144 @discussion Called by the parent. */
145 bool getAwaitingAck ( void );
146
147 /*! @function setReadyFlag
148 @abstract Sets the readyFlag variable.
149 @discussion Called by the parent. */
150void setReadyFlag( bool flag );
151
152 /*! @function getReadyFlag
153 @abstract Returns the readyFlag variable.
154 @discussion Called by the parent. */
155bool getReadyFlag( void ) const;
156};
157
158#endif /* ! _IOKIT_IOPOWERCONNECTION_H */
159
160

Archive Download this file

Revision: 1129