]>
git.saurik.com Git - apple/xnu.git/blob - iokit/Kernel/IOPowerConnection.cpp
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #include <IOKit/pwr_mgt/IOPowerConnection.h>
31 #define super IOService
32 OSDefineMetaClassAndStructors(IOPowerConnection
, IOService
)
35 // **********************************************************************************
36 // setDesiredDomainState
38 // Parent of the connection calls here to save the childs desire
39 // **********************************************************************************
41 IOPowerConnection::setDesiredDomainState(unsigned long stateNumber
)
43 desiredDomainState
= stateNumber
;
47 // **********************************************************************************
48 // getDesiredDomainState
50 // **********************************************************************************
52 IOPowerConnection::getDesiredDomainState( void )
54 return desiredDomainState
;
58 // **********************************************************************************
59 // setChildHasRequestedPower
61 // Parent of the connection calls here when the child requests power
62 // **********************************************************************************
64 IOPowerConnection::setChildHasRequestedPower( void )
69 // **********************************************************************************
70 // childHasRequestedPower
72 // Parent of the connection calls here when the child requests power
73 // **********************************************************************************
75 IOPowerConnection::childHasRequestedPower( void )
81 // **********************************************************************************
82 // setPreventIdleSleepFlag
84 // **********************************************************************************
86 IOPowerConnection::setPreventIdleSleepFlag( unsigned long flag
)
88 preventIdleSleepFlag
= (flag
!= 0);
92 // **********************************************************************************
93 // getPreventIdleSleepFlag
95 // **********************************************************************************
97 IOPowerConnection::getPreventIdleSleepFlag( void )
99 return preventIdleSleepFlag
;
103 // **********************************************************************************
104 // setPreventSystemSleepFlag
106 // **********************************************************************************
108 IOPowerConnection::setPreventSystemSleepFlag( unsigned long flag
)
110 preventSystemSleepFlag
= (flag
!= 0);
114 // **********************************************************************************
115 // getPreventSystemSleepFlag
117 // **********************************************************************************
119 IOPowerConnection::getPreventSystemSleepFlag( void )
121 return preventSystemSleepFlag
;
125 // **********************************************************************************
126 // setParentKnowsState
128 // Child of the connection calls here to set its reminder that the parent does
129 // or does not yet know the state if its domain.
130 // **********************************************************************************
132 IOPowerConnection::setParentKnowsState(bool flag
)
138 // **********************************************************************************
139 // setParentCurrentPowerFlags
141 // Child of the connection calls here to save what the parent says
142 // is the state if its domain.
143 // **********************************************************************************
145 IOPowerConnection::setParentCurrentPowerFlags(IOPMPowerFlags flags
)
147 currentPowerFlags
= flags
;
151 // **********************************************************************************
154 // **********************************************************************************
156 IOPowerConnection::parentKnowsState(void )
162 // **********************************************************************************
163 // parentCurrentPowerFlags
165 // **********************************************************************************
167 IOPowerConnection::parentCurrentPowerFlags(void )
169 return currentPowerFlags
;
173 // **********************************************************************************
176 // **********************************************************************************
178 IOPowerConnection::setAwaitingAck( bool value
)
184 // **********************************************************************************
187 // **********************************************************************************
189 IOPowerConnection::getAwaitingAck( void )
195 // **********************************************************************************
198 // **********************************************************************************
200 IOPowerConnection::setReadyFlag( bool flag
)
206 // **********************************************************************************
209 // **********************************************************************************
211 IOPowerConnection::getReadyFlag( void ) const