/*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
class RootDomainUserClient;
class PMAssertionsTracker;
-#define OBFUSCATE(x) \
- (((((uintptr_t)(x)) >= VM_MIN_KERNEL_AND_KEXT_ADDRESS) && (((uintptr_t)(x)) < VM_MAX_KERNEL_ADDRESS)) ? \
- ((void *)(VM_KERNEL_ADDRPERM(x))) : (void *)(x))
+#define OBFUSCATE(x) (void *)VM_KERNEL_UNSLIDE_OR_PERM(x)
#endif
@discussion systemPowerEventOccurred is a richer alternative to receivePowerNotification()
Only Apple-owned kexts should have reason to call systemPowerEventOccurred.
@param event An OSSymbol describing the type of power event.
- @param value A 32-bit integer value associated with the event.
- @param shouldUpdate indicates whether the root domain should send a notification
- to interested parties. Pass false if you're calling systemPowerEventOccurred
- several times in succession; and pass true only on the last invocatino.
+ @param intValue A 32-bit integer value associated with the event.
@result kIOReturnSuccess on success */
IOReturn systemPowerEventOccurred(
/*! @function createPMAssertion
@abstract Creates an assertion to influence system power behavior.
- @param whichAssertionBits A bitfield specify the assertion that the caller requests.
+ @param whichAssertionsBits A bitfield specify the assertion that the caller requests.
@param assertionLevel An integer detailing the initial assertion level, kIOPMDriverAssertionLevelOn
or kIOPMDriverAssertionLevelOff.
@param ownerService A pointer to the caller's IOService class, for tracking.
IOReturn setMaintenanceWakeCalendar(
const IOPMCalendarStruct * calendar );
- IOReturn getSystemSleepType( uint32_t * sleepType );
+ IOReturn getSystemSleepType(uint32_t * sleepType, uint32_t * standbyTimer);
// Handle callbacks from IOService::systemWillShutdown()
void acknowledgeSystemWillShutdown( IOService * from );
IOReturn joinAggressiveness( IOService * service );
void handleAggressivesRequests( void );
- void tracePoint( uint8_t point );
- void tracePoint( uint8_t point, uint8_t data );
- void traceDetail( uint32_t data32 );
+ void kdebugTrace(uint32_t event, uint64_t regId,
+ uintptr_t param1, uintptr_t param2, uintptr_t param3 = 0);
+ void tracePoint(uint8_t point);
+ void traceDetail(uint32_t msgType, uint32_t msgIndex, uint32_t delay);
+ void traceDetail(OSObject *notifier);
+ void traceAckDelay(OSObject *notifier, uint32_t response, uint32_t delay_ms);
+
+ void startSpinDump(uint32_t spindumpKind);
bool systemMessageFilter(
void * object, void * arg1, void * arg2, void * arg3 );
const char *name,
int messageType,
uint32_t delay_ms,
- int app_pid,
+ uint64_t id,
OSObject *object,
IOPMPowerStateIndex ps=0);
uint32_t * hibernateMode,
uint32_t * hibernateFreeRatio,
uint32_t * hibernateFreeTime );
+ bool mustHibernate( void );
#endif
void takeStackshot(bool restart, bool isOSXWatchdog, bool isSpinDump);
void sleepWakeDebugTrig(bool restart);
bool sleepWakeDebugIsWdogEnabled();
static void saveTimeoutAppStackShot(void *p0, void *p1);
void sleepWakeDebugSaveSpinDumpFile();
+ void swdDebugSetup();
+ void swdDebugTeardown();
private:
friend class PMSettingObject;
bool uuidPublished;
// Pref: idle time before idle sleep
+ bool idleSleepEnabled;
unsigned long sleepSlider;
unsigned long idleSeconds;
uint64_t autoWakeStart;
thread_call_t extraSleepTimer;
thread_call_t diskSyncCalloutEntry;
thread_call_t fullWakeThreadCall;
- thread_call_t hibDebugSetupEntry;
+ thread_call_t swdDebugSetupEntry;
+ thread_call_t swdDebugTearDownEntry;
thread_call_t updateConsoleUsersEntry;
// Track system capabilities.
uint32_t lastSleepReason;
uint32_t fullToDarkReason;
uint32_t hibernateAborted;
+ uint8_t standbyNixed;
+ uint8_t resetTimers;
enum FullWakeReason {
kFullWakeReasonNone = 0,
OSData * aggressivesData;
AbsoluteTime userBecameInactiveTime;
- AbsoluteTime systemWakeTime;
// PCI top-level PM trace
IOService * pciHostBridgeDevice;
#endif
volatile uint32_t swd_lock; /* Lock to access swd_buffer & and its header */
void * swd_buffer; /* Memory allocated for dumping sleep/wake logs */
- uint8_t swd_flags; /* Flags defined in IOPMPrivate.h */
+ uint32_t swd_flags; /* Flags defined in IOPMPrivate.h */
+ uint8_t swd_DebugImageSetup;
void * swd_spindump_buffer;
+ IOBufferMemoryDescriptor *swd_memDesc;
+
IOMemoryMap * swd_logBufMap; /* Memory with sleep/wake logs from previous boot */
// Wake Event Reporting
void deregisterPMSettingObject( PMSettingObject * pmso );
- void checkForValidDebugData(const char *fname, vfs_context_t *ctx,
+ uint32_t checkForValidDebugData(const char *fname, vfs_context_t *ctx,
void *tmpBuf, struct vnode **vp);
void sleepWakeDebugMemAlloc( );
void sleepWakeDebugSpinDumpMemAlloc( );