]>
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_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 #include <IOKit/pwr_mgt/IOPowerConnection.h>
28 #define super IOService
29 OSDefineMetaClassAndStructors(IOPowerConnection
,IOService
)
32 // **********************************************************************************
33 // setDesiredDomainState
35 // Parent of the connection calls here to save the childs desire
36 // **********************************************************************************
37 void IOPowerConnection::setDesiredDomainState (unsigned long stateNumber
)
39 desiredDomainState
= stateNumber
;
43 // **********************************************************************************
44 // getDesiredDomainState
46 // **********************************************************************************
47 unsigned long IOPowerConnection::getDesiredDomainState ( void )
49 return desiredDomainState
;
53 // **********************************************************************************
54 // setChildHasRequestedPower
56 // Parent of the connection calls here when the child requests power
57 // **********************************************************************************
58 void IOPowerConnection::setChildHasRequestedPower ( void )
63 // **********************************************************************************
64 // childHasRequestedPower
66 // Parent of the connection calls here when the child requests power
67 // **********************************************************************************
68 bool IOPowerConnection::childHasRequestedPower ( void )
74 // **********************************************************************************
75 // setPreventIdleSleepFlag
77 // **********************************************************************************
78 void IOPowerConnection::setPreventIdleSleepFlag ( unsigned long flag
)
80 preventIdleSleepFlag
= (flag
!= 0);
84 // **********************************************************************************
85 // getPreventIdleSleepFlag
87 // **********************************************************************************
88 bool IOPowerConnection::getPreventIdleSleepFlag ( void )
90 return preventIdleSleepFlag
;
94 // **********************************************************************************
95 // setPreventSystemSleepFlag
97 // **********************************************************************************
98 void IOPowerConnection::setPreventSystemSleepFlag ( unsigned long flag
)
100 preventSystemSleepFlag
= (flag
!= 0);
104 // **********************************************************************************
105 // getPreventSystemSleepFlag
107 // **********************************************************************************
108 bool IOPowerConnection::getPreventSystemSleepFlag ( void )
110 return preventSystemSleepFlag
;
114 // **********************************************************************************
115 // setParentKnowsState
117 // Child of the connection calls here to set its reminder that the parent does
118 // or does not yet know the state if its domain.
119 // **********************************************************************************
120 void IOPowerConnection::setParentKnowsState (bool flag
)
126 // **********************************************************************************
127 // setParentCurrentPowerFlags
129 // Child of the connection calls here to save what the parent says
130 // is the state if its domain.
131 // **********************************************************************************
132 void IOPowerConnection::setParentCurrentPowerFlags (IOPMPowerFlags flags
)
134 currentPowerFlags
= flags
;
138 // **********************************************************************************
141 // **********************************************************************************
142 bool IOPowerConnection::parentKnowsState (void )
148 // **********************************************************************************
149 // parentCurrentPowerFlags
151 // **********************************************************************************
152 IOPMPowerFlags
IOPowerConnection::parentCurrentPowerFlags (void )
154 return currentPowerFlags
;
158 // **********************************************************************************
161 // **********************************************************************************
162 void IOPowerConnection::setAwaitingAck ( bool value
)
168 // **********************************************************************************
171 // **********************************************************************************
172 bool IOPowerConnection::getAwaitingAck ( void )