IOReturn GPUSensors::delayedStartEvent() { HWSensorsDebugLog("delayed start..."); onAcceleratorFound(pciDevice); releaseTimerEventSource(timerEventSource); return kIOReturnSuccess; }
IOReturn GPUSensors::probeEvent() { HWSensorsDebugLog("Probe event..."); if (acceleratorLoadedCheck()) { releaseTimerEventSource; onAcceleratorFound(pciDevice); } else if (probeCounter++ == (1000.0f / (float)kGPUSensorsAcceleratorWaitCycle) * 45) { releaseTimerEventSource; onTimeoutExceeded(pciDevice); } else { if (probeCounter > 0 && !(probeCounter % ((int)(1000.0f / (float)kGPUSensorsAcceleratorWaitCycle) * 15))) HWSensorsInfoLog("still waiting for accelerator to start..."); timerEventSource->setTimeoutMS(kGPUSensorsAcceleratorWaitCycle); } return kIOReturnSuccess; }
IOReturn GPUSensors::probeEvent() { HWSensorsDebugLog("Probe event..."); bool acceleratorFound = false; if (OSDictionary *matching = serviceMatching("IOAccelerator")) { if (OSIterator *iterator = getMatchingServices(matching)) { while (IOService *service = (IOService*)iterator->getNextObject()) { if (pciDevice == service->getParentEntry(gIOServicePlane)) { acceleratorFound = true; break; } } OSSafeRelease(iterator); } OSSafeRelease(matching); } if (acceleratorFound) { releaseTimerEventSource; onAcceleratorFound(pciDevice); } else if (probeCounter++ == 45) { releaseTimerEventSource; onTimeoutExceeded(pciDevice); } else { if (probeCounter > 0 && !(probeCounter % 15)) HWSensorsInfoLog("still waiting for IOAccelerator to start..."); timerEventSource->setTimeoutMS(1000); } return kIOReturnSuccess; }