MCPcopy Create free account
hub / github.com/USBToolBox/kext / removeACPIPorts

Method removeACPIPorts

USBToolBox/USBToolBox.cpp:336–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336void USBToolBox::removeACPIPorts() {
337 if (!(checkKernelArgument(bootargAcpiOff) || checkProperty(propertyAcpiOff))) {
338 const IORegistryPlane* acpiPlane = IORegistryEntry::getPlane("IOACPIPlane");
339
340 if (!acpiPlane) {
341 SYSTEMLOGPROV("Could not get ACPI plane!");
342 return;
343 }
344
345 IORegistryEntry* acpiEntry = OSDynamicCast(IORegistryEntry, pciDevice->getProperty("acpi-device"));
346
347 if (acpiEntry) {
348 if (OSIterator* acpiIterator = acpiEntry->getChildIterator(acpiPlane)) {
349 DEBUGLOGPROV("Starting iteration over ACPI plane");
350 while (IORegistryEntry* entry = OSDynamicCast(IORegistryEntry, acpiIterator->getNextObject())) {
351 DEBUGLOGPROV("Object name is %s, detatching", entry->getName());
352 entry->detachAll(acpiPlane);
353 }
354 DEBUGLOGPROV("Iteration over ACPI plane finished");
355 acpiEntry->setProperty("ACPI removed by USBToolBox", true);
356 OSSafeReleaseNULL(acpiIterator);
357 } else {
358 SYSTEMLOGPROV("Failed to create ACPI iterator!");
359 }
360 } else {
361 SYSTEMLOGPROV("Failed to get ACPI entry or none available");
362 }
363 } else {
364 SYSTEMLOGPROV("ACPI fixup disabled, continuing");
365 }
366}
367
368IOService* USBToolBox::probe(IOService* provider, SInt32* score) {
369 DEBUGLOG("%s: probe start", provider->getName());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected