]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/pwr_mgt/IOPMPrivate.h
3e61d81e0a4bb6da4d22bb305ac9c91c24bbab55
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPMPrivate.h
1 /*
2 * Copyright (c) 2002 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 #ifndef _IOKIT_IOPMPRIVATE_H
29 #define _IOKIT_IOPMPRIVATE_H
30
31 #include <IOKit/pwr_mgt/IOPM.h>
32
33 #pragma mark PM Timeline Logging
34 /**************************************************
35 *
36 * Timeline API Keys - Reports timing details for
37 * applications, drivers, and system during PM activity
38 *
39 * For kernel-internal use only
40 **************************************************/
41
42 // Keys for interfacing with IOPMrootDomain Timeline
43 /* @constant kIOPMTimelineDictionaryKey
44 * @abstract RootDomain key for dictionary describing Timeline's info
45 */
46 #define kIOPMTimelineDictionaryKey "PMTimelineLogging"
47
48 /* @constant kIOPMTimelineEnabledKey
49 * @abstract Boolean value indicating whether the system is recording PM events.
50 * @discussion Key may be found in the dictionary at IOPMrootDomain's property
51 * kIOPMTimelineDictionaryKey. uint32_t value; may be 0.
52 */
53 #define kIOPMTimelineEnabledKey "TimelineEnabled"
54
55 /* @constant kIOMPTimelineSystemNumberTrackedKey
56 * @abstract The maximum number of system power events the system may record.
57 * @discussion Key may be found in the dictionary at IOPMrootDomain's property
58 * kIOPMTimelineDictionaryKey. uint32_t value; may be 0.
59 */
60 #define kIOPMTimelineSystemNumberTrackedKey "TimelineSystemEventsTracked"
61
62 /* @constant kIOPMTimelineSystemBufferSizeKey
63 * @abstract Size in bytes of buffer recording system PM events
64 * @discussion Key may be found in the dictionary at IOPMrootDomain's property
65 * kIOPMTimelineDictionaryKey. uint32_t value; may be 0.
66 */
67 #define kIOPMTimelineSystemBufferSizeKey "TimelineSystemBufferSize"
68
69
70
71 /* @constant kIOPMEventTypeIntermediateFlag
72 * @abstract This bit indicates the event is an intermediate event
73 * which must occur within a major system power event.
74 */
75 #define kIOPMEventTypeIntermediateFlag 0x10000000
76
77 /* @enum SystemEventTypes
78 * @abstract Potential system events logged in the system event record.
79 */
80 enum {
81 kIOPMEventTypeUndefined = 0,
82
83 /* Event types mark driver events
84 */
85 kIOPMEventTypeSetPowerStateImmediate = 1001,
86 kIOPMEventTypeSetPowerStateDelayed = 1002,
87 kIOPMEventTypePSWillChangeTo = 1003,
88 kIOPMEventTypePSDidChangeTo = 1004,
89 kIOPMEventTypeAppResponse = 1005,
90
91
92 /* Start and stop event types bracket major
93 * system power management events.
94 */
95 kIOPMEventTypeSleep = 2001,
96 kIOPMEventTypeSleepDone = 2002,
97 kIOPMEventTypeWake = 3001,
98 kIOPMEventTypeWakeDone = 3002,
99 kIOPMEventTypeDoze = 4001,
100 kIOPMEventTypeDozeDone = 4002,
101 kIOPMEventTypeLiteWakeUp = 5001,
102 kIOPMEventTypeLiteWakeUpDone = 5002,
103 kIOPMEventTypeLiteWakeDown = 5003,
104 kIOPMEventTypeLiteWakeDownDone = 5004,
105 kIOPMEventTypeUUIDSet = 6001,
106 kIOPMEventTypeUUIDClear = 6002,
107
108 /* Intermediate events that may only occur within the bounds
109 * of a major system event (between the event's initiation and its "done event".)
110 * e.g. chronologically kIOPMEventTypeSleep may be followed by one or more
111 * intermediate events, which then must be followed by kIOPMEventTypeSleepDone.
112 *
113 * The intermediate events below will always occur in a Sleep or Wake event, and may
114 * or may not occur for any of the other events.
115 */
116 kIOPMEventTypeAppNotificationsFinished = 501 | kIOPMEventTypeIntermediateFlag,
117 kIOPMEventTypeDriverNotificationsFinished = 502 | kIOPMEventTypeIntermediateFlag,
118 kIOPMEventTypeCalTimeChange = 503 | kIOPMEventTypeIntermediateFlag
119 };
120
121
122 /* @enum SystemSleepReasons
123 * @abstract The potential causes for system sleep as logged in the system event record.
124 */
125 enum {
126 kIOPMSleepReasonClamshell = 101,
127 kIOPMSleepReasonPowerButton = 102,
128 kIOPMSleepReasonSoftware = 103,
129 kIOPMSleepReasonOSSwitchHibernate = 104,
130 kIOPMSleepReasonIdle = 105,
131 kIOPMSleepReasonLowPower = 106,
132 kIOPMSleepReasonThermalEmergency = 107,
133 kIOPMSleepReasonMaintenance = 108
134 };
135
136 /*
137 * Possible C-string sleep reasons found under kRootDomainSleepReasonsKey
138 */
139 #define kIOPMClamshellSleepKey "Clamshell Sleep"
140 #define kIOPMPowerButtonSleepKey "Power Button Sleep"
141 #define kIOPMSoftwareSleepKey "Software Sleep"
142 #define kIOPMOSSwitchHibernationKey "OS Switch Sleep"
143 #define kIOPMIdleSleepKey "Idle Sleep"
144 #define kIOPMLowPowerSleepKey "Low Power Sleep"
145 #define kIOPMThermalEmergencySleepKey "Thermal Emergency Sleep"
146
147
148 enum {
149 kIOPMMaxSystemEventsTracked = 25000,
150 kIOPMDefaultSystemEventsTracked = 1000,
151 kMaxPMStringLength = 40,
152 };
153
154 /* @struct IOPMSystemEventRecord
155 * @abstract Records a singe power event to a particular PM entity.
156 * This includes changes to a driver's power state, application responses
157 * to PM notifications, or system power management milestones.
158 */
159 typedef struct {
160 union {
161 // For DRIVER events
162 char ownerName[kMaxPMStringLength];
163 // For SYSTEM events, uuid contains the string describing the active UUID
164 char uuid[kMaxPMStringLength];
165 };
166
167 // For DRIVER events - records the name of the driver who generated the notifications.
168 char interestName[kMaxPMStringLength];
169
170 // DRIVER & SYSTEM - Times are stored as uint64_t
171 // The high 32 bytes are the seconds returned from clock_get_calendar_microtime,
172 // and the low 32 bytes are the accompanying microseconds.
173 uint64_t timestamp;
174
175 union {
176 // For DRIVER events - ownerDisambiguateID is a unique descriptor of the driver, to disambiguate
177 // several similarly named drivers.
178 uint64_t ownerDisambiguateID;
179 // For SYSTEM events - eventReason is a value in SystemSleepReason
180 uint64_t eventReason;
181 };
182
183 // DRIVER & SYSTEM - eventType is one of 'SystemEventTypes'
184 // The value of eventType determines, among ohter things, whether this is a SYSTEM or
185 // DRIVER event type.
186 uint32_t eventType;
187
188 // DRIVER & SYSTEM - eventResult is an IOReturn value
189 uint32_t eventResult;
190
191 // DRIVER - If defined, elapsedTimeUS records the entire time a transaction took to complete
192 uint32_t elapsedTimeUS;
193
194 // DRIVER - in power state changes, oldState & newState are PM power state indices.
195 uint8_t oldState;
196 uint8_t newState;
197 } IOPMSystemEventRecord;
198
199 /* @struct IOPMTraceBufferHeader
200 * Occupies the first bytes in the buffer allocated by IOPMrootDomain
201 * Describes the size and current index of the trace buffer
202 */
203 typedef struct {
204 uint32_t sizeBytes;
205 uint32_t sizeEntries;
206 uint32_t index;
207 } IOPMTraceBufferHeader;
208
209 /* Argument to IOPMrootDomain::clientMemoryForType to acquire
210 * memory mapping.
211 */
212 enum {
213 kPMRootDomainMapTraceBuffer = 1
214 };
215
216 /**************************************************
217 *
218 * Accountability API Ends here
219 *
220 **************************************************/
221
222
223 #pragma mark Stray Bitfields
224 // Private power commands issued to root domain
225 // bits 0-7 in IOPM.h
226
227 enum {
228 kIOPMSetValue = (1<<16),
229 // don't sleep on clamshell closure on a portable with AC connected
230 kIOPMSetDesktopMode = (1<<17),
231 // set state of AC adaptor connected
232 kIOPMSetACAdaptorConnected = (1<<18)
233 };
234
235 /*****************************************************************************/
236 /*****************************************************************************/
237
238 /*
239 * PM notification types
240 */
241
242 /* @constant kIOPMStateConsoleUserShutdown
243 * @abstract Notification of GUI shutdown state available to kexts.
244 * @discussion This type can be passed as arguments to registerPMSettingController()
245 * to receive callbacks.
246 */
247 #define kIOPMStateConsoleShutdown "ConsoleShutdown"
248
249 /* @enum ShutdownValues
250 * @abstract Potential values shared with key kIOPMStateConsoleUserShutdown
251 */
252 enum {
253 /* @constant kIOPMStateConsoleShutdownNone
254 * @abstract System shutdown (or restart) hasn't started; system is ON.
255 * @discussion Next state: 2
256 */
257 kIOPMStateConsoleShutdownNone = 1,
258 /* @constant kIOPMStateConsoleShutdownPossible
259 * @abstract User has been presented with the option to shutdown or restart. Shutdown may be cancelled.
260 * @discussion Next state may be: 1, 4
261 */
262 kIOPMStateConsoleShutdownPossible = 2,
263 /* @constant kIOPMStateConsoleShutdownUnderway
264 * @abstract Shutdown or restart is proceeding. It may still be cancelled.
265 * @discussion Next state may be: 1, 4. This state is currently unused.
266 */
267 kIOPMStateConsoleShutdownUnderway = 3,
268 /* @constant kIOPMStateConsoleShutdownCertain
269 * @abstract Shutdown is in progress and irrevocable.
270 * @discussion State remains 4 until power is removed from CPU.
271 */
272 kIOPMStateConsoleShutdownCertain = 4
273 };
274
275 /*****************************************************************************/
276 /*****************************************************************************/
277
278 /* PM Statistics - event indices
279 * These are arguments to IOPMrootDomain::pmStatsRecordEvent().
280 */
281 enum {
282 kIOPMStatsHibernateImageWrite = 1,
283 kIOPMStatsHibernateImageRead,
284 kIOPMStatsDriversNotify,
285 kIOPMStatsApplicationNotify,
286 kIOPMStatsLateDriverAcknowledge,
287 kIOPMStatsLateAppAcknowledge,
288
289 // To designate if you're specifying the start or stop end of
290 // each of the above events, do a bitwise OR of the appropriate
291 // Start/Stop flag and pass the result to IOPMrootDomain to record
292 // the event.
293 kIOPMStatsEventStartFlag = (1 << 24),
294 kIOPMStatsEventStopFlag = (1 << 25)
295 };
296
297 // Keys for IOPMrootDomain registry properties
298 #define kIOPMSleepStatisticsKey "SleepStatistics"
299 #define kIOPMSleepStatisticsAppsKey "AppStatistics"
300
301 // Application response statistics
302 #define kIOPMStatsNameKey "Name"
303 #define kIOPMStatsPIDKey "Pid"
304 #define kIOPMStatsTimeMSKey "TimeMS"
305 #define kIOPMStatsApplicationResponseTypeKey "ResponseType"
306 #define kIOPMStatsMessageTypeKey "MessageType"
307
308 // PM Statistics: potential values for the key kIOPMStatsApplicationResponseTypeKey
309 // entry in the application results array.
310 #define kIOPMStatsResponseTimedOut "ResponseTimedOut"
311 #define kIOPMStatsResponseCancel "ResponseCancel"
312 #define kIOPMStatsResponseSlow "ResponseSlow"
313
314 typedef struct {
315 struct bounds{
316 uint64_t start;
317 uint64_t stop;
318 };
319
320 struct bounds hibWrite;
321 struct bounds hibRead;
322 // bounds driverNotifySleep;
323 // bounds driverNotifyWake;
324 // bounds appNotifySleep;
325 // bounds appNotifyWake;
326 // OSDictionary *tardyApps;
327 // OSDictionary *tardyDrivers;
328 } PMStatsStruct;
329
330 /*****************************************************************************/
331
332 /* PM RootDomain tracePoints
333 *
334 * In the sleep/wake process, we expect the sleep trace points to proceed
335 * in increasing order. Once sleep begins with code kIOPMTracePointSleepStarted,
336 * we expect sleep to continue in a monotonically increasing order of tracepoints
337 * to kIOPMTracePointSystemLoginwindowPhase. After trace point SystemLoginWindowPhase,
338 * the system will return to kIOPMTracePointSystemUp.
339 *
340 * If the trace point decreases (instead of increasing) before reaching kIOPMTracePointSystemUp,
341 * that indicates that the sleep process was cancelled. The cancel reason shall be indicated
342 * in the cancel tracepoint. (TBD)
343 */
344
345 enum {
346 /* When kTracePointSystemUp is the latest tracePoint,
347 * the system is awake. It is not asleep, sleeping, or waking.
348 *
349 * Phase begins: At boot, at completion of wake from sleep,
350 * immediately following kIOPMTracePointSystemLoginwindowPhase.
351 * Phase ends: When a sleep attempt is initiated.
352 */
353 kIOPMTracePointSystemUp = 0,
354
355 /* When kIOPMTracePointSleepStarted is the latest tracePoint,
356 * sleep has been initiated.
357 *
358 * Phase begins: At initiation of system sleep (idle or forced).
359 * Phase ends: PM starts to notify applications of system sleep.
360 */
361 kIOPMTracePointSleepStarted = 0x10,
362
363 /* When kIOPMTracePointSleepApplications is the latest tracePoint,
364 * a system sleep has been initiated and PM waits for responses
365 * from notified applications.
366 *
367 * Phase begins: Begin to asynchronously fire kIOMessageSystemWillSleep
368 * notifications, and also kIOMessageCanSystemSleep for the idle sleep case.
369 * Phase ends: When PM has received all application responses.
370 */
371 kIOPMTracePointSleepApplications = 0x11,
372
373 /* When kIOPMTracePointSleepPriorityClients is the latest tracePoint,
374 * PM is notifying priority clients and in-kernel system capability
375 * clients, and waiting for any asynchronous completions.
376 *
377 * Phase begins: Synchronous delivery of kIOMessageSystemWillSleep notifications.
378 * Phase ends: All notified clients have acknowledged.
379 */
380 kIOPMTracePointSleepPriorityClients = 0x12,
381
382 /* When kIOPMTracePointSleepWillChangeInterests is the latest tracePoint,
383 * PM is calling powerStateWillChangeTo() on interested drivers of root domain.
384 *
385 * Phase begins: Dispatch a callout thread to call interested drivers.
386 * Phase ends: Callout thread work done, and acknowledgePowerChange() called
387 * by drivers that indicated asynchronous completion.
388 */
389 kIOPMTracePointSleepWillChangeInterests = 0x13,
390
391 /* When kIOPMTracePointSleepPowerPlaneDrivers is the latest tracePoint,
392 * PM is directing power plane drivers to power off in leaf-to-root order.
393 *
394 * Phase begins: Root domain informs its power children that it will drop to
395 * sleep state. This has a cascade effect and triggers all drivers in
396 * the power plane to transition to a lower power state if necessary.
397 * Phase ends: All power transitions in response to the root domain power
398 * change have completed.
399 */
400 kIOPMTracePointSleepPowerPlaneDrivers = 0x14,
401
402 /* When kIOPMTracePointSleepDidChangeInterests is the latest tracePoint,
403 * PM is calling powerStateDidChangeTo() on interested drivers of root domain.
404 *
405 * Phase begins: Dispatch a callout thread to call interested drivers.
406 * Phase ends: Callout thread work done, and acknowledgePowerChange() called
407 * by drivers that indicated asynchronous completion.
408 */
409 kIOPMTracePointSleepDidChangeInterests = 0x15,
410
411 /* When kIOPMTracePointSleepCapabilityClients is the latest tracePoint,
412 * PM is notifying system capability clients about system sleep.
413 *
414 * Phase begins: Send kIOMessageSystemCapabilityChange notifications to inform
415 * capability clients that system has lost all capabilities.
416 * Phase ends: Finished sending notifications.
417 */
418 kIOPMTracePointSleepCapabilityClients = 0x16,
419
420 /* When kIOPMTracePointSleepPlatformActions is the latest tracePoint,
421 * PM is calling drivers that have registered a platform sleep action.
422 */
423 kIOPMTracePointSleepPlatformActions = 0x17,
424
425 /* When kIOPMTracePointSleepCPUs is the latest tracePoint,
426 * PM is shutting down all non-boot processors.
427 *
428 * Phase begins: Shutdown all non-boot processors.
429 * Phase ends: Reduced to only the boot processor running.
430 */
431 kIOPMTracePointSleepCPUs = 0x18,
432
433 /* When kIOPMTracePointSleepPlatformDriver is the latest tracePoint,
434 * PM is executing platform dependent code to prepare for system sleep.
435 */
436 kIOPMTracePointSleepPlatformDriver = 0x19,
437
438 /* When kIOPMTracePointHibernate is the latest tracePoint,
439 * PM is writing the hibernate image to disk.
440 */
441 kIOPMTracePointHibernate = 0x1a,
442
443 /* When kIOPMTracePointSystemSleep is the latest tracePoint,
444 * PM has recorded the final trace point before the hardware platform
445 * enters sleep state, or low level wakeup is underway - such as restoring
446 * the hibernate image from disk.
447 *
448 * Note: If a system is asleep and then loses power, and it does not have a
449 * hibernate image to restore from (e.g. hibernatemode = 0), then OS X will
450 * interpret this power loss as a failure in kIOPMTracePointSystemSleep.
451 *
452 * Phase begins: Before the OS directs the hardware to enter sleep state.
453 * Phase ends: Control returns to the OS on wake, but before recording the first
454 * wake trace point.
455 */
456 kIOPMTracePointSystemSleep = 0x1f,
457
458 /* When kIOPMTracePointWakePlatformDriver is the latest tracePoint,
459 * PM is executing platform dependent code to prepare for system wake.
460 */
461 kIOPMTracePointWakePlatformDriver = 0x21,
462
463 /* When kIOPMTracePointWakePlatformActions is the latest tracePoint,
464 * PM is calling drivers that have registered a platform wake action.
465 */
466 kIOPMTracePointWakePlatformActions = 0x22,
467
468 /* When kIOPMTracePointWakeCPUs is the latest tracePoint,
469 * PM is bringing all non-boot processors online.
470 */
471 kIOPMTracePointWakeCPUs = 0x23,
472
473 /* When kIOPMTracePointWakeWillPowerOnClients is the latest tracePoint,
474 * PM is sending kIOMessageSystemWillPowerOn to both kernel clients and
475 * applications. PM also notifies system capability clients about the
476 * proposed capability change.
477 *
478 * Phase begins: Send kIOMessageSystemWillPowerOn and
479 * kIOMessageSystemCapabilityChange notifications.
480 * Phase ends: Finished sending notifications.
481 */
482 kIOPMTracePointWakeWillPowerOnClients = 0x24,
483
484 /* When kIOPMTracePointWakeWillChangeInterests is the latest tracePoint,
485 * PM is calling powerStateWillChangeTo() on interested drivers of root domain.
486 *
487 * Phase begins: Dispatch a callout thread to call interested drivers.
488 * Phase ends: Callout thread work done, and acknowledgePowerChange() called
489 * by drivers that indicated asynchronous completion.
490 */
491 kIOPMTracePointWakeWillChangeInterests = 0x25,
492
493 /* When kIOPMTracePointWakeDidChangeInterests is the latest tracePoint,
494 * PM is calling powerStateDidChangeTo() on interested drivers of root domain.
495 *
496 * Phase begins: Dispatch a callout thread to call interested drivers.
497 * Phase ends: Callout thread work done, and acknowledgePowerChange() called
498 * by drivers that indicated asynchronous completion.
499 */
500 kIOPMTracePointWakeDidChangeInterests = 0x26,
501
502 /* When kIOPMTracePointWakePowerPlaneDrivers is the latest tracePoint,
503 * PM is directing power plane drivers to power up in root-to-leaf order.
504 *
505 * Phase begins: Root domain informs its power children that it transitioned
506 * to ON state. This has a cascade effect and triggers all drivers in
507 * the power plane to re-evaluate and potentially change power state.
508 * Phase ends: All power transitions in response to the root domain power
509 * change have completed.
510 */
511 kIOPMTracePointWakePowerPlaneDrivers = 0x27,
512
513 /* When kIOPMTracePointWakeCapabilityClients is the latest tracePoint,
514 * PM is notifying system capability clients about system wake, and waiting
515 * for any asynchronous completions.
516 *
517 * Phase begins: Inform capability clients that system has gained capabilities.
518 * Phase ends: All notified clients have acknowledged.
519 */
520 kIOPMTracePointWakeCapabilityClients = 0x28,
521
522 /* When kIOPMTracePointWakeApplications is the latest tracePoint,
523 * System CPU is powered, PM has powered on each driver.
524 *
525 * Phase begins: Send asynchronous kIOMessageSystemHasPoweredOn notifications.
526 * Phase ends: Finished sending asynchronous notifications.
527 */
528 kIOPMTracePointWakeApplications = 0x29,
529
530 /* kIOPMTracePointSystemLoginwindowPhase
531 * This phase represents a several minute window after the system has powered on.
532 * Higher levels of system diagnostics are in a heightened state of alert in this phase,
533 * in case any user errors occurred that we could not detect in software.
534 *
535 * Phase begins: After IOPMrootDomain sends kIOMessageSystemHasPoweredOn message.
536 * Phase ends: When loginwindow calls IOPMSleepWakeSetUUID(NULL) the system shall
537 * be considered awake and usable. The next phase shall be kIOPMTracePointSystemUp.
538 */
539 kIOPMTracePointSystemLoginwindowPhase = 0x30,
540
541 /* When kIOPMTracePointDarkWakeEntry is the latest tracePoint,
542 * PM has started a transition from full wake to dark wake.
543 *
544 * Phase begins: Start transition to dark wake.
545 * Phase ends: System in dark wake. Before recording kIOPMTracePointSystemUp.
546 */
547 kIOPMTracePointDarkWakeEntry = 0x31,
548
549 /* When kIOPMTracePointDarkWakeExit is the latest tracePoint,
550 * PM has started a transition from dark wake to full wake.
551 *
552 * Phase begins: Start transition to full wake.
553 * Phase ends: System in full wake. Before recording kIOPMTracePointSystemUp.
554 */
555 kIOPMTracePointDarkWakeExit = 0x32
556 };
557
558 /*****************************************************************************/
559
560 /*
561 Ê* kIOPMLoginWindowSecurityDebugKey - identifies PM debug data specific to LoginWindow
562 * for use with IOPMrootDomain.
563 Ê*/
564 #define kIOPMLoginWindowSecurityDebugKey "LoginWindowSecurity"
565
566 // For PM internal use only - key to locate sleep failure results within SCDynamicStore.
567 #define kIOPMDynamicStoreSleepFailureKey "SleepFailure"
568
569 /*****************************************************************************/
570
571 // For IOPMLibPrivate.h
572 #define kIOPMSleepWakeFailureKey "PMFailurePhase"
573 #define kIOPMSleepWakeFailureCodeKey "PMStatusCode"
574 #define kIOPMSleepWakeFailureLoginKey "LWFailurePhase"
575 #define kIOPMSleepWakeFailureUUIDKey "UUID"
576 #define kIOPMSleepWakeFailureDateKey "Date"
577
578 /******************************************************************************/
579 /* System sleep policy
580 * Shared between PM root domain and platform driver.
581 */
582
583 // Platform specific property added by the platform driver.
584 // An OSData that describes the system sleep policy.
585 #define kIOPlatformSystemSleepPolicyKey "IOPlatformSystemSleepPolicy"
586
587 // Root domain property updated before platform sleep.
588 // An OSData that describes the system sleep parameters.
589 #define kIOPMSystemSleepParametersKey "IOPMSystemSleepParameters"
590
591 struct IOPMSystemSleepParameters
592 {
593 uint32_t version;
594 uint32_t sleepFlags;
595 uint32_t sleepTimer;
596 uint32_t wakeEvents;
597 };
598
599 // Sleep flags
600 enum {
601 kIOPMSleepFlagHibernate = 0x00000001,
602 kIOPMSleepFlagSleepTimerEnable = 0x00000002
603 };
604
605 #endif /* ! _IOKIT_IOPMPRIVATE_H */