Loading...
--- xnu/xnu-2422.100.13/iokit/Kernel/RootDomainUserClient.cpp
+++ xnu/xnu-1699.32.7/iokit/Kernel/RootDomainUserClient.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2012 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@@ -36,8 +36,6 @@
#include <IOKit/IOBufferMemoryDescriptor.h>
#include "RootDomainUserClient.h"
#include <IOKit/pwr_mgt/IOPMLibDefs.h>
-#include <IOKit/pwr_mgt/IOPMPrivate.h>
-#include <sys/proc.h>
#define super IOUserClient
@@ -80,7 +78,7 @@
IOReturn RootDomainUserClient::secureSleepSystemOptions(
const void *inOptions,
- IOByteCount inOptionsSize,
+ IOByteCount inOptionsSize __unused,
uint32_t *returnCode)
{
@@ -100,7 +98,7 @@
if (inOptions)
{
unserializedOptions = OSDynamicCast( OSDictionary,
- OSUnserializeXML((const char *)inOptions, inOptionsSize, &unserializeErrorString));
+ OSUnserializeXML((const char *)inOptions, &unserializeErrorString));
if (!unserializedOptions) {
IOLog("IOPMRootDomain SleepSystem unserialization failure: %s\n",
@@ -108,14 +106,9 @@
}
}
- if ( (local_priv || admin_priv) && fOwner )
+ if ( (local_priv || admin_priv)
+ && fOwner )
{
- proc_t p;
- p = (proc_t)get_bsdtask_info(fOwningTask);
- if (p) {
- fOwner->setProperty("SleepRequestedByPID", proc_pid(p), 32);
- }
-
if (unserializedOptions)
{
// Publish Sleep Options in registry under root_domain
@@ -195,23 +188,6 @@
ret = kIOReturnNotPrivileged;
}
return kIOReturnSuccess;
-}
-
-IOReturn RootDomainUserClient::secureGetSystemSleepType(
- uint32_t *outSleepType)
-{
- int admin_priv = 0;
- IOReturn ret;
-
- ret = clientHasPrivilege(fOwningTask, kIOClientPrivilegeAdministrator);
- admin_priv = (kIOReturnSuccess == ret);
-
- if (admin_priv && fOwner) {
- ret = fOwner->getSystemSleepType(outSleepType);
- } else {
- ret = kIOReturnNotPrivileged;
- }
- return ret;
}
IOReturn RootDomainUserClient::clientClose( void )
@@ -334,48 +310,10 @@
break;
case kPMActivityTickle:
- if ( fOwner->checkSystemCanSustainFullWake() )
- {
- fOwner->reportUserInput( );
- fOwner->setProperty(kIOPMRootDomainWakeTypeKey, "UserActivity Assertion");
- }
+ fOwner->reportUserInput( );
ret = kIOReturnSuccess;
break;
-
- case kPMSetClamshellSleepState:
- fOwner->setDisableClamShellSleep(arguments->scalarInput[0] ? true : false);
- ret = kIOReturnSuccess;
- break;
-
- case kPMGetSystemSleepType:
- if (1 == arguments->scalarOutputCount)
- {
- ret = this->secureGetSystemSleepType(
- (uint32_t *) &arguments->scalarOutput[0]);
- }
- break;
-
- case kPMSleepWakeWatchdogEnable:
- ret = clientHasPrivilege(fOwningTask, kIOClientPrivilegeAdministrator);
- if (ret == kIOReturnSuccess)
- fOwner->sleepWakeDebugEnableWdog();
- break;
-
-
- case kPMSleepWakeDebugTrig:
- ret = clientHasPrivilege(fOwningTask, kIOClientPrivilegeAdministrator);
- if (ret == kIOReturnSuccess)
- fOwner->sleepWakeDebugTrig(false);
- break;
-
- case kPMSetDisplayPowerOn:
- if (1 == arguments->scalarInputCount)
- {
- ret = clientHasPrivilege(fOwningTask, kIOClientPrivilegeAdministrator);
- if (ret == kIOReturnSuccess)
- fOwner->setDisplayPowerOn((uint32_t)arguments->scalarInput[0]);
- }
- break;
+
/*
case kPMMethodCopySystemTimeline:
// intentional fallthrough