PalmService registerPalmService(const char *name) { Handle public_handle = registerService(name, true); Handle private_handle = registerService(name, false); return PalmService(std::move(private_handle), std::move(public_handle)); }
bool BatteryTracker::start(IOService* provider) { DEBUG_LOG("BatteryTracker::start: entering start\n"); if (!IOService::start(provider)) { IOLog("BatteryTracker: IOService::start failed!\n"); return false; } IOWorkLoop* workLoop = getWorkLoop(); if (!workLoop) { IOLog("BatteryTracker: getWorkLoop failed\n"); return false; } m_pCmdGate = IOCommandGate::commandGate(this); if (!m_pCmdGate) { IOLog("BatteryTracker: IOCommandGate::commmandGate failed\n"); return false; } workLoop->addEventSource(m_pCmdGate); DEBUG_LOG("ACPIBatteryManager: Version 1.52 starting BatteryTracker.\n"); m_pBatteryList = OSArray::withCapacity(2); m_pLock = IORecursiveLockAlloc(); registerService(); return true; }
bool FakeSMC::start(IOService *provider) { if (!super::start(provider)) return false; OSString *vendor = OSDynamicCast(OSString, getProperty(kFakeSMCFirmwareVendor)); int arg_value = 1; if (PE_parse_boot_argn("-fakesmc-force-start", &arg_value, sizeof(arg_value))) { HWSensorsInfoLog("firmware vendor check disabled"); } else if (vendor && vendor->isEqualTo("Apple")) { HWSensorsFatalLog("forbidding start on Apple hardware"); return false; } if (!smcDevice->initAndStart(provider, this)) { HWSensorsInfoLog("failed to initialize SMC device"); return false; } registerService(); // Load keys from NVRAM if (PE_parse_boot_argn("-fakesmc-use-nvram", &arg_value, sizeof(arg_value))) { if (UInt32 count = smcDevice->loadKeysFromNVRAM()) HWSensorsInfoLog("%d key%s loaded from NVRAM", count, count == 1 ? "" : "s"); else HWSensorsInfoLog("NVRAM will be used to store system written keys..."); } return true; }
bool IOI2CLM6x::start ( IOService* provider ) { IOReturn status; fRegistersAreSaved = false; sGetSensorValueSym = OSSymbol::withCString( "getSensorValue" ); // Start I2CDriver first... if ( !( super::start( provider ) ) ) return( false ); nrequire( fInitHWFailed, IOI2CLM6x_start_fInitHWFailedErr ); // Create child nubs. require_success( ( status = createChildNubs( fProvider ) ), IOI2CLM6x_start_createChildNubsErr ); // Register so others can find us with a waitForService(). registerService(); return( true ); IOI2CLM6x_start_createChildNubsErr: IOI2CLM6x_start_fInitHWFailedErr: freeI2CResources(); return( false ); }
Preferences::Preferences() : m_currentTimeFormat("HH12") , m_showAlertsWhenLocked(true) , m_ledThrobberEnabled(true) , m_playFeedbackSounds(true) , m_sysUiNoHomeButtonMode(true) , m_sysUiEnableNextPrevGestures(false) , m_lockTimeout(0) , m_lsHandle(0) , m_imeEnabled(false) , m_pinyinEnabled(false) , m_pinyinPassthrough(false) , m_hwrEnabled(false) , m_roamingIndicator("") , m_hideWANAlert(false) , m_dualRSSI(false) , m_airplaneMode(false) , m_wifiOn(false) , m_bluetoothOn(false) , m_show3GForEvdo(false) , m_enableVoiceDial(false) , m_rotationLock(OrientationEvent::Orientation_Invalid) , m_muteOn(false) , m_enableALS(true) { init(); registerService(); }
bool SuperIODevice::start(IOService *provider) { if (!super::start(provider)) return false; // Gigabyte mobos usualy use ITE if (OSDictionary *matching = serviceMatching(kFakeSMCService)) { if (IOService *headingProvider = waitForMatchingService(matching, kFakeSMCDefaultWaitTimeout)) { if (OSString *manufacturer = OSDynamicCast(OSString, headingProvider->getProperty(kOEMInfoManufacturer))) { if (manufacturer->isEqualTo("Gigabyte")) { if (!detectITEFamilyChip()) { UInt16 ite_id = id; if (!detectWinbondFamilyChip()) { HWSensorsFatalLog("found unsupported chip! ITE sequence ID=0x%x, Winbond sequence ID=0x%x", ite_id, id); return false; } } } } } OSSafeRelease(matching); } // Other vendors usualy use Winbond family chipsets if (model == 0) { if (!detectWinbondFamilyChip()) { UInt16 wnbnd_id = id; if (!detectITEFamilyChip()) { HWSensorsFatalLog("found unsupported chip! ITE sequence ID=0x%x, Winbond sequence ID=0x%x", id, wnbnd_id); return false; } } } HWSensorsInfoLog("found %s %s on port=0x%x address=0x%x", vendor, superio_get_model_name(model), port, address); char string[128]; snprintf(string, sizeof(string), "%s,%s", vendor, superio_get_model_name(model)); setName(string); //setProperty("name", &string, (UInt32)strlen(string) + 1); setProperty(kSuperIOHWMAddress, address, 16); setProperty(kSuperIOControlPort, port, 8); setProperty(kSuperIOModelValue, model, 16); setProperty(kSuperIOModelName, superio_get_model_name(model)); setProperty(kSuperIOVendorName, vendor); setProperty(kSuperIODeviceID, OSData::withBytes(&id, sizeof(id))); registerService(); return true; }
void QQmlConfigurableDebugService::init() { Q_D(QQmlConfigurableDebugService); QMutexLocker lock(&d->configMutex); // If we're not enabled or not blocking, don't wait for configuration d->waitingForConfiguration = (registerService() == Enabled && blockingMode()); }
bool IOFireWireAVCLocalNode::start(IOService *provider) { //IOLog( "IOFireWireAVCLocalNode::start\n"); fDevice = OSDynamicCast(IOFireWireNub, provider); if(!fDevice) return false; if (!IOService::start(provider)) return false; fPCRSpace = IOFireWirePCRSpace::getPCRAddressSpace(fDevice->getBus()); if(!fPCRSpace) return false; fPCRSpace->activate(); fAVCTargetSpace = IOFireWireAVCTargetSpace::getAVCTargetSpace(fDevice->getController()); if(!fAVCTargetSpace) return false; fAVCTargetSpace->activateWithUserClient((IOFireWireAVCProtocolUserClient*)0xFFFFFFFF); // Enable the communication between the PCR space and the Target space objects fPCRSpace->setAVCTargetSpacePointer(fAVCTargetSpace); registerService(); fStarted = true; return true; }
void Session::loadService(const std::string &moduleName, const std::string& renameModule, const AnyReferenceVector& args) { size_t separatorPos = moduleName.find_last_of("."); std::string package = moduleName.substr(0, separatorPos); std::string factory = moduleName.substr(separatorPos + 1); std::string rename = renameModule; if (rename.empty()) rename = factory; qi::AnyModule p = qi::import(package); AnyReferenceVector fullargs; SessionPtr thisptr = shared_from_this(); fullargs.push_back(AnyReference::from(thisptr)); fullargs.insert(fullargs.end(), args.begin(), args.end()); int id = p.metaObject().findMethod(factory, fullargs); qi::Future<AnyReference> ret; if (id > 0) ret = p.metaCall(factory, fullargs); else ret = p.metaCall(factory, args); qi::AnyValue retval(ret.value(), false, true); registerService(rename, retval.to<qi::AnyObject>()); }
bool registerService (std::shared_ptr<CommonAPI::Runtime> runtime, Provider *provider, std::string address, std::string friendly, MmError *e) { auto factory = runtime->createFactory(); if (!factory) { std::cerr << "Error: Unable to create factory!\n"; return false; } auto servicePublisher = runtime->getServicePublisher(); if (!servicePublisher) { std::cerr << "Error: Unable to load service publisher!\n"; return false; } if (!e) { auto stub = std::make_shared<StubImpl>(provider); const bool success= servicePublisher->registerService(stub, address, factory); if (!success) { std::cerr << "Error: Unable to register " << friendly << " service!\n"; } } else { std::cout << "Error connecting to " << friendly << ": " << e->message << std::endl; return false; } return true; }
bool org_pqrs_driver_Seil::start(IOService* provider) { IOLOG_INFO("start\n"); bool res = super::start(provider); if (!res) { return res; } org_pqrs_Seil::GlobalLock::initialize(); notifier_hookKeyboard_ = addMatchingNotification(gIOMatchedNotification, serviceMatching("IOHIKeyboard"), org_pqrs_driver_Seil::IOHIKeyboard_gIOMatchedNotification_callback, this, nullptr, 0); if (notifier_hookKeyboard_ == nullptr) { IOLOG_ERROR("initialize_notification notifier_hookKeyboard_ == nullptr\n"); return false; } notifier_unhookKeyboard_ = addMatchingNotification(gIOTerminatedNotification, serviceMatching("IOHIKeyboard"), org_pqrs_driver_Seil::IOHIKeyboard_gIOTerminatedNotification_callback, this, nullptr, 0); if (notifier_unhookKeyboard_ == nullptr) { IOLOG_ERROR("initialize_notification notifier_unhookKeyboard_ == nullptr\n"); return false; } // Publish ourselves so clients can find us registerService(); return res; }
//================================================================================================ // // CheckSleepCapability // //================================================================================================ // void AppleUSBUHCI::CheckSleepCapability(void) { if (_device->getProperty("built-in") && (_ERRATA64BITS & kErrataICH6PowerSequencing)) { // The ICH6 UHCI drivers on a Transition system just magically work on sleep/wake // so we will just hard code those. Other systems will have to be evaluated later setProperty("Card Type","Built-in"); _controllerCanSleep = true; } else { // This appears to be necessary setProperty("Card Type","PCI"); _controllerCanSleep = false; } // if we have an ExpressCard attached (non-zero port), then we need to register for some special messages to allow us to override the Resume Enables // for that port (some cards disconnect when the ExpressCard power goes away and we would like to ignore these extra detach events. if ((_ExpressCardPort = ExpressCardPort(_device))) { _device->callPlatformFunction( /* function */ "RegisterDebugDriver", /* waitForFunction */ false, /* provider nubÊ Ê */ _device, /* unused Ê */ (void *) this, /* unused Ê */ (void *) NULL, /* unused Ê */ (void *) NULL ); } _badExpressCardAttached = false; // Call registerService() so that the IOUSBController object is published and clients (like Prober) can find it registerService(); }
bool X3100monitor::start(IOService * provider) { if (!super::start(provider)) return false; //Find card number SInt8 cardIndex = getVacantGPUIndex(); if (cardIndex < 0) { HWSensorsWarningLog("failed to obtain vacant GPU index"); return false; } char key[5]; snprintf(key, 5, KEY_FORMAT_GPU_PROXIMITY_TEMPERATURE, cardIndex); if (!addSensor(key, TYPE_SP78, 2, kFakeSMCTemperatureSensor, 0)) { HWSensorsWarningLog("failed to register temperature sensor"); return false; } registerService(); return true; }
bool TZSensors::start(IOService * provider) { if (!super::start(provider)) return false; acpiDevice = (IOACPIPlatformDevice *)provider; if (!acpiDevice) { HWSensorsFatalLog("ACPI device not ready"); return false; } OSObject *object = NULL; if(kIOReturnSuccess == acpiDevice->evaluateObject("_TMP", &object) && object) { for (UInt8 i = 0; i < 0xf; i++) { char key[5]; snprintf(key, 5, KEY_FORMAT_THERMALZONE_TEMPERATURE, i); if (!isKeyHandled(key)) { if (addSensor(key, TYPE_SP78, TYPE_SPXX_SIZE, kFakeSMCTemperatureSensor, 0)) { break; } } } } registerService(); HWSensorsInfoLog("started on %s", acpiDevice->getName()); return true; }
C3200VolumeService::C3200VolumeService(): QtopiaIpcAdaptor("QPE/AudioVolumeManager/C3200VolumeService") { publishAll(Slots); QTimer::singleShot(0, this, SLOT(registerService())); }
void AlarmTransferClient::registerService(const std::string& id) { m_serviceId = id; if(m_procname.empty()) m_procname = m_serviceId; registerService(); }
bool ServicePublisher::registerService(std::shared_ptr<_Stub> stub, const std::string& participantId, const std::string& serviceName, const std::string& domain, std::shared_ptr<Factory> factory) { std::shared_ptr<StubBase> stubBase = std::dynamic_pointer_cast<StubBase>(stub); return registerService(stubBase, _Stub::StubInterface::getInterfaceId(), participantId, serviceName, domain, factory); }
bool AppleS5L8930XIO::start(IOService* provider) { if(!super::start(provider)) { panic("failed to start super provider"); } S5L_LOG("Publishing entries to IOService tree plane"); publishBelow(provider); registerService(); return true; }
bool WirtualJoy::start(IOService *provider) { if(!super::start(provider)) return false; registerService(); dmsg("started"); return true; }
bool AppleACPIPS2Nub::start(IOService *provider) { if (!super::start(provider)) return false; DEBUG_LOG("AppleACPIPS2Nub::start: provider=%p\n", provider); /* Initialize our interrupt controller/specifier i-vars */ m_interruptControllers = OSArray::withCapacity(2); m_interruptSpecifiers = OSArray::withCapacity(2); if(m_interruptControllers == NULL || m_interruptSpecifiers == NULL) return false; /* Merge in the keyboard (primary) provider interrupt properties */ mergeInterruptProperties(provider, LEGACY_KEYBOARD_IRQ); /* Initialize and register our power management properties */ PMinit(); registerPowerDriver(this, myTwoStates, 2); provider->joinPMtree(this); /* Find the mouse provider */ m_mouseProvider = findMouseDevice(); if(m_mouseProvider != NULL) { DEBUG_LOG("AppleACPIPS2Nub::start: Found mouse PNP device\n"); if(attach(m_mouseProvider)) { mergeInterruptProperties(m_mouseProvider, LEGACY_MOUSE_IRQ); if(m_mouseProvider->inPlane(gIOPowerPlane)) { m_mouseProvider->joinPMtree(this); } } } /* Set our interrupt properties in the IO registry */ if(m_interruptControllers->getCount() != 0 && m_interruptSpecifiers->getCount() != 0) { setProperty(gIOInterruptControllersKey, m_interruptControllers); setProperty(gIOInterruptSpecifiersKey, m_interruptSpecifiers); } /* Release the arrays we allocated. Our properties dictionary has them retained */ m_interruptControllers->release(); m_interruptControllers = NULL; m_interruptSpecifiers->release(); m_interruptSpecifiers = NULL; /* Make ourselves the ps2controller nub and register so ApplePS2Controller can find us. */ setName("ps2controller"); registerService(); DEBUG_LOG("AppleACPIPS2Nub::start: startup complete\n"); return true; }
QQmlEngineDebugService::QQmlEngineDebugService(QObject *parent) : QQmlDebugService(QStringLiteral("QmlDebugger"), 2, parent), m_watch(new QQmlWatcher(this)), m_statesDelegate(0) { QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)), this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant))); registerService(); }
bool GmaSensors::managedStart(IOService *provider) { IOPhysicalAddress bar = (IOPhysicalAddress)((pciDevice->configRead32(kMCHBAR)) & ~0xf); HWSensorsDebugLog("Fx3100: register space=%08lx", (long unsigned int)bar); if(IOMemoryDescriptor * theDescriptor = IOMemoryDescriptor::withPhysicalAddress (bar, 0x2000, kIODirectionOutIn)) { if ((mmio = theDescriptor->map())) { mmio_base = (volatile UInt8 *)mmio->getVirtualAddress(); /*HWSensorsDebugLog("MCHBAR mapped"); for (int i = 0; i < 0x2f; i += 16) { HWSensorsDebugLog("%04lx: ", (long unsigned int)i+0x1000); for (int j=0; j<16; j += 1) { HWSensorsDebugLog("%02lx ", (long unsigned int)INVID8(i+j+0x1000)); } HWSensorsDebugLog(""); }*/ } else { HWSensorsInfoLog("MCHBAR failed to map"); return false; } } enableExclusiveAccessMode(); //Find card number gpuIndex = takeVacantGPUIndex(); if (gpuIndex < 0) { HWSensorsFatalLog("failed to obtain vacant GPU index"); return false; } char key[5]; snprintf(key, 5, KEY_FORMAT_GPU_PROXIMITY_TEMPERATURE, gpuIndex); if (!addSensor(key, TYPE_SP78, 2, kFakeSMCTemperatureSensor, 0)) { HWSensorsFatalLog("failed to register temperature sensor"); releaseGPUIndex(gpuIndex); gpuIndex = -1; return false; } disableExclusiveAccessMode(); registerService(); return true; }
EzxVolumeService::EzxVolumeService(): QtopiaIpcAdaptor("QPE/AudioVolumeManager/EzxVolumeService") { publishAll(Slots); m_d = new EzxVolumeServicePrivate; m_d->currVolume = 0; setVolume(60); QTimer::singleShot(0, this, SLOT(registerService())); }
bool BrcmPatchRAMResidency::start(IOService *provider) { DebugLog("BrcmPatchRAMResidency start\n"); if (!super::start(provider)) return false; registerService(); return true; }
VOID createService() { NCLOGI("SystemService create."); extern ncsp<NEServiceStub>::sp CreateNMAudioService(); ncsp<NEServiceStub>::sp s = CreateNMAudioService(); s->onInit(); s->onHibernate(); s->onAwake(); registerService(s); NCLOGI("SystemService After register."); }
void IODMAController::registerDMAController(IOOptionBits options) { OSData *phandleData; phandleData = OSDynamicCast(OSData, _provider->getProperty("AAPL,phandle")); _dmaControllerName = createControllerName(*(UInt32 *)phandleData->getBytesNoCopy()); setName(_dmaControllerName); registerService(options | ((options & kIOServiceAsynchronous) ? 0 : kIOServiceSynchronous)); }
/** * Start this service. */ bool org_virtualbox_SupDrv::start(IOService *pProvider) { LogFlow(("org_virtualbox_SupDrv::start([%p])\n", this)); if (IOService::start(pProvider)) { /* register the service. */ registerService(); return true; } return false; }
void MprisPlayer::setServiceName(const QString &serviceName) { if (m_serviceName == serviceName) { return; } unregisterService(); m_serviceName = serviceName; registerService(); emit serviceNameChanged(); }
bool TZSensors::start(IOService * provider) { if (!super::start(provider)) return false; acpiDevice = (IOACPIPlatformDevice *)provider; if (!acpiDevice) { HWSensorsFatalLog("ACPI device not ready"); return false; } if (OSDictionary *configuration = getConfigurationNode()) { OSBoolean* disable = OSDynamicCast(OSBoolean, configuration->getObject("DisableDevice")); if (disable && disable->isTrue()) return false; } // On some computers (eg. RehabMan's ProBook 4530s), the system will hang on startup // if kernel cache is used, because of the early call to updateTemperatures and/or // updateTachometers. At least that is the case with an SSD and a valid pre-linked // kernel, along with kernel cache enabled. This 1000ms sleep seems to fix the problem, // enabling a clean boot with TZSensors enabled. // // On the ProBook this is the case with both TZSensors and PTIDSensors, although // PTIDSensors can be avoided by using DropSSDT=Yes (because PTID device is in an SSDT) // // And in the case of TZSensors it even happens (intermittently) without kernel cache. IOSleep(1000); OSObject *object = NULL; if(kIOReturnSuccess == acpiDevice->evaluateObject("_TMP", &object) && object) { for (UInt8 i = 0; i < 0xf; i++) { char key[5]; snprintf(key, 5, KEY_FORMAT_THERMALZONE_TEMPERATURE, i); if (!isKeyHandled(key)) { if (addSensor(key, TYPE_SP78, TYPE_SPXX_SIZE, kFakeSMCTemperatureSensor, 0)) { break; } } } } registerService(); HWSensorsInfoLog("started on %s", acpiDevice->getName()); return true; }
bool com_enkript_driver_Service::start(IOService* provider) { EKDebugLog(""); /* start super */ if (!super::start(provider)) return EKErrorLog("super::start() failed"); /* register the service in order to be found be clients */ registerService(); return true; }