Lines Matching refs:context
281 IOPMInterestContext *context);
285 IOPMInterestContext *context,
2958 void * context, in applyToPowerChildren() argument
2975 (*applier)(child, context); in applyToPowerChildren()
2988 void * context, in applyToPowerParent() argument
3006 (*applier)(parent, context); in applyToPowerParent()
4820 IOPMRequestDomainPowerContext * context; in requestDomainPowerApplier() local
4831 context = (IOPMRequestDomainPowerContext *) inContext; in requestDomainPowerApplier()
4835 context->requestPowerFlags, in requestDomainPowerApplier()
4858 IOPMRequestDomainPowerContext context; in requestDomainPower() local
4884 context.child = this; in requestDomainPower()
4885 context.requestPowerFlags = requestPowerFlags; in requestDomainPower()
4887 applyToParents(requestDomainPowerApplier, &context, gIOPowerPlane); in requestDomainPower()
6066 IOPMInterestContext * context = (IOPMInterestContext *) arg; in logAppTimeouts() local
6077 clientIndex = context->notifyClients->getNextIndexOfObject(object, 0); in logAppTimeouts()
6080 (flag = context->responseArray->getObject(clientIndex)) && in logAppTimeouts()
6082 OSNumber *clientID = copyClientIDForNotification(object, context); in logAppTimeouts()
6104 IOPMInterestContext * context = (IOPMInterestContext *) arg; in logClientTimeouts() local
6109 …isPriorityClient = (context->notifyType == kNotifyPriority) || (context->notifyType == kNotifyCapa… in logClientTimeouts()
6113 …while ((clientIndex = context->notifyClients->getNextIndexOfObject(object, startIndex)) != (unsign… in logClientTimeouts()
6115 …bool timeout = (flag = context->responseArray->getObject(clientIndex)) && (flag != kOSBooleanTrue); in logClientTimeouts()
6117 if (context->us == IOService::getPMRootDomain()) { in logClientTimeouts()
6139 isPriorityClient ? "priority " : "", context->us->getName(), id); in logClientTimeouts()
6152 IOPMInterestContext context; in cleanClientResponses() local
6154 context.responseArray = fResponseArray; in cleanClientResponses()
6155 context.notifyClients = fNotifyClientArray; in cleanClientResponses()
6156 context.serialNumber = fSerialNumber; in cleanClientResponses()
6157 context.messageType = kIOMessageCopyClientID; in cleanClientResponses()
6158 context.notifyType = fOutOfBandParameter; in cleanClientResponses()
6159 context.isPreChange = fIsPreChange; in cleanClientResponses()
6160 context.enableTracing = false; in cleanClientResponses()
6161 context.us = this; in cleanClientResponses()
6162 context.maxTimeRequested = 0; in cleanClientResponses()
6163 context.stateNumber = fHeadNotePowerState; in cleanClientResponses()
6164 context.stateFlags = fHeadNotePowerArrayEntry->capabilityFlags; in cleanClientResponses()
6165 context.changeFlags = fHeadNoteChangeFlags; in cleanClientResponses()
6170 applyToInterested(gIOGeneralInterest, logClientTimeouts, (void *) &context); in cleanClientResponses()
6173 applyToInterested(gIOAppPowerStateInterest, logAppTimeouts, (void *) &context); in cleanClientResponses()
6178 applyToInterested(gIOPriorityPowerStateInterest, logClientTimeouts, (void *) &context); in cleanClientResponses()
6211 IOPMInterestContext context; in tellClientsWithResponse() local
6232 context.responseArray = fResponseArray; in tellClientsWithResponse()
6233 context.notifyClients = NULL; in tellClientsWithResponse()
6234 context.serialNumber = fSerialNumber; in tellClientsWithResponse()
6235 context.messageType = messageType; in tellClientsWithResponse()
6236 context.notifyType = fOutOfBandParameter; in tellClientsWithResponse()
6237 context.skippedInDark = 0; in tellClientsWithResponse()
6238 context.notSkippedInDark = 0; in tellClientsWithResponse()
6239 context.isPreChange = fIsPreChange; in tellClientsWithResponse()
6240 context.enableTracing = false; in tellClientsWithResponse()
6241 context.us = this; in tellClientsWithResponse()
6242 context.maxTimeRequested = 0; in tellClientsWithResponse()
6243 context.stateNumber = fHeadNotePowerState; in tellClientsWithResponse()
6244 context.stateFlags = fHeadNotePowerArrayEntry->capabilityFlags; in tellClientsWithResponse()
6245 context.changeFlags = fHeadNoteChangeFlags; in tellClientsWithResponse()
6246 context.messageFilter = (isRootDomain) ? in tellClientsWithResponse()
6255 pmTellAppWithResponse, (void *) &context ); in tellClientsWithResponse()
6260 (context.messageType != kIOPMMessageLastCallBeforeSleep)) { in tellClientsWithResponse()
6263 context.notifyType = kNotifyCapabilityChangeApps; in tellClientsWithResponse()
6264 context.messageType = kIOMessageSystemCapabilityChange; in tellClientsWithResponse()
6266 pmTellCapabilityAppWithResponse, (void *) &context ); in tellClientsWithResponse()
6267 context.notifyType = fOutOfBandParameter; in tellClientsWithResponse()
6268 context.messageType = messageType; in tellClientsWithResponse()
6270 if (context.messageType == kIOMessageCanSystemSleep) { in tellClientsWithResponse()
6276 if (context.messageType == kIOMessageSystemWillSleep) { in tellClientsWithResponse()
6282 context.maxTimeRequested = maxTimeOut; in tellClientsWithResponse()
6283 context.enableTracing = isRootDomain; in tellClientsWithResponse()
6285 pmTellClientWithResponse, (void *) &context ); in tellClientsWithResponse()
6290 context.enableTracing = isRootDomain; in tellClientsWithResponse()
6292 pmTellClientWithResponse, (void *) &context ); in tellClientsWithResponse()
6296 context.notifyType = kNotifyCapabilityChangePriority; in tellClientsWithResponse()
6297 context.messageType = kIOMessageSystemCapabilityChange; in tellClientsWithResponse()
6299 pmTellCapabilityClientWithResponse, (void *) &context ); in tellClientsWithResponse()
6304 context.enableTracing = isRootDomain; in tellClientsWithResponse()
6306 pmTellCapabilityAppWithResponse, (void *) &context ); in tellClientsWithResponse()
6307 if (context.messageType == kIOMessageCanSystemSleep) { in tellClientsWithResponse()
6313 context.maxTimeRequested = maxTimeOut; in tellClientsWithResponse()
6317 context.enableTracing = isRootDomain; in tellClientsWithResponse()
6319 pmTellCapabilityClientWithResponse, (void *) &context ); in tellClientsWithResponse()
6322 fNotifyClientArray = context.notifyClients; in tellClientsWithResponse()
6324 if (context.skippedInDark) { in tellClientsWithResponse()
6327 context.skippedInDark, context.skippedInDark + context.notSkippedInDark); in tellClientsWithResponse()
6332 OUR_PMLog(kPMLogStartAckTimer, context.maxTimeRequested, 0); in tellClientsWithResponse()
6333 if (context.enableTracing) { in tellClientsWithResponse()
6334 getPMRootDomain()->traceDetail(context.messageType, 0, context.maxTimeRequested / 1000); in tellClientsWithResponse()
6335 getPMRootDomain()->reset_watchdog_timer(this, context.maxTimeRequested / USEC_PER_SEC + 1); in tellClientsWithResponse()
6337 start_ack_timer( context.maxTimeRequested / 1000, kMillisecondScale ); in tellClientsWithResponse()
6365 IOPMInterestContext * context = (IOPMInterestContext *) arg; in pmTellAppWithResponse() local
6366 IOServicePM * pwrMgt = context->us->pwrMgt; in pmTellAppWithResponse()
6380 if (context->us == getPMRootDomain()) { in pmTellAppWithResponse()
6381 if ((clientID = copyClientIDForNotification(object, context))) { in pmTellAppWithResponse()
6389 logClientIDForNotification(object, context, "PMTellAppWithResponse - Suspended"); in pmTellAppWithResponse()
6392 context->skippedInDark++; in pmTellAppWithResponse()
6402 if (context->messageFilter && in pmTellAppWithResponse()
6403 !context->messageFilter(context->us, object, context, NULL, &waitForReply)) { in pmTellAppWithResponse()
6405 logClientIDForNotification(object, context, "DROP App"); in pmTellAppWithResponse()
6409 context->notSkippedInDark++; in pmTellAppWithResponse()
6413 if (NULL == context->notifyClients) { in pmTellAppWithResponse()
6414 context->notifyClients = OSArray::withCapacity( 32 ); in pmTellAppWithResponse()
6417 msgType = context->messageType; in pmTellAppWithResponse()
6418 msgIndex = context->responseArray->getCount(); in pmTellAppWithResponse()
6419 msgRef = ((context->serialNumber & 0xFFFF) << 16) + (msgIndex & 0xFFFF); in pmTellAppWithResponse()
6423 logClientIDForNotification(object, context, "MESG App"); in pmTellAppWithResponse()
6431 context->responseArray->setObject(msgIndex, num); in pmTellAppWithResponse()
6434 context->responseArray->setObject(msgIndex, kOSBooleanFalse); in pmTellAppWithResponse()
6437 context->responseArray->setObject(msgIndex, kOSBooleanTrue); in pmTellAppWithResponse()
6439 logClientIDForNotification(object, context, "App response ignored"); in pmTellAppWithResponse()
6443 if (context->notifyClients) { in pmTellAppWithResponse()
6444 context->notifyClients->setObject(msgIndex, object); in pmTellAppWithResponse()
6447 context->us->messageClient(msgType, object, (void *)(uintptr_t) msgRef); in pmTellAppWithResponse()
6461 IOPMInterestContext * context = (IOPMInterestContext *) arg; in pmTellClientWithResponse() local
6470 if (context->messageFilter && in pmTellClientWithResponse()
6471 !context->messageFilter(context->us, object, context, NULL, NULL)) { in pmTellClientWithResponse()
6481 msgType = context->messageType; in pmTellClientWithResponse()
6482 msgIndex = context->responseArray->getCount(); in pmTellClientWithResponse()
6483 msgRef = ((context->serialNumber & 0xFFFF) << 16) + (msgIndex & 0xFFFF); in pmTellClientWithResponse()
6484 enableTracing = context->enableTracing && (notifier != NULL); in pmTellClientWithResponse()
6486 IOServicePM * pwrMgt = context->us->pwrMgt; in pmTellClientWithResponse()
6497 if (NULL == context->notifyClients) { in pmTellClientWithResponse()
6498 context->notifyClients = OSArray::withCapacity(32); in pmTellClientWithResponse()
6499 assert(context->notifyClients != NULL); in pmTellClientWithResponse()
6504 notify.stateNumber = context->stateNumber; in pmTellClientWithResponse()
6505 notify.stateFlags = context->stateFlags; in pmTellClientWithResponse()
6512 retCode = context->us->messageClient(msgType, object, (void *) ¬ify, sizeof(notify)); in pmTellClientWithResponse()
6522 context->responseArray->setObject(msgIndex, replied); in pmTellClientWithResponse()
6526 if (notify.returnValue > context->maxTimeRequested) { in pmTellClientWithResponse()
6528 context->maxTimeRequested = ackTimeRequested = kPriorityClientMaxWait; in pmTellClientWithResponse()
6530 context->us->getName(), in pmTellClientWithResponse()
6535 context->maxTimeRequested = (typeof(context->maxTimeRequested))notify.returnValue; in pmTellClientWithResponse()
6545 context->responseArray->setObject(msgIndex, ackState); in pmTellClientWithResponse()
6548 context->responseArray->setObject(msgIndex, replied); in pmTellClientWithResponse()
6564 context->responseArray->setObject(msgIndex, replied); in pmTellClientWithResponse()
6566 if (context->notifyClients) { in pmTellClientWithResponse()
6567 context->notifyClients->setObject(msgIndex, object); in pmTellClientWithResponse()
6579 IOPMInterestContext * context = (IOPMInterestContext *) arg; in pmTellCapabilityAppWithResponse() local
6581 IOServicePM * pwrMgt = context->us->pwrMgt; in pmTellCapabilityAppWithResponse()
6592 if (context->messageFilter && in pmTellCapabilityAppWithResponse()
6593 !context->messageFilter(context->us, object, context, &msgArg, &waitForReply)) { in pmTellCapabilityAppWithResponse()
6597 if (context->us == getPMRootDomain() && in pmTellCapabilityAppWithResponse()
6603 if ((clientID = copyClientIDForNotification(object, context))) { in pmTellCapabilityAppWithResponse()
6610 logClientIDForNotification(object, context, "PMTellCapablityAppWithResponse - Suspended"); in pmTellCapabilityAppWithResponse()
6613 context->skippedInDark++; in pmTellCapabilityAppWithResponse()
6622 context->notSkippedInDark++; in pmTellCapabilityAppWithResponse()
6626 if (NULL == context->notifyClients) { in pmTellCapabilityAppWithResponse()
6627 context->notifyClients = OSArray::withCapacity(32); in pmTellCapabilityAppWithResponse()
6628 assert(context->notifyClients != NULL); in pmTellCapabilityAppWithResponse()
6631 msgType = context->messageType; in pmTellCapabilityAppWithResponse()
6632 msgIndex = context->responseArray->getCount(); in pmTellCapabilityAppWithResponse()
6633 msgRef = ((context->serialNumber & 0xFFFF) << 16) + (msgIndex & 0xFFFF); in pmTellCapabilityAppWithResponse()
6640 context->us->messageClient(kIOMessageCopyClientID, object, &clientID); in pmTellCapabilityAppWithResponse()
6646 context->us->getName(), in pmTellCapabilityAppWithResponse()
6663 context->responseArray->setObject(msgIndex, kOSBooleanTrue); in pmTellCapabilityAppWithResponse()
6664 if (context->notifyClients) { in pmTellCapabilityAppWithResponse()
6665 context->notifyClients->setObject(msgIndex, kOSBooleanTrue); in pmTellCapabilityAppWithResponse()
6672 context->responseArray->setObject(msgIndex, num); in pmTellCapabilityAppWithResponse()
6675 context->responseArray->setObject(msgIndex, kOSBooleanFalse); in pmTellCapabilityAppWithResponse()
6678 if (context->notifyClients) { in pmTellCapabilityAppWithResponse()
6679 context->notifyClients->setObject(msgIndex, object); in pmTellCapabilityAppWithResponse()
6683 context->us->messageClient(msgType, object, (void *) &msgArg, sizeof(msgArg)); in pmTellCapabilityAppWithResponse()
6695 IOPMInterestContext * context = (IOPMInterestContext *) arg; in pmTellCapabilityClientWithResponse() local
6705 if (context->messageFilter && in pmTellCapabilityClientWithResponse()
6706 !context->messageFilter(context->us, object, context, &msgArg, NULL)) { in pmTellCapabilityClientWithResponse()
6711 if (NULL == context->notifyClients) { in pmTellCapabilityClientWithResponse()
6712 context->notifyClients = OSArray::withCapacity(32); in pmTellCapabilityClientWithResponse()
6713 assert(context->notifyClients != NULL); in pmTellCapabilityClientWithResponse()
6717 msgType = context->messageType; in pmTellCapabilityClientWithResponse()
6718 msgIndex = context->responseArray->getCount(); in pmTellCapabilityClientWithResponse()
6719 msgRef = ((context->serialNumber & 0xFFFF) << 16) + (msgIndex & 0xFFFF); in pmTellCapabilityClientWithResponse()
6720 enableTracing = context->enableTracing && (notifier != NULL); in pmTellCapabilityClientWithResponse()
6722 IOServicePM * pwrMgt = context->us->pwrMgt; in pmTellCapabilityClientWithResponse()
6741 retCode = context->us->messageClient(msgType, object, (void *) &msgArg, sizeof(msgArg)); in pmTellCapabilityClientWithResponse()
6752 context->responseArray->setObject(msgIndex, replied); in pmTellCapabilityClientWithResponse()
6756 if (msgArg.maxWaitForReply > context->maxTimeRequested) { in pmTellCapabilityClientWithResponse()
6758 context->maxTimeRequested = ackTimeRequested = kCapabilityClientMaxWait; in pmTellCapabilityClientWithResponse()
6760 context->us->getName(), in pmTellCapabilityClientWithResponse()
6765 context->maxTimeRequested = msgArg.maxWaitForReply; in pmTellCapabilityClientWithResponse()
6775 context->responseArray->setObject(msgIndex, ackState); in pmTellCapabilityClientWithResponse()
6778 context->responseArray->setObject(msgIndex, replied); in pmTellCapabilityClientWithResponse()
6794 context->responseArray->setObject(msgIndex, replied); in pmTellCapabilityClientWithResponse()
6796 if (context->notifyClients) { in pmTellCapabilityClientWithResponse()
6797 context->notifyClients->setObject(msgIndex, object); in pmTellCapabilityClientWithResponse()
6841 IOPMInterestContext context; in tellClients() local
6845 memset(&context, 0, sizeof(context)); in tellClients()
6846 context.messageType = messageType; in tellClients()
6847 context.isPreChange = fIsPreChange; in tellClients()
6848 context.us = this; in tellClients()
6849 context.stateNumber = fHeadNotePowerState; in tellClients()
6850 context.stateFlags = fHeadNotePowerArrayEntry->capabilityFlags; in tellClients()
6851 context.changeFlags = fHeadNoteChangeFlags; in tellClients()
6852 context.enableTracing = IS_ROOT_DOMAIN; in tellClients()
6853 context.messageFilter = (IS_ROOT_DOMAIN) ? in tellClients()
6859 context.notifyType = kNotifyPriority; in tellClients()
6861 tellKernelClientApplier, (void *) &context ); in tellClients()
6863 context.notifyType = kNotifyApps; in tellClients()
6865 tellAppClientApplier, (void *) &context ); in tellClients()
6868 tellKernelClientApplier, (void *) &context ); in tellClients()
6881 IOPMInterestContext * context = (IOPMInterestContext *) arg; in tellKernelClientApplier() local
6882 bool enableTracing = context->enableTracing; in tellKernelClientApplier()
6884 if (context->messageFilter && in tellKernelClientApplier()
6885 !context->messageFilter(context->us, object, context, NULL, NULL)) { in tellKernelClientApplier()
6892 notify.stateNumber = context->stateNumber; in tellKernelClientApplier()
6893 notify.stateFlags = context->stateFlags; in tellKernelClientApplier()
6899 context->us->messageClient(context->messageType, object, ¬ify, sizeof(notify)); in tellKernelClientApplier()
6909 IOPMInterestContext *context) in copyClientIDForNotification() argument
6912 context->us->messageClient(kIOMessageCopyClientID, object, &clientID); in copyClientIDForNotification()
6919 IOPMInterestContext *context, in logClientIDForNotification() argument
6923 OSNumber *clientID = copyClientIDForNotification(object, context); in logClientIDForNotification()
6931 context->us->getName(), logString, in logClientIDForNotification()
6932 IOService::getIOMessageString(context->messageType), in logClientIDForNotification()
6950 IOPMInterestContext * context = (IOPMInterestContext *) arg; in tellAppClientApplier() local
6955 if (context->us == IOService::getPMRootDomain()) { in tellAppClientApplier()
6956 if ((clientID = copyClientIDForNotification(object, context))) { in tellAppClientApplier()
6964 logClientIDForNotification(object, context, "tellAppClientApplier - Suspended"); in tellAppClientApplier()
6967 context->skippedInDark++; in tellAppClientApplier()
6977 if (context->messageFilter && in tellAppClientApplier()
6978 !context->messageFilter(context->us, object, context, NULL, NULL)) { in tellAppClientApplier()
6980 logClientIDForNotification(object, context, "DROP App"); in tellAppClientApplier()
6984 context->notSkippedInDark++; in tellAppClientApplier()
6987 logClientIDForNotification(object, context, "MESG App"); in tellAppClientApplier()
6990 context->us->messageClient(context->messageType, object, NULL); in tellAppClientApplier()