]>
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_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 #include <IOKit/pwr_mgt/IOPowerConnection.h>
33 #define super IOService
34 OSDefineMetaClassAndStructors(IOPowerConnection
,IOService
)
37 // **********************************************************************************
38 // setDesiredDomainState
40 // Parent of the connection calls here to save the childs desire
41 // **********************************************************************************
42 void IOPowerConnection::setDesiredDomainState (unsigned long stateNumber
)
44 desiredDomainState
= stateNumber
;
48 // **********************************************************************************
49 // getDesiredDomainState
51 // **********************************************************************************
52 unsigned long IOPowerConnection::getDesiredDomainState ( void )
54 return desiredDomainState
;
58 // **********************************************************************************
59 // setChildHasRequestedPower
61 // Parent of the connection calls here when the child requests power
62 // **********************************************************************************
63 void IOPowerConnection::setChildHasRequestedPower ( void )
68 // **********************************************************************************
69 // childHasRequestedPower
71 // Parent of the connection calls here when the child requests power
72 // **********************************************************************************
73 bool IOPowerConnection::childHasRequestedPower ( void )
79 // **********************************************************************************
80 // setPreventIdleSleepFlag
82 // **********************************************************************************
83 void IOPowerConnection::setPreventIdleSleepFlag ( unsigned long flag
)
85 preventIdleSleepFlag
= (flag
!= 0);
89 // **********************************************************************************
90 // getPreventIdleSleepFlag
92 // **********************************************************************************
93 bool IOPowerConnection::getPreventIdleSleepFlag ( void )
95 return preventIdleSleepFlag
;
99 // **********************************************************************************
100 // setPreventSystemSleepFlag
102 // **********************************************************************************
103 void IOPowerConnection::setPreventSystemSleepFlag ( unsigned long flag
)
105 preventSystemSleepFlag
= (flag
!= 0);
109 // **********************************************************************************
110 // getPreventSystemSleepFlag
112 // **********************************************************************************
113 bool IOPowerConnection::getPreventSystemSleepFlag ( void )
115 return preventSystemSleepFlag
;
119 // **********************************************************************************
120 // setParentKnowsState
122 // Child of the connection calls here to set its reminder that the parent does
123 // or does not yet know the state if its domain.
124 // **********************************************************************************
125 void IOPowerConnection::setParentKnowsState (bool flag
)
131 // **********************************************************************************
132 // setParentCurrentPowerFlags
134 // Child of the connection calls here to save what the parent says
135 // is the state if its domain.
136 // **********************************************************************************
137 void IOPowerConnection::setParentCurrentPowerFlags (IOPMPowerFlags flags
)
139 currentPowerFlags
= flags
;
143 // **********************************************************************************
146 // **********************************************************************************
147 bool IOPowerConnection::parentKnowsState (void )
153 // **********************************************************************************
154 // parentCurrentPowerFlags
156 // **********************************************************************************
157 IOPMPowerFlags
IOPowerConnection::parentCurrentPowerFlags (void )
159 return currentPowerFlags
;
163 // **********************************************************************************
166 // **********************************************************************************
167 void IOPowerConnection::setAwaitingAck ( bool value
)
173 // **********************************************************************************
176 // **********************************************************************************
177 bool IOPowerConnection::getAwaitingAck ( void )