]>
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 // **********************************************************************************
40 void IOPowerConnection::setDesiredDomainState (unsigned long stateNumber
)
42 desiredDomainState
= stateNumber
;
46 // **********************************************************************************
47 // getDesiredDomainState
49 // **********************************************************************************
50 unsigned long IOPowerConnection::getDesiredDomainState ( void )
52 return desiredDomainState
;
56 // **********************************************************************************
57 // setChildHasRequestedPower
59 // Parent of the connection calls here when the child requests power
60 // **********************************************************************************
61 void IOPowerConnection::setChildHasRequestedPower ( void )
66 // **********************************************************************************
67 // childHasRequestedPower
69 // Parent of the connection calls here when the child requests power
70 // **********************************************************************************
71 bool IOPowerConnection::childHasRequestedPower ( void )
77 // **********************************************************************************
78 // setPreventIdleSleepFlag
80 // **********************************************************************************
81 void IOPowerConnection::setPreventIdleSleepFlag ( unsigned long flag
)
83 preventIdleSleepFlag
= (flag
!= 0);
87 // **********************************************************************************
88 // getPreventIdleSleepFlag
90 // **********************************************************************************
91 bool IOPowerConnection::getPreventIdleSleepFlag ( void )
93 return preventIdleSleepFlag
;
97 // **********************************************************************************
98 // setPreventSystemSleepFlag
100 // **********************************************************************************
101 void IOPowerConnection::setPreventSystemSleepFlag ( unsigned long flag
)
103 preventSystemSleepFlag
= (flag
!= 0);
107 // **********************************************************************************
108 // getPreventSystemSleepFlag
110 // **********************************************************************************
111 bool IOPowerConnection::getPreventSystemSleepFlag ( void )
113 return preventSystemSleepFlag
;
117 // **********************************************************************************
118 // setParentKnowsState
120 // Child of the connection calls here to set its reminder that the parent does
121 // or does not yet know the state if its domain.
122 // **********************************************************************************
123 void IOPowerConnection::setParentKnowsState (bool flag
)
129 // **********************************************************************************
130 // setParentCurrentPowerFlags
132 // Child of the connection calls here to save what the parent says
133 // is the state if its domain.
134 // **********************************************************************************
135 void IOPowerConnection::setParentCurrentPowerFlags (IOPMPowerFlags flags
)
137 currentPowerFlags
= flags
;
141 // **********************************************************************************
144 // **********************************************************************************
145 bool IOPowerConnection::parentKnowsState (void )
151 // **********************************************************************************
152 // parentCurrentPowerFlags
154 // **********************************************************************************
155 IOPMPowerFlags
IOPowerConnection::parentCurrentPowerFlags (void )
157 return currentPowerFlags
;
161 // **********************************************************************************
164 // **********************************************************************************
165 void IOPowerConnection::setAwaitingAck ( bool value
)
171 // **********************************************************************************
174 // **********************************************************************************
175 bool IOPowerConnection::getAwaitingAck ( void )
181 // **********************************************************************************
184 // **********************************************************************************
185 void IOPowerConnection::setReadyFlag( bool flag
)
191 // **********************************************************************************
194 // **********************************************************************************
195 bool IOPowerConnection::getReadyFlag( void ) const