Skip to content

Commit d43a05f

Browse files
committed
Improve LegacyIOService compatibility
1 parent 2183e2a commit d43a05f

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

KnownPlugins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Please note that improperly written immature plugins will not be listed there.
1616
[HibernationFixup](https://github.com/acidanthera/HibernationFixup) | Enable 3 & 25 mode hibernation on certain hardware
1717
[NightShiftUnlocker](https://github.com/Austere-J/NightShiftUnlocker) | Enables Night Shift on all the models
1818
[NoTouchID](https://github.com/al3xtjames/NoTouchID) | Disables Touch ID checks causing hangs
19+
[NVMeFix](https://github.com/acidanthera/NVMeFix) | Improved power management for generic NVMe SSDs
1920
[OpcodeEmulator](https://www.insanelymac.com/forum/topic/329704-opcode-emulator-opemu-plug-in-project/) | Intel Haswell Pentium / Celeron Series Or older processor expansion instruction set Emulation
2021
[RTCMemoryFixup](https://github.com/acidanthera/RTCMemoryFixup) | Offsets in CMOS (RTC) memory emulation
2122
[SystemProfilerMemoryFixup](https://github.com/Goldfish64/SystemProfilerMemoryFixup) | Show memory tab on MacBook models with soldered RAM

Lilu/Library/LegacyIOService.h

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@
5252

5353
#include <IOKit/pwr_mgt/IOPMpowerState.h>
5454
#include <IOKit/IOServicePM.h>
55+
#include <IOKit/IOReportTypes.h>
5556

5657
extern "C" {
5758
#include <kern/thread_call.h>
5859
}
5960

61+
#include <Availability.h>
6062
#include "LegacyLibkernMacros.h"
6163

6264
#ifndef UINT64_MAX
@@ -378,25 +380,75 @@ class IOService : public IORegistryEntry
378380

379381
virtual IOService * copyClientWithCategory( const OSSymbol * category );
380382

383+
public:
384+
385+
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
386+
387+
/*! @function configureReport
388+
@abstract configure IOReporting channels
389+
@availability SPI on OS X v10.9 / iOS 7 and later
390+
391+
@param channels - channels to configure
392+
@param action - enable/disable/size, etc
393+
@param result - action-specific returned value
394+
@param destination - action-specific default destination
395+
*/
396+
virtual IOReturn configureReport(IOReportChannelList *channels,
397+
IOReportConfigureAction action,
398+
void *result,
399+
void *destination);
400+
401+
/*! @function updateReport
402+
@abstract request current data for the specified channels
403+
@availability SPI on OS X 10.9 / iOS 7 and later
404+
405+
@param channels - channels to be updated
406+
@param action - type/style of update
407+
@param result - returned details about what was updated
408+
@param destination - destination for this update (action-specific)
409+
*/
410+
virtual IOReturn updateReport(IOReportChannelList *channels,
411+
IOReportUpdateAction action,
412+
void *result,
413+
void *destination);
414+
415+
#endif
416+
381417
private:
382418
#if __LP64__
419+
420+
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
421+
OSMetaClassDeclareReservedUsed(IOService, 0);
422+
OSMetaClassDeclareReservedUsed(IOService, 1);
423+
#else
383424
OSMetaClassDeclareReservedUnused(IOService, 0);
384425
OSMetaClassDeclareReservedUnused(IOService, 1);
426+
#endif
427+
385428
OSMetaClassDeclareReservedUnused(IOService, 2);
386429
OSMetaClassDeclareReservedUnused(IOService, 3);
387430
OSMetaClassDeclareReservedUnused(IOService, 4);
388431
OSMetaClassDeclareReservedUnused(IOService, 5);
432+
OSMetaClassDeclareReservedUnused(IOService, 6);
433+
OSMetaClassDeclareReservedUnused(IOService, 7);
389434
#else
390435
OSMetaClassDeclareReservedUsed(IOService, 0);
391436
OSMetaClassDeclareReservedUsed(IOService, 1);
392437
OSMetaClassDeclareReservedUsed(IOService, 2);
393438
OSMetaClassDeclareReservedUsed(IOService, 3);
394439
OSMetaClassDeclareReservedUsed(IOService, 4);
395440
OSMetaClassDeclareReservedUsed(IOService, 5);
396-
#endif
397441

442+
#ifdef defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
443+
OSMetaClassDeclareReservedUsed(IOService, 6);
444+
OSMetaClassDeclareReservedUsed(IOService, 7);
445+
#else
398446
OSMetaClassDeclareReservedUnused(IOService, 6);
399447
OSMetaClassDeclareReservedUnused(IOService, 7);
448+
#endif
449+
450+
#endif
451+
400452
OSMetaClassDeclareReservedUnused(IOService, 8);
401453
OSMetaClassDeclareReservedUnused(IOService, 9);
402454
OSMetaClassDeclareReservedUnused(IOService, 10);

0 commit comments

Comments
 (0)