├── .gitattributes ├── .gitignore ├── tables ├── table.zip ├── README.md └── codec#0 ├── CLOVER ├── CLOVERX64.efi ├── tools │ ├── bdmesg.efi │ ├── Shell32.efi │ ├── Shell64.efi │ └── Shell64U.efi ├── themes │ └── OSS │ │ ├── mpr.png │ │ ├── font.png │ │ ├── mpr2.png │ │ ├── FontKorean.png │ │ ├── background.png │ │ ├── icons │ │ ├── osx.icns │ │ ├── os_mac.icns │ │ ├── os_win.icns │ │ ├── pointer.png │ │ ├── boot_win.icns │ │ ├── func_about.png │ │ ├── func_help.png │ │ ├── func_reset.png │ │ ├── os_cougar.icns │ │ ├── os_legacy.icns │ │ ├── os_lion.icns │ │ ├── os_snow.icns │ │ ├── os_vista.icns │ │ ├── os_win7.icns │ │ ├── os_win8.icns │ │ ├── tool_shell.png │ │ ├── boot_linux.icns │ │ ├── func_clover.png │ │ ├── func_options.png │ │ ├── vol_clover.icns │ │ ├── vol_netboot.icns │ │ ├── vol_optical.icns │ │ ├── func_shutdown.png │ │ ├── pointer-black.png │ │ ├── vol_external.icns │ │ ├── vol_internal.icns │ │ ├── vol_recovery.icns │ │ ├── vol_internal_hfs.icns │ │ ├── vol_internal_ext3.icns │ │ └── vol_internal_ntfs.icns │ │ ├── logo-trans.png │ │ ├── Selection_big.png │ │ ├── Select_trans_big.png │ │ ├── Selection_big_2.png │ │ ├── selection.small.png │ │ ├── Select_trans_small.png │ │ ├── background copy 2.png │ │ ├── scrollbar │ │ ├── bar_end.png │ │ ├── bar_fill.png │ │ ├── bar_start.png │ │ ├── down_button.png │ │ ├── scroll_end.png │ │ ├── scroll_fill.png │ │ ├── up_button.png │ │ └── scroll_start.png │ │ └── theme.plist ├── ACPI │ └── patched │ │ └── SSDT-UIAC.aml ├── drivers64UEFI │ ├── Fat-64.efi │ ├── HFSPlus.efi │ ├── UsbKbDxe.efi │ ├── VBoxHfs-64.efi │ ├── AptioInputFix.efi │ ├── DataHubDxe-64.efi │ ├── FSInject-64.efi │ ├── AptioMemoryFix.efi │ ├── PartitionDxe-64.efi │ ├── ApfsDriverLoader.efi │ └── OsxFatBinaryDrv-64.efi ├── kexts │ └── 10.14 │ │ ├── Lilu.kext │ │ └── Contents │ │ │ ├── MacOS │ │ │ └── Lilu │ │ │ ├── Resources │ │ │ ├── Library │ │ │ │ ├── libkmod.a │ │ │ │ ├── wrappers │ │ │ │ │ ├── entry64.S │ │ │ │ │ ├── entry32.S │ │ │ │ │ ├── wrappers.inc │ │ │ │ │ └── build.tool │ │ │ │ ├── LegacyLibkernMacros.h │ │ │ │ ├── plugin_start.cpp │ │ │ │ └── security │ │ │ │ │ └── _label.h │ │ │ └── Headers │ │ │ │ ├── kern_config.hpp │ │ │ │ ├── kern_atomic.hpp │ │ │ │ ├── plugin_start.hpp │ │ │ │ ├── kern_policy.hpp │ │ │ │ ├── kern_compression.hpp │ │ │ │ ├── kern_compat.hpp │ │ │ │ ├── kern_efi.hpp │ │ │ │ ├── kern_file.hpp │ │ │ │ ├── kern_crypto.hpp │ │ │ │ ├── kern_time.hpp │ │ │ │ ├── capstone │ │ │ │ ├── platform.h │ │ │ │ ├── xcore.h │ │ │ │ └── sparc.h │ │ │ │ ├── kern_disasm.hpp │ │ │ │ ├── kern_nvram.hpp │ │ │ │ ├── kern_rtc.hpp │ │ │ │ ├── kern_devinfo.hpp │ │ │ │ ├── kern_mach.hpp │ │ │ │ ├── kern_iokit.hpp │ │ │ │ └── kern_api.hpp │ │ │ └── Info.plist │ │ ├── FakeSMC.kext │ │ └── Contents │ │ │ ├── MacOS │ │ │ └── FakeSMC │ │ │ └── Info.plist │ │ ├── AppleALC.kext │ │ └── Contents │ │ │ └── MacOS │ │ │ └── AppleALC │ │ ├── CPUFriend.kext │ │ └── Contents │ │ │ ├── MacOS │ │ │ └── CPUFriend │ │ │ └── Info.plist │ │ ├── USBInjectAll.kext │ │ └── Contents │ │ │ └── MacOS │ │ │ └── USBInjectAll │ │ ├── RTCMemoryFixup.kext │ │ └── Contents │ │ │ ├── MacOS │ │ │ └── RTCMemoryFixup │ │ │ └── Info.plist │ │ ├── RealtekRTL8111.kext │ │ └── Contents │ │ │ ├── MacOS │ │ │ └── RealtekRTL8111 │ │ │ ├── Resources │ │ │ └── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ └── Info.plist │ │ ├── WhateverGreen.kext │ │ └── Contents │ │ │ └── MacOS │ │ │ └── WhateverGreen │ │ └── VoodooPS2Controller.kext │ │ └── Contents │ │ ├── MacOS │ │ └── VoodooPS2Controller │ │ ├── PlugIns │ │ ├── VoodooPS2Mouse.kext │ │ │ └── Contents │ │ │ │ ├── MacOS │ │ │ │ └── VoodooPS2Mouse │ │ │ │ └── Info.plist │ │ ├── VoodooPS2Keyboard.kext │ │ │ └── Contents │ │ │ │ └── MacOS │ │ │ │ └── VoodooPS2Keyboard │ │ └── VoodooPS2Trackpad.kext │ │ │ └── Contents │ │ │ └── MacOS │ │ │ └── VoodooPS2Trackpad │ │ └── Info.plist └── config.plist ├── document ├── README.md ├── old │ ├── HDMI.md │ ├── E440-USB.md │ └── DSDT.MD ├── e440_键盘完善记录.md └── 10.14升级记录.md ├── README-zh.md ├── README.md └── patch ├── battery_ThinkPad_E440.md └── battery_Lenovo-E430.md /.gitattributes: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /tables/table.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/tables/table.zip -------------------------------------------------------------------------------- /CLOVER/CLOVERX64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/CLOVERX64.efi -------------------------------------------------------------------------------- /CLOVER/tools/bdmesg.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/tools/bdmesg.efi -------------------------------------------------------------------------------- /document/README.md: -------------------------------------------------------------------------------- 1 | 这里保存了一些制作过程和方法,供追踪错误和新人研究 2 | 3 | 旧版本的文档移动到了 old 文件夹中,他们可能不适合当前的 clover 和 mac 系统版本,但依旧有参考价值 -------------------------------------------------------------------------------- /CLOVER/themes/OSS/mpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/mpr.png -------------------------------------------------------------------------------- /CLOVER/tools/Shell32.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/tools/Shell32.efi -------------------------------------------------------------------------------- /CLOVER/tools/Shell64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/tools/Shell64.efi -------------------------------------------------------------------------------- /CLOVER/tools/Shell64U.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/tools/Shell64U.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/font.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/mpr2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/mpr2.png -------------------------------------------------------------------------------- /CLOVER/ACPI/patched/SSDT-UIAC.aml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/ACPI/patched/SSDT-UIAC.aml -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/Fat-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/Fat-64.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/HFSPlus.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/HFSPlus.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/UsbKbDxe.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/UsbKbDxe.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/FontKorean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/FontKorean.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/background.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/osx.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/osx.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/logo-trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/logo-trans.png -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/VBoxHfs-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/VBoxHfs-64.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/Selection_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/Selection_big.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_mac.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_mac.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_win.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_win.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/pointer.png -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/AptioInputFix.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/AptioInputFix.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/DataHubDxe-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/DataHubDxe-64.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/FSInject-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/FSInject-64.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/Select_trans_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/Select_trans_big.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/Selection_big_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/Selection_big_2.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/boot_win.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/boot_win.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_about.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_help.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_reset.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_cougar.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_cougar.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_legacy.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_legacy.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_lion.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_lion.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_snow.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_snow.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_vista.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_vista.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_win7.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_win7.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/os_win8.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/os_win8.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/tool_shell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/tool_shell.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/selection.small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/selection.small.png -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/AptioMemoryFix.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/AptioMemoryFix.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/PartitionDxe-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/PartitionDxe-64.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/Select_trans_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/Select_trans_small.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/background copy 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/background copy 2.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/boot_linux.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/boot_linux.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_clover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_clover.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_options.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_clover.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_clover.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_netboot.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_netboot.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_optical.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_optical.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/bar_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/bar_end.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/bar_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/bar_fill.png -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/ApfsDriverLoader.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/ApfsDriverLoader.efi -------------------------------------------------------------------------------- /CLOVER/drivers64UEFI/OsxFatBinaryDrv-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/drivers64UEFI/OsxFatBinaryDrv-64.efi -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/func_shutdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/func_shutdown.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/pointer-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/pointer-black.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_external.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_external.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_internal.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_internal.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_recovery.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_recovery.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/bar_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/bar_start.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/down_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/down_button.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/scroll_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/scroll_end.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/scroll_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/scroll_fill.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/up_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/up_button.png -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_internal_hfs.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_internal_hfs.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/scrollbar/scroll_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/scrollbar/scroll_start.png -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/MacOS/Lilu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/Lilu.kext/Contents/MacOS/Lilu -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_internal_ext3.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_internal_ext3.icns -------------------------------------------------------------------------------- /CLOVER/themes/OSS/icons/vol_internal_ntfs.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/themes/OSS/icons/vol_internal_ntfs.icns -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/FakeSMC.kext/Contents/MacOS/FakeSMC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/FakeSMC.kext/Contents/MacOS/FakeSMC -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/AppleALC.kext/Contents/MacOS/AppleALC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/AppleALC.kext/Contents/MacOS/AppleALC -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/CPUFriend.kext/Contents/MacOS/CPUFriend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/CPUFriend.kext/Contents/MacOS/CPUFriend -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/libkmod.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/libkmod.a -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/USBInjectAll.kext/Contents/MacOS/USBInjectAll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/USBInjectAll.kext/Contents/MacOS/USBInjectAll -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/RTCMemoryFixup.kext/Contents/MacOS/RTCMemoryFixup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/RTCMemoryFixup.kext/Contents/MacOS/RTCMemoryFixup -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/RealtekRTL8111.kext/Contents/MacOS/RealtekRTL8111: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/RealtekRTL8111.kext/Contents/MacOS/RealtekRTL8111 -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/WhateverGreen.kext/Contents/MacOS/WhateverGreen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/WhateverGreen.kext/Contents/MacOS/WhateverGreen -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/MacOS/VoodooPS2Controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/MacOS/VoodooPS2Controller -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/RealtekRTL8111.kext/Contents/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/RealtekRTL8111.kext/Contents/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext/Contents/MacOS/VoodooPS2Mouse: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext/Contents/MacOS/VoodooPS2Mouse -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/MacOS/VoodooPS2Keyboard: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/MacOS/VoodooPS2Keyboard -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Trackpad.kext/Contents/MacOS/VoodooPS2Trackpad: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzmark/Thinkpad-E440-Hackintosh/HEAD/CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Trackpad.kext/Contents/MacOS/VoodooPS2Trackpad -------------------------------------------------------------------------------- /tables/README.md: -------------------------------------------------------------------------------- 1 | # tables 2 | 3 | This folder save current version some files for modification to new version 4 | 5 | > original DSDT => table.zip 6 | > audio CODEC => codec#0 7 | > current version DSDT has not compiled => *.dsl 8 | 9 | --- 10 | 11 | 该文件夹保存当前版本的一些文件,供新版本修改使用 12 | 13 | > 原始DSDT提取 table.zip 14 | > CODEC codec#0 15 | > 当前版本DSDT的dsl文件 *.dsl 16 | 17 | --- 18 | 19 | table: 2019-08-08 20 | 21 | codec#0: 2017-02-06 -------------------------------------------------------------------------------- /document/old/HDMI.md: -------------------------------------------------------------------------------- 1 | # HDMI实现 2 | 3 | ## 现状 4 | 5 | HDMI识别显示器,识别分辨率,无图像 6 | 7 | HDMI音频无法识别 8 | 9 | [guide-intel-igpu-hdmi-dp-audio-sandy-ivy-haswell-broadwell-skylake](https://www.tonymacx86.com/threads/guide-intel-igpu-hdmi-dp-audio-sandy-ivy-haswell-broadwell-skylake.189495/) 10 | 11 | 指出需要修改`ig-platform-id`和打入相应补丁 12 | 13 | 当前ig为 `0x0a 26 00 06` 14 | 15 | @1和@2缓冲状态为`0105 0204` 16 | 17 | `audio-device-info`值 18 | 19 | `AppleIntelFramebuffer`中指出,本机有三个缓冲区 20 | 21 | @0为内置显示器,@1为HDMI,@2应为VGI(无数据证实)。 22 | 0x00 0x05 0x06 23 | 24 | ## 处理日志 25 | 26 | 启用`config.plist`中的`HDMI-audio, port 0105(12), 0x0a260005 0x0a260006, 0x0d220003, 0x0a2e000a, 0x0a26000a-02`补丁,视频已可以使用,音频仍在排查,应该是DSDT中HDAU相关补丁错误导致 -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_config.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_config.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_config_hpp 9 | #define kern_config_hpp 10 | 11 | /** 12 | * Enable kext patching support 13 | */ 14 | #define LILU_KEXTPATCH_SUPPORT 1 15 | 16 | /** 17 | * Enable compression and decompression support 18 | */ 19 | #define LILU_COMPRESSION_SUPPORT 1 20 | 21 | /** 22 | * Enable advanced disassembly API based on capstone 23 | */ 24 | // #define LILU_ADVANCED_DISASSEMBLY 1 25 | 26 | /** 27 | * Specify custom initialisation code 28 | * Use these in plugins in Xcode Project Preprocessor Macros section. 29 | */ 30 | // #define LILU_CUSTOM_IOKIT_INIT 1 31 | // #define LILU_CUSTOM_KMOD_INIT 1 32 | 33 | #endif /* kern_config_hpp */ 34 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/wrappers/entry64.S: -------------------------------------------------------------------------------- 1 | # 2 | # entry64.S 3 | # Lilu 4 | # 5 | # Copyright © 2018 vit9696. All rights reserved. 6 | # 7 | 8 | .text 9 | .global _main 10 | _main: 11 | push %rbp 12 | mov %rsp, %rbp 13 | # ensure 16-byte alignment 14 | and $0xfffffffffffffff0, %rsp 15 | # int main(int argc, const char* argv[], const char* envp[], const char* apple[]); 16 | push %rdi 17 | push %rsi 18 | push %rdx 19 | push %rcx 20 | call *booter(%rip) 21 | xor %eax, %eax 22 | pop %rcx 23 | pop %rdx 24 | pop %rsi 25 | pop %rdi 26 | mov %rbp, %rsp 27 | pop %rbp 28 | jmp *entrypoint(%rip) 29 | # original entrypoint (main) 30 | entrypoint: 31 | .word 0xFFFF 32 | .word 0xFFFF 33 | .word 0xFFFF 34 | .word 0xFFFF 35 | # entrypoint-compatible wrapper 36 | booter: 37 | .word 0xFFFF 38 | .word 0xFFFF 39 | .word 0xFFFF 40 | .word 0xFFFF 41 | _end: 42 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/wrappers/entry32.S: -------------------------------------------------------------------------------- 1 | # 2 | # entry32.S 3 | # Lilu 4 | # 5 | # Copyright © 2018 vit9696. All rights reserved. 6 | # 7 | 8 | .text 9 | .global _main 10 | _main: 11 | push %ebp 12 | mov %esp, %ebp 13 | # ensure 16-byte alignment 14 | and $0xfffffff0, %esp 15 | # int main(int argc, const char* argv[], const char* envp[], const char* apple[]); 16 | push 20(%ebp) 17 | push 16(%ebp) 18 | push 12(%ebp) 19 | push 8(%ebp) 20 | call get_booter 21 | # entrypoint-compatible wrapper 22 | booter: 23 | .word 0xFFFF 24 | .word 0xFFFF 25 | get_booter: 26 | pop %edx 27 | mov (%edx), %edx 28 | call *%edx 29 | xor %eax, %eax 30 | mov %ebp, %esp 31 | pop %ebp 32 | call get_entrypoint 33 | # original entrypoint (main) 34 | entrypoint: 35 | .word 0xFFFF 36 | .word 0xFFFF 37 | get_entrypoint: 38 | pop %edx 39 | mov (%edx), %edx 40 | jmp *%edx 41 | _end: 42 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_atomic.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_atomic.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_atomic_h 9 | #define kern_atomic_h 10 | 11 | #if defined(__has_include) 12 | #if __has_include() 13 | #include 14 | #else 15 | 16 | // Provide basic atomic support for legacy compilers 17 | 18 | typedef enum memory_order { 19 | memory_order_relaxed = __ATOMIC_RELAXED, 20 | memory_order_consume = __ATOMIC_CONSUME, 21 | memory_order_acquire = __ATOMIC_ACQUIRE, 22 | memory_order_release = __ATOMIC_RELEASE, 23 | memory_order_acq_rel = __ATOMIC_ACQ_REL, 24 | memory_order_seq_cst = __ATOMIC_SEQ_CST 25 | } memory_order; 26 | 27 | #define atomic_init __c11_atomic_init 28 | #define atomic_store_explicit __c11_atomic_store 29 | #define atomic_load_explicit __c11_atomic_load 30 | #define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong 31 | 32 | #endif 33 | #else 34 | // Assume to be available when there is no __has_include. 35 | #include 36 | #endif 37 | 38 | #endif /* kern_atomic_h */ 39 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/wrappers/wrappers.inc: -------------------------------------------------------------------------------- 1 | // 2 | // wrappers.inc 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | // This is an autogenerated file, do not edit! 9 | static uint8_t entryWrapper32[] = { 10 | 0x55, 0x89, 0xe5, 0x83, 0xe4, 0xf0, 0xff, 0x75, 0x14, 0xff, 0x75, 0x10, 11 | 0xff, 0x75, 0x0c, 0xff, 0x75, 0x08, 0xe8, 0x04, 0x00, 0x00, 0x00, 0xff, 12 | 0xff, 0xff, 0xff, 0x5a, 0x8b, 0x12, 0xff, 0xd2, 0x31, 0xc0, 0x89, 0xec, 13 | 0x5d, 0xe8, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x5a, 0x8b, 14 | 0x12, 0xff, 0xe2 15 | }; 16 | static uint8_t entryWrapper64[] = { 17 | 0x55, 0x48, 0x89, 0xe5, 0x48, 0x83, 0xe4, 0xf0, 0x57, 0x56, 0x52, 0x51, 18 | 0xff, 0x15, 0x18, 0x00, 0x00, 0x00, 0x31, 0xc0, 0x59, 0x5a, 0x5e, 0x5f, 19 | 0x48, 0x89, 0xec, 0x5d, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 20 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 21 | 0xff, 0xff 22 | }; 23 | static_assert(sizeof(entryWrapper32) == 51, "Invalid entryWrapper32 size"); 24 | static_assert(sizeof(entryWrapper64) == 50, "Invalid entryWrapper64 size"); 25 | static constexpr size_t EntryWrapper32Booter {0x00000017}; 26 | static constexpr size_t EntryWrapper64Booter {0x000000000000002a}; 27 | static constexpr size_t EntryWrapper32Entry {0x0000002a}; 28 | static constexpr size_t EntryWrapper64Entry {0x0000000000000022}; 29 | -------------------------------------------------------------------------------- /CLOVER/themes/OSS/theme.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Author 6 | lisai9093 7 | Description 8 | OS X Selection 9 | Theme 10 | 11 | Background 12 | 13 | Dark 14 | 15 | Path 16 | background.png 17 | Sharp 18 | 0xFF 19 | Type 20 | Scale 21 | 22 | Badges 23 | 24 | Inline 25 | 26 | Show 27 | 28 | Swap 29 | 30 | 31 | Banner 32 | logo-trans.png 33 | Font 34 | 35 | CharWidth 36 | 12 37 | Path 38 | mpr2.png 39 | Proportional 40 | 41 | Type 42 | Load 43 | 44 | Selection 45 | 46 | Big 47 | Select_trans_big.png 48 | Color 49 | 0xF3F3F380 50 | Small 51 | Select_trans_small.png 52 | 53 | 54 | Version 55 | 1.2 56 | Year 57 | 2015 58 | 59 | 60 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/LegacyLibkernMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // LegacyLibkernMacros.h 3 | // Lilu 4 | // 5 | // Copyright © 2019 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef LegacyLibkernMacros_h 9 | #define LegacyLibkernMacros_h 10 | 11 | // This is a compatibility header to let Lilu build with different Xcode 12 | // versions and be able to use legacy headers and clang analyzer. 13 | 14 | #include 15 | 16 | #if !defined(LIBKERN_RETURNS_NOT_RETAINED) 17 | #define LIBKERN_RETURNS_NOT_RETAINED 18 | #elif defined(__clang_major__) && __clang_major__ < 11 19 | #undef LIBKERN_RETURNS_NOT_RETAINED 20 | #define LIBKERN_RETURNS_NOT_RETAINED 21 | #endif 22 | 23 | #if !defined(LIBKERN_RETURNS_RETAINED) 24 | #define LIBKERN_RETURNS_RETAINED 25 | #elif defined(__clang_major__) && __clang_major__ < 11 26 | #undef LIBKERN_RETURNS_RETAINED 27 | #define LIBKERN_RETURNS_RETAINED 28 | #endif 29 | 30 | #if !defined(LIBKERN_CONSUMED) 31 | #define LIBKERN_CONSUMED 32 | #elif defined(__clang_major__) && __clang_major__ < 11 33 | #undef LIBKERN_CONSUMED 34 | #define LIBKERN_CONSUMED 35 | #endif 36 | 37 | #if !defined(LIBKERN_CONSUMES_THIS) 38 | #define LIBKERN_CONSUMES_THIS 39 | #elif defined(__clang_major__) && __clang_major__ < 11 40 | #undef LIBKERN_CONSUMES_THIS 41 | #define LIBKERN_CONSUMES_THIS 42 | #endif 43 | 44 | #if !defined(LIBKERN_RETURNS_RETAINED_ON_ZERO) 45 | #define LIBKERN_RETURNS_RETAINED_ON_ZERO 46 | #elif defined(__clang_major__) && __clang_major__ < 11 47 | #undef LIBKERN_RETURNS_RETAINED_ON_ZERO 48 | #define LIBKERN_RETURNS_RETAINED_ON_ZERO 49 | #endif 50 | 51 | #if !defined(LIBKERN_RETURNS_RETAINED_ON_NONZERO) 52 | #define LIBKERN_RETURNS_RETAINED_ON_NONZERO 53 | #elif defined(__clang_major__) && __clang_major__ < 11 54 | #undef LIBKERN_RETURNS_RETAINED_ON_NONZERO 55 | #define LIBKERN_RETURNS_RETAINED_ON_NONZERO 56 | #endif 57 | 58 | #endif /* LegacyLibkernMacros_h */ 59 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/plugin_start.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_start.hpp 3 | // AppleALC 4 | // 5 | // Copyright © 2016 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_start_hpp 9 | #define kern_start_hpp 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | struct PluginConfiguration { 17 | const char *product; // Product name (e.g. xStringify(PRODUCT_NAME)) 18 | size_t version; // Product version (e.g. parseModuleVersion(xStringify(MODULE_VERSION))) 19 | uint32_t runmode; // Product supported environments (e.g. LiluAPI::AllowNormal) 20 | const char **disableArg; // Pointer to disabling boot arguments array 21 | size_t disableArgNum; // Number of disabling boot arguments 22 | const char **debugArg; // Pointer to debug boot arguments array 23 | size_t debugArgNum; // Number of debug boot arguments 24 | const char **betaArg; // Pointer to beta boot arguments array 25 | size_t betaArgNum; // Number of beta boot arguments 26 | KernelVersion minKernel; // Minimal required kernel version 27 | KernelVersion maxKernel; // Maximum supported kernel version 28 | void (*pluginStart)(); // Main function 29 | }; 30 | 31 | #ifndef LILU_CUSTOM_KMOD_INIT 32 | 33 | extern PluginConfiguration ADDPR(config); 34 | 35 | extern bool ADDPR(startSuccess); 36 | 37 | #endif /* LILU_CUSTOM_KMOD_INIT */ 38 | 39 | #ifndef LILU_CUSTOM_IOKIT_INIT 40 | 41 | class EXPORT PRODUCT_NAME : public IOService { 42 | OSDeclareDefaultStructors(PRODUCT_NAME) 43 | public: 44 | IOService *probe(IOService *provider, SInt32 *score) override; 45 | bool start(IOService *provider) override; 46 | void stop(IOService *provider) override; 47 | }; 48 | 49 | extern PRODUCT_NAME *ADDPR(selfInstance); 50 | 51 | #endif /* LILU_CUSTOM_IOKIT_INIT */ 52 | 53 | #endif /* kern_start_hpp */ 54 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_policy.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_policy.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_policy_hpp 9 | #define kern_policy_hpp 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | class Policy { 21 | /** 22 | * TrustedBSD Policy handle 23 | */ 24 | mac_policy_handle_t policyHandle {0}; 25 | 26 | /** 27 | * TrustedBSD policy configuration 28 | */ 29 | mac_policy_conf policyConf; 30 | public: 31 | /** 32 | * May be used at TrustedBSD policy initialisation 33 | * 34 | * @param conf policy configuration 35 | */ 36 | static void dummyPolicyInitBSD(mac_policy_conf *conf) { 37 | DBGLOG("policy", "init bsd"); 38 | } 39 | 40 | /** 41 | * Compile-time policy constructor 42 | * 43 | * @param name policy name literal 44 | * @param descr policy description literal 45 | * @param ops policy functions 46 | */ 47 | constexpr Policy(const char *name, const char *descr, struct mac_policy_ops *ops) : policyConf{ 48 | .mpc_name = name, 49 | .mpc_fullname = descr, 50 | .mpc_labelnames = nullptr, 51 | .mpc_labelname_count = 0, 52 | .mpc_ops = ops, 53 | // Our policies are loaded very early and are static. We cannot unload them. 54 | .mpc_loadtime_flags = 0 /*MPC_LOADTIME_FLAG_UNLOADOK*/, 55 | .mpc_field_off = nullptr, 56 | .mpc_runtime_flags = 0 57 | } { } 58 | 59 | /** 60 | * Registers TrustedBSD policy 61 | * 62 | * @return true on success 63 | */ 64 | EXPORT bool registerPolicy(); 65 | 66 | /** 67 | * Unregisters TrustedBSD policy if allowed 68 | * 69 | * @return true on success 70 | */ 71 | EXPORT bool unregisterPolicy(); 72 | }; 73 | 74 | #endif /* kern_policy_hpp */ 75 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_compression.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_compression.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_compression_hpp 9 | #define kern_compression_hpp 10 | 11 | #include 12 | 13 | #ifdef LILU_COMPRESSION_SUPPORT 14 | 15 | #include 16 | #include 17 | 18 | namespace Compression { 19 | 20 | /** 21 | * Compression constants and modes 22 | */ 23 | static constexpr uint32_t Magic {0x706D6F63}; //comp 24 | static constexpr uint32_t ModeLZVN {0x6E767A6C}; //lzvn 25 | static constexpr uint32_t ModeLZSS {0x73737A6C}; //lzss 26 | 27 | /** 28 | * Compressed header structure 29 | */ 30 | struct Header { 31 | uint32_t magic; 32 | uint32_t compression; 33 | uint32_t hash; // adler32 34 | uint32_t decompressed; 35 | uint32_t compressed; 36 | uint32_t version; 37 | uint32_t padding[90]; 38 | }; 39 | 40 | /** 41 | * Typed decompressing function (currently for lzvn and lzss) 42 | * 43 | * @param compression compression type 44 | * @param dstlen decompression buffer size 45 | * @param src compressed data 46 | * @param srclen compressed data size 47 | * @param buffer preallocated buffer to use 48 | * 49 | * @return decompressed buffer (must be freeded by Buffer::deleter if not preallocated) 50 | */ 51 | EXPORT uint8_t *decompress(uint32_t compression, uint32_t dstlen, const uint8_t *src, uint32_t srclen, uint8_t *buffer=nullptr); 52 | 53 | /** 54 | * Typed compressing function (currently for lzss) 55 | * 56 | * @param compression compression type 57 | * @param dstlen maximum compression buffer size 58 | * @param src uncompressed data 59 | * @param srclen uncompressed data size 60 | * @param buffer preallocated buffer to use 61 | * 62 | * @return compressed buffer with its actual size in dstlen (must be freeded by Buffer::deleter if not preallocated) 63 | */ 64 | EXPORT uint8_t *compress(uint32_t compression, uint32_t &dstlen, const uint8_t *src, uint32_t srclen, uint8_t *buffer=nullptr); 65 | 66 | } 67 | 68 | #endif /* LILU_COMPRESSION_SUPPORT */ 69 | 70 | #endif /* kern_compression_hpp */ 71 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/wrappers/build.tool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # build.tool 4 | # Lilu 5 | # 6 | # Copyright © 2018 vit9696. All rights reserved. 7 | # 8 | 9 | cd $(dirname "$0") || exit 1 10 | 11 | rm -f *.o *.bin wrappers.inc entry32 entry64 12 | 13 | clang -m32 -c entry32.S || exit 1 14 | clang -m64 -c entry64.S || exit 1 15 | 16 | clang -m32 entry32.o -o entry32 || exit 1 17 | clang -m64 entry64.o -o entry64 || exit 1 18 | 19 | if [ "$(nm entry32.o | grep '00000000 T _main')" == "" ] || [ "$(nm entry64.o | grep '0000000000000000 T _main')" == "" ]; then 20 | echo "Invalid main address" 21 | exit 1 22 | fi 23 | 24 | otool -t entry32 | grep -E '^0000' | sed 's#^[0-9a-f]*##' | xxd -r -p > entry32.bin 25 | otool -t entry64 | grep -E '^0000' | sed 's#^[0-9a-f]*##' | xxd -r -p > entry64.bin 26 | 27 | sz32=$(stat -f '%z' entry32.bin) 28 | sz64=$(stat -f '%z' entry64.bin) 29 | 30 | btr32=$(nm entry32.o | grep -E 't booter$' | cut -f1 -d' ') 31 | btr64=$(nm entry64.o | grep -E 't booter$' | cut -f1 -d' ') 32 | 33 | ep32=$(nm entry32.o | grep -E 't entrypoint$' | cut -f1 -d' ') 34 | ep64=$(nm entry64.o | grep -E 't entrypoint$' | cut -f1 -d' ') 35 | 36 | echo '//' > wrappers.inc 37 | echo '// wrappers.inc' >> wrappers.inc 38 | echo '// Lilu' >> wrappers.inc 39 | echo '//' >> wrappers.inc 40 | echo '// Copyright © 2018 vit9696. All rights reserved.' >> wrappers.inc 41 | echo '//' >> wrappers.inc 42 | echo '' >> wrappers.inc 43 | echo '// This is an autogenerated file, do not edit!' >> wrappers.inc 44 | echo 'static uint8_t entryWrapper32[] = {' >> wrappers.inc 45 | cat entry32.bin | xxd -i >> wrappers.inc 46 | echo '};' >> wrappers.inc 47 | echo 'static uint8_t entryWrapper64[] = {' >> wrappers.inc 48 | cat entry64.bin | xxd -i >> wrappers.inc 49 | echo '};' >> wrappers.inc 50 | echo "static_assert(sizeof(entryWrapper32) == ${sz32}, \"Invalid entryWrapper32 size\");" >> wrappers.inc 51 | echo "static_assert(sizeof(entryWrapper64) == ${sz64}, \"Invalid entryWrapper64 size\");" >> wrappers.inc 52 | echo "static constexpr size_t EntryWrapper32Booter {0x${btr32}};" >> wrappers.inc 53 | echo "static constexpr size_t EntryWrapper64Booter {0x${btr64}};" >> wrappers.inc 54 | echo "static constexpr size_t EntryWrapper32Entry {0x${ep32}};" >> wrappers.inc 55 | echo "static constexpr size_t EntryWrapper64Entry {0x${ep64}};" >> wrappers.inc 56 | 57 | rm -f *.o *.bin entry32 entry64 58 | -------------------------------------------------------------------------------- /document/old/E440-USB.md: -------------------------------------------------------------------------------- 1 | # E440 USB问题解决记录 2 | 3 | 10.11时期,pcbeta上得一位大神给了我一个kext驱动,配合驱动给dsdt打一个补丁(实际是改了三个名字,当时不懂),然后摄像头就出来了。 4 | 5 | 前阵升级了10.12,升级后发现usb全家都出了问题,延用上一版本的usb,usb3.0可用但usb声卡爆音、usb网卡无法识别,用rehabman大神的UsbInjectAll的话usb3.0不能用,声卡不能用,深入研究发现了许多错误的使用方法。 6 | 7 | 首先贴上我的USB Map 8 | 9 | |-Port-|-address-|-端口位置-|-对应DSDT-| 10 | |:---:|:-----:|:----:|:---:| 11 | |port1|0x01(1)|左下2.0|HSP0| 12 | |port2|0x02(2)|左上2.0|HSP1| 13 | |port6|0x06(6)|右方2.0|HSP5| 14 | |port7|0x07(7)|蓝牙|HSP6| 15 | |prot12|0x0c(12)|摄像头|HSPB| 16 | |port17|0x11(17)|左下3.0|SSP1| 17 | |port20|0x14(20)|左上3.0|SSP4| 18 | 19 | 这些数据可以从Windows下的[usbtreeview](http://www.uwe-sieber.de/files/usbtreeview.zip)软件中获取到 20 | 21 | `Rehabman`的项目中,与USB相关的共有两个,一个是FakePCIID,另一个就是`UsbInjectAll`,其中FakePCIID中有一个`FakePCIID_XHCIMux.kext`,该文件的作用很特殊,下面会单独说明。 22 | 23 | UsbInjectAll的工作原理类似于pjalm所提供的遮罩器(应该说是遮罩器的加强版)(这两个人的关系也不清楚,说法可能不精确),rehabman大神也推荐在一些特别情况下自制遮罩器,毕竟通用性不一定够。 24 | 25 | 修复USB驱动,首先需要知道以下几点 26 | 27 | 1. Intel 8/9/100系列的主板中,所有USB控制器全都分划到了XHCI中(usb3.0控制器,有的主板会叫做XHC或者XHC1),8系列主板3.0控制器下一般会有HSP0~HSPE(HS01~HS15)15个USB2.0和SSP0~SSP5(SS01~SS06)六个USB3.0控制器总计21个USB控制器。 28 | 29 | 1. 因为苹果对USB的规则改变,限制USB控制器数量为15,导致XHC控制器下只能显示到SSP0。这个数量限制可以由补丁去除,但是这个补丁在我这里不清楚是否有效(加不加都出不来)。 30 | 31 | 1. 苹果对USB的规则中还有一点,就是port和配置的对应关系由SMBIOS决定,即你所仿冒的机型是什么,你的USB数据便会继承下来,导致很多机型的USB失效,例如MBP11.1所使用的是HSP0、1、3、5,SSP0、1、4,摄像头就不见了。这一点大神提出了用inject遮罩器来解决,重新将端口映射,也曾有绕过这个限制的方法,即将USB控制器的名字改成与Mac默认的不同,使系统从DSDT中读取控制器节点数据,建立接口关系。 32 | 33 | 1. Macbook Pro 11.1 白苹果机,实际上只有USB3.0总线控制器显示,即遵循第一点将2.0设备放在3.0控制器下管理 34 | 35 | 1. 遮罩器的功能就是提供一套USB Map节点数据,供系统驱动USB。 36 | 37 | 1. FakePCIID_XHCIMux的功能:这个kext的功能非常坑爹,它的功能是将USB3.0控制器下USB2.0设备映射回EH01和EH02控制器中,相关说明很少,据本人猜测可能会有性能提升,也可能是为了避开15控制器数量限制。 38 | 39 | 最开始没有注意FakePCIID_XHCIMux这个kext,升级10.12前更新FakePCIID的时候一起带上了,结果导致了USB3.0的驱动失败却又不清楚哪里出了问题,去掉这个kext后USB3.0一下就好使了,说明这个映射在我的机器上可能存在某些问题。 40 | 41 | 后来进一步研究发现很多不完善的地方,最后决定自行制作遮罩器,使用pjalm提供的遮罩器为原本,添加了自己的节点数据。 42 | 43 | 参考资料: 44 | 45 | * [http://bbs.pcbeta.com/viewthread-1723131-1-1.html](http://bbs.pcbeta.com/viewthread-1723131-1-1.html) 46 | * [http://bbs.pcbeta.com/viewthread-1651615-1-3.html](http://bbs.pcbeta.com/viewthread-1651615-1-3.html) 47 | * [http://bbs.pcbeta.com/viewthread-1647984-1-1.html](http://bbs.pcbeta.com/viewthread-1647984-1-1.html) 48 | * [https://github.com/RehabMan/OS-X-USB-Inject-All](https://github.com/RehabMan/OS-X-USB-Inject-All) 49 | * [https://github.com/RehabMan/OS-X-Fake-PCI-ID](https://github.com/RehabMan/OS-X-Fake-PCI-ID) -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # Thinkpad E440 Hackintosh Files 2 | 3 | # Deprecated 4 | 5 | 因为一些问题,我不再使用这个笔记本 6 | 7 | 所以,有问题请直接 google 或者 pcbeta 8 | 9 | 转投台式机了。 10 | 11 | 江湖再见 12 | 13 | ## ReadMe 14 | 15 | 本仓库用于 Lenovo Thinkpad E440 20C5A08ECD 型号笔记本电脑 16 | 17 | 内容均为自用,仅保证同型号可用,据网友反馈 E440 系列 GT840m 显卡的型号、CPU 为 i5、i7 均可使用没有出现大问题 18 | 19 | 据网友测试,E440 740m显卡也有可用型号,E540也有型号可以使用,但没有 i3 成功的消息。 20 | 21 | 仓库包含: 22 | 23 | * 电池补丁 battary-patch 24 | * Clover 相关所有内容 25 | * 使用的驱动列表和版本 26 | * 原始 DSDT 27 | 28 | ## Overview 29 | 30 | **Working** 31 | 32 | * Intel HD4600 Graphic 33 | * HDMI 34 | * 独显屏蔽 35 | * 有线网卡 36 | * 电源管理和变频 37 | * 睡眠支持 38 | * USB 3.0 和摄像头 39 | 40 | **Not Working** 41 | 42 | * 内置无线网卡: RTL8723 无解 43 | * HDMI 音频暂且无法使用 44 | * 声卡 CONEXANT CX20751/2 (使用 Lilu + AppleALC 认不到设备) 45 | 46 | ## Releases 47 | 48 | **[下载链接](https://github.com/ZzMark/Thinkpad-E440-Hackintosh/releases)** 49 | 50 | ## changelog 51 | 52 | **Versions:** 53 | 54 | * 2019-09-20: 55 | - update to 10.14.5(Mojave) 56 | - update Clover to r5070; 57 | - update all kext and update all driver 58 | - Upgrade to the new graphics driver methods 59 | - remove to SD Card Reader(driver norenew) 60 | 61 | * 2017-03-11: 62 | * Fix Shutdown starts up again(Need change BIOS setting) 63 | * Add SD Card reader driver thnx [Sinetek](http://www.insanelymac.com/forum/topic/321080-sineteks-driver-for-realtek-rtsx-sdhc-card-readers/)(RTS5227 ID: 0x522710ec) 64 | * Updata Clover to 4012 65 | 66 | * 2017-02-18:Initial version 67 | * Realized some moudle include graphic, audio, cable network, keyboard and touchpad 68 | * Disable Discrete Graphics on DSDT 69 | * HDMI support (But HDMI audio can not use) 70 | * Keyboard adjustment(Reference to document) 71 | * Sleep support(More than 2 hours will be black screen) 72 | 73 | ## 关机后自动启动问题 74 | 75 | 这个问题我没有彻底解决 76 | 77 | 关掉 Network Wake 设置、不使用网线、关机前拔掉所有 USB 设备、关机前断开电源适配器,基本没有出现过该问题(20次还是会有一次自动开机) 78 | 79 | 最近更新到最新的 RTL8111 驱动,插着网线、USB、电源适配器也很少出现该问题(20次会有一次的程度),基本不会影响到使用,也不想再追查下去了。 80 | 81 | ## Feedback 82 | 83 | If you have any question, Plese do not hesitate to contact me by using the issue function. 84 | 85 | ## thanks to 86 | 87 | Clover Team 88 | 89 | RehabMan 90 | 91 | Sinetek 92 | 93 | pcbeta 论坛的各路水友们 94 | 95 | 全世界为 Hackintosh 奋斗的 程序员/黑客 们 96 | 97 | ## License 98 | 99 | 本项目使用 [GPL v3](http://www.gnu.org/copyleft/gpl.html) 协议,如需使用请遵照协议。 100 | -------------------------------------------------------------------------------- /document/old/DSDT.MD: -------------------------------------------------------------------------------- 1 | # DSDT修改记录 2 | 3 | 提取工具:Ubuntu 4 | 5 | 提取版本:BIOS 2.27 6 | 7 | 版本:17-2-18 8 | 9 | ## 使用补丁: 10 | 11 | ### DSDT 12 | 13 | Remove _DSM 14 | 15 | Rename PCI0.VID to PCI0.IGPU 16 | 17 | Rename B0D3 to HDAU (ID=12) 18 | 19 | Haswell HD4600 Yosemite 20 | 21 | Brightness fix 22 | 23 | Haswell LPC(修改ID为8086:8c4b) 24 | 25 | OS Check Fix(win8) 26 | 27 | 0x0D-USB3补丁 28 | 29 | 电池补丁 30 | 31 | 声卡注入(ID=28) 32 | 33 | IRQ patch 34 | 35 | ### SSDT-4 36 | 37 | Remove _PSS placeholder 38 | 39 | ### SSDT-5 40 | 41 | 删除,替换ss变频文件 42 | 43 | ### SSDT-6 44 | 45 | Rename PCI0.VID to PCI0.IGPU 46 | 47 | Rename B0D3 to HDAU (ID=12) 48 | 49 | 手动修改device名称 50 | 51 | ### 备选补丁: 52 | 53 | HPET Fix 修正因HPET唤醒睡眠 54 | 55 | ## HDMI: 56 | 57 | 参考教程:[\[Guide\] Intel IGPU HDMI/DP audio](https://www.tonymacx86.com/threads/guide-intel-igpu-hdmi-dp-audio-sandy-ivy-haswell-broadwell-skylake.189495/) 58 | 59 | 若接上HDMI黑屏,可参照该教程 60 | 61 | 查明缓冲区参数是0105还是0204(`IOReg`中查看 `Framebuffer@X` 的属性,一般 X为1 是内置显示器,第二个是外置接口)然后使用Clover打上相应补丁(补丁参照Rehabman的Github中的文件) 62 | 63 | 该补丁修复了接口状态问题,若接口本来就是DP(0x00400000)则不需要这个补丁 64 | 65 | ## 屏蔽独显: 66 | 67 | 参考教程:[https://www.firewolf.science/2015/05/%E5%B1%8F%E8%94%BD%E5%8F%8C%E6%98%BE%E5%8D%A1%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%9A%84%E7%8B%AC%E6%98%BE/](https://www.firewolf.science/2015/05/%E5%B1%8F%E8%94%BD%E5%8F%8C%E6%98%BE%E5%8D%A1%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%9A%84%E7%8B%AC%E6%98%BE/) 68 | 69 | 关闭独显Method:GPOF 70 | 71 | ```iasl 72 | \_SB.PCI0.PEG.VID.OMPR = 0x03 73 | \_SB.PCI0.PEG.VID._PS3() 74 | ``` 75 | 76 | 几个和独显切换相关的Method: 77 | 78 | NBCI、NVOP(NV OPTIMUS DSM)、NVPS(NV GPS DSM) 79 | 80 | 将关闭两行放在`_WAK`的 return 前,调用 `_PS3` 方法来改变电源状态 81 | 82 | 开启放在 `_PTS` 最前,即开始睡眠时打开显卡,调用 `_PS0` 电源状态 83 | 84 | ## 待解决 85 | 86 | ### 唤醒后风扇不停 87 | 88 | 修改: 89 | 90 | 删除GPOF中 91 | 92 | ```iasl 93 | While ((\LCHK (0x00) == 0x00)) 94 | { 95 | Stall (0x64) 96 | } 97 | ``` 98 | 99 | 链路分析: 100 | 101 | _PS3电源状态:=》调用GPOF:=》ISOP=》判断(VDSP && (VIGD && VDSC))三个寄存器状态{ 102 | 103 | VDSP,默认为1,根级寄存器,没有赋值,功能不明 104 | 105 | VIGD,默认值1,根级寄存器,没有赋值,与EC相关,与两个显卡相关,疑似有其他的可以改这个值 106 | 107 | VDSC,默认值1,根级寄存器,没有赋值,就用过这一次 108 | 109 | } =》\_SB.PCI0.PEG.VID.OMPR == 0x03 判断该值 =》 修改D80P=0x33 该寄存器在EC中随处可见 110 | 111 | ### 关机变重启 112 | 113 | ~~方案1:DSDT USB名称从BHC1改成EH01-失败~~ 114 | 115 | 方案2:主板上,关闭 `LAN Wake` 网卡唤醒 — 成功但不完全,使用电源、网线、usb时还是会发生该问题 116 | 117 | ~~方案3:Clover打FixShutdown补丁 - 失败~~ 118 | 119 | ~~方案4:DSDT Shutdown补丁 - 不支持~~ 120 | 121 | 方案5:删掉网卡驱动 -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_compat.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_compat.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_compat_hpp 9 | #define kern_compat_hpp 10 | 11 | #include 12 | //Actually do not include to catch real errors 13 | //#include 14 | #include 15 | 16 | // Please do not use memcpy and similar functions, since they compile 17 | // to macros unsupported by any other system with 10.13 SDK unless 18 | // Availability.h header is included. 19 | #define lilu_os_memcpy(...) (memcpy)(__VA_ARGS__) 20 | #define lilu_os_memmove(...) (memmove)(__VA_ARGS__) 21 | #define lilu_os_strncpy(...) (strncpy)(__VA_ARGS__) 22 | #define lilu_os_strncat(...) (strncat)(__VA_ARGS__) 23 | #define lilu_os_strlcat(...) (strlcat)(__VA_ARGS__) 24 | #define lilu_os_strlcpy(...) (strlcpy)(__VA_ARGS__) 25 | #define lilu_os_strcat(...) (strcat)(__VA_ARGS__) 26 | #define lilu_os_bcopy(...) (bcopy)(__VA_ARGS__) 27 | 28 | // Additionally disallow the use of the original functions 29 | #ifndef LILU_DISABLE_MEMFUNC_REDEFINE 30 | 31 | #ifdef memcpy 32 | #undef memcpy 33 | #define memcpy(...) _Pragma("GCC error \"Avoid memcpy due to 10.13 SDK bugs!\"") 34 | #endif 35 | 36 | #ifdef memmove 37 | #undef memmove 38 | #define memmove(...) _Pragma("GCC error \"Avoid memmove due to 10.13 SDK bugs!\"") 39 | #endif 40 | 41 | #ifdef strncpy 42 | #undef strncpy 43 | #define strncpy(...) _Pragma("GCC error \"Avoid strncpy due to 10.13 SDK bugs!\"") 44 | #endif 45 | 46 | #ifdef strncat 47 | #undef strncat 48 | #define strncat(...) _Pragma("GCC error \"Avoid strncat due to 10.13 SDK bugs!\"") 49 | #endif 50 | 51 | #ifdef strlcat 52 | #undef strlcat 53 | #define strlcat(...) _Pragma("GCC error \"Avoid strlcat due to 10.13 SDK bugs!\"") 54 | #endif 55 | 56 | #ifdef strlcpy 57 | #undef strlcpy 58 | #define strlcpy(...) _Pragma("GCC error \"Avoid strlcpy due to 10.13 SDK bugs!\"") 59 | #endif 60 | 61 | #ifdef strcat 62 | #undef strcat 63 | #define strcat(...) _Pragma("GCC error \"Avoid strcat due to 10.13 SDK bugs!\"") 64 | #endif 65 | 66 | #ifdef bcopy 67 | #undef bcopy 68 | #define bcopy(...) _Pragma("GCC error \"Avoid bcopy due to 10.13 SDK bugs!\"") 69 | #endif 70 | 71 | #endif /* LILU_DISABLE_MEMFUNC_REDEFINE */ 72 | 73 | // This may not be nice but will protect users from changes in KernInfo strcture. 74 | #ifndef LILU_DISABLE_BRACE_WARNINGS 75 | #pragma clang diagnostic error "-Wmissing-braces" 76 | #endif 77 | 78 | #endif /* kern_compat_hpp */ 79 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_efi.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_efi.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_efi_h 9 | #define kern_efi_h 10 | 11 | #include 12 | 13 | #include 14 | 15 | /** 16 | * Convert 32-bit EFI errors provided by Apple to 64-bit EFI errors 17 | */ 18 | #define EFI_ERROR64(x) (((x) & ~(1ULL << 31)) | (1ULL << 63)) 19 | static_assert(EFI_LOAD_ERROR == 0x80000001 && EFI_ERROR64(EFI_LOAD_ERROR) == 0x8000000000000001, 20 | "Apple has finally upgraded EFI headers!"); 21 | 22 | class EfiRuntimeServices { 23 | IOLock *accessLock {nullptr}; 24 | static EfiRuntimeServices *instance; 25 | public: 26 | /** 27 | * Activates EFI Runtime Services 28 | */ 29 | static void activate(); 30 | 31 | /** 32 | * Lilu custom GUIDs exports, see OcSupportPkg/Include/Guid/OcVariables.h 33 | */ 34 | EXPORT static const EFI_GUID LiluVendorGuid; 35 | EXPORT static const EFI_GUID LiluReadOnlyGuid; 36 | EXPORT static const EFI_GUID LiluWriteOnlyGuid; 37 | 38 | /** 39 | * Get EFI Runtime Services wrapper if supported 40 | * 41 | * @param lock lock instance during the run, must be put back 42 | * 43 | * @return wrapper instance 44 | */ 45 | EXPORT static EfiRuntimeServices *get(bool lock=false); 46 | 47 | /** 48 | * Put EFI Runtime Services wrapper to unlock 49 | */ 50 | EXPORT void put(); 51 | 52 | /** 53 | * Perform system reset (does not return on success) 54 | * 55 | * @param type reset type 56 | */ 57 | EXPORT void resetSystem(EFI_RESET_TYPE type); 58 | 59 | /** 60 | * Obtain EFI variable, invokes EFI_RUNTIME_SERVICES::GetVariable. 61 | * 62 | * @param name variable name 63 | * @param guid vendor guid 64 | * @param attr variable attributes 65 | * @param size data buffer size updated on read 66 | * @param data read data 67 | * 68 | * @return EFI_STATUS code 69 | */ 70 | EXPORT uint64_t getVariable(const char16_t *name, const EFI_GUID *guid, uint32_t *attr, uint64_t *size, void *data); 71 | 72 | /** 73 | * Set EFI variable, invokes EFI_RUNTIME_SERVICES::SetVariable. 74 | * 75 | * @param name variable name 76 | * @param guid vendor guid 77 | * @param attr variable attributes 78 | * @param size data buffer size 79 | * @param data data to write 80 | * 81 | * @return EFI_STATUS code 82 | */ 83 | EXPORT uint64_t setVariable(const char16_t *name, const EFI_GUID *guid, uint32_t attr, uint64_t size, void *data); 84 | }; 85 | 86 | #endif /* kern_efi_h */ 87 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 17D102 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Lilu 11 | CFBundleIdentifier 12 | as.vit9696.Lilu 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Lilu 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.3.7 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.3.7 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 9F2000 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 17E189 37 | DTSDKName 38 | macosx10.13 39 | DTXcode 40 | 0941 41 | DTXcodeBuild 42 | 9F2000 43 | IOKitPersonalities 44 | 45 | as.vit9696.Lilu 46 | 47 | CFBundleIdentifier 48 | as.vit9696.Lilu 49 | IOClass 50 | Lilu 51 | IOMatchCategory 52 | Lilu 53 | IOProviderClass 54 | IOResources 55 | IOResourceMatch 56 | IOKit 57 | 58 | 59 | NSHumanReadableCopyright 60 | Copyright © 2016-2018 vit9696. All rights reserved. 61 | OSBundleCompatibleVersion 62 | 1.2.0 63 | OSBundleLibraries 64 | 65 | com.apple.kpi.bsd 66 | 12.0.0 67 | com.apple.kpi.dsep 68 | 12.0.0 69 | com.apple.kpi.iokit 70 | 12.0.0 71 | com.apple.kpi.libkern 72 | 12.0.0 73 | com.apple.kpi.mach 74 | 12.0.0 75 | com.apple.kpi.unsupported 76 | 12.0.0 77 | 78 | OSBundleRequired 79 | Root 80 | 81 | 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Thinkpad E440 Hackintosh Files 2 | 3 | English | [中文](./README-zh.md) 4 | 5 | # Deprecated 6 | 7 | by something, i ve lost this laptop. 8 | 9 | so, this repository was archived. any question please goto google. 10 | 11 | ## ReadMe 12 | 13 | This is related to OS X repositories. 14 | 15 | Only support Lenovo Thinkpad E440 20C5A08ECD. 16 | 17 | Other models are not applicable. 18 | 19 | This repositories contains: 20 | 21 | * battary-patch 22 | * Clover-config 23 | * kext-list 24 | * DSDT-source 25 | 26 | ## Overview 27 | 28 | **Working** 29 | 30 | * Intel HD4600 Graphic 31 | * Brightness to Shortcut 32 | * HDMI support (But HDMI audio can not use) 33 | * Disabled NVIDA Geforce graphic card under DSDT 34 | * Cabel Network Support 35 | * SpeedStepping 36 | * Sleep 37 | * USB 38 | 39 | **Not Working** 40 | 41 | * internal WIFI cark: RTL8723 not solution 42 | * USB not integrated: Shutdown change to restart 43 | * HDMI Audio not working 44 | * CONEXANT CX20751/2 Audio (not work to use AppleALC) 45 | * USB 3.0(just a few problems) 46 | 47 | ## Releases 48 | 49 | **[Click to Download Releases](https://github.com/ZzMark/Thinkpad-E440-Hackintosh/releases)** 50 | 51 | **Versions:** 52 | 53 | * 2019-09-20: 54 | - update to 10.14.5(Mojave) 55 | - update Clover to r5070; 56 | - update all kext and update all driver 57 | - Upgrade to the new graphics driver methods 58 | - remove to SD Card Reader(driver norenew) 59 | 60 | * 2017-03-11: 61 | * Fix Shutdown starts up again(Need change BIOS setting) 62 | * Add SD Card reader driver thnx[Sinetek](http://www.insanelymac.com/forum/topic/321080-sineteks-driver-for-realtek-rtsx-sdhc-card-readers/)(RTS5227 ID: 0x522710ec) 63 | * Updata Clover to 4012 64 | 65 | * 2017-02-18:Initial version 66 | * Realized some moudle include graphic, audio, cable network, keyboard and touchpad 67 | * Disable Discrete Graphics on DSDT 68 | * HDMI support (But HDMI audio can not use) 69 | * Keyboard adjustment(Reference to document) 70 | * Sleep support(More than 2 hours will be black screen) 71 | 72 | ## How to fix Shutdown 73 | 74 | Turn off about Network Wake setting in BIOS 75 | 76 | ## How to use it 77 | 78 | Download this and according to Clover boot. 79 | 80 | ## Feedback 81 | 82 | If you have any question, Plese do not hesitate to contact me by using the issue function. 83 | 84 | ## thanks to 85 | 86 | Clover Team 87 | 88 | RehabMan 89 | 90 | Sinetek 91 | 92 | pcbeta forum's users 93 | 94 | and more OS X hacker 95 | 96 | ## License 97 | 98 | The source code is released under [GPL v3](http://www.gnu.org/copyleft/gpl.html) or (at your option) any later version. 99 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/RTCMemoryFixup.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 17D102 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | RTCMemoryFixup 11 | CFBundleIdentifier 12 | as.lvs1974.RTCMemoryFixup 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | RTCMemoryFixup 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.0.3 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1.0.3 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 9F2000 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 17E189 35 | DTSDKName 36 | macosx10.13 37 | DTXcode 38 | 0941 39 | DTXcodeBuild 40 | 9F2000 41 | IOKitPersonalities 42 | 43 | as.lvs1974.RTCMemoryFixup 44 | 45 | CFBundleIdentifier 46 | as.lvs1974.RTCMemoryFixup 47 | IOClass 48 | RTCMemoryFixup 49 | IONameMatch 50 | PNP0B00 51 | IOProbeScore 52 | 100 53 | IOProviderClass 54 | IOACPIPlatformDevice 55 | 56 | 57 | NSHumanReadableCopyright 58 | Copyright © 2018 lvs1974. All rights reserved. 59 | OSBundleCompatibleVersion 60 | 1.0 61 | OSBundleLibraries 62 | 63 | as.vit9696.Lilu 64 | 1.2.0 65 | com.apple.kpi.bsd 66 | 12.0.0 67 | com.apple.kpi.dsep 68 | 12.0.0 69 | com.apple.kpi.iokit 70 | 12.0.0 71 | com.apple.kpi.libkern 72 | 12.0.0 73 | com.apple.kpi.mach 74 | 12.0.0 75 | com.apple.kpi.unsupported 76 | 12.0.0 77 | 78 | OSBundleRequired 79 | Root 80 | 81 | 82 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_file.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_file.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_file_hpp 9 | #define kern_file_hpp 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | namespace FileIO { 18 | /** 19 | * Reads file data at path 20 | * 21 | * @param path full file path 22 | * @param size bytes read 23 | * 24 | * @return allocated buffer on success or nullptr on error 25 | */ 26 | EXPORT uint8_t *readFileToBuffer(const char *path, size_t &size); 27 | 28 | /** 29 | * Read file data from a vnode 30 | * 31 | * @param buffer output buffer 32 | * @param off file offset 33 | * @param sz bytes to read 34 | * @param vnode file node 35 | * @param ctxt filesystem context 36 | * 37 | * @return 0 on success 38 | */ 39 | EXPORT int readFileData(void *buffer, off_t off, size_t sz, vnode_t vnode, vfs_context_t ctxt); 40 | 41 | /** 42 | * Read file size from a vnode 43 | * 44 | * @param vnode file node 45 | * @param ctxt filesystem context 46 | * 47 | * @return file size or 0 48 | */ 49 | EXPORT size_t readFileSize(vnode_t vnode, vfs_context_t ctxt); 50 | 51 | /** 52 | * Writes buffer to a file at path 53 | * 54 | * @param path full file path 55 | * @param buffer input buffer 56 | * @param size bytes write 57 | * @param fmode file opening mode 58 | * @param cmode file permissions 59 | * 60 | * @return 0 on success 61 | */ 62 | EXPORT int writeBufferToFile(const char *path, void *buffer, size_t size, int fmode=O_TRUNC | O_CREAT | FWRITE | O_NOFOLLOW, int cmode=S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); 63 | 64 | /** 65 | * Write file data to a vnode 66 | * 67 | * @param buffer input buffer 68 | * @param off file offset 69 | * @param size bytes to write 70 | * @param vnode file node 71 | * @param ctxt filesystem context 72 | * 73 | * @return 0 on success 74 | */ 75 | EXPORT int writeFileData(void *buffer, off_t off, size_t size, vnode_t vnode, vfs_context_t ctxt); 76 | 77 | /** 78 | * Perform file i/o through a vnode 79 | * 80 | * @param buffer input buffer 81 | * @param off file offset 82 | * @param size bytes to write 83 | * @param vnode file node 84 | * @param ctxt filesystem context 85 | * @param write write to buffer otherwise read 86 | * 87 | * @return 0 on success 88 | */ 89 | int performFileIO(void *buffer, off_t off, size_t size, vnode_t vnode, vfs_context_t ctxt, bool write); 90 | } 91 | 92 | #endif /* kern_file_hpp */ 93 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_crypto.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_crypto.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_crypto_h 9 | #define kern_crypto_h 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace Crypto { 16 | /** 17 | * Currently this is equal to both key size and block size 18 | */ 19 | static constexpr uint32_t BlockSize = 16; 20 | 21 | /** 22 | * Currently this is guaranteed hash size 23 | */ 24 | static constexpr uint32_t MinDigestSize = 32; 25 | 26 | /** 27 | * Encrypted data format 28 | */ 29 | struct PACKED Encrypted { 30 | uint8_t iv[BlockSize]; // Initialisation vector 31 | struct PACKED Data { 32 | uint32_t size; // Actual encrypted buffer size 33 | uint8_t buf[BlockSize - sizeof(uint32_t)]; // Encrypted buffer >= BlockSize 34 | }; 35 | 36 | union { 37 | Data enc; 38 | uint8_t buf[BlockSize]; 39 | }; 40 | }; 41 | 42 | /** 43 | * Securely erase memory buffer 44 | * Based off cc_clear from corecrypto (src/cc_clear.c) 45 | * 46 | * @param len buffer length 47 | * @param dst buffer pointer 48 | */ 49 | inline void zeroMemory(size_t len, void *dst) { 50 | auto vptr = reinterpret_cast(dst); 51 | while (len--) 52 | *vptr++ = '\0'; 53 | } 54 | 55 | /** 56 | * Generates cryptographically secure encryption key (from /dev/random) 57 | * 58 | * @return generated key of at least BlockSize bits long (must be freeded by Buffer::deleter) or nullptr 59 | */ 60 | EXPORT uint8_t *genUniqueKey(uint32_t size=BlockSize); 61 | 62 | /** 63 | * Encrypts data of specified size and stores in Encrypted format 64 | * 65 | * @param key encryption key returned by genUniqueKey 66 | * @param src source data 67 | * @param size data size, encrypted size is returned on success 68 | * 69 | * @param encrypted data in Encrypted format (must be freeded by Buffer::deleter) or nullptr 70 | */ 71 | EXPORT uint8_t *encrypt(const uint8_t *key, const uint8_t *src, uint32_t &size); 72 | 73 | /** 74 | * Decrypts data of specified size stored in Encrypted format 75 | * 76 | * @param key encryption key returned by genUniqueKey 77 | * @param src source data 78 | * @param size data size, decrypted size is returned on success 79 | * 80 | * @param decrypted data (must be freeded by Buffer::deleter) or nullptr 81 | */ 82 | EXPORT uint8_t *decrypt(const uint8_t *key, const uint8_t *src, uint32_t &size); 83 | 84 | /** 85 | * Calculate digest of given size 86 | * 87 | * @param src source data 88 | * @param size data size 89 | * 90 | * @return digest hash of at least MinDigestSize bytes (must be freeded by Buffer::deleter) or nullptr 91 | */ 92 | EXPORT uint8_t *hash(const uint8_t *src, uint32_t size); 93 | } 94 | 95 | #endif /* kern_crypto_h */ 96 | -------------------------------------------------------------------------------- /document/e440_键盘完善记录.md: -------------------------------------------------------------------------------- 1 | # E440 键盘完善记录 2 | 3 | Mac的键盘使用逻辑和Windows有着一些差别,例如`Home`、`End`的功能设计,Windows中是切换到这一行的开始和结尾,而苹果则是回到该页面的最上和最下,使用 `Command+←/→` 可以实现Windows中Home、End的功能。 4 | 5 | 本篇修改`VoodooPS2`驱动,为了实现`上排多媒体功能键`的功能和`Fn系列`按键的功能,对照并沿用了一部分Windows的习惯,若需要更进一步的统一化,建议使用[KeyRemap4MacBook](http://pqrs.org/macosx/keyremap4macbook)软件来实现更复杂的功能。 6 | 7 | **本文所使用的快捷键功能等名词并不准确,若有疑问请提交Issue,我会重新审阅。** 8 | 9 | --- 10 | 11 | ## 名词 12 | 13 | * Fn状态: 键盘上Fn按键右上角的灯亮,在win中反应为F5按键为刷新功能,Fn+F5为减少亮度。`Fn+Esc`可切换该状态 14 | 15 | ## 预期结果: 16 | 17 | 因为键盘上的F1-F12中有很多按钮在非Fn状态下连PS2键值(也就是硬件的按键码)都没有,也就无从谈起修改 18 | 19 | 最后决定方案设定如下: 20 | 21 | f1-f3音量功能默认在非Fn状态下,取功能值并映射在Fn状态下,最终实现以下内容 22 | 23 | * Fn+F1:静音 24 | * Fn+F2:音量减 25 | * Fn+F3:音量加 26 | * Fn+F4:无 27 | * Fn+F5:亮度减 28 | * Fn+F6:亮度加 29 | * Fn+F7:无 30 | * Fn+F8:无 31 | * Fn+F9:设置(需到设置中修改) 32 | * Fn+F10:Spotlight(需到设置中修改) 33 | * Fn+F11:显示桌面(默认) 34 | * Fn+F12:显示Dashboard(默认) 35 | 36 | --- 37 | 38 | ## 使用方法: 39 | 40 | 将修饰键的顺序调整为 41 | 42 | * Control => Command 43 | * Option => Control 44 | * Command => Option 45 | 46 | 该顺序可还原许多Windows上的习惯,例如Ctrl+C/X/V/Z/Y复制剪切粘贴撤销复原等操作。 47 | 48 | win+左右可以切换桌面,也和win10的习惯相近(win10中为ctrl+win+左右) 49 | 50 | 退出Fn状态,设置亮度快捷键为F5、F6,调整设置快捷键为F9,Spotlight为F10,即可实现上述要求,并且不影响快捷键-键盘中涉及到F4-F10的功能。 51 | 52 | ### 问题 53 | 54 | F1-F3因为系统无法替换音量快捷键,故采取了按键映射法,将功能键音量静音、减、加与F1、F2、F3替换,故使用按键时为使用方便应尽量避免使用F1-F3,若需要真正的F1-F3,该按键的使用方法为Fn+F1-F3。 55 | 56 | --- 57 | 58 | ### 普通用户看到这就可以了。 59 | 60 | --- 61 | 62 | ### 附1:键值映射表 63 | 64 | **完整键值表及mac功能码表请参阅源代码中[ApplePS2ToADBMap.h](https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/blob/master/VoodooPS2Keyboard/ApplePS2ToADBMap.h)文件。 65 | 66 | e020=4a down // 功能音量静音 67 | 68 | e02e=49 down // 功能音量减 69 | 70 | e030=48 down // 功能音量加 71 | 72 | 3b=7a down // F1 73 | 74 | 3c=78 down // F2 75 | 76 | 3d=63 down // F3 77 | 78 | --- 79 | 80 | ### 附2:常用快捷键 81 | 82 | Win键+方向 左右切换屏幕 83 | 84 | Win键+上下 多桌面/多文档 85 | 86 | Win键+空格 切换输入法 87 | 88 | Win键+Alt+空格 直接切换输入法 89 | 90 | Ctrl+Tab 相当于Windows中Alt+Tab 91 | 92 | Ctrl+· 直接切换程序 93 | 94 | Ctrl+Win+空格 表情面板(重点推荐) 95 | 96 | Ctrl+方向上下、左右 相当于Win中的PgUp/PgDw、Home/End 97 | 98 | --- 99 | 100 | ### 附3:完善修改过程 101 | 102 | **为了实现预期目标设计的键位调换** 103 | 104 | F1 静音 105 | 106 | F2 音量减 107 | 108 | F3 音量加 109 | 110 | 上述三组按键对换 111 | 112 | #### 计算得出的补丁为: 113 | 114 | 3b=4a 115 | 116 | 3c=49 117 | 118 | 3d=48 119 | 120 | e020=7a 121 | 122 | e02e=78 123 | 124 | e030=63 125 | 126 | #### 将下面代码填写至 127 | 128 | `VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist` 129 | 130 | 文件中的 131 | 132 | `IOKitPersonalities/ApplePS2Keyboard/Platform Profile/Default/Custom ADB Map` 133 | 134 | ```xml 135 | Custom ADB Map 136 | 137 | 3b=4a 138 | 3c=49 139 | 3d=48 140 | e020=7a 141 | e02e=78 142 | e030=63 143 | 144 | ``` 145 | 146 | --- 147 | -------------------------------------------------------------------------------- /document/10.14升级记录.md: -------------------------------------------------------------------------------- 1 | # 10.14 升级记录 2 | 3 | ## clover 4 | 5 | 准备最新的 Clover 6 | 7 | 准备kext: 8 | 9 | - Lilu.kext 10 | - AppleALC.kext 11 | - WhateverGreen.kext 12 | - FakeSMC.kext 13 | - VoodooPS2Controller.kext 14 | - RealtekRTL8111.kext 15 | 16 | kext 一律放在 kext/10.14 中,我的系统是从 10.12 直接升级上来的,必要的文件准备好后就可以直接升级 17 | 18 | 准备 driver64UEFI: 19 | 20 | - ApfsDriverLoader apfs文件系统支持 21 | - [AptioInputFix](https://github.com/acidanthera/AptioFixPkg) IO映射 22 | - [AptioMemoryFix](https://github.com/acidanthera/AptioFixPkg) 内存映射 23 | - DataHubDxe Clover包含,必备驱动 24 | - Fat-64 fat文件系统驱动 25 | - FSInject-64 Clover包含,kext注入必备 26 | - HFSPlus hfs文件系统,mac必备之一 27 | - OsxFatBinaryDrv-64 28 | - PartitionDxe-64 分区表支持 29 | - SMCHelper-64 激活 File Vault 时 fakeSMC 搭配需要,不是必须 30 | - UsbKbDxe 激活 File Vault 需要 31 | 32 | 驱动中可能会有不必要的,如需要去掉请自行测试。 33 | 34 | 其中 hfsplus 要优于 vbox-hfs,但 hfsplus 是闭源的,我的包中没有放入这个,需要的话自行寻找 35 | 36 | 有了这些,不需要DSDT,不需要什么奇特的配置,直接就可以正常使用 37 | 38 | ## 显卡驱动、完善、注入Framebuffer 39 | 40 | 目前显卡驱动依托于 WhateverGreen,不再使用 FakePCIID 驱动,也不用在DSDT内注入显卡、亮度等信息了。 41 | 42 | 不过 HD4600 有其他的麻烦,就是花屏,花屏的原因在于 DVMT 给的太少(确切说是 cursor memory 默认只有6M,这是4代特有的属性),为了解决花屏问题,需要增加显存。 43 | 44 | 补丁在 config.plist 的 Device -> Properties 中 45 | 46 | 补丁的制作参考 [WhateverGreen/FAQ](https://github.com/acidanthera/WhateverGreen/blob/master/Manual/FAQ.IntelHD.cn.md) 47 | 48 | 我所选用的参数,都是DATA格式,括号内为人能看得懂的值: 49 | 50 | - ig-platform-id: 0600260A(0x0a260006) 51 | - framebuffer-cursormem: 00009000(00900000, 9M) 52 | - framebuffer-fbmem: 00009000(00900000, 9M) 53 | - framebuffer-unifiedmem: 00000080(80000000, 2048M) 54 | - framebuffer-stolenmem: 00003001(01300000, 48M) 55 | 56 | 设置显存为 2048M,设置 `cursor memory` 为 9M,设置 stolen 为 48M,解决了花屏问题。不过这个参数是否可行,还需要大量的测试 57 | 58 | 对于笔记本 HD4600 开机的八个苹果问题,网友说注入正确的 EDID 可以解决,但我尝试了许多次,无一例外全都失败了。最终的解决方案为修改 clover 的分辨率为 1024x768,带来的问题是选择引导的时候图标大的恼人,但这也不是什么大问题了,毕竟除了美观什么都没问题 59 | 60 | PS: 如果 stolen 设置为 64M,就会出现显示异常,具体表现为 许多app无法显示图片、汉字,甚至整个都无法显示。 61 | 62 | PS2: stolen 小于 32M,在我这里会无法开机 63 | 64 | PS3: [Coffee Lake帧缓冲区补丁及UHD630 Coffee Lake ig-platform-id数据整理](https://blog.daliansky.net/Coffee-Lake-frame-buffer-patch-and-UHD630-Coffee-Lake-ig-platform-id-data-finishing.html) 整理了许多的数据,可供参考,实际还是需要自行测试,反正我是一条都没用上。 65 | 66 | PS4: 小兵的教程那有太多东西在 HD4600 这里效果不佳,所以还是遵照原文,计算一下所需数值为佳。 67 | 68 | ## 内建usb 69 | 70 | 1. 使用命令输出USB总线 71 | ```sh 72 | ioreg | grep @14 | awk '{print $3 $4 $5 $6}' | sed 's/ 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G1114 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | RealtekRTL8111 11 | CFBundleIdentifier 12 | com.insanelymac.RealtekRTL8111 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | RealtekRTL8111 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 2.2.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 2.2.2 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | IOKitPersonalities 44 | 45 | RTL8111 PCIe Adapter 46 | 47 | CFBundleIdentifier 48 | com.insanelymac.RealtekRTL8111 49 | Driver_Version 50 | 2.2.2 51 | IOClass 52 | RTL8111 53 | IOPCIMatch 54 | 0x816810ec 0x81681186 55 | IOProbeScore 56 | 1000 57 | IOProviderClass 58 | IOPCIDevice 59 | Model 60 | RTL8111 61 | Vendor 62 | Realtek 63 | disableASPM 64 | 65 | enableCSO6 66 | 67 | enableEEE 68 | 69 | enableTSO4 70 | 71 | enableTSO6 72 | 73 | intrMitigate 74 | 53080 75 | rxPolling 76 | 77 | 78 | 79 | NSHumanReadableCopyright 80 | Copyright © 2013 Laura Müller. All rights reserved. 81 | OSBundleLibraries 82 | 83 | com.apple.iokit.IONetworkingFamily 84 | 1.5.0 85 | com.apple.iokit.IOPCIFamily 86 | 1.7 87 | com.apple.kpi.bsd 88 | 8.10.0 89 | com.apple.kpi.iokit 90 | 8.10.0 91 | com.apple.kpi.libkern 92 | 8.10.0 93 | com.apple.kpi.mach 94 | 8.10.0 95 | 96 | OSBundleRequired 97 | Network-Root 98 | 99 | 100 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/CPUFriend.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 17D102 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | CPUFriend 11 | CFBundleIdentifier 12 | org.vanilla.driver.CPUFriend 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | CPUFriend 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.1.8 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.1.8 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 9F2000 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 17E189 37 | DTSDKName 38 | macosx10.13 39 | DTXcode 40 | 0941 41 | DTXcodeBuild 42 | 9F2000 43 | IOKitPersonalities 44 | 45 | CPUFriend 46 | 47 | CFBundleIdentifier 48 | org.vanilla.driver.CPUFriend 49 | IOClass 50 | CPUFriend 51 | IOMatchCategory 52 | CPUFriend 53 | IOProviderClass 54 | IOResources 55 | IOResourceMatch 56 | IOKit 57 | 58 | CPUFriendPlatform 59 | 60 | CFBundleIdentifier 61 | org.vanilla.driver.CPUFriend 62 | IOClass 63 | CPUFriendData 64 | IOProbeScore 65 | 6000 66 | IOPropertyMatch 67 | 68 | IOCPUNumber 69 | 0 70 | 71 | IOProviderClass 72 | AppleACPICPU 73 | IOResourceMatch 74 | ACPI 75 | 76 | 77 | NSHumanReadableCopyright 78 | Copyright © 2017 - 2019 PMheart. All rights reserved. 79 | OSBundleCompatibleVersion 80 | 1.0 81 | OSBundleLibraries 82 | 83 | as.vit9696.Lilu 84 | 1.2.0 85 | com.apple.iokit.IOACPIFamily 86 | 1.0.0d1 87 | com.apple.kpi.bsd 88 | 12.0.0 89 | com.apple.kpi.dsep 90 | 12.0.0 91 | com.apple.kpi.iokit 92 | 12.0.0 93 | com.apple.kpi.libkern 94 | 12.0.0 95 | com.apple.kpi.mach 96 | 12.0.0 97 | com.apple.kpi.unsupported 98 | 12.0.0 99 | 100 | OSBundleRequired 101 | Root 102 | 103 | 104 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_time.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_time.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_time_hpp 9 | #define kern_time_hpp 10 | 11 | #include 12 | 13 | /** 14 | * Obtain current system time in nanoseconds 15 | * 16 | * @return current time 17 | */ 18 | inline uint64_t getCurrentTimeNs() { 19 | uint64_t currt = 0; 20 | absolutetime_to_nanoseconds(mach_absolute_time(), &currt); 21 | return currt; 22 | } 23 | 24 | /** 25 | * Obtain current calendar system time in nanoseconds 26 | * 27 | * @return current time 28 | */ 29 | inline uint64_t getCalendarTimeNs() { 30 | clock_sec_t sc; 31 | clock_nsec_t ns; 32 | clock_get_calendar_nanotime(&sc, &ns); 33 | return static_cast(sc) * NSEC_PER_SEC + ns; 34 | } 35 | 36 | /** 37 | * Obtain time passed since some timestamp in nanoseconds 38 | * 39 | * @param start starting timestamp 40 | * @param current timestamp to check against (pass 0 for current time) 41 | * 42 | * @return delta or 0 (if current time equals or precedeces the start) 43 | */ 44 | inline uint64_t getTimeSinceNs(uint64_t start, uint64_t current = 0) { 45 | if (current == 0) 46 | current = getCurrentTimeNs(); 47 | if (current > start) 48 | return current - start; 49 | return 0; 50 | } 51 | 52 | /** 53 | * Obtain time left till a timestamp in the future in nanoseconds 54 | * 55 | * @param start starting timestamp 56 | * @param timeout timeout for the event 57 | * @param current timestamp to check against (pass 0 for current time) 58 | * 59 | * @return delta or 0 (if the timeout is over) 60 | */ 61 | inline uint64_t getTimeLeftNs(uint64_t start, uint64_t timeout, uint64_t current = 0) { 62 | if (current == 0) 63 | current = getCurrentTimeNs(); 64 | if (start + timeout > current) 65 | return start + timeout - current; 66 | return 0; 67 | } 68 | 69 | /** 70 | * Convert from nanoseconds to milliseconds 71 | * 72 | * @param t timestamp in ns 73 | * 74 | * @return timestamp in ms 75 | */ 76 | constexpr uint64_t convertNsToMs(uint64_t t) { 77 | return t / 1000000; 78 | } 79 | 80 | /** 81 | * Convert from nanoseconds to seconds 82 | * 83 | * @param t timestamp in ns 84 | * 85 | * @return timestamp in s 86 | */ 87 | constexpr uint64_t convertNsToSc(uint64_t t) { 88 | return t / 1000000000; 89 | } 90 | 91 | /** 92 | * Convert from milliseconds to seconds 93 | * 94 | * @param t timestamp in ms 95 | * 96 | * @return timestamp in s 97 | */ 98 | constexpr uint64_t convertMsToSc(uint64_t t) { 99 | return t / 1000; 100 | } 101 | 102 | /** 103 | * Convert from milliseconds to nanoseconds 104 | * 105 | * @param t timestamp in ms 106 | * 107 | * @return timestamp in ns 108 | */ 109 | constexpr uint64_t convertMsToNs(uint64_t t) { 110 | return t * 1000000; 111 | } 112 | 113 | /** 114 | * Convert from seconds to nanoseconds 115 | * 116 | * @param t timestamp in s 117 | * 118 | * @return timestamp in ns 119 | */ 120 | constexpr uint64_t convertScToNs(uint64_t t) { 121 | return t * 1000000000; 122 | } 123 | 124 | /** 125 | * Convert from seconds to milliseconds 126 | * 127 | * @param t timestamp in s 128 | * 129 | * @return timestamp in ms 130 | */ 131 | constexpr uint64_t convertScToMs(uint64_t t) { 132 | return t * 1000; 133 | } 134 | 135 | #endif /* kern_time_hpp */ 136 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/plugin_start.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // plugin_start.cpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #ifndef LILU_CUSTOM_KMOD_INIT 13 | bool ADDPR(startSuccess) = false; 14 | #else 15 | // Workaround custom kmod code and enable by default 16 | bool ADDPR(startSuccess) = true; 17 | #endif 18 | 19 | bool ADDPR(debugEnabled) = false; 20 | uint32_t ADDPR(debugPrintDelay) = 0; 21 | 22 | #if !defined(LILU_CUSTOM_KMOD_INIT) || !defined(LILU_CUSTOM_IOKIT_INIT) 23 | 24 | static const char kextVersion[] { 25 | #ifdef DEBUG 26 | 'D', 'B', 'G', '-', 27 | #else 28 | 'R', 'E', 'L', '-', 29 | #endif 30 | xStringify(MODULE_VERSION)[0], xStringify(MODULE_VERSION)[2], xStringify(MODULE_VERSION)[4], '-', 31 | getBuildYear<0>(), getBuildYear<1>(), getBuildYear<2>(), getBuildYear<3>(), '-', 32 | getBuildMonth<0>(), getBuildMonth<1>(), '-', getBuildDay<0>(), getBuildDay<1>(), '\0' 33 | }; 34 | 35 | #endif 36 | 37 | #ifndef LILU_CUSTOM_IOKIT_INIT 38 | 39 | OSDefineMetaClassAndStructors(PRODUCT_NAME, IOService) 40 | 41 | PRODUCT_NAME *ADDPR(selfInstance) = nullptr; 42 | 43 | IOService *PRODUCT_NAME::probe(IOService *provider, SInt32 *score) { 44 | ADDPR(selfInstance) = this; 45 | setProperty("VersionInfo", kextVersion); 46 | auto service = IOService::probe(provider, score); 47 | return ADDPR(startSuccess) ? service : nullptr; 48 | } 49 | 50 | bool PRODUCT_NAME::start(IOService *provider) { 51 | ADDPR(selfInstance) = this; 52 | if (!IOService::start(provider)) { 53 | SYSLOG("init", "failed to start the parent"); 54 | return false; 55 | } 56 | 57 | return ADDPR(startSuccess); 58 | } 59 | 60 | void PRODUCT_NAME::stop(IOService *provider) { 61 | ADDPR(selfInstance) = nullptr; 62 | IOService::stop(provider); 63 | } 64 | 65 | #endif /* LILU_CUSTOM_IOKIT_INIT */ 66 | 67 | #ifndef LILU_CUSTOM_KMOD_INIT 68 | 69 | EXPORT extern "C" kern_return_t ADDPR(kern_start)(kmod_info_t *, void *) { 70 | // This is an ugly hack necessary on some systems where buffering kills most of debug output. 71 | PE_parse_boot_argn("liludelay", &ADDPR(debugPrintDelay), sizeof(ADDPR(debugPrintDelay))); 72 | 73 | auto error = lilu.requestAccess(); 74 | if (error == LiluAPI::Error::NoError) { 75 | error = lilu.shouldLoad(ADDPR(config).product, ADDPR(config).version, ADDPR(config).runmode, ADDPR(config).disableArg, ADDPR(config).disableArgNum, 76 | ADDPR(config).debugArg, ADDPR(config).debugArgNum, ADDPR(config).betaArg, ADDPR(config).betaArgNum, ADDPR(config).minKernel, 77 | ADDPR(config).maxKernel, ADDPR(debugEnabled)); 78 | 79 | if (error == LiluAPI::Error::NoError) { 80 | DBGLOG("init", "%s bootstrap %s", xStringify(PRODUCT_NAME), kextVersion); 81 | (void)kextVersion; 82 | ADDPR(startSuccess) = true; 83 | ADDPR(config).pluginStart(); 84 | } else { 85 | SYSLOG("init", "parent said we should not continue %d", error); 86 | } 87 | 88 | lilu.releaseAccess(); 89 | } else { 90 | SYSLOG("init", "failed to call parent %d", error); 91 | } 92 | 93 | // Report success but actually do not start and let I/O Kit unload us. 94 | // This works better and increases boot speed in some cases. 95 | return KERN_SUCCESS; 96 | } 97 | 98 | EXPORT extern "C" kern_return_t ADDPR(kern_stop)(kmod_info_t *, void *) { 99 | // It is not safe to unload Lilu plugins unless they were disabled! 100 | return ADDPR(startSuccess) ? KERN_FAILURE : KERN_SUCCESS; 101 | } 102 | 103 | #endif /* LILU_CUSTOM_KMOD_INIT */ 104 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/capstone/platform.h: -------------------------------------------------------------------------------- 1 | /* Capstone Disassembly Engine */ 2 | /* By Axel Souchet & Nguyen Anh Quynh, 2014 */ 3 | 4 | #ifndef CAPSTONE_PLATFORM_H 5 | #define CAPSTONE_PLATFORM_H 6 | 7 | // handle C99 issue (for pre-2013 VisualStudio) 8 | #if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)) 9 | // MSVC 10 | 11 | // stdbool.h 12 | #if (_MSC_VER < 1800) || defined(_KERNEL_MODE) 13 | // this system does not have stdbool.h 14 | #ifndef __cplusplus 15 | typedef unsigned char bool; 16 | #define false 0 17 | #define true 1 18 | #endif 19 | 20 | #else 21 | // VisualStudio 2013+ -> C99 is supported 22 | #include 23 | #endif 24 | 25 | #else 26 | // not MSVC -> C99 is supported 27 | #include 28 | #endif 29 | 30 | 31 | // handle C99 issue (for pre-2013 VisualStudio) 32 | #if defined(CAPSTONE_HAS_OSXKERNEL) || (defined(_MSC_VER) && (_MSC_VER <= 1700 || defined(_KERNEL_MODE))) 33 | // this system does not have inttypes.h 34 | 35 | #if defined(_MSC_VER) && (_MSC_VER < 1600 || defined(_KERNEL_MODE)) 36 | // this system does not have stdint.h 37 | typedef signed char int8_t; 38 | typedef signed short int16_t; 39 | typedef signed int int32_t; 40 | typedef unsigned char uint8_t; 41 | typedef unsigned short uint16_t; 42 | typedef unsigned int uint32_t; 43 | typedef signed long long int64_t; 44 | typedef unsigned long long uint64_t; 45 | 46 | #define INT8_MIN (-127i8 - 1) 47 | #define INT16_MIN (-32767i16 - 1) 48 | #define INT32_MIN (-2147483647i32 - 1) 49 | #define INT64_MIN (-9223372036854775807i64 - 1) 50 | #define INT8_MAX 127i8 51 | #define INT16_MAX 32767i16 52 | #define INT32_MAX 2147483647i32 53 | #define INT64_MAX 9223372036854775807i64 54 | #define UINT8_MAX 0xffui8 55 | #define UINT16_MAX 0xffffui16 56 | #define UINT32_MAX 0xffffffffui32 57 | #define UINT64_MAX 0xffffffffffffffffui64 58 | #endif 59 | 60 | #define __PRI_8_LENGTH_MODIFIER__ "hh" 61 | #define __PRI_64_LENGTH_MODIFIER__ "ll" 62 | 63 | #define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" 64 | #define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" 65 | #define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" 66 | #define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" 67 | #define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" 68 | #define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" 69 | 70 | #define PRId16 "hd" 71 | #define PRIi16 "hi" 72 | #define PRIo16 "ho" 73 | #define PRIu16 "hu" 74 | #define PRIx16 "hx" 75 | #define PRIX16 "hX" 76 | 77 | #if defined(_MSC_VER) && _MSC_VER <= 1700 78 | #define PRId32 "ld" 79 | #define PRIi32 "li" 80 | #define PRIo32 "lo" 81 | #define PRIu32 "lu" 82 | #define PRIx32 "lx" 83 | #define PRIX32 "lX" 84 | #else // OSX 85 | #define PRId32 "d" 86 | #define PRIi32 "i" 87 | #define PRIo32 "o" 88 | #define PRIu32 "u" 89 | #define PRIx32 "x" 90 | #define PRIX32 "X" 91 | #endif 92 | 93 | #if defined(_MSC_VER) && _MSC_VER <= 1700 94 | // redefine functions from inttypes.h used in cstool 95 | #define strtoull _strtoui64 96 | #endif 97 | 98 | #define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" 99 | #define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" 100 | #define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" 101 | #define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" 102 | #define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" 103 | #define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" 104 | 105 | #else 106 | // this system has inttypes.h by default 107 | #include 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Library/security/_label.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 | * 6 | * This file contains Original Code and/or Modifications of Original Code 7 | * as defined in and that are subject to the Apple Public Source License 8 | * Version 2.0 (the 'License'). You may not use this file except in 9 | * compliance with the License. The rights granted to you under the License 10 | * may not be used to create, or enable the creation or redistribution of, 11 | * unlawful or unlicensed copies of an Apple operating system, or to 12 | * circumvent, violate, or enable the circumvention or violation of, any 13 | * terms of an Apple operating system software license agreement. 14 | * 15 | * Please obtain a copy of the License at 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 | * 18 | * The Original Code and all software distributed under the License are 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 | * Please see the License for the specific language governing rights and 24 | * limitations under the License. 25 | * 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 | */ 28 | /*- 29 | * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson 30 | * Copyright (c) 2001, 2002 Networks Associates Technology, Inc. 31 | * Copyright (c) 2005 SPARTA, Inc. 32 | * All rights reserved. 33 | * 34 | * This software was developed by Robert Watson for the TrustedBSD Project. 35 | * 36 | * This software was developed for the FreeBSD Project in part by Network 37 | * Associates Laboratories, the Security Research Division of Network 38 | * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), 39 | * as part of the DARPA CHATS research program. 40 | * 41 | * Redistribution and use in source and binary forms, with or without 42 | * modification, are permitted provided that the following conditions 43 | * are met: 44 | * 1. Redistributions of source code must retain the above copyright 45 | * notice, this list of conditions and the following disclaimer. 46 | * 2. Redistributions in binary form must reproduce the above copyright 47 | * notice, this list of conditions and the following disclaimer in the 48 | * documentation and/or other materials provided with the distribution. 49 | * 50 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 51 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 52 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 53 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 54 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 55 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 56 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 57 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 58 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 | * SUCH DAMAGE. 61 | * 62 | * $FreeBSD: src/sys/sys/_label.h,v 1.4 2003/05/08 19:49:42 rwatson Exp $ 63 | */ 64 | #ifndef _SECURITY_LABEL_H_ 65 | #define _SECURITY_LABEL_H_ 66 | 67 | /* 68 | * XXXMAC: This shouldn't be exported to userland, but is because of ucred.h 69 | * and various other messes. 70 | */ 71 | #if CONFIG_EMBEDDED 72 | #define MAC_MAX_SLOTS 3 73 | #else 74 | #define MAC_MAX_SLOTS 7 75 | #endif 76 | 77 | #define MAC_FLAG_INITIALIZED 0x0000001 /* Is initialized for use. */ 78 | 79 | struct label { 80 | int l_flags; 81 | union { 82 | void *l_ptr; 83 | long l_long; 84 | } l_perpolicy[MAC_MAX_SLOTS]; 85 | }; 86 | 87 | #endif /* !_SECURITY_LABEL_H_ */ 88 | -------------------------------------------------------------------------------- /patch/battery_ThinkPad_E440.md: -------------------------------------------------------------------------------- 1 | # battery_ThinkPad_E440.txt 2 | 3 | # version(版本): 1.0 4 | # Update Time(更新时间) :2017-01-26 5 | 6 | # initial work by Zz.Mark 2015-09-21, 由 Zz.Mark 制作 7 | 8 | # works for: ThinkPad E440 20C5A08ECD 9 | 10 | # Tip: If you get a 0% battery status,you should also patch the Rehabman's "Fix Mutex with non-zero SyncLevel" patch. 11 | # You also can patch the both of your computer's battery patch and the Rehabman's patch at one time. 12 | 13 | # 注意:如果打过电量补丁后,有获取的电池状态显示为0%的情况,你需要打 Rehabman的 “Fix Mutex with non-zero SyncLevel” 补丁。 14 | # 你也可以,一次性打好 自己电脑的电量补丁 和 Rehabman 的那个补丁。 15 | 16 | # ==== Method Load ==== 17 | 18 | into method label B1B2 remove_entry; 19 | into definitionblock code_regex . insert 20 | begin 21 | Method (B1B2, 2, NotSerialized)\n 22 | {\n 23 | Return(Or(Arg0, ShiftLeft(Arg1, 8)))\n 24 | }\n 25 | end; 26 | 27 | into method label B1B4 remove_entry; 28 | into definitionblock code_regex . insert 29 | begin 30 | Method (B1B4, 4, NotSerialized)\n 31 | {\n 32 | Store(Arg3, Local0)\n 33 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 34 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 35 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 36 | Return(Local0)\n 37 | }\n 38 | end; 39 | 40 | into method label RE1B parent_label EC remove_entry; 41 | into method label RECB parent_label EC remove_entry; 42 | into device label EC insert 43 | begin 44 | Method (RE1B, 1, NotSerialized)\n 45 | {\n 46 | OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n 47 | Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 48 | Return(BYTE)\n 49 | }\n 50 | Method (RECB, 2, Serialized)\n 51 | // Arg0 - offset in bytes from zero-based EC\n 52 | // Arg1 - size of buffer in bits\n 53 | {\n 54 | ShiftRight(Arg1, 3, Arg1)\n 55 | Name(TEMP, Buffer(Arg1) { })\n 56 | Add(Arg0, Arg1, Arg1)\n 57 | Store(0, Local0)\n 58 | While (LLess(Arg0, Arg1))\n 59 | {\n 60 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 61 | Increment(Arg0)\n 62 | Increment(Local0)\n 63 | }\n 64 | Return(TEMP)\n 65 | }\n 66 | end; 67 | 68 | # ==== Field devide ==== 69 | 70 | into device label EC code_regex SBRC,\s+16, replace_matched begin SBR1,8,SBR2,8, end; 71 | into device label EC code_regex SBAC,\s+16, replace_matched begin SBC1,8,SBC2,8, end; 72 | into device label EC code_regex SBVO,\s+16, replace_matched begin SVO1,8,SVO2,8, end; 73 | into device label EC code_regex SBBM,\s+16, replace_matched begin SBM1,8,SBM2,8, end; 74 | into device label EC code_regex SBDC,\s+16, replace_matched begin SDC1,8,SDC2,8, end; 75 | into device label EC code_regex SBDV,\s+16, replace_matched begin SDD1,8,SDD2,8, end; 76 | into device label EC code_regex SBSN,\s+16 replace_matched begin SBN1,8,SBN2,8, end; 77 | into device label EC code_regex SBFC,\s+16, replace_matched begin SBF1,8,SBF2,8, end; 78 | into device label EC code_regex SBCH,\s+32 replace_matched begin SCH0,8,SCH1,8,SCH2,8,SCH3,8 end; 79 | 80 | # ==== Replace ==== 81 | 82 | into method label GBST code_regex SBRC replace_matched begin B1B2(SBR1,SBR2) end; 83 | into method label GBST code_regex SBRC replace_matched begin B1B2(SBR1,SBR2) end; 84 | into method label GBST code_regex SBAC replace_matched begin B1B2(SBC1,SBC2) end; 85 | into method label GBST code_regex SBVO replace_matched begin B1B2(SVO1,SVO2) end; 86 | into method label GBIF code_regex SBBM replace_matched begin B1B2(SBM1,SBM2) end; 87 | into method label GBIF code_regex SBDC replace_matched begin B1B2(SDC1,SDC2) end; 88 | into method label GBIF code_regex SBDC replace_matched begin B1B2(SDC1,SDC2) end; 89 | into method label GBIF code_regex SBDV replace_matched begin B1B2(SDD1,SDD2) end; 90 | into method label GBIF code_regex SBDV replace_matched begin B1B2(SDD1,SDD2) end; 91 | into method label GBIF code_regex SBDV replace_matched begin B1B2(SDD1,SDD2) end; 92 | into method label GBIF code_regex SBSN replace_matched begin B1B2(SBN1,SBN2) end; 93 | into method label GBIF code_regex SBFC replace_matched begin B1B2(SBF1,SBF2) end; 94 | into method label GBIF code_regex SBFC replace_matched begin B1B2(SBF1,SBF2) end; 95 | 96 | into method label GBIF code_regex SBCH replaceall_matched begin B1B4(SCH0,SCH1,SCH2,SCH3) end; 97 | 98 | # utility methods to read/write buffers from/to EC 99 | 100 | into method label GBIF code_regex SBMN replaceall_matched begin RECB(0xA0, 128) end; 101 | into method label GBIF code_regex SBDN replaceall_matched begin RECB(0xA0, 128) end; 102 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18A391 7 | CFBundleExecutable 8 | VoodooPS2Controller 9 | CFBundleGetInfoString 10 | 1.9.2, Copyright Apple Computer, Inc. 2000-2003, David Elliot 2007, RehabMan 2012-2013 11 | CFBundleIdentifier 12 | org.rehabman.voodoo.driver.PS2Controller 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Voodoo PS/2 Controller 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.9.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.9.2 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 9F2000 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 12D75 37 | DTSDKName 38 | macosx10.8 39 | DTXcode 40 | 0941 41 | DTXcodeBuild 42 | 9F2000 43 | IOKitPersonalities 44 | 45 | ACPI PS/2 Nub 46 | 47 | CFBundleIdentifier 48 | org.rehabman.voodoo.driver.PS2Controller 49 | FindMouseDelay 50 | 100 51 | IOClass 52 | AppleACPIPS2Nub 53 | IONameMatch 54 | 55 | PNP0303 56 | PNP030B 57 | PNP0320 58 | 59 | IOProviderClass 60 | IOACPIPlatformDevice 61 | MouseNameMatch 62 | 63 | PNP0F03 64 | PNP0F0B 65 | PNP0F0E 66 | PNP0F13 67 | 68 | 69 | ApplePS2Controller 70 | 71 | CFBundleIdentifier 72 | org.rehabman.voodoo.driver.PS2Controller 73 | IOClass 74 | ApplePS2Controller 75 | IONameMatch 76 | ps2controller 77 | IOProviderClass 78 | IOPlatformDevice 79 | Platform Profile 80 | 81 | Default 82 | 83 | MouseWakeFirst 84 | 85 | WakeDelay 86 | 10 87 | 88 | HPQOEM 89 | 90 | 1411 91 | ProBook 92 | 1619 93 | ProBook 94 | 161C 95 | ProBook 96 | 164F 97 | ProBook 98 | 167C 99 | ProBook 100 | 167E 101 | ProBook 102 | 1680 103 | ProBook 104 | 179B 105 | ProBook 106 | 179C 107 | ProBook 108 | 17A9 109 | ProBook 110 | 17F0 111 | ProBook 112 | 17F3 113 | ProBook 114 | 17F6 115 | ProBook 116 | 1942 117 | ProBook 118 | 1949 119 | ProBook 120 | 198F 121 | ProBook 122 | ProBook 123 | 124 | WakeDelay 125 | 0 126 | 127 | ProBook-102 128 | ProBook 129 | ProBook-87 130 | ProBook 131 | 132 | 133 | RM,deliverNotifications 134 | 135 | 136 | 137 | OSBundleCompatibleVersion 138 | 1.9.2 139 | OSBundleLibraries 140 | 141 | com.apple.iokit.IOACPIFamily 142 | 1.0.0d1 143 | com.apple.kpi.bsd 144 | 8.0.0 145 | com.apple.kpi.iokit 146 | 8.0.0 147 | com.apple.kpi.libkern 148 | 8.0.0 149 | com.apple.kpi.mach 150 | 8.0.0 151 | com.apple.kpi.unsupported 152 | 8.0.0 153 | 154 | OSBundleRequired 155 | Console 156 | Source Code 157 | https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller 158 | 159 | 160 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_disasm.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_disasm.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_disasm_hpp 9 | #define kern_disasm_hpp 10 | 11 | #include 12 | #include 13 | 14 | #ifdef LILU_ADVANCED_DISASSEMBLY 15 | #ifndef CAPSTONE_HAS_OSXKERNEL 16 | #define CAPSTONE_HAS_OSXKERNEL 1 17 | #endif 18 | #include 19 | #endif /* LILU_ADVANCED_DISASSEMBLY */ 20 | 21 | #include 22 | #include 23 | 24 | class Disassembler { 25 | #ifdef LILU_ADVANCED_DISASSEMBLY 26 | /** 27 | * Because captsone handle can be 0 28 | */ 29 | bool initialised {false}; 30 | 31 | /** 32 | * Internal capstone handle 33 | */ 34 | size_t handle {}; 35 | #endif 36 | 37 | /** 38 | * Max instruction size 39 | */ 40 | static constexpr size_t MaxInstruction {15}; 41 | public: 42 | 43 | /** 44 | * Return the real instruction size contained within min bytes 45 | * Unlike instructionSize this uses HDE engine and at the cost of reduced compatibility it is much faster 46 | * Note: instruction pointer should point to at least min + 32 valid bytes. 47 | * 48 | * @param ptr instruction pointer 49 | * @param min minimal possible size 50 | * 51 | * @return instruction size >= min on success or 0 52 | */ 53 | EXPORT static size_t quickInstructionSize(mach_vm_address_t ptr, size_t min); 54 | 55 | #ifdef LILU_ADVANCED_DISASSEMBLY 56 | 57 | /** 58 | * Initialise advanced dissassembling framework 59 | * 60 | * @param detailed debugging output necessity 61 | * 62 | * @return true on success 63 | */ 64 | EXPORT bool init(bool detailed=false); 65 | 66 | /** 67 | * Deinitialise advanced dissassembling framework, must be called regardless of the init error 68 | */ 69 | EXPORT void deinit(); 70 | 71 | /** 72 | * Reads size bytes from addr and disassembles them. 73 | * 74 | * @param addr Address to read from 75 | * @param size Size of buffer to read 76 | * @param result Disassembled instructions array. You must free it 77 | * 78 | * @return size of result 79 | */ 80 | EXPORT size_t disasmBuf(mach_vm_address_t addr, size_t size, cs_insn **result); 81 | 82 | /** 83 | * Return the real instruction size contained within min bytes 84 | * 85 | * @param ptr instruction pointer 86 | * @param min minimal possible size 87 | * 88 | * @return instruction size >= min on success or 0 89 | */ 90 | EXPORT size_t instructionSize(mach_vm_address_t ptr, size_t min); 91 | 92 | /** 93 | * Reads lookup_size bytes from addr and disassembles them. 94 | * After disassembling, tries to find num-th entry with call instruction, which argument is an immediate value (some address). 95 | * 96 | * @param addr Address to read from 97 | * @param num Number of call instruction to search for 98 | * @param lookup_size Number of bytes to read 99 | * 100 | * @note It is assumed that the operand contains a positive relative address. 101 | * 102 | * @return direct address of num-th call instruction on success, else 0 103 | */ 104 | EXPORT mach_vm_address_t disasmNthSub(mach_vm_address_t addr, size_t num, size_t lookup_size); 105 | 106 | /** 107 | * @brief Reads lookup_size bytes from addr and disassembles them. 108 | * 109 | * After disassembling, tries to find num-th entry with jmp instruction, which argument is an immediate value (some address). 110 | * 111 | * @param addr Address to read from 112 | * @param num Number of jmp instruction to search for 113 | * @param lookup_size Number of bytes to read 114 | * 115 | * @note It is assumed that the operand contains a positive relative address. 116 | * 117 | * @return direct address of num-th jmp instruction on success, else 0 118 | */ 119 | EXPORT mach_vm_address_t disasmNthJmp(mach_vm_address_t addr, size_t num, size_t lookup_size); 120 | 121 | /** 122 | * Reads lookup_size bytes from addr and disassembles them. 123 | * After disassembling, tries to find num-th entry of inst instruction. 124 | * 125 | * @param addr Addres to read from 126 | * @param ins Instruction code 127 | * @param num Number of ins instruction to search for 128 | * @param lookup_size Number of bytes to read 129 | * 130 | * @return address of found instruction on success, else 0 131 | */ 132 | EXPORT mach_vm_address_t disasmNthIns(mach_vm_address_t addr, x86_insn ins, size_t num, size_t lookup_size); 133 | 134 | /** 135 | * Disassembly matching structure 136 | */ 137 | struct DisasmSig { 138 | x86_insn ins; // instruction 139 | bool sub; // relevant only for X86_INS_CALL, if its arg is X86_OP_IMM 140 | bool addr; // if you want to return the address of exact inst in sig 141 | 142 | static DisasmSig *create() { return new DisasmSig; } 143 | static void deleter(DisasmSig *sig NONNULL) { delete sig; } 144 | }; 145 | 146 | /** 147 | * Reads lookup_size bytes from addr and disassembles them. 148 | * After disassembling, tries to find num-th entry of sig instruction pattern. 149 | * 150 | * @param addr Address to read from 151 | * @param sig Instruction pattern 152 | * @param num Order of pattern to search for 153 | * @param lookup_size Number of bytes to read 154 | * 155 | * @return direct address of pattern start on success, else 0 156 | */ 157 | EXPORT mach_vm_address_t disasmSig(mach_vm_address_t addr, evector &sig, size_t num, size_t lookup_size); 158 | 159 | #endif /* LILU_ADVANCED_DISASSEMBLY */ 160 | }; 161 | 162 | #endif /* kern_disasm_hpp */ 163 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/capstone/xcore.h: -------------------------------------------------------------------------------- 1 | #ifndef CAPSTONE_XCORE_H 2 | #define CAPSTONE_XCORE_H 3 | 4 | /* Capstone Disassembly Engine */ 5 | /* By Nguyen Anh Quynh , 2014 */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #if !defined(_MSC_VER) || !defined(_KERNEL_MODE) 12 | #include 13 | #endif 14 | 15 | #include "platform.h" 16 | 17 | #ifdef _MSC_VER 18 | #pragma warning(disable:4201) 19 | #endif 20 | 21 | //> Operand type for instruction's operands 22 | typedef enum xcore_op_type { 23 | XCORE_OP_INVALID = 0, // = CS_OP_INVALID (Uninitialized). 24 | XCORE_OP_REG, // = CS_OP_REG (Register operand). 25 | XCORE_OP_IMM, // = CS_OP_IMM (Immediate operand). 26 | XCORE_OP_MEM, // = CS_OP_MEM (Memory operand). 27 | } xcore_op_type; 28 | 29 | // Instruction's operand referring to memory 30 | // This is associated with XCORE_OP_MEM operand type above 31 | typedef struct xcore_op_mem { 32 | uint8_t base; // base register 33 | uint8_t index; // index register 34 | int32_t disp; // displacement/offset value 35 | int direct; // +1: forward, -1: backward 36 | } xcore_op_mem; 37 | 38 | // Instruction operand 39 | typedef struct cs_xcore_op { 40 | xcore_op_type type; // operand type 41 | union { 42 | unsigned int reg; // register value for REG operand 43 | int32_t imm; // immediate value for IMM operand 44 | xcore_op_mem mem; // base/disp value for MEM operand 45 | }; 46 | } cs_xcore_op; 47 | 48 | // Instruction structure 49 | typedef struct cs_xcore { 50 | // Number of operands of this instruction, 51 | // or 0 when instruction has no operand. 52 | uint8_t op_count; 53 | cs_xcore_op operands[8]; // operands for this instruction. 54 | } cs_xcore; 55 | 56 | //> XCore registers 57 | typedef enum xcore_reg { 58 | XCORE_REG_INVALID = 0, 59 | 60 | XCORE_REG_CP, 61 | XCORE_REG_DP, 62 | XCORE_REG_LR, 63 | XCORE_REG_SP, 64 | XCORE_REG_R0, 65 | XCORE_REG_R1, 66 | XCORE_REG_R2, 67 | XCORE_REG_R3, 68 | XCORE_REG_R4, 69 | XCORE_REG_R5, 70 | XCORE_REG_R6, 71 | XCORE_REG_R7, 72 | XCORE_REG_R8, 73 | XCORE_REG_R9, 74 | XCORE_REG_R10, 75 | XCORE_REG_R11, 76 | 77 | //> pseudo registers 78 | XCORE_REG_PC, // pc 79 | 80 | // internal thread registers 81 | // see The-XMOS-XS1-Architecture(X7879A).pdf 82 | XCORE_REG_SCP, // save pc 83 | XCORE_REG_SSR, // save status 84 | XCORE_REG_ET, // exception type 85 | XCORE_REG_ED, // exception data 86 | XCORE_REG_SED, // save exception data 87 | XCORE_REG_KEP, // kernel entry pointer 88 | XCORE_REG_KSP, // kernel stack pointer 89 | XCORE_REG_ID, // thread ID 90 | 91 | XCORE_REG_ENDING, // <-- mark the end of the list of registers 92 | } xcore_reg; 93 | 94 | //> XCore instruction 95 | typedef enum xcore_insn { 96 | XCORE_INS_INVALID = 0, 97 | 98 | XCORE_INS_ADD, 99 | XCORE_INS_ANDNOT, 100 | XCORE_INS_AND, 101 | XCORE_INS_ASHR, 102 | XCORE_INS_BAU, 103 | XCORE_INS_BITREV, 104 | XCORE_INS_BLA, 105 | XCORE_INS_BLAT, 106 | XCORE_INS_BL, 107 | XCORE_INS_BF, 108 | XCORE_INS_BT, 109 | XCORE_INS_BU, 110 | XCORE_INS_BRU, 111 | XCORE_INS_BYTEREV, 112 | XCORE_INS_CHKCT, 113 | XCORE_INS_CLRE, 114 | XCORE_INS_CLRPT, 115 | XCORE_INS_CLRSR, 116 | XCORE_INS_CLZ, 117 | XCORE_INS_CRC8, 118 | XCORE_INS_CRC32, 119 | XCORE_INS_DCALL, 120 | XCORE_INS_DENTSP, 121 | XCORE_INS_DGETREG, 122 | XCORE_INS_DIVS, 123 | XCORE_INS_DIVU, 124 | XCORE_INS_DRESTSP, 125 | XCORE_INS_DRET, 126 | XCORE_INS_ECALLF, 127 | XCORE_INS_ECALLT, 128 | XCORE_INS_EDU, 129 | XCORE_INS_EEF, 130 | XCORE_INS_EET, 131 | XCORE_INS_EEU, 132 | XCORE_INS_ENDIN, 133 | XCORE_INS_ENTSP, 134 | XCORE_INS_EQ, 135 | XCORE_INS_EXTDP, 136 | XCORE_INS_EXTSP, 137 | XCORE_INS_FREER, 138 | XCORE_INS_FREET, 139 | XCORE_INS_GETD, 140 | XCORE_INS_GET, 141 | XCORE_INS_GETN, 142 | XCORE_INS_GETR, 143 | XCORE_INS_GETSR, 144 | XCORE_INS_GETST, 145 | XCORE_INS_GETTS, 146 | XCORE_INS_INCT, 147 | XCORE_INS_INIT, 148 | XCORE_INS_INPW, 149 | XCORE_INS_INSHR, 150 | XCORE_INS_INT, 151 | XCORE_INS_IN, 152 | XCORE_INS_KCALL, 153 | XCORE_INS_KENTSP, 154 | XCORE_INS_KRESTSP, 155 | XCORE_INS_KRET, 156 | XCORE_INS_LADD, 157 | XCORE_INS_LD16S, 158 | XCORE_INS_LD8U, 159 | XCORE_INS_LDA16, 160 | XCORE_INS_LDAP, 161 | XCORE_INS_LDAW, 162 | XCORE_INS_LDC, 163 | XCORE_INS_LDW, 164 | XCORE_INS_LDIVU, 165 | XCORE_INS_LMUL, 166 | XCORE_INS_LSS, 167 | XCORE_INS_LSUB, 168 | XCORE_INS_LSU, 169 | XCORE_INS_MACCS, 170 | XCORE_INS_MACCU, 171 | XCORE_INS_MJOIN, 172 | XCORE_INS_MKMSK, 173 | XCORE_INS_MSYNC, 174 | XCORE_INS_MUL, 175 | XCORE_INS_NEG, 176 | XCORE_INS_NOT, 177 | XCORE_INS_OR, 178 | XCORE_INS_OUTCT, 179 | XCORE_INS_OUTPW, 180 | XCORE_INS_OUTSHR, 181 | XCORE_INS_OUTT, 182 | XCORE_INS_OUT, 183 | XCORE_INS_PEEK, 184 | XCORE_INS_REMS, 185 | XCORE_INS_REMU, 186 | XCORE_INS_RETSP, 187 | XCORE_INS_SETCLK, 188 | XCORE_INS_SET, 189 | XCORE_INS_SETC, 190 | XCORE_INS_SETD, 191 | XCORE_INS_SETEV, 192 | XCORE_INS_SETN, 193 | XCORE_INS_SETPSC, 194 | XCORE_INS_SETPT, 195 | XCORE_INS_SETRDY, 196 | XCORE_INS_SETSR, 197 | XCORE_INS_SETTW, 198 | XCORE_INS_SETV, 199 | XCORE_INS_SEXT, 200 | XCORE_INS_SHL, 201 | XCORE_INS_SHR, 202 | XCORE_INS_SSYNC, 203 | XCORE_INS_ST16, 204 | XCORE_INS_ST8, 205 | XCORE_INS_STW, 206 | XCORE_INS_SUB, 207 | XCORE_INS_SYNCR, 208 | XCORE_INS_TESTCT, 209 | XCORE_INS_TESTLCL, 210 | XCORE_INS_TESTWCT, 211 | XCORE_INS_TSETMR, 212 | XCORE_INS_START, 213 | XCORE_INS_WAITEF, 214 | XCORE_INS_WAITET, 215 | XCORE_INS_WAITEU, 216 | XCORE_INS_XOR, 217 | XCORE_INS_ZEXT, 218 | 219 | XCORE_INS_ENDING, // <-- mark the end of the list of instructions 220 | } xcore_insn; 221 | 222 | //> Group of XCore instructions 223 | typedef enum xcore_insn_group { 224 | XCORE_GRP_INVALID = 0, // = CS_GRP_INVALID 225 | 226 | //> Generic groups 227 | // all jump instructions (conditional+direct+indirect jumps) 228 | XCORE_GRP_JUMP, // = CS_GRP_JUMP 229 | 230 | XCORE_GRP_ENDING, // <-- mark the end of the list of groups 231 | } xcore_insn_group; 232 | 233 | #ifdef __cplusplus 234 | } 235 | #endif 236 | 237 | #endif 238 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18A391 7 | CFBundleExecutable 8 | VoodooPS2Mouse 9 | CFBundleGetInfoString 10 | 1.9.2, Copyright Apple Computer, Inc. 2000-2004, Slice 2010, RehabMan 2012-2013 11 | CFBundleIdentifier 12 | org.rehabman.voodoo.driver.PS2Mouse 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Voodoo PS/2 Mouse 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.9.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.9.2 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 9F2000 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 12D75 37 | DTSDKName 38 | macosx10.8 39 | DTXcode 40 | 0941 41 | DTXcodeBuild 42 | 9F2000 43 | IOKitPersonalities 44 | 45 | ApplePS2Mouse 46 | 47 | CFBundleIdentifier 48 | org.rehabman.voodoo.driver.PS2Mouse 49 | HIDPointerAccelerationType 50 | HIDTrackpadAcceleration 51 | HIDScrollAccelerationType 52 | HIDTrackpadScrollAcceleration 53 | IOClass 54 | ApplePS2Mouse 55 | IOProviderClass 56 | ApplePS2MouseDevice 57 | Platform Profile 58 | 59 | Default 60 | 61 | ActLikeTrackpad 62 | 63 | ButtonCount 64 | 3 65 | Darwin 16+ 66 | 67 | ApplePreferenceCapability 68 | 69 | ApplePreferenceIdentifier 70 | com.apple.AppleMultitouchTrackpad 71 | MT Built-in 72 | 73 | MTHIDDevice 74 | 75 | SupportsGestureScrolling 76 | 77 | TrackpadEmbedded 78 | 79 | TrackpadFourFingerGestures 80 | 81 | TrackpadSecondaryClickCorners 82 | 83 | TrackpadThreeFingerDrag 84 | 85 | 86 | DefaultResolution 87 | 240 88 | DisableDevice 89 | 90 | DisableLEDUpdating 91 | 92 | FakeMiddleButton 93 | 94 | ForceDefaultResolution 95 | 96 | ForceSetResolution 97 | 98 | MiddleClickTime 99 | 100000000 100 | MouseCount 101 | 0 102 | MouseYInverter 103 | 1 104 | ProcessBluetoothMouseStopsTrackpad 105 | 106 | ProcessUSBMouseStopsTrackpad 107 | 108 | QuietTimeAfterTyping 109 | 500000000 110 | ResolutionMode 111 | 3 112 | ScrollResolution 113 | 5 114 | ScrollYInverter 115 | 1 116 | TrackpadScroll 117 | 118 | WakeDelay 119 | 1000 120 | 121 | HPQOEM 122 | 123 | 1411 124 | ProBook 125 | 1619 126 | ProBook 127 | 161C 128 | ProBook 129 | 164F 130 | ProBook 131 | 167C 132 | ProBook 133 | 167E 134 | ProBook 135 | 1680 136 | ProBook 137 | 179B 138 | ProBook 139 | 179C 140 | ProBook 141 | 17A9 142 | ProBook 143 | 17F0 144 | ProBook 145 | 17F3 146 | ProBook 147 | 17F6 148 | ProBook 149 | 1942 150 | ProBook 151 | 1949 152 | ProBook 153 | 198F 154 | ProBook 155 | ProBook 156 | 157 | ActLikeTrackpad 158 | 159 | DisableDevice 160 | 161 | 162 | ProBook-102 163 | ProBook 164 | ProBook-87 165 | ProBook 166 | 167 | 168 | ProductID 169 | 547 170 | RM,deliverNotifications 171 | 172 | USBMouseStopsTrackpad 173 | 0 174 | VendorID 175 | 1452 176 | 177 | 178 | OSBundleLibraries 179 | 180 | com.apple.iokit.IOHIDFamily 181 | 1.0.0b1 182 | com.apple.kpi.iokit 183 | 9.0.0 184 | com.apple.kpi.libkern 185 | 9.0.0 186 | com.apple.kpi.mach 187 | 9.0.0 188 | org.rehabman.voodoo.driver.PS2Controller 189 | 1.9.2 190 | 191 | OSBundleRequired 192 | Console 193 | Source Code 194 | https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller 195 | 196 | 197 | -------------------------------------------------------------------------------- /tables/codec#0: -------------------------------------------------------------------------------- 1 | Codec: Conexant CX20751/2 2 | Address: 0 3 | Vendor Id: 0x14f1510f 4 | Subsystem Id: 0x17aa5028 5 | Revision Id: 0x100100 6 | No Modem Function Group found 7 | Default PCM: 8 | rates [0x160]: 44100 48000 96000 9 | bits [0xe]: 16 20 24 10 | formats [0x1]: PCM 11 | Default Amp-In caps: N/A 12 | Default Amp-Out caps: N/A 13 | State of AFG node 0x01: 14 | Power states: D0 D1 D2 D3 D3cold S3D3cold CLKSTOP EPSS 15 | Power: setting=D0, actual=D0 16 | GPIO: io=3, o=0, i=0, unsolicited=1, wake=0 17 | IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 18 | IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0 19 | IO[2]: enable=1, dir=0, wake=0, sticky=0, data=0, unsol=1 20 | Node 0x10 [Audio Output] wcaps 0xc1d: Stereo Amp-Out R/L 21 | Control: name="Headphone Playback Volume", index=0, device=0 22 | ControlAmp: chs=3, dir=Out, idx=0, ofs=0 23 | Control: name="Headphone Playback Switch", index=0, device=0 24 | ControlAmp: chs=3, dir=Out, idx=0, ofs=0 25 | Device: name="CX20751/2 Analog", type="Audio", device=0 26 | Amp-Out caps: ofs=0x4a, nsteps=0x4a, stepsize=0x03, mute=1 27 | Amp-Out vals: [0x36 0x36] 28 | Converter: stream=8, channel=0 29 | PCM: 30 | rates [0x60]: 44100 48000 31 | bits [0xa]: 16 24 32 | formats [0x1]: PCM 33 | Power states: D0 D1 D2 D3 EPSS 34 | Power: setting=D0, actual=D0 35 | Node 0x11 [Audio Output] wcaps 0xc1d: Stereo Amp-Out R/L 36 | Control: name="Speaker Playback Volume", index=0, device=0 37 | ControlAmp: chs=3, dir=Out, idx=0, ofs=0 38 | Control: name="Speaker Playback Switch", index=0, device=0 39 | ControlAmp: chs=3, dir=Out, idx=0, ofs=0 40 | Amp-Out caps: ofs=0x4a, nsteps=0x4a, stepsize=0x03, mute=1 41 | Amp-Out vals: [0x36 0x36] 42 | Converter: stream=8, channel=0 43 | PCM: 44 | rates [0x60]: 44100 48000 45 | bits [0xa]: 16 24 46 | formats [0x1]: PCM 47 | Power states: D0 D1 D2 D3 EPSS 48 | Power: setting=D0, actual=D0 49 | Node 0x12 [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out 50 | Control: name="Beep Playback Volume", index=0, device=0 51 | ControlAmp: chs=1, dir=Out, idx=0, ofs=0 52 | Control: name="Beep Playback Switch", index=0, device=0 53 | ControlAmp: chs=1, dir=Out, idx=0, ofs=0 54 | Amp-Out caps: ofs=0x07, nsteps=0x07, stepsize=0x0f, mute=0 55 | Amp-Out vals: [0x06] 56 | Node 0x13 [Audio Input] wcaps 0x100d1b: Stereo Amp-In R/L 57 | Control: name="Capture Volume", index=0, device=0 58 | ControlAmp: chs=3, dir=In, idx=2, ofs=0 59 | Control: name="Capture Switch", index=0, device=0 60 | ControlAmp: chs=3, dir=In, idx=2, ofs=0 61 | Device: name="CX20751/2 Analog", type="Audio", device=0 62 | Amp-In caps: ofs=0x4a, nsteps=0x50, stepsize=0x03, mute=1 63 | Amp-In vals: [0x80 0x80] [0x50 0x50] [0x50 0x50] 64 | Converter: stream=4, channel=0 65 | SDI-Select: 0 66 | PCM: 67 | rates [0x160]: 44100 48000 96000 68 | bits [0xa]: 16 24 69 | formats [0x1]: PCM 70 | Power states: D0 D1 D2 D3 EPSS 71 | Power: setting=D0, actual=D0 72 | Connection: 3 73 | 0x18 0x1a* 0x19 74 | Node 0x14 [Audio Input] wcaps 0x100d1b: Stereo Amp-In R/L 75 | Amp-In caps: ofs=0x4a, nsteps=0x50, stepsize=0x03, mute=1 76 | Amp-In vals: [0x4a 0x4a] [0x4a 0x4a] [0x4a 0x4a] 77 | Converter: stream=0, channel=0 78 | SDI-Select: 0 79 | PCM: 80 | rates [0x160]: 44100 48000 96000 81 | bits [0xa]: 16 24 82 | formats [0x1]: PCM 83 | Power states: D0 D1 D2 D3 EPSS 84 | Power: setting=D0, actual=D0 85 | Connection: 3 86 | 0x19 0x1a* 0x15 87 | Node 0x15 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In 88 | Amp-In caps: ofs=0x4a, nsteps=0x4a, stepsize=0x03, mute=1 89 | Amp-In vals: [0x00 0x00] [0x00 0x00] 90 | Power states: D0 D1 D2 D3 EPSS 91 | Power: setting=D0, actual=D0 92 | Connection: 2 93 | 0x10 0x11 94 | Node 0x16 [Pin Complex] wcaps 0x400581: Stereo 95 | Control: name="Headphone Jack", index=0, device=0 96 | Pincap 0x0000001c: OUT HP Detect 97 | Pin Default 0x04211040: [Jack] HP Out at Ext Right 98 | Conn = 1/8, Color = Black 99 | DefAssociation = 0x4, Sequence = 0x0 100 | Pin-ctls: 0xc0: OUT HP 101 | Unsolicited: tag=01, enabled=1 102 | Power states: D0 D1 D2 D3 EPSS 103 | Power: setting=D0, actual=D0 104 | Connection: 2 105 | 0x10* 0x11 106 | Node 0x17 [Pin Complex] wcaps 0x400501: Stereo 107 | Control: name="Speaker Phantom Jack", index=0, device=0 108 | Pincap 0x00000010: OUT 109 | Pin Default 0x90170110: [Fixed] Speaker at Int N/A 110 | Conn = Analog, Color = Unknown 111 | DefAssociation = 0x1, Sequence = 0x0 112 | Misc = NO_PRESENCE 113 | Pin-ctls: 0x40: OUT 114 | Power states: D0 D1 D2 D3 EPSS 115 | Power: setting=D0, actual=D0 116 | Connection: 2 117 | 0x10 0x11* 118 | Node 0x18 [Pin Complex] wcaps 0x40048b: Stereo Amp-In 119 | Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 120 | Amp-In vals: [0x00 0x00] 121 | Pincap 0x00001124: IN Detect 122 | Vref caps: HIZ 80 123 | Pin Default 0x40f001f0: [N/A] Other at Ext N/A 124 | Conn = Unknown, Color = Unknown 125 | DefAssociation = 0xf, Sequence = 0x0 126 | Misc = NO_PRESENCE 127 | Pin-ctls: 0x00: VREF_HIZ 128 | Unsolicited: tag=00, enabled=0 129 | Power states: D0 D1 D2 D3 EPSS 130 | Power: setting=D0, actual=D0 131 | Node 0x19 [Pin Complex] wcaps 0x40048b: Stereo Amp-In 132 | Control: name="Mic Boost Volume", index=0, device=0 133 | ControlAmp: chs=3, dir=In, idx=0, ofs=0 134 | Control: name="Mic Jack", index=0, device=0 135 | Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 136 | Amp-In vals: [0x00 0x00] 137 | Pincap 0x00001124: IN Detect 138 | Vref caps: HIZ 80 139 | Pin Default 0x04a11030: [Jack] Mic at Ext Right 140 | Conn = 1/8, Color = Black 141 | DefAssociation = 0x3, Sequence = 0x0 142 | Pin-ctls: 0x24: IN VREF_80 143 | Unsolicited: tag=02, enabled=1 144 | Power states: D0 D1 D2 D3 EPSS 145 | Power: setting=D0, actual=D0 146 | Node 0x1a [Pin Complex] wcaps 0x40048b: Stereo Amp-In 147 | Control: name="Internal Mic Boost Volume", index=0, device=0 148 | ControlAmp: chs=3, dir=In, idx=0, ofs=0 149 | Control: name="Internal Mic Phantom Jack", index=0, device=0 150 | Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x2f, mute=0 151 | Amp-In vals: [0x00 0x00] 152 | Pincap 0x00000020: IN 153 | Pin Default 0x95a60120: [Fixed] Mic at Int Top 154 | Conn = Digital, Color = Unknown 155 | DefAssociation = 0x2, Sequence = 0x0 156 | Misc = NO_PRESENCE 157 | Pin-ctls: 0x20: IN 158 | Unsolicited: tag=00, enabled=0 159 | Power states: D0 D1 D2 D3 EPSS 160 | Power: setting=D0, actual=D0 161 | Node 0x1b [Vendor Defined Widget] wcaps 0xf00000: Mono 162 | Node 0x1c [Vendor Defined Widget] wcaps 0xf00000: Mono 163 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_nvram.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_nvram.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_nvram_hpp 9 | #define kern_nvram_hpp 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | /** 18 | * Some of the most common GUIDs used for variable storage on macOS 19 | */ 20 | #define NVRAM_GLOBAL_GUID "8BE4DF61-93CA-11D2-AA0D-00E098032B8C" 21 | #define NVRAM_APPLE_BOOT_GUID "7C436110-AB2A-4BBB-A880-FE41995C9F82" 22 | #define NVRAM_APPLE_VENDOR_GUID "4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14" 23 | #define NVRAM_APPLE_FILEVAULT_GUID "8D63D4FE-BD3C-4AAD-881D-86FD974BC1DF" 24 | #define NVRAM_APPLE_PASSWORD_UI_GUID "9EBA2D25-BBE3-4AC2-A2C6-C87F44A1278C" 25 | 26 | /** 27 | * Custom GUIDs used for Lilu preferences 28 | * Must be kept in sync to OcSupportPkg/Include/Guid/OcVariables.h 29 | */ 30 | #define LILU_VENDOR_GUID "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102" 31 | #define LILU_READ_ONLY_GUID "E09B9297-7928-4440-9AAB-D1F8536FBF0A" 32 | #define LILU_WRITE_ONLY_GUID "F0B9AF8F-2222-4840-8A37-ECF7CC8C12E1" 33 | 34 | /** 35 | * Prefix variable name with a GUID 36 | */ 37 | #define NVRAM_PREFIX(x, y) x ":" y 38 | 39 | class NVStorage { 40 | /** 41 | * Local nvram controller reference 42 | */ 43 | IORegistryEntry *dtEntry {nullptr}; 44 | 45 | public: 46 | /** 47 | * Compress data with a default compression algorithm 48 | * 49 | * @param src source data 50 | * @param size data size (updated with new size) 51 | * @param sensitive contains sensitive data 52 | * 53 | * @return compressed data (must be freed with Buffer::deleter) or nullptr 54 | */ 55 | EXPORT uint8_t *compress(const uint8_t *src, uint32_t &size, bool sensitive=false); 56 | 57 | /** 58 | * Decompress data compressed with compress 59 | * 60 | * @param src compressed data 61 | * @param size data size (updated with new size) 62 | * @param sensitive contains sensitive data 63 | * 64 | * @return decompressed data (must be freed with Buffer::deleter) or nullptr 65 | */ 66 | EXPORT uint8_t *decompress(const uint8_t *src, uint32_t &size, bool sensitive=false); 67 | 68 | /** 69 | * Value storage options 70 | */ 71 | enum Options { 72 | OptAuto = 0, // Default options 73 | OptRaw = 1, // i/o as raw buffer 74 | OptCompressed = 2, // Apply compression (see kern_compression.hpp) 75 | OptEncrypted = 4, // Apply encryption with device-unique key (see kern_crypto.hpp) 76 | OptChecksum = 8, // Append CRC32 checksum to the end 77 | OptSensitive = 16 // Value contains sensitive data 78 | }; 79 | 80 | /** 81 | * Prepended value header unless OptRaw is used 82 | * After the header the following fields should go: 83 | * uint8_t iv[16]; aes initialisation vector (if OptEncrypted is set) 84 | * uint32_t size; decryption size (if OptEncrypted is set, encrypted) 85 | * uint32_t size; decompression size (if OptCompressed is set, encrypted if OptEncrypted) 86 | * uint8_t data[]; content data (encrypted if OptEncrypted) 87 | * uint32_t crc32; CRC32 cheksum (if OptChecksum is set) 88 | */ 89 | struct PACKED Header { 90 | static constexpr uint16_t Magic = 0xC717; 91 | static constexpr uint8_t MaxVer = 1; 92 | using Checksum = uint32_t; 93 | 94 | uint16_t magic {Magic}; 95 | uint8_t version {MaxVer}; 96 | uint8_t opts {OptAuto}; 97 | }; 98 | 99 | /** 100 | * Attempt to connect to active nvram, may fail at early stages 101 | * 102 | * @return true on success 103 | */ 104 | EXPORT bool init(); 105 | 106 | /** 107 | * Relinquish resources used, must be called regardless of the init error 108 | */ 109 | EXPORT void deinit(); 110 | 111 | /** 112 | * Read data from nvram 113 | * 114 | * @param key key name 115 | * @param size amount of data read 116 | * @param opts bitmask of Options, may set option requirements 117 | * @param enckey encryption key (platform-defined if OptEncrypted is set) 118 | * 119 | * @return pointer to data (must be freed via Buffer::deleter), nullptr on failure 120 | */ 121 | EXPORT uint8_t *read(const char *key, uint32_t &size, uint8_t opts=OptAuto, const uint8_t *enckey=nullptr); 122 | 123 | /** 124 | * Read data from nvram 125 | * 126 | * @param key key name 127 | * @param opts bitmask of Options, may set option requirements 128 | * @param enckey encryption key (platform-defined if OptEncrypted is set) 129 | * 130 | * @return pointer to data (must be freed via OSData::release), nullptr on failure 131 | */ 132 | EXPORT OSData *read(const char *key, uint8_t opts=OptAuto, const uint8_t *enckey=nullptr); 133 | 134 | /** 135 | * Write data to nvram 136 | * 137 | * @param key key name 138 | * @param src source buffer 139 | * @param size buffer size 140 | * @param opts bitmask of Options 141 | * @param enckey encryption key (platform-defined if OptEncrypted is set) 142 | * 143 | * @return true on success 144 | */ 145 | EXPORT bool write(const char *key, const uint8_t *src, uint32_t sz, uint8_t opts=OptAuto, const uint8_t *enckey=nullptr); 146 | 147 | /** 148 | * Write data to nvram 149 | * 150 | * @param key key name 151 | * @param data data object to write 152 | * @param opts bitmask of Options 153 | * @param enckey encryption key (platform-defined if OptEncrypted is set) 154 | * 155 | * @return true on success 156 | */ 157 | EXPORT bool write(const char *key, const OSData *data, uint8_t opts=OptAuto, const uint8_t *enckey=nullptr); 158 | 159 | /** 160 | * Delete key from nvram 161 | * 162 | * @param key key name 163 | * @param sensitive sensitive data 164 | * 165 | * @return true on successful deletion or if key is missing 166 | */ 167 | EXPORT bool remove(const char *key, bool sensitive=false); 168 | 169 | /** 170 | * Synchronize with nvram controller 171 | * This method might fail if synchronisation was done recently. 172 | * 173 | * @return true if synchronised 174 | */ 175 | EXPORT bool sync(); 176 | 177 | /** 178 | * Exports nvram to a plist file 179 | * 180 | * @param filename file path 181 | * @oaram max max output size 182 | * @param sensitive contains sensitive data 183 | * 184 | * @return true if saved 185 | */ 186 | EXPORT bool save(const char *filename, uint32_t max=0x20000, bool sensitive=false); 187 | 188 | /** 189 | * Check whether key exists 190 | * 191 | * @param key key name 192 | * 193 | * @return true if key exists 194 | */ 195 | EXPORT bool exists(const char *key); 196 | }; 197 | 198 | #endif /* kern_nvram_hpp */ 199 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_rtc.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_rtc.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_rtc_h 9 | #define kern_rtc_h 10 | 11 | #include 12 | #include 13 | 14 | #pragma clang diagnostic push 15 | #pragma clang diagnostic ignored "-Winconsistent-missing-override" 16 | #include 17 | #pragma clang diagnostic pop 18 | 19 | class RTCStorage { 20 | /** 21 | * General access RTC ports on x86 systems. 22 | */ 23 | static constexpr uint8_t R_PCH_RTC_INDEX = 0x70; 24 | static constexpr uint8_t R_PCH_RTC_TARGET = 0x71; 25 | static constexpr uint8_t R_PCH_RTC_EXT_INDEX = 0x72; 26 | static constexpr uint8_t R_PCH_RTC_EXT_TARGET = 0x73; 27 | 28 | /** 29 | * RTC has N banks (we support up to 2) of memory. 30 | */ 31 | static constexpr uint8_t RTC_BANK_SIZE = 0x80; 32 | 33 | /** 34 | * Non-ext RTC index register uses higher bit for nmi. 35 | */ 36 | static constexpr uint8_t RTC_DATA_MASK = 0x7F; 37 | static constexpr uint8_t RTC_NMI_MASK = 0x80; 38 | 39 | /** 40 | * Apple-specific RTC checksum addresses 41 | */ 42 | static constexpr uint8_t APPLERTC_HASHED_ADDR = 0x0E; 43 | static constexpr uint8_t APPLERTC_CHECKSUM_ADDR1 = 0x58; 44 | static constexpr uint8_t APPLERTC_CHECKSUM_ADDR2 = 0x59; 45 | 46 | /** 47 | * AppleRTC service handle 48 | */ 49 | IOService *rtcSrv {nullptr}; 50 | 51 | /** 52 | * Low-level RTC read (does not check memory availability). 53 | * 54 | * @param dev RTC ACPI device 55 | * @param offset offset 56 | * 57 | * @result read value 58 | */ 59 | static uint8_t readByte(IOACPIPlatformDevice *dev, uint8_t offset); 60 | 61 | /** 62 | * Low-level RTC write (does not check memory availability). 63 | * 64 | * @param dev RTC ACPI device 65 | * @param offset offset 66 | * @param value value 67 | */ 68 | static void writeByte(IOACPIPlatformDevice *dev, uint8_t offset, uint8_t value); 69 | public: 70 | /** 71 | * Attempt to connect to active RTC service 72 | * 73 | * @param wait wait for service availability 74 | * 75 | * @return true on success 76 | */ 77 | EXPORT bool init(bool wait=true); 78 | 79 | /** 80 | * Release obtained RTC service 81 | */ 82 | EXPORT void deinit(); 83 | 84 | /** 85 | * Check whether extended (higher 128 bytes) is available 86 | * 87 | * @return true on success 88 | */ 89 | EXPORT bool checkExtendedMemory(); 90 | 91 | /** 92 | * Read memory from RTC 93 | * 94 | * @param off offset to read data from 95 | * @param size data size 96 | * @param buffer data buffer to read to 97 | * 98 | * @return true on success 99 | */ 100 | EXPORT bool read(uint64_t off, uint32_t size, uint8_t *buffer); 101 | 102 | /** 103 | * Write memory to RTC 104 | * 105 | * @param off offset to write data to 106 | * @param size data size 107 | * @param buffer data buffer to write from 108 | * 109 | * @return true on success 110 | */ 111 | EXPORT bool write(uint64_t off, uint32_t size, uint8_t *buffer); 112 | 113 | /** 114 | * Obtain RTC device for direct writing. 115 | * Written as inline to avoid IOACPIPlatformDevice dependency. 116 | * 117 | * @param name device name 118 | * 119 | * @return RTC ACPI device for I/O access, must be released 120 | */ 121 | static inline IOACPIPlatformDevice *getRTCDevice(const char *name = "PNP0B00") { 122 | IOService *rtcDev = nullptr; 123 | auto matching = IOService::nameMatching(name); 124 | if (matching) { 125 | rtcDev = IOService::waitForMatchingService(matching); 126 | matching->release(); 127 | } else { 128 | SYSLOG("rtc", "failed to allocate rtc device matching"); 129 | } 130 | 131 | if (rtcDev) { 132 | DBGLOG("rtc", "got rtc device"); 133 | auto acpiDev = OSDynamicCast(IOACPIPlatformDevice, rtcDev); 134 | if (acpiDev) { 135 | DBGLOG("rtc", "got rtc acpi device"); 136 | return acpiDev; 137 | } else { 138 | SYSLOG("rtc", "failed to obtain rtc acpi device"); 139 | rtcDev->release(); 140 | } 141 | } 142 | 143 | SYSLOG("rtc", "failed to get rtc device"); 144 | return nullptr; 145 | } 146 | 147 | /** 148 | * Directly read RTC memory (UNSAFE, usage with caution!) 149 | * 150 | * @param dev RTC device 151 | * @param off offset to read data from 152 | * @param size data size 153 | * @param buffer data buffer to read to 154 | * @param introff turn interrupts off 155 | * 156 | * @return true on success 157 | */ 158 | EXPORT static void readDirect(IOACPIPlatformDevice *dev, uint8_t off, uint16_t size, uint8_t *buffer, bool introff); 159 | 160 | /** 161 | * Directly write RTC memory (UNSAFE, usage with caution!) 162 | * 163 | * @param dev RTC device 164 | * @param off offset to read data from 165 | * @param size data size 166 | * @param buffer data buffer to read to 167 | * @param updatecrc recalculate crc on write 168 | * @param introff turn interrupts off 169 | * 170 | * @return true on success 171 | */ 172 | EXPORT static void writeDirect(IOACPIPlatformDevice *dev, uint8_t off, uint16_t size, uint8_t *buffer, bool updatecrc, bool introff); 173 | 174 | 175 | /** 176 | * Directly read RTC memory (UNSAFE, usage with caution!), this is just a compatibility function. 177 | * 178 | * @param off offset to read data from 179 | * @param size data size 180 | * @param buffer data buffer to read to 181 | * @param introff turn interrupts off 182 | * 183 | * @return true on success 184 | */ 185 | static inline bool readDirect(uint8_t off, uint16_t size, uint8_t *buffer, bool introff) { 186 | if (size > RTC_BANK_SIZE*2 - off) { 187 | SYSLOG("rtc", "reading unsupported size"); 188 | return false; 189 | } 190 | 191 | auto rtc = getRTCDevice(); 192 | if (rtc) { 193 | readDirect(rtc, off, size, buffer, introff); 194 | rtc->release(); 195 | return true; 196 | } 197 | 198 | return false; 199 | } 200 | 201 | /** 202 | * Directly write RTC memory (UNSAFE, usage with caution!), this is just a compatibility function. 203 | * 204 | * @param off offset to read data from 205 | * @param size data size 206 | * @param buffer data buffer to read to 207 | * @param updatecrc recalculate crc on write 208 | * @param introff turn interrupts off 209 | * 210 | * @return true on success 211 | */ 212 | static inline bool writeDirect(uint8_t off, uint16_t size, uint8_t *buffer, bool updatecrc, bool introff) { 213 | if (size > RTC_BANK_SIZE*2 - off) { 214 | SYSLOG("rtc", "writing unsupported size"); 215 | return false; 216 | } 217 | 218 | auto rtc = getRTCDevice(); 219 | if (rtc) { 220 | writeDirect(rtc, off, size, buffer, updatecrc, introff); 221 | rtc->release(); 222 | return true; 223 | } 224 | 225 | return false; 226 | } 227 | }; 228 | 229 | #endif /* kern_rtc_h */ 230 | -------------------------------------------------------------------------------- /patch/battery_Lenovo-E430.md: -------------------------------------------------------------------------------- 1 | #Maintained by: RehabMan for: Laptop Patches 2 | #battery_Lenovo-E430.txt 3 | 4 | # created by nxho93 2015-02-18 5 | # modified for E540 by RehabMan based on nayeweiyang work 6 | 7 | # works for: 8 | # Lenovo E430 9 | # Lenovo E531 10 | # Lenovo E540 (per nayeweiyang) 11 | 12 | # Note: This DSDT requires "Fix Mutex with non-zero SyncLevel" 13 | 14 | into method label B1B2 remove_entry; 15 | into definitionblock code_regex . insert 16 | begin 17 | Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n 18 | end; 19 | 20 | into method label B1B4 remove_entry; 21 | into definitionblock code_regex . insert 22 | begin 23 | Method (B1B4, 4, NotSerialized)\n 24 | {\n 25 | Store(Arg3, Local0)\n 26 | Or(Arg2, ShiftLeft(Local0, 8), Local0)\n 27 | Or(Arg1, ShiftLeft(Local0, 8), Local0)\n 28 | Or(Arg0, ShiftLeft(Local0, 8), Local0)\n 29 | Return(Local0)\n 30 | }\n 31 | end; 32 | 33 | into method label RE1B parent_label EC0 remove_entry; 34 | into method label RECB parent_label EC0 remove_entry; 35 | into device label EC0 insert 36 | begin 37 | Method (RE1B, 1, NotSerialized)\n 38 | // Arg0 - offset in bytes from zero-based EC\n 39 | {\n 40 | OperationRegion(ECOR, EmbeddedControl, Arg0, 1)\n 41 | Field(ECOR, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 42 | Return(BYTE)\n 43 | }\n 44 | Method (RECB, 2, Serialized)\n 45 | // Arg0 - offset in bytes from zero-based EC\n 46 | // Arg1 - size of buffer in bits\n 47 | {\n 48 | ShiftRight(Arg1, 3, Arg1)\n 49 | Name(TEMP, Buffer(Arg1) { })\n 50 | Add(Arg0, Arg1, Arg1)\n 51 | Store(0, Local0)\n 52 | While (LLess(Arg0, Arg1))\n 53 | {\n 54 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 55 | Increment(Arg0)\n 56 | Increment(Local0)\n 57 | }\n 58 | Return(TEMP)\n 59 | }\n 60 | end; 61 | 62 | into method label RE1B parent_label EC remove_entry; 63 | into method label RECB parent_label EC remove_entry; 64 | into device label EC insert 65 | begin 66 | Method (RE1B, 1, NotSerialized)\n 67 | // Arg0 - offset in bytes from zero-based EC\n 68 | {\n 69 | OperationRegion(ECOR, EmbeddedControl, Arg0, 1)\n 70 | Field(ECOR, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n 71 | Return(BYTE)\n 72 | }\n 73 | Method (RECB, 2, Serialized)\n 74 | // Arg0 - offset in bytes from zero-based EC\n 75 | // Arg1 - size of buffer in bits\n 76 | {\n 77 | ShiftRight(Arg1, 3, Arg1)\n 78 | Name(TEMP, Buffer(Arg1) { })\n 79 | Add(Arg0, Arg1, Arg1)\n 80 | Store(0, Local0)\n 81 | While (LLess(Arg0, Arg1))\n 82 | {\n 83 | Store(RE1B(Arg0), Index(TEMP, Local0))\n 84 | Increment(Arg0)\n 85 | Increment(Local0)\n 86 | }\n 87 | Return(TEMP)\n 88 | }\n 89 | end; 90 | 91 | into device label EC0 code_regex HWAK,\s+16, replace_matched begin AK00,8,AK01,8, end; 92 | into device label EC0 code_regex SBRC,\s+16, replace_matched begin RC00,8,RC01,8, end; 93 | into device label EC0 code_regex SBFC,\s+16, replace_matched begin FC00,8,FC01,8, end; 94 | into device label EC0 code_regex SBAC,\s+16, replace_matched begin AC00,8,AC01,8, end; 95 | into device label EC0 code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end; 96 | into device label EC0 code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8, end; 97 | into device label EC0 code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8, end; 98 | into device label EC0 code_regex SBSN,\s+16 replace_matched begin SN00,8,SN01,8 end; 99 | into device label EC0 code_regex SBCH,\s+32 replace_matched begin CH00,8,CH01,8,CH02,8,CH03,8 end; 100 | into device label EC0 code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end; 101 | into device label EC0 code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end; 102 | 103 | into device label EC code_regex HWAK,\s+16, replace_matched begin AK00,8,AK01,8, end; 104 | into device label EC code_regex SBRC,\s+16, replace_matched begin RC00,8,RC01,8, end; 105 | into device label EC code_regex SBFC,\s+16, replace_matched begin FC00,8,FC01,8, end; 106 | into device label EC code_regex SBAC,\s+16, replace_matched begin AC00,8,AC01,8, end; 107 | into device label EC code_regex SBVO,\s+16, replace_matched begin BV00,8,BV01,8, end; 108 | into device label EC code_regex SBDC,\s+16, replace_matched begin DC00,8,DC01,8, end; 109 | into device label EC code_regex SBDV,\s+16, replace_matched begin DV00,8,DV01,8, end; 110 | into device label EC code_regex SBSN,\s+16 replace_matched begin SN00,8,SN01,8 end; 111 | into device label EC code_regex SBCH,\s+32 replace_matched begin CH00,8,CH01,8,CH02,8,CH03,8 end; 112 | into device label EC code_regex (SBMN,)\s+(128) replace_matched begin BMNX,%2,//%1%2 end; 113 | into device label EC code_regex (SBDN,)\s+(128) replace_matched begin BDNX,%2,//%1%2 end; 114 | 115 | into device label EC code_regex SBBM,\s+16 replace_matched begin BM00,8,BM01,8 end; 116 | into method label GBIF code_regex SBBM replaceall_matched begin B1B2(BM00,BM01) end; 117 | 118 | 119 | into method label _L23 code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.AK00,\\_SB.PCI0.LPCB.EC0.AK01), end; 120 | into method label _WAK code_regex \(\\_SB\.PCI0\.LPCB\.EC0\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.AK00,\\_SB.PCI0.LPCB.EC0.AK01), end; 121 | into method label _L1D code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AK00,\\_SB.PCI0.LPC.EC.AK01), end; 122 | into method label _WAK code_regex \(\\_SB\.PCI0\.LPC\.EC\.HWAK, replaceall_matched begin (B1B2(\\_SB.PCI0.LPC.EC.AK00,\\_SB.PCI0.LPC.EC.AK01), end; 123 | 124 | # storing into AK00,AK01 (orig HWAK) 8-bit registers 125 | 126 | into method label _WAK code_regex Store\s\(Local0,\s\\_SB\.PCI0\.LPCB\.EC0\.HWAK\) replaceall_matched 127 | begin 128 | Store(Local0,\\_SB.PCI0.LPCB.EC0.AK00)\n 129 | Store(ShiftRight(Local0,8),\\_SB.PCI0.LPCB.EC0.AK01) 130 | end; 131 | into method label _WAK code_regex Store\s\(Zero,\s\\_SB\.PCI0\.LPCB\.EC0\.HWAK\) replaceall_matched 132 | begin 133 | Store(Zero,\\_SB.PCI0.LPCB.EC0.AK00)\n 134 | Store(Zero,\\_SB.PCI0.LPCB.EC0.AK01) 135 | end; 136 | 137 | into method label GBST code_regex \(SBRC, replaceall_matched begin (B1B2(RC00,RC01), end; 138 | into method label GBIF code_regex \(SBFC, replaceall_matched begin (B1B2(FC00,FC01), end; 139 | into method label GBST code_regex \(SBAC, replaceall_matched begin (B1B2(AC00,AC01), end; 140 | into method label GBST code_regex \(SBVO, replaceall_matched begin (B1B2(BV00,BV01), end; 141 | into method label GBIF code_regex \(SBDC, replaceall_matched begin (B1B2(DC00,DC01), end; 142 | into method label GBIF code_regex \(SBDV\) replaceall_matched begin (B1B2(DV00,DV01)) end; 143 | into method label GBIF code_regex SBDV, replaceall_matched begin B1B2(DV00,DV01), end; 144 | into method label GBIF code_regex \(SBSN, replaceall_matched begin (B1B2(SN00,SN01), end; 145 | into method label GBIF code_regex \(SBCH, replaceall_matched begin (B1B4(CH00,CH01,CH02,CH03), end; 146 | into method label GBIF code_regex \(SBMN, replaceall_matched begin (RECB(0xA0,128), end; 147 | into method label GBIF code_regex \(SBDN, replaceall_matched begin (RECB(0xA0,128), end; 148 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/FakeSMC.kext/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16C67 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | FakeSMC 11 | CFBundleIdentifier 12 | org.netkas.driver.FakeSMC 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | FakeSMC 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 6.24-316-g197d663.1737 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1737 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8C1002 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 12D75 37 | DTSDKName 38 | macosx10.8 39 | DTXcode 40 | 0821 41 | DTXcodeBuild 42 | 8C1002 43 | IOKitPersonalities 44 | 45 | FakeSMC 46 | 47 | CFBundleIdentifier 48 | org.netkas.driver.FakeSMC 49 | Configuration 50 | 51 | Clover 52 | 53 | BEMB 54 | 55 | BEMB 56 | flag 57 | 58 | EPCI 59 | 60 | EPCI 61 | ui32 62 | 63 | RBr 64 | 65 | RBr 66 | ch8* 67 | 68 | REV 69 | 70 | REV 71 | {rev 72 | 73 | RPlt 74 | 75 | RPlt 76 | ch8* 77 | 78 | 79 | ExceptionKeys 80 | 81 | CLKH 82 | 1 83 | CLKT 84 | 1 85 | MSDW 86 | 1 87 | NATJ 88 | 1 89 | NATi 90 | 1 91 | NTOK 92 | 1 93 | WKTP 94 | 0 95 | 96 | Keys 97 | 98 | $Adr 99 | 100 | ui32 101 | 102 | AAADAA== 103 | 104 | 105 | $Num 106 | 107 | ui8 108 | 109 | AQ== 110 | 111 | 112 | ACID 113 | 114 | ch8* 115 | 116 | hfwETdgSevQ= 117 | 118 | 119 | FNum 120 | 121 | ui8 122 | 123 | AA== 124 | 125 | 126 | LsNM 127 | 128 | ui8 129 | 130 | AQ== 131 | 132 | 133 | LsbV 134 | 135 | {rev 136 | 137 | AQQKAAY= 138 | 139 | 140 | MSSD 141 | 142 | si8 143 | 144 | BQ== 145 | 146 | 147 | MSSP 148 | 149 | si8 150 | 151 | BQ== 152 | 153 | 154 | NATJ 155 | 156 | ui8 157 | 158 | AA== 159 | 160 | 161 | OSK0 162 | 163 | ch8* 164 | 165 | b3VyaGFyZHdvcmtieXRoZXNld29y 166 | ZHNndWFyZGVkcGw= 167 | 168 | 169 | OSK1 170 | 171 | ch8* 172 | 173 | ZWFzZWRvbnRzdGVhbChjKUFwcGxl 174 | Q29tcHV0ZXJJbmM= 175 | 176 | 177 | REV 178 | 179 | {rev 180 | 181 | ATAPAAAD 182 | 183 | 184 | RVBF 185 | 186 | {rev 187 | 188 | ATAPAAAD 189 | 190 | 191 | RVUF 192 | 193 | {rev 194 | 195 | ATAPAAAD 196 | 197 | 198 | 199 | Types 200 | 201 | BEMB 202 | flag 203 | CLKC 204 | {clc 205 | CLKH 206 | {clh 207 | CLKT 208 | ui32 209 | CLWK 210 | ui32 211 | EPCI 212 | flag 213 | LSSS 214 | {lso 215 | MSDS 216 | ui8 217 | MSDW 218 | flag 219 | MSPS 220 | {msp 221 | RPlt 222 | ch8* 223 | 224 | debug 225 | 226 | smc-compatible 227 | smc-napa 228 | trace 229 | 230 | 231 | IOClass 232 | FakeSMC 233 | IOMatchCategory 234 | FakeSMC 235 | IOProviderClass 236 | AppleACPIPlatformExpert 237 | IOResourceMatch 238 | FakeSMCKeyStore 239 | RM,Build 240 | Release-rehabman 241 | RM,Version 242 | FakeSMC 1737 243 | 244 | FakeSMCKeyStore 245 | 246 | CFBundleIdentifier 247 | org.netkas.driver.FakeSMC 248 | IOClass 249 | FakeSMCKeyStore 250 | IOMatchCategory 251 | FakeSMCKeyStore 252 | IOProviderClass 253 | IOResources 254 | IOResourceMatch 255 | IOKit 256 | IOUserClientClass 257 | FakeSMCKeyStoreUserClient 258 | 259 | 260 | NSHumanReadableCopyright 261 | Copyright © 2015 netkas. All rights reserved. 262 | OSBundleCompatibleVersion 263 | 1212 264 | OSBundleLibraries 265 | 266 | com.apple.iokit.IOACPIFamily 267 | 1.0.0d1 268 | com.apple.kpi.bsd 269 | 10.6 270 | com.apple.kpi.iokit 271 | 10.6 272 | com.apple.kpi.libkern 273 | 10.6 274 | com.apple.kpi.mach 275 | 10.6 276 | com.apple.kpi.unsupported 277 | 10.6 278 | 279 | OSBundleRequired 280 | Root 281 | Source Code 282 | "https://github.com/RehabMan/OS-X-FakeSMC-kozlek.git" 283 | 284 | 285 | -------------------------------------------------------------------------------- /CLOVER/config.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ACPI 6 | 7 | AutoMerge 8 | 9 | DSDT 10 | 11 | DropOEM_DSM 12 | 13 | Fixes 14 | 15 | AddPNLF 16 | 17 | FixHPET 18 | 19 | FixIPIC 20 | 21 | FixRTC 22 | 23 | FixTMR 24 | 25 | Comment-IRQ Fix 26 | The following fixes may be needed for onboard audio/USB/etc 27 | 28 | 29 | Comment-DisabledAML 30 | Disable other forms of CPU PM due to SSDT/Generate/PluginType=true 31 | DisabledAML 32 | 33 | SSDT.aml 34 | SSDT-XCPM.aml 35 | SSDT-PluginType1.aml 36 | 37 | DropTables 38 | 39 | 40 | Signature 41 | DMAR 42 | 43 | 44 | FixHeaders 45 | 46 | SSDT 47 | 48 | DropOem 49 | 50 | Generate 51 | 52 | PluginType 53 | 54 | 55 | NoOemTableId 56 | 57 | 58 | 59 | Boot 60 | 61 | Arguments 62 | dart=0 nv_disable=1 kext-dev-mode=1 -wegnoegpu -igfxnohdmi 63 | DefaultVolume 64 | LastBootedVolume 65 | Legacy 66 | LegacyBiosDefault 67 | NeverHibernate 68 | 69 | NoEarlyProgress 70 | 71 | Secure 72 | 73 | Timeout 74 | 2 75 | 76 | Devices 77 | 78 | Audio 79 | 80 | Inject 81 | No 82 | 83 | FakeID 84 | 85 | #IntelGFX 86 | 0x04128086 87 | 88 | Properties 89 | 90 | PciRoot(0x0)/Pci(0x2,0x0) 91 | 92 | AAPL,ig-platform-id 93 | 94 | BgAmCg== 95 | 96 | AAPL,slot-name 97 | Internal 98 | device-id 99 | 100 | EgQAAA== 101 | 102 | framebuffer-con1-enable 103 | 104 | AQAAAA== 105 | 106 | framebuffer-con1-pipe 107 | 108 | EgAAAA== 109 | 110 | framebuffer-con1-type 111 | 112 | AAgAAA== 113 | 114 | framebuffer-con2-alldata 115 | 116 | /wAAAAEAAABAAAAA 117 | 118 | framebuffer-con2-enable 119 | 120 | AQAAAA== 121 | 122 | framebuffer-cursormem 123 | 124 | AACQAA== 125 | 126 | framebuffer-fbmem 127 | 128 | AACQAA== 129 | 130 | framebuffer-memorycount 131 | 132 | AgAAAA== 133 | 134 | framebuffer-patch-enable 135 | 136 | AQAAAA== 137 | 138 | framebuffer-portcount 139 | 140 | AgAAAA== 141 | 142 | 143 | 144 | SetIntelBacklight 145 | 146 | SetIntelMaxBacklight 147 | 148 | USB 149 | 150 | FixOwnership 151 | 152 | Inject 153 | 154 | 155 | 156 | DisableDrivers 157 | 158 | VBoxHfs 159 | 160 | GUI 161 | 162 | Custom 163 | 164 | Entries 165 | 166 | 167 | Disabled 168 | 169 | Hidden 170 | 171 | Ignore 172 | 173 | NoCaches 174 | 175 | Type 176 | OSXRecovery 177 | 178 | 179 | Disabled 180 | 181 | Ignore 182 | 183 | Title 184 | Windows 185 | Type 186 | Windows 187 | 188 | 189 | 190 | Hide 191 | 192 | Preboot 193 | 194 | Mouse 195 | 196 | Enabled 197 | 198 | 199 | Scan 200 | 201 | Entries 202 | 203 | Legacy 204 | 205 | Linux 206 | 207 | Tool 208 | 209 | 210 | ScreenResolution 211 | 1024x768 212 | Theme 213 | OSS 214 | 215 | Graphics 216 | 217 | Inject 218 | 219 | ATI 220 | 221 | Intel 222 | 223 | NVidia 224 | 225 | 226 | 227 | KernelAndKextPatches 228 | 229 | AppleRTC 230 | 231 | DellSMBIOSPatch 232 | 233 | ForceKextsToLoad 234 | 235 | \System\Library\Extensions\IONetworkingFamily.kext 236 | 237 | KernelLapic 238 | 239 | KernelPm 240 | 241 | 242 | RtVariables 243 | 244 | BooterConfig 245 | 0x28 246 | CsrActiveConfig 247 | 0x67 248 | ROM 249 | 250 | qRQiAycK 251 | 252 | 253 | SMBIOS 254 | 255 | BiosReleaseDate 256 | 05/27/2019 257 | BiosVendor 258 | Apple Inc. 259 | BiosVersion 260 | MBP111.88Z.F000.B00.1905271046 261 | Board-ID 262 | Mac-189A3D4F975D5FFC 263 | BoardManufacturer 264 | Apple Inc. 265 | BoardSerialNumber 266 | C17435207QXFH318C 267 | BoardType 268 | 10 269 | BoardVersion 270 | 1.0 271 | ChassisAssetTag 272 | MacBook-Aluminum 273 | ChassisManufacturer 274 | Apple Inc. 275 | ChassisType 276 | 0x0A 277 | EfiVersion 278 | 155.0.0.0.0 279 | Family 280 | MacBook Pro 281 | FirmwareFeatures 282 | 0xE80FE137 283 | FirmwareFeaturesMask 284 | 0xFF1FFF3F 285 | LocationInChassis 286 | Part Component 287 | Manufacturer 288 | Apple Inc. 289 | Mobile 290 | 291 | PlatformFeature 292 | 0x02 293 | ProductName 294 | MacBookPro11,1 295 | SerialNumber 296 | C02LQSUMFGYY 297 | SmUUID 298 | FEE584C2-CAAB-4C32-9D51-8DA65DD909BC 299 | Version 300 | 1.0 301 | 302 | SystemParameters 303 | 304 | CustomUUID 305 | D01DD2B1-B8A0-463E-AE27-44E90BB42743 306 | InjectKexts 307 | Detect 308 | 309 | 310 | 311 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_devinfo.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_devinfo.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2018 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_devinfo_h 9 | #define kern_devinfo_h 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | /** 16 | * Obtain installed devices split into categories. 17 | * Should be used from onPatcherLoad and onwards. 18 | */ 19 | class DeviceInfo { 20 | /** 21 | * Updates reportedLayoutId 22 | */ 23 | void updateLayoutId(); 24 | 25 | /** 26 | * Updates reportedFramebufferId 27 | */ 28 | void updateFramebufferId(); 29 | 30 | /** 31 | * Updates firmwareVendor 32 | */ 33 | void updateFirmwareVendor(); 34 | 35 | /** 36 | * Obtains devices from PCI root 37 | * 38 | * @param pciRoot PCI root instance (commonly PCI0@0 device) 39 | */ 40 | void grabDevicesFromPciRoot(IORegistryEntry *pciRoot); 41 | 42 | public: 43 | /** 44 | * Obtains autodetected legacy framebuffer if applicable 45 | * 46 | * @return framebuffer or 0xFFFFFFFF 47 | */ 48 | static uint32_t getLegacyFramebufferId(); 49 | 50 | /** 51 | * Checks whether the framebuffer has connectors or not. 52 | * 53 | * @return true if the framebuffer has no connectors 54 | */ 55 | static bool isConnectorLessPlatformId(uint32_t id); 56 | 57 | /** 58 | * Common external GPU parameter list 59 | */ 60 | struct ExternalVideo { 61 | /** 62 | * Aka GFX0 device 63 | */ 64 | IORegistryEntry *video {nullptr}; 65 | 66 | /** 67 | * Aka HDAU device 68 | */ 69 | IORegistryEntry *audio {nullptr}; 70 | 71 | /** 72 | * External GPU vendor 73 | */ 74 | uint32_t vendor {0}; 75 | }; 76 | 77 | /** 78 | * Aka HDEF device 79 | */ 80 | IORegistryEntry *audioBuiltinAnalog {nullptr}; 81 | 82 | /** 83 | * Aka HDAU device for builtin GPU 84 | */ 85 | IORegistryEntry *audioBuiltinDigital {nullptr}; 86 | 87 | /** 88 | * Aka IGPU device 89 | */ 90 | IORegistryEntry *videoBuiltin {nullptr}; 91 | 92 | /** 93 | * Aka IMEI device 94 | */ 95 | IORegistryEntry *managementEngine {nullptr}; 96 | 97 | /** 98 | * Aka GFX0 devices (kept in sync with audioExternal) 99 | */ 100 | evector videoExternal; 101 | 102 | private: 103 | /** 104 | * This is the default reported layout-id passed to reportedLayoutId. 105 | * The reason for choosing 7 is its presence in 10.14 and the fact 106 | * Apple frameworks still communicate to the files present on disk. 107 | * For information purposes only! Use reportedLayoutId! 108 | */ 109 | static constexpr uint32_t DefaultReportedLayoutId = 7; 110 | 111 | /** 112 | * The boot-arg to override the reported layout-id to AppleHDA. 113 | * For user configuration only! Use reportedLayoutId! 114 | */ 115 | static constexpr const char *ReportedLayoutIdArg = "alcapplid"; 116 | 117 | /** 118 | * The property to override the reported layout-id to AppleHDA. 119 | * For user configuration only! Use reportedLayoutId! 120 | */ 121 | static constexpr const char *ReportedLayoutIdName = "apple-layout-id"; 122 | 123 | public: 124 | /** 125 | * Layout id to be reported by all audio devices (you must update it yourself). 126 | * This follows the standard convention initially found in AppleALC: 127 | * alcapplid=X boot-arg has highest priority and overrides any other value. 128 | * apple-layout-id HDEF prop has normal priority, you may use it if you need. 129 | * DefaultReportedLayoutId will be used if both of the above are not set. 130 | */ 131 | uint32_t reportedLayoutId {0}; 132 | 133 | private: 134 | /** 135 | * The boot-arg to override the reported AAPL,ig-platform-id to Intel drivers. 136 | * For user configuration only! Use reportedFramebufferId! 137 | */ 138 | static constexpr const char *ReportedFrameIdArg = "igfxframe"; 139 | 140 | /** 141 | * The boot-arg to override the reported AAPL,ig-platform-id to Intel drivers. 142 | * Sets VESA framebuffer id (0xFFFFFFFF). 143 | * For user configuration only! Use reportedFramebufferId! 144 | */ 145 | static constexpr const char *ReportedVesaIdArg = "-igfxvesa"; 146 | 147 | /** 148 | * The boot-arg to force-disable any external GPU if found. 149 | * For user configuration only! Use requestedExternalSwitchOff! 150 | */ 151 | static constexpr const char *RequestedExternalSwitchOffArg {"-wegnoegpu"}; 152 | 153 | /** 154 | * The property to set your platform id for Intel drivers (Ivy and newer). 155 | * For user configuration only! Use reportedFramebufferName! 156 | */ 157 | static constexpr const char *ReportedFrameIdName = "AAPL,ig-platform-id"; 158 | 159 | /** 160 | * The property to set your platform id for Intel drivers (Sandy). 161 | * For user configuration only! Use reportedFramebufferName! 162 | */ 163 | static constexpr const char *ReportedFrameIdLegacyName = "AAPL,snb-platform-id"; 164 | 165 | /** 166 | * The IGPU property to force-disable any external GPU if found. 167 | * For user configuration only! Use requestedExternalSwitchOff! 168 | */ 169 | static constexpr const char *RequestedExternalSwitchOffName {"disable-external-gpu"}; 170 | 171 | /** 172 | * Known platform ids used by Intel GPU kexts 173 | * For user configuration only! 174 | */ 175 | static constexpr uint32_t DefaultAppleSkylakePlatformId {0x19120000}; 176 | static constexpr uint32_t DefaultAppleKabyLakePlatformId {0x59160000}; 177 | static constexpr uint32_t DefaultAppleCoffeeLakePlatformId {0x3EA50000}; 178 | static constexpr uint32_t DefaultAppleCannonLakePlatformId {0x5A520000}; 179 | static constexpr uint32_t DefaultAppleIceLakeRealPlatformId {0x8A520000}; 180 | static constexpr uint32_t DefaultAppleIceLakeSimulatorPlatformId {0xFF050000}; 181 | 182 | /** 183 | * Framebuffers without any ports used for hardware acceleration only 184 | * Note 1: Broadwell framebuffers all have connectors added. 185 | * Note 2: Coffee Lake framebuffers without connectors are only present in 10.14. 186 | * Note 3: prerelease Cannon Lake and Ice Lake framebuffers are without connectors. 187 | * For user configuration only! 188 | */ 189 | static constexpr uint32_t ConnectorLessSandyBridgePlatformId1 {0x00030030}; 190 | static constexpr uint32_t ConnectorLessSandyBridgePlatformId2 {0x00050000}; 191 | static constexpr uint32_t ConnectorLessIvyBridgePlatformId1 {0x01620006}; 192 | static constexpr uint32_t ConnectorLessIvyBridgePlatformId2 {0x01620007}; 193 | static constexpr uint32_t ConnectorLessHaswellPlatformId1 {0x04120004}; 194 | static constexpr uint32_t ConnectorLessHaswellPlatformId2 {0x0412000B}; 195 | static constexpr uint32_t ConnectorLessSkylakePlatformId1 {0x19020001}; 196 | static constexpr uint32_t ConnectorLessSkylakePlatformId2 {0x19170001}; 197 | static constexpr uint32_t ConnectorLessSkylakePlatformId3 {0x19120001}; 198 | static constexpr uint32_t ConnectorLessSkylakePlatformId4 {0x19320001}; 199 | static constexpr uint32_t ConnectorLessKabyLakePlatformId1 {0x59180002}; 200 | static constexpr uint32_t ConnectorLessKabyLakePlatformId2 {0x59120003}; 201 | static constexpr uint32_t ConnectorLessCoffeeLakePlatformId1 {0x3E920003}; 202 | static constexpr uint32_t ConnectorLessCoffeeLakePlatformId2 {0x3E910003}; 203 | static constexpr uint32_t ConnectorLessCoffeeLakePlatformId3 {0x3E980003}; 204 | 205 | public: 206 | /** 207 | * Vesa framebuffer identifier 208 | */ 209 | static constexpr uint32_t DefaultVesaPlatformId {0xFFFFFFFF}; 210 | 211 | /** 212 | * Framebuffer id to be reported to IGPU. 213 | * This follows the standard convention initially found in IntelGraphicsFixup: 214 | * igfxframe=X boot-arg has highest priority and overrides any other value. 215 | * -igfxvesa forces 0xFFFFFFFF frame to get into VESA mode. 216 | * Manually specified AAPL,ig-platform-id or AAPL,snb-platform-id go next. 217 | * On Sandy Bridge processors a default AAPL,snb-platform-id will be tried afterwards. 218 | * On Skylake and Kaby Lake processors some default id will be tried afterwards. 219 | */ 220 | uint32_t reportedFramebufferId {0}; 221 | 222 | /** 223 | * Compatible platform id property name for this IGPU 224 | */ 225 | const char *reportedFramebufferName {nullptr}; 226 | 227 | /** 228 | * Set to true if the framebuffer has no connectors 229 | */ 230 | bool reportedFramebufferIsConnectorLess {false}; 231 | 232 | /** 233 | * Known variants of firmware vendors 234 | * Please note, that it may not be possible to always detect the right vendor 235 | */ 236 | enum class FirmwareVendor { 237 | Unknown, 238 | Apple, 239 | VMware, 240 | EDKII, 241 | Parallels, 242 | AMI, 243 | Insyde, 244 | Phoenix, 245 | HP 246 | }; 247 | 248 | /** 249 | * Firmware vendor manufacturer 250 | */ 251 | FirmwareVendor firmwareVendor {FirmwareVendor::Unknown}; 252 | 253 | /** 254 | * Requested external GPU switchoff 255 | */ 256 | bool requestedExternalSwitchOff {false}; 257 | 258 | /** 259 | * Allocate and initialise the device list. 260 | * 261 | * @return device list or nullptr 262 | */ 263 | EXPORT static DeviceInfo *create(); 264 | 265 | /** 266 | * Release initialised device list. 267 | * 268 | * @param d device list 269 | */ 270 | EXPORT static void deleter(DeviceInfo *d NONNULL); 271 | }; 272 | 273 | #endif /* kern_devinfo_h */ 274 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_mach.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_mach.hpp 3 | // Lilu 4 | // 5 | // Certain parts of code are the subject of 6 | // copyright © 2011, 2012, 2013, 2014 fG!, reverser@put.as - http://reverse.put.as 7 | // Copyright © 2016-2017 vit9696. All rights reserved. 8 | // 9 | 10 | #ifndef kern_mach_hpp 11 | #define kern_mach_hpp 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class MachInfo { 24 | mach_vm_address_t running_text_addr {0}; // the address of running __TEXT segment 25 | mach_vm_address_t disk_text_addr {0}; // the same address at from a file 26 | mach_vm_address_t kaslr_slide {0}; // the kernel aslr slide, computed as the difference between above's addresses 27 | uint8_t *file_buf {nullptr}; // read file data 28 | OSDictionary *prelink_dict {nullptr}; // read prealinked kext dictionary 29 | uint8_t *prelink_addr {nullptr}; // prelink text base address 30 | mach_vm_address_t prelink_vmaddr {0}; // prelink text base vm address (for kexts this is their actual slide) 31 | uint32_t file_buf_size {0}; // read file data size 32 | uint8_t *linkedit_buf {nullptr}; // pointer to __LINKEDIT buffer containing symbols to solve 33 | uint64_t linkedit_fileoff {0}; // __LINKEDIT file offset so we can read 34 | uint64_t linkedit_size {0}; 35 | uint32_t symboltable_fileoff {0}; // file offset to symbol table - used to position inside the __LINKEDIT buffer 36 | uint32_t symboltable_nr_symbols {0}; 37 | uint32_t stringtable_fileoff {0}; // file offset to string table 38 | mach_header_64 *running_mh {nullptr}; // pointer to mach-o header of running kernel item 39 | off_t fat_offset {0}; // additional fat offset 40 | size_t memory_size {HeaderSize}; // memory size 41 | bool kaslr_slide_set {false}; // kaslr can be null, used for disambiguation 42 | bool allow_decompress {true}; // allows mach decompression 43 | bool prelink_slid {false}; // assume kaslr-slid kext addresses 44 | uint64_t self_uuid[2] {}; // saved uuid of the loaded kext or kernel 45 | 46 | /** 47 | * Kernel slide is aligned by 20 bits 48 | */ 49 | static constexpr size_t KASLRAlignment {0x100000}; 50 | 51 | /** 52 | * Retrieve LC_UUID command value from a mach header 53 | * 54 | * @param header mach header pointer 55 | * 56 | * @return UUID or nullptr 57 | */ 58 | uint64_t *getUUID(void *header); 59 | 60 | /** 61 | * Retrieve and preserve LC_UUID command value from a mach header 62 | * 63 | * @param header mach header pointer 64 | * 65 | * @return true on success 66 | */ 67 | bool loadUUID(void *header); 68 | 69 | /** 70 | * Enable/disable the Write Protection bit in CR0 register 71 | * 72 | * @param enable the desired value 73 | * 74 | * @return KERN_SUCCESS if succeeded 75 | */ 76 | static kern_return_t setWPBit(bool enable); 77 | 78 | /** 79 | * Retrieve the first pages of a binary at disk into a buffer 80 | * Version that uses KPI VFS functions and a ripped uio_createwithbuffer() from XNU 81 | * 82 | * @param buffer allocated buffer sized no less than HeaderSize 83 | * @param vnode file node 84 | * @param ctxt filesystem context 85 | * @param decompress enable decompression 86 | * @param off fat offset or 0 87 | * 88 | * @return KERN_SUCCESS if the read data contains 64-bit mach header 89 | */ 90 | kern_return_t readMachHeader(uint8_t *buffer, vnode_t vnode, vfs_context_t ctxt, off_t off=0); 91 | 92 | /** 93 | * Retrieve the whole linkedit segment into target buffer from kernel binary at disk 94 | * 95 | * @param vnode file node 96 | * @param ctxt filesystem context 97 | * 98 | * @return KERN_SUCCESS on success 99 | */ 100 | kern_return_t readLinkedit(vnode_t vnode, vfs_context_t ctxt); 101 | 102 | /** 103 | * Retrieve necessary mach-o header information from the mach header 104 | * 105 | * @param header read header sized no less than HeaderSize 106 | */ 107 | void processMachHeader(void *header); 108 | 109 | /** 110 | * Load kext info dictionary and addresses if they were not loaded previously 111 | */ 112 | void updatePrelinkInfo(); 113 | 114 | /** 115 | * Lookup mach image in prelinked image 116 | * 117 | * @param identifier identifier 118 | * @param imageSize size of the returned buffer 119 | * @param slide actual slide for symbols (normally kaslr or 0) 120 | * @param missing set to true on successful prelink parsing when image is not needed 121 | * 122 | * @return pointer to const buffer on success or nullptr 123 | */ 124 | uint8_t *findImage(const char *identifier, uint32_t &imageSize, mach_vm_address_t &slide, bool &missing); 125 | 126 | MachInfo(bool asKernel, const char *id) : isKernel(asKernel), objectId(id) { 127 | DBGLOG("mach", "MachInfo asKernel %d object constructed", asKernel); 128 | } 129 | MachInfo(const MachInfo &) = delete; 130 | MachInfo &operator =(const MachInfo &) = delete; 131 | 132 | /** 133 | * Resolve mach data in the kernel via prelinked cache 134 | * 135 | * @param prelink prelink information source (i.e. Kernel MachInfo) 136 | * 137 | * @return KERN_SUCCESS if loaded 138 | */ 139 | kern_return_t initFromPrelinked(MachInfo *prelink); 140 | 141 | /** 142 | * Resolve mach data in the kernel via filesystem access 143 | * 144 | * @param paths filesystem paths for lookup 145 | * @param num the number of paths passed 146 | * 147 | * @return KERN_SUCCESS if loaded 148 | */ 149 | kern_return_t initFromFileSystem(const char * const paths[], size_t num); 150 | 151 | public: 152 | 153 | /** 154 | * Each header is assumed to fit two pages 155 | */ 156 | static constexpr size_t HeaderSize {PAGE_SIZE_64*2}; 157 | 158 | /** 159 | * Representation mode (kernel/kext) 160 | */ 161 | EXPORT const bool isKernel; 162 | 163 | /** 164 | * Specified file identifier 165 | */ 166 | EXPORT const char *objectId {nullptr}; 167 | 168 | /** 169 | * MachInfo object generator 170 | * 171 | * @param asKernel this MachInfo represents a kernel 172 | * @param id kinfo identifier (e.g. CFBundleIdentifier) 173 | * 174 | * @return MachInfo object or nullptr 175 | */ 176 | static MachInfo *create(bool asKernel=false, const char *id=nullptr) { return new MachInfo(asKernel, id); } 177 | static void deleter(MachInfo *i NONNULL) { delete i; } 178 | 179 | /** 180 | * Resolve mach data in the kernel 181 | * 182 | * @param paths filesystem paths for lookup 183 | * @param num the number of paths passed 184 | * @param prelink prelink information source (i.e. Kernel MachInfo) 185 | * @param fsfallback fallback to reading from filesystem if prelink failed 186 | * 187 | * @return KERN_SUCCESS if loaded 188 | */ 189 | EXPORT kern_return_t init(const char * const paths[], size_t num = 1, MachInfo *prelink=nullptr, bool fsfallback=false); 190 | 191 | /** 192 | * Release the allocated memory, must be called regardless of the init error 193 | */ 194 | EXPORT void deinit(); 195 | 196 | /** 197 | * Retrieve the mach header and __TEXT addresses 198 | * 199 | * @param slide load slide if calculating for kexts 200 | * @param size memory size 201 | * @param force force address recalculation 202 | * 203 | * @return KERN_SUCCESS on success 204 | */ 205 | EXPORT kern_return_t getRunningAddresses(mach_vm_address_t slide=0, size_t size=0, bool force=false); 206 | 207 | /** 208 | * Set the mach header address 209 | * 210 | * @param slide load address 211 | * @param size memory size 212 | * 213 | * @return KERN_SUCCESS on success 214 | */ 215 | EXPORT kern_return_t setRunningAddresses(mach_vm_address_t slide=0, size_t size=0); 216 | 217 | /** 218 | * Retrieve running mach positions 219 | * 220 | * @param header pointer to header 221 | * @param size file size 222 | */ 223 | EXPORT void getRunningPosition(uint8_t * &header, size_t &size); 224 | 225 | /** 226 | * Solve a mach symbol (running addresses must be calculated) 227 | * 228 | * @param symbol symbol to solve 229 | * 230 | * @return running symbol address or 0 231 | */ 232 | EXPORT mach_vm_address_t solveSymbol(const char *symbol); 233 | 234 | /** 235 | * Find the kernel base address (mach-o header) 236 | * 237 | * @return kernel base address or 0 238 | */ 239 | EXPORT mach_vm_address_t findKernelBase(); 240 | 241 | /** 242 | * Compare the loaded kernel with the current UUID (see loadUUID) 243 | * 244 | * @param base image base, pass 0 to use kernel base 245 | * 246 | * @return true if image uuids match 247 | */ 248 | EXPORT bool isCurrentBinary(mach_vm_address_t base=0); 249 | 250 | /** 251 | * Enable/disable interrupt handling 252 | * this is similar to ml_set_interrupts_enabled except the return value 253 | * 254 | * @param enable the desired value 255 | * 256 | * @return true if changed the value and false if it is unchanged 257 | */ 258 | EXPORT static bool setInterrupts(bool enable); 259 | 260 | /** 261 | * Enable/disable kernel memory write protection 262 | * 263 | * @param enable the desired value 264 | * @param lock use spinlock to disable cpu preemption (see KernelPatcher::kernelWriteLock) 265 | * 266 | * @return KERN_SUCCESS if succeeded 267 | */ 268 | EXPORT static kern_return_t setKernelWriting(bool enable, IOSimpleLock *lock); 269 | 270 | /** 271 | * Find section bounds in a passed binary for provided cpu 272 | * 273 | * @param ptr pointer to a complete mach-o binary 274 | * @param sourceSize size of the mach-o binary 275 | * @param vmsegment returned vm segment pointer 276 | * @param vmsection returned vm section pointer 277 | * @param sectionptr returned section pointer 278 | * @param sectionSize returned section size or 0 on failure 279 | * @param segmentName segment name 280 | * @param sectionName section name 281 | * @param cpu cpu to look for in case of fat binaries 282 | */ 283 | EXPORT static void findSectionBounds(void *ptr, size_t sourceSize, vm_address_t &vmsegment, vm_address_t &vmsection, void *§ionptr, size_t §ionSize, const char *segmentName="__TEXT", const char *sectionName="__text", cpu_type_t cpu=CPU_TYPE_X86_64); 284 | 285 | /** 286 | * Request to free file buffer resources (not including linkedit symtable) 287 | */ 288 | void freeFileBufferResources(); 289 | }; 290 | 291 | #endif /* kern_mach_hpp */ 292 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_iokit.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_iokit.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_iokit_hpp 9 | #define kern_iokit_hpp 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | namespace WIOKit { 20 | 21 | /** 22 | * AppleHDAEngine::getLocation teaches us to use loop infinitely when talking to IOReg 23 | * This feels mad and insane, since it may prevent the system from booting. 24 | * Although this had never happened, we will use a far bigger fail-safe stop value. 25 | */ 26 | static constexpr size_t bruteMax {0x10000000}; 27 | 28 | /** 29 | * Read typed OSData 30 | * 31 | * @param obj read object 32 | * @param value read value 33 | * @param name propert name 34 | * 35 | * @return true on success 36 | */ 37 | template 38 | inline bool getOSDataValue(const OSObject *obj, const char *name, T &value) { 39 | if (obj) { 40 | auto data = OSDynamicCast(OSData, obj); 41 | if (data && data->getLength() == sizeof(T)) { 42 | value = *static_cast(data->getBytesNoCopy()); 43 | DBGLOG("iokit", "getOSData %s has %llX value", name, static_cast(value)); 44 | return true; 45 | } else { 46 | SYSLOG("iokit", "getOSData %s has unexpected format", name); 47 | } 48 | } else { 49 | DBGLOG("iokit", "getOSData %s was not found", name); 50 | } 51 | return false; 52 | } 53 | 54 | /** 55 | * Read typed OSData through a temp type 56 | * 57 | * @param obj read object 58 | * @param value read value 59 | * @param name propert name 60 | * 61 | * @return true on success 62 | */ 63 | template 64 | inline bool getOSDataValue(const OSObject *obj, const char *name, T &value) { 65 | AS tmp; 66 | if (getOSDataValue(obj, name, tmp)) { 67 | value = static_cast(tmp); 68 | return true; 69 | } 70 | 71 | return false; 72 | } 73 | 74 | /** 75 | * Read typed OSData from IORegistryEntry 76 | * 77 | * @see getOSDataValue 78 | */ 79 | template 80 | inline bool getOSDataValue(const IORegistryEntry *sect, const char *name, T &value) { 81 | return getOSDataValue(sect->getProperty(name), name, value); 82 | } 83 | 84 | /** 85 | * Read typed OSData from IORegistryEntry 86 | * 87 | * @see getOSDataValue 88 | */ 89 | template 90 | inline bool getOSDataValue(const IORegistryEntry *sect, const char *name, T &value) { 91 | return getOSDataValue(sect->getProperty(name), name, value); 92 | } 93 | 94 | /** 95 | * Read typed OSData from IORegistryEntry 96 | * 97 | * @see getOSDataValue 98 | */ 99 | template 100 | inline bool getOSDataValue(const OSDictionary *dict, const char *name, T &value) { 101 | return getOSDataValue(dict->getObject(name), name, value); 102 | } 103 | 104 | /** 105 | * Read typed OSData from IORegistryEntry 106 | * 107 | * @see getOSDataValue 108 | */ 109 | template 110 | inline bool getOSDataValue(const OSDictionary *dict, const char *name, T &value) { 111 | return getOSDataValue(dict->getObject(name), name, value); 112 | } 113 | 114 | /** 115 | * Retrieve property object 116 | * 117 | * @param entry IORegistry entry 118 | * @param property property name 119 | * 120 | * @return property object (must be released) or nullptr 121 | */ 122 | EXPORT LIBKERN_RETURNS_RETAINED OSSerialize *getProperty(IORegistryEntry *entry, const char *property); 123 | 124 | /** 125 | * Model variants 126 | */ 127 | struct ComputerModel { 128 | enum { 129 | ComputerInvalid = 0x0, 130 | ComputerLaptop = 0x1, 131 | ComputerDesktop = 0x2, 132 | ComputerAny = ComputerLaptop | ComputerDesktop 133 | }; 134 | }; 135 | 136 | /** 137 | * PCI GPU Vendor identifiers 138 | */ 139 | struct VendorID { 140 | enum : uint16_t { 141 | ATIAMD = 0x1002, 142 | AMDZEN = 0x1022, 143 | NVIDIA = 0x10DE, 144 | Intel = 0x8086, 145 | VMware = 0x15AD 146 | }; 147 | }; 148 | 149 | /** 150 | * PCI class codes 151 | */ 152 | struct ClassCode { 153 | enum : uint32_t { 154 | VGAController = 0x030000, 155 | // I have never seen this one, but laptops are evil. 156 | XGAController = 0x030100, 157 | // Some laptops use this for Optimus GPUs. 158 | Ex3DController = 0x030200, 159 | DisplayController = 0x038000, 160 | PCIBridge = 0x060400, 161 | // HDA device on some laptops like Acer Aspire VN7-592G (INSYDE). 162 | HDAMmDevice = 0x040100, 163 | // Watch out for PCISubclassMask, 0x040380 is common on laptops. 164 | HDADevice = 0x040300, 165 | // This does not seem to be documented. It works on Haswell at least. 166 | IMEI = 0x078000, 167 | // To ignore device subclasses. 168 | PCISubclassMask = 0xFFFF00, 169 | }; 170 | }; 171 | 172 | /** 173 | * Definitions of PCI Config Registers 174 | */ 175 | enum PCIRegister : uint8_t { 176 | kIOPCIConfigVendorID = 0x00, 177 | kIOPCIConfigDeviceID = 0x02, 178 | kIOPCIConfigCommand = 0x04, 179 | kIOPCIConfigStatus = 0x06, 180 | kIOPCIConfigRevisionID = 0x08, 181 | kIOPCIConfigClassCode = 0x09, 182 | kIOPCIConfigCacheLineSize = 0x0C, 183 | kIOPCIConfigLatencyTimer = 0x0D, 184 | kIOPCIConfigHeaderType = 0x0E, 185 | kIOPCIConfigBIST = 0x0F, 186 | kIOPCIConfigBaseAddress0 = 0x10, 187 | kIOPCIConfigBaseAddress1 = 0x14, 188 | kIOPCIConfigBaseAddress2 = 0x18, 189 | kIOPCIConfigBaseAddress3 = 0x1C, 190 | kIOPCIConfigBaseAddress4 = 0x20, 191 | kIOPCIConfigBaseAddress5 = 0x24, 192 | kIOPCIConfigCardBusCISPtr = 0x28, 193 | kIOPCIConfigSubSystemVendorID = 0x2C, 194 | kIOPCIConfigSubSystemID = 0x2E, 195 | kIOPCIConfigExpansionROMBase = 0x30, 196 | kIOPCIConfigCapabilitiesPtr = 0x34, 197 | kIOPCIConfigInterruptLine = 0x3C, 198 | kIOPCIConfigInterruptPin = 0x3D, 199 | kIOPCIConfigMinimumGrant = 0x3E, 200 | kIOPCIConfigMaximumLatency = 0x3F 201 | }; 202 | 203 | /** 204 | * Fixed offsets for PCI Config I/O virtual methods 205 | */ 206 | struct PCIConfigOffset { 207 | enum : size_t { 208 | ConfigRead32 = 0x10A, 209 | ConfigWrite32 = 0x10B, 210 | ConfigRead16 = 0x10C, 211 | ConfigWrite16 = 0x10D, 212 | ConfigRead8 = 0x10E, 213 | ConfigWrite8 = 0x10F, 214 | GetBusNumber = 0x11D, 215 | GetDeviceNumber = 0x11E, 216 | GetFunctionNumber = 0x11F 217 | }; 218 | }; 219 | 220 | /** 221 | * PCI Config I/O method prototypes 222 | */ 223 | using t_PCIConfigRead32 = uint32_t (*)(IORegistryEntry *service, uint32_t space, uint8_t offset); 224 | using t_PCIConfigRead16 = uint16_t (*)(IORegistryEntry *service, uint32_t space, uint8_t offset); 225 | using t_PCIConfigRead8 = uint8_t (*)(IORegistryEntry *service, uint32_t space, uint8_t offset); 226 | using t_PCIConfigWrite32 = void (*)(IORegistryEntry *service, uint32_t space, uint8_t offset, uint32_t data); 227 | using t_PCIConfigWrite16 = void (*)(IORegistryEntry *service, uint32_t space, uint8_t offset, uint16_t data); 228 | using t_PCIConfigWrite8 = void (*)(IORegistryEntry *service, uint32_t space, uint8_t offset, uint8_t data); 229 | using t_PCIGetBusNumber = uint8_t (*)(IORegistryEntry *service); 230 | using t_PCIGetDeviceNumber = uint8_t (*)(IORegistryEntry *service); 231 | using t_PCIGetFunctionNumber = uint8_t (*)(IORegistryEntry *service); 232 | 233 | /** 234 | * Read PCI Config register 235 | * 236 | * @param service IOPCIDevice-compatible service. 237 | * @param reg PCI config register 238 | * @param space adress space 239 | * @param size read size for reading custom registers 240 | */ 241 | EXPORT uint32_t readPCIConfigValue(IORegistryEntry *service, uint32_t reg, uint32_t space = 0, uint32_t size = 0); 242 | 243 | /** 244 | * Retrieve PCI device address 245 | * 246 | * @param service IOPCIDevice-compatible service. 247 | * @param bus bus address 248 | * @param device device address 249 | * @param function function address 250 | */ 251 | EXPORT void getDeviceAddress(IORegistryEntry *service, uint8_t &bus, uint8_t &device, uint8_t &function); 252 | 253 | /** 254 | * Retrieve the computer type 255 | * 256 | * @return valid computer type or ComputerAny 257 | */ 258 | EXPORT int getComputerModel(); 259 | 260 | /** 261 | * Retrieve computer model and/or board-id properties 262 | * 263 | * @param model model name output buffer or null 264 | * @param modelsz model name output buffer size 265 | * @param board board identifier output buffer or null 266 | * @param boardsz board identifier output buffer size 267 | * 268 | * @return true if relevant properties already are available, otherwise buffers are unchanged 269 | */ 270 | EXPORT bool getComputerInfo(char *model, size_t modelsz, char *board, size_t boardsz); 271 | 272 | /** 273 | * Retrieve an ioreg entry by path/prefix 274 | * 275 | * @param path an exact lookup path 276 | * @param prefix entry prefix at path 277 | * @param plane plane to lookup in 278 | * @param proc process every found entry with the method 279 | * @param brute kick ioreg until a value is found 280 | * @param user pass some value to the callback function 281 | * 282 | * @return entry pointer (must NOT be released) or nullptr (on failure or in proc mode) 283 | */ 284 | EXPORT LIBKERN_RETURNS_NOT_RETAINED IORegistryEntry *findEntryByPrefix(const char *path, const char *prefix, const IORegistryPlane *plane, bool (*proc)(void *, IORegistryEntry *)=nullptr, bool brute=false, void *user=nullptr); 285 | 286 | /** 287 | * Retrieve an ioreg entry by path/prefix 288 | * 289 | * @param entry an ioreg entry to look in 290 | * @param prefix entry prefix at path 291 | * @param plane plane to lookup in 292 | * @param proc process every found entry with the method 293 | * @param brute kick ioreg until a value is found 294 | * @param user pass some value to the callback function 295 | * 296 | * @return entry pointer (must NOT be released) or nullptr (on failure or in proc mode) 297 | */ 298 | EXPORT LIBKERN_RETURNS_NOT_RETAINED IORegistryEntry *findEntryByPrefix(IORegistryEntry *entry, const char *prefix, const IORegistryPlane *plane, bool (*proc)(void *, IORegistryEntry *)=nullptr, bool brute=false, void *user=nullptr); 299 | 300 | /** 301 | * Check if we are using prelinked kernel/kexts or not 302 | * 303 | * @return true when confirmed that we definitely are 304 | */ 305 | EXPORT bool usingPrelinkedCache(); 306 | 307 | /** 308 | * Properly rename the device 309 | * 310 | * @param entry device to rename 311 | * @param name new name 312 | * @param compat correct compatible 313 | * 314 | * @return true on success 315 | */ 316 | EXPORT bool renameDevice(IORegistryEntry *entry, const char *name, bool compat=true); 317 | } 318 | 319 | #endif /* kern_iokit_hpp */ 320 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/capstone/sparc.h: -------------------------------------------------------------------------------- 1 | #ifndef CAPSTONE_SPARC_H 2 | #define CAPSTONE_SPARC_H 3 | 4 | /* Capstone Disassembly Engine */ 5 | /* By Nguyen Anh Quynh , 2014 */ 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #if !defined(_MSC_VER) || !defined(_KERNEL_MODE) 12 | #include 13 | #endif 14 | 15 | #include "platform.h" 16 | 17 | // GCC SPARC toolchain has a default macro called "sparc" which breaks 18 | // compilation 19 | #undef sparc 20 | 21 | #ifdef _MSC_VER 22 | #pragma warning(disable:4201) 23 | #endif 24 | 25 | //> Enums corresponding to Sparc condition codes, both icc's and fcc's. 26 | typedef enum sparc_cc { 27 | SPARC_CC_INVALID = 0, // invalid CC (default) 28 | //> Integer condition codes 29 | SPARC_CC_ICC_A = 8+256, // Always 30 | SPARC_CC_ICC_N = 0+256, // Never 31 | SPARC_CC_ICC_NE = 9+256, // Not Equal 32 | SPARC_CC_ICC_E = 1+256, // Equal 33 | SPARC_CC_ICC_G = 10+256, // Greater 34 | SPARC_CC_ICC_LE = 2+256, // Less or Equal 35 | SPARC_CC_ICC_GE = 11+256, // Greater or Equal 36 | SPARC_CC_ICC_L = 3+256, // Less 37 | SPARC_CC_ICC_GU = 12+256, // Greater Unsigned 38 | SPARC_CC_ICC_LEU = 4+256, // Less or Equal Unsigned 39 | SPARC_CC_ICC_CC = 13+256, // Carry Clear/Great or Equal Unsigned 40 | SPARC_CC_ICC_CS = 5+256, // Carry Set/Less Unsigned 41 | SPARC_CC_ICC_POS = 14+256, // Positive 42 | SPARC_CC_ICC_NEG = 6+256, // Negative 43 | SPARC_CC_ICC_VC = 15+256, // Overflow Clear 44 | SPARC_CC_ICC_VS = 7+256, // Overflow Set 45 | 46 | //> Floating condition codes 47 | SPARC_CC_FCC_A = 8+16+256, // Always 48 | SPARC_CC_FCC_N = 0+16+256, // Never 49 | SPARC_CC_FCC_U = 7+16+256, // Unordered 50 | SPARC_CC_FCC_G = 6+16+256, // Greater 51 | SPARC_CC_FCC_UG = 5+16+256, // Unordered or Greater 52 | SPARC_CC_FCC_L = 4+16+256, // Less 53 | SPARC_CC_FCC_UL = 3+16+256, // Unordered or Less 54 | SPARC_CC_FCC_LG = 2+16+256, // Less or Greater 55 | SPARC_CC_FCC_NE = 1+16+256, // Not Equal 56 | SPARC_CC_FCC_E = 9+16+256, // Equal 57 | SPARC_CC_FCC_UE = 10+16+256, // Unordered or Equal 58 | SPARC_CC_FCC_GE = 11+16+256, // Greater or Equal 59 | SPARC_CC_FCC_UGE = 12+16+256, // Unordered or Greater or Equal 60 | SPARC_CC_FCC_LE = 13+16+256, // Less or Equal 61 | SPARC_CC_FCC_ULE = 14+16+256, // Unordered or Less or Equal 62 | SPARC_CC_FCC_O = 15+16+256, // Ordered 63 | } sparc_cc; 64 | 65 | //> Branch hint 66 | typedef enum sparc_hint { 67 | SPARC_HINT_INVALID = 0, // no hint 68 | SPARC_HINT_A = 1 << 0, // annul delay slot instruction 69 | SPARC_HINT_PT = 1 << 1, // branch taken 70 | SPARC_HINT_PN = 1 << 2, // branch NOT taken 71 | } sparc_hint; 72 | 73 | //> Operand type for instruction's operands 74 | typedef enum sparc_op_type { 75 | SPARC_OP_INVALID = 0, // = CS_OP_INVALID (Uninitialized). 76 | SPARC_OP_REG, // = CS_OP_REG (Register operand). 77 | SPARC_OP_IMM, // = CS_OP_IMM (Immediate operand). 78 | SPARC_OP_MEM, // = CS_OP_MEM (Memory operand). 79 | } sparc_op_type; 80 | 81 | // Instruction's operand referring to memory 82 | // This is associated with SPARC_OP_MEM operand type above 83 | typedef struct sparc_op_mem { 84 | uint8_t base; // base register 85 | uint8_t index; // index register 86 | int32_t disp; // displacement/offset value 87 | } sparc_op_mem; 88 | 89 | // Instruction operand 90 | typedef struct cs_sparc_op { 91 | sparc_op_type type; // operand type 92 | union { 93 | unsigned int reg; // register value for REG operand 94 | int32_t imm; // immediate value for IMM operand 95 | sparc_op_mem mem; // base/disp value for MEM operand 96 | }; 97 | } cs_sparc_op; 98 | 99 | // Instruction structure 100 | typedef struct cs_sparc { 101 | sparc_cc cc; // code condition for this insn 102 | sparc_hint hint; // branch hint: encoding as bitwise OR of sparc_hint. 103 | // Number of operands of this instruction, 104 | // or 0 when instruction has no operand. 105 | uint8_t op_count; 106 | cs_sparc_op operands[4]; // operands for this instruction. 107 | } cs_sparc; 108 | 109 | //> SPARC registers 110 | typedef enum sparc_reg { 111 | SPARC_REG_INVALID = 0, 112 | 113 | SPARC_REG_F0, 114 | SPARC_REG_F1, 115 | SPARC_REG_F2, 116 | SPARC_REG_F3, 117 | SPARC_REG_F4, 118 | SPARC_REG_F5, 119 | SPARC_REG_F6, 120 | SPARC_REG_F7, 121 | SPARC_REG_F8, 122 | SPARC_REG_F9, 123 | SPARC_REG_F10, 124 | SPARC_REG_F11, 125 | SPARC_REG_F12, 126 | SPARC_REG_F13, 127 | SPARC_REG_F14, 128 | SPARC_REG_F15, 129 | SPARC_REG_F16, 130 | SPARC_REG_F17, 131 | SPARC_REG_F18, 132 | SPARC_REG_F19, 133 | SPARC_REG_F20, 134 | SPARC_REG_F21, 135 | SPARC_REG_F22, 136 | SPARC_REG_F23, 137 | SPARC_REG_F24, 138 | SPARC_REG_F25, 139 | SPARC_REG_F26, 140 | SPARC_REG_F27, 141 | SPARC_REG_F28, 142 | SPARC_REG_F29, 143 | SPARC_REG_F30, 144 | SPARC_REG_F31, 145 | SPARC_REG_F32, 146 | SPARC_REG_F34, 147 | SPARC_REG_F36, 148 | SPARC_REG_F38, 149 | SPARC_REG_F40, 150 | SPARC_REG_F42, 151 | SPARC_REG_F44, 152 | SPARC_REG_F46, 153 | SPARC_REG_F48, 154 | SPARC_REG_F50, 155 | SPARC_REG_F52, 156 | SPARC_REG_F54, 157 | SPARC_REG_F56, 158 | SPARC_REG_F58, 159 | SPARC_REG_F60, 160 | SPARC_REG_F62, 161 | SPARC_REG_FCC0, // Floating condition codes 162 | SPARC_REG_FCC1, 163 | SPARC_REG_FCC2, 164 | SPARC_REG_FCC3, 165 | SPARC_REG_FP, 166 | SPARC_REG_G0, 167 | SPARC_REG_G1, 168 | SPARC_REG_G2, 169 | SPARC_REG_G3, 170 | SPARC_REG_G4, 171 | SPARC_REG_G5, 172 | SPARC_REG_G6, 173 | SPARC_REG_G7, 174 | SPARC_REG_I0, 175 | SPARC_REG_I1, 176 | SPARC_REG_I2, 177 | SPARC_REG_I3, 178 | SPARC_REG_I4, 179 | SPARC_REG_I5, 180 | SPARC_REG_I7, 181 | SPARC_REG_ICC, // Integer condition codes 182 | SPARC_REG_L0, 183 | SPARC_REG_L1, 184 | SPARC_REG_L2, 185 | SPARC_REG_L3, 186 | SPARC_REG_L4, 187 | SPARC_REG_L5, 188 | SPARC_REG_L6, 189 | SPARC_REG_L7, 190 | SPARC_REG_O0, 191 | SPARC_REG_O1, 192 | SPARC_REG_O2, 193 | SPARC_REG_O3, 194 | SPARC_REG_O4, 195 | SPARC_REG_O5, 196 | SPARC_REG_O7, 197 | SPARC_REG_SP, 198 | SPARC_REG_Y, 199 | 200 | // special register 201 | SPARC_REG_XCC, 202 | 203 | SPARC_REG_ENDING, // <-- mark the end of the list of registers 204 | 205 | // extras 206 | SPARC_REG_O6 = SPARC_REG_SP, 207 | SPARC_REG_I6 = SPARC_REG_FP, 208 | } sparc_reg; 209 | 210 | //> SPARC instruction 211 | typedef enum sparc_insn { 212 | SPARC_INS_INVALID = 0, 213 | 214 | SPARC_INS_ADDCC, 215 | SPARC_INS_ADDX, 216 | SPARC_INS_ADDXCC, 217 | SPARC_INS_ADDXC, 218 | SPARC_INS_ADDXCCC, 219 | SPARC_INS_ADD, 220 | SPARC_INS_ALIGNADDR, 221 | SPARC_INS_ALIGNADDRL, 222 | SPARC_INS_ANDCC, 223 | SPARC_INS_ANDNCC, 224 | SPARC_INS_ANDN, 225 | SPARC_INS_AND, 226 | SPARC_INS_ARRAY16, 227 | SPARC_INS_ARRAY32, 228 | SPARC_INS_ARRAY8, 229 | SPARC_INS_B, 230 | SPARC_INS_JMP, 231 | SPARC_INS_BMASK, 232 | SPARC_INS_FB, 233 | SPARC_INS_BRGEZ, 234 | SPARC_INS_BRGZ, 235 | SPARC_INS_BRLEZ, 236 | SPARC_INS_BRLZ, 237 | SPARC_INS_BRNZ, 238 | SPARC_INS_BRZ, 239 | SPARC_INS_BSHUFFLE, 240 | SPARC_INS_CALL, 241 | SPARC_INS_CASX, 242 | SPARC_INS_CAS, 243 | SPARC_INS_CMASK16, 244 | SPARC_INS_CMASK32, 245 | SPARC_INS_CMASK8, 246 | SPARC_INS_CMP, 247 | SPARC_INS_EDGE16, 248 | SPARC_INS_EDGE16L, 249 | SPARC_INS_EDGE16LN, 250 | SPARC_INS_EDGE16N, 251 | SPARC_INS_EDGE32, 252 | SPARC_INS_EDGE32L, 253 | SPARC_INS_EDGE32LN, 254 | SPARC_INS_EDGE32N, 255 | SPARC_INS_EDGE8, 256 | SPARC_INS_EDGE8L, 257 | SPARC_INS_EDGE8LN, 258 | SPARC_INS_EDGE8N, 259 | SPARC_INS_FABSD, 260 | SPARC_INS_FABSQ, 261 | SPARC_INS_FABSS, 262 | SPARC_INS_FADDD, 263 | SPARC_INS_FADDQ, 264 | SPARC_INS_FADDS, 265 | SPARC_INS_FALIGNDATA, 266 | SPARC_INS_FAND, 267 | SPARC_INS_FANDNOT1, 268 | SPARC_INS_FANDNOT1S, 269 | SPARC_INS_FANDNOT2, 270 | SPARC_INS_FANDNOT2S, 271 | SPARC_INS_FANDS, 272 | SPARC_INS_FCHKSM16, 273 | SPARC_INS_FCMPD, 274 | SPARC_INS_FCMPEQ16, 275 | SPARC_INS_FCMPEQ32, 276 | SPARC_INS_FCMPGT16, 277 | SPARC_INS_FCMPGT32, 278 | SPARC_INS_FCMPLE16, 279 | SPARC_INS_FCMPLE32, 280 | SPARC_INS_FCMPNE16, 281 | SPARC_INS_FCMPNE32, 282 | SPARC_INS_FCMPQ, 283 | SPARC_INS_FCMPS, 284 | SPARC_INS_FDIVD, 285 | SPARC_INS_FDIVQ, 286 | SPARC_INS_FDIVS, 287 | SPARC_INS_FDMULQ, 288 | SPARC_INS_FDTOI, 289 | SPARC_INS_FDTOQ, 290 | SPARC_INS_FDTOS, 291 | SPARC_INS_FDTOX, 292 | SPARC_INS_FEXPAND, 293 | SPARC_INS_FHADDD, 294 | SPARC_INS_FHADDS, 295 | SPARC_INS_FHSUBD, 296 | SPARC_INS_FHSUBS, 297 | SPARC_INS_FITOD, 298 | SPARC_INS_FITOQ, 299 | SPARC_INS_FITOS, 300 | SPARC_INS_FLCMPD, 301 | SPARC_INS_FLCMPS, 302 | SPARC_INS_FLUSHW, 303 | SPARC_INS_FMEAN16, 304 | SPARC_INS_FMOVD, 305 | SPARC_INS_FMOVQ, 306 | SPARC_INS_FMOVRDGEZ, 307 | SPARC_INS_FMOVRQGEZ, 308 | SPARC_INS_FMOVRSGEZ, 309 | SPARC_INS_FMOVRDGZ, 310 | SPARC_INS_FMOVRQGZ, 311 | SPARC_INS_FMOVRSGZ, 312 | SPARC_INS_FMOVRDLEZ, 313 | SPARC_INS_FMOVRQLEZ, 314 | SPARC_INS_FMOVRSLEZ, 315 | SPARC_INS_FMOVRDLZ, 316 | SPARC_INS_FMOVRQLZ, 317 | SPARC_INS_FMOVRSLZ, 318 | SPARC_INS_FMOVRDNZ, 319 | SPARC_INS_FMOVRQNZ, 320 | SPARC_INS_FMOVRSNZ, 321 | SPARC_INS_FMOVRDZ, 322 | SPARC_INS_FMOVRQZ, 323 | SPARC_INS_FMOVRSZ, 324 | SPARC_INS_FMOVS, 325 | SPARC_INS_FMUL8SUX16, 326 | SPARC_INS_FMUL8ULX16, 327 | SPARC_INS_FMUL8X16, 328 | SPARC_INS_FMUL8X16AL, 329 | SPARC_INS_FMUL8X16AU, 330 | SPARC_INS_FMULD, 331 | SPARC_INS_FMULD8SUX16, 332 | SPARC_INS_FMULD8ULX16, 333 | SPARC_INS_FMULQ, 334 | SPARC_INS_FMULS, 335 | SPARC_INS_FNADDD, 336 | SPARC_INS_FNADDS, 337 | SPARC_INS_FNAND, 338 | SPARC_INS_FNANDS, 339 | SPARC_INS_FNEGD, 340 | SPARC_INS_FNEGQ, 341 | SPARC_INS_FNEGS, 342 | SPARC_INS_FNHADDD, 343 | SPARC_INS_FNHADDS, 344 | SPARC_INS_FNOR, 345 | SPARC_INS_FNORS, 346 | SPARC_INS_FNOT1, 347 | SPARC_INS_FNOT1S, 348 | SPARC_INS_FNOT2, 349 | SPARC_INS_FNOT2S, 350 | SPARC_INS_FONE, 351 | SPARC_INS_FONES, 352 | SPARC_INS_FOR, 353 | SPARC_INS_FORNOT1, 354 | SPARC_INS_FORNOT1S, 355 | SPARC_INS_FORNOT2, 356 | SPARC_INS_FORNOT2S, 357 | SPARC_INS_FORS, 358 | SPARC_INS_FPACK16, 359 | SPARC_INS_FPACK32, 360 | SPARC_INS_FPACKFIX, 361 | SPARC_INS_FPADD16, 362 | SPARC_INS_FPADD16S, 363 | SPARC_INS_FPADD32, 364 | SPARC_INS_FPADD32S, 365 | SPARC_INS_FPADD64, 366 | SPARC_INS_FPMERGE, 367 | SPARC_INS_FPSUB16, 368 | SPARC_INS_FPSUB16S, 369 | SPARC_INS_FPSUB32, 370 | SPARC_INS_FPSUB32S, 371 | SPARC_INS_FQTOD, 372 | SPARC_INS_FQTOI, 373 | SPARC_INS_FQTOS, 374 | SPARC_INS_FQTOX, 375 | SPARC_INS_FSLAS16, 376 | SPARC_INS_FSLAS32, 377 | SPARC_INS_FSLL16, 378 | SPARC_INS_FSLL32, 379 | SPARC_INS_FSMULD, 380 | SPARC_INS_FSQRTD, 381 | SPARC_INS_FSQRTQ, 382 | SPARC_INS_FSQRTS, 383 | SPARC_INS_FSRA16, 384 | SPARC_INS_FSRA32, 385 | SPARC_INS_FSRC1, 386 | SPARC_INS_FSRC1S, 387 | SPARC_INS_FSRC2, 388 | SPARC_INS_FSRC2S, 389 | SPARC_INS_FSRL16, 390 | SPARC_INS_FSRL32, 391 | SPARC_INS_FSTOD, 392 | SPARC_INS_FSTOI, 393 | SPARC_INS_FSTOQ, 394 | SPARC_INS_FSTOX, 395 | SPARC_INS_FSUBD, 396 | SPARC_INS_FSUBQ, 397 | SPARC_INS_FSUBS, 398 | SPARC_INS_FXNOR, 399 | SPARC_INS_FXNORS, 400 | SPARC_INS_FXOR, 401 | SPARC_INS_FXORS, 402 | SPARC_INS_FXTOD, 403 | SPARC_INS_FXTOQ, 404 | SPARC_INS_FXTOS, 405 | SPARC_INS_FZERO, 406 | SPARC_INS_FZEROS, 407 | SPARC_INS_JMPL, 408 | SPARC_INS_LDD, 409 | SPARC_INS_LD, 410 | SPARC_INS_LDQ, 411 | SPARC_INS_LDSB, 412 | SPARC_INS_LDSH, 413 | SPARC_INS_LDSW, 414 | SPARC_INS_LDUB, 415 | SPARC_INS_LDUH, 416 | SPARC_INS_LDX, 417 | SPARC_INS_LZCNT, 418 | SPARC_INS_MEMBAR, 419 | SPARC_INS_MOVDTOX, 420 | SPARC_INS_MOV, 421 | SPARC_INS_MOVRGEZ, 422 | SPARC_INS_MOVRGZ, 423 | SPARC_INS_MOVRLEZ, 424 | SPARC_INS_MOVRLZ, 425 | SPARC_INS_MOVRNZ, 426 | SPARC_INS_MOVRZ, 427 | SPARC_INS_MOVSTOSW, 428 | SPARC_INS_MOVSTOUW, 429 | SPARC_INS_MULX, 430 | SPARC_INS_NOP, 431 | SPARC_INS_ORCC, 432 | SPARC_INS_ORNCC, 433 | SPARC_INS_ORN, 434 | SPARC_INS_OR, 435 | SPARC_INS_PDIST, 436 | SPARC_INS_PDISTN, 437 | SPARC_INS_POPC, 438 | SPARC_INS_RD, 439 | SPARC_INS_RESTORE, 440 | SPARC_INS_RETT, 441 | SPARC_INS_SAVE, 442 | SPARC_INS_SDIVCC, 443 | SPARC_INS_SDIVX, 444 | SPARC_INS_SDIV, 445 | SPARC_INS_SETHI, 446 | SPARC_INS_SHUTDOWN, 447 | SPARC_INS_SIAM, 448 | SPARC_INS_SLLX, 449 | SPARC_INS_SLL, 450 | SPARC_INS_SMULCC, 451 | SPARC_INS_SMUL, 452 | SPARC_INS_SRAX, 453 | SPARC_INS_SRA, 454 | SPARC_INS_SRLX, 455 | SPARC_INS_SRL, 456 | SPARC_INS_STBAR, 457 | SPARC_INS_STB, 458 | SPARC_INS_STD, 459 | SPARC_INS_ST, 460 | SPARC_INS_STH, 461 | SPARC_INS_STQ, 462 | SPARC_INS_STX, 463 | SPARC_INS_SUBCC, 464 | SPARC_INS_SUBX, 465 | SPARC_INS_SUBXCC, 466 | SPARC_INS_SUB, 467 | SPARC_INS_SWAP, 468 | SPARC_INS_TADDCCTV, 469 | SPARC_INS_TADDCC, 470 | SPARC_INS_T, 471 | SPARC_INS_TSUBCCTV, 472 | SPARC_INS_TSUBCC, 473 | SPARC_INS_UDIVCC, 474 | SPARC_INS_UDIVX, 475 | SPARC_INS_UDIV, 476 | SPARC_INS_UMULCC, 477 | SPARC_INS_UMULXHI, 478 | SPARC_INS_UMUL, 479 | SPARC_INS_UNIMP, 480 | SPARC_INS_FCMPED, 481 | SPARC_INS_FCMPEQ, 482 | SPARC_INS_FCMPES, 483 | SPARC_INS_WR, 484 | SPARC_INS_XMULX, 485 | SPARC_INS_XMULXHI, 486 | SPARC_INS_XNORCC, 487 | SPARC_INS_XNOR, 488 | SPARC_INS_XORCC, 489 | SPARC_INS_XOR, 490 | 491 | // alias instructions 492 | SPARC_INS_RET, 493 | SPARC_INS_RETL, 494 | 495 | SPARC_INS_ENDING, // <-- mark the end of the list of instructions 496 | } sparc_insn; 497 | 498 | //> Group of SPARC instructions 499 | typedef enum sparc_insn_group { 500 | SPARC_GRP_INVALID = 0, // = CS_GRP_INVALID 501 | 502 | //> Generic groups 503 | // all jump instructions (conditional+direct+indirect jumps) 504 | SPARC_GRP_JUMP, // = CS_GRP_JUMP 505 | 506 | //> Architecture-specific groups 507 | SPARC_GRP_HARDQUAD = 128, 508 | SPARC_GRP_V9, 509 | SPARC_GRP_VIS, 510 | SPARC_GRP_VIS2, 511 | SPARC_GRP_VIS3, 512 | SPARC_GRP_32BIT, 513 | SPARC_GRP_64BIT, 514 | 515 | SPARC_GRP_ENDING, // <-- mark the end of the list of groups 516 | } sparc_insn_group; 517 | 518 | #ifdef __cplusplus 519 | } 520 | #endif 521 | 522 | #endif 523 | -------------------------------------------------------------------------------- /CLOVER/kexts/10.14/Lilu.kext/Contents/Resources/Headers/kern_api.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // kern_api.hpp 3 | // Lilu 4 | // 5 | // Copyright © 2016-2017 vit9696. All rights reserved. 6 | // 7 | 8 | #ifndef kern_api_h 9 | #define kern_api_h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | class LiluAPI { 21 | public: 22 | /** 23 | * Initialise lilu api 24 | */ 25 | void init(); 26 | 27 | /** 28 | * Deinitialise lilu api 29 | */ 30 | void deinit(); 31 | 32 | /** 33 | * Errors returned by functions 34 | */ 35 | enum class Error { 36 | NoError, 37 | LockError, 38 | MemoryError, 39 | UnsupportedFeature, 40 | IncompatibleOS, 41 | Disabled, 42 | TooLate, 43 | Offline 44 | }; 45 | 46 | /** 47 | * Minimal API version that guarantees forward ABI compatibility 48 | * Present due to lack of OSBundleCompatibleVersion at kext injection 49 | */ 50 | static constexpr size_t CompatibilityVersion {parseModuleVersion("1.2.0")}; 51 | 52 | /** 53 | * Obtains api access by holding a lock, which is required when accessing out of the main context 54 | * 55 | * @param version api compatibility version 56 | * @param check do not wait on the lock but return Error::LockError on failure 57 | * 58 | * @return Error::NoError on success 59 | */ 60 | EXPORT Error requestAccess(size_t version=CompatibilityVersion, bool check=false); 61 | 62 | /** 63 | * Releases api lock 64 | * 65 | * @return Error::NoError on success 66 | */ 67 | EXPORT Error releaseAccess(); 68 | 69 | /** 70 | * You are supposed declare that your plugins work in at least one of these modes 71 | * It is assumed that single user mode is equal to normal, because it is generally 72 | * used to continue the load of a complete OS, and by default Lilu itself ignores it. 73 | */ 74 | enum RunningMode : uint32_t { 75 | RunningNormal = 1, 76 | AllowNormal = RunningNormal, 77 | RunningInstallerRecovery = 2, 78 | AllowInstallerRecovery = RunningInstallerRecovery, 79 | RunningSafeMode = 4, 80 | AllowSafeMode = RunningSafeMode 81 | }; 82 | 83 | /** 84 | * Obtain current run mode similarly to requirements 85 | * 86 | * @return run mode mask (RunningMode) 87 | */ 88 | inline uint32_t getRunMode() { 89 | return currentRunMode; 90 | } 91 | 92 | /** 93 | * Decides whether you are eligible to continue 94 | * 95 | * @param product product name 96 | * @param version product version 97 | * @param runmode bitmask of allowed enviornments 98 | * @param disableArg pointer to disabling boot arguments array 99 | * @param disableArgNum number of disabling boot arguments 100 | * @param debugArg pointer to debug boot arguments array 101 | * @param debugArgNum number of debug boot arguments 102 | * @param betaArg pointer to beta boot arguments array 103 | * @param betaArgNum number of beta boot arguments 104 | * @param min minimal required kernel version 105 | * @param max maximum supported kernel version 106 | * @param printDebug returns debug printing status (based on debugArg) 107 | * 108 | * @return Error::NoError on success 109 | */ 110 | EXPORT Error shouldLoad(const char *product, size_t version, uint32_t runmode, const char **disableArg, size_t disableArgNum, const char **debugArg, size_t debugArgNum, const char **betaArg, size_t betaArgNum, KernelVersion min, KernelVersion max, bool &printDebug); 111 | 112 | /** 113 | * Kernel patcher loaded callback 114 | * 115 | * @param user user provided pointer at registering 116 | * @param patcher kernel patcher instance 117 | */ 118 | using t_patcherLoaded = void (*)(void *user, KernelPatcher &patcher); 119 | 120 | /** 121 | * Registers custom provided callbacks for later invocation on kernel patcher initialisation 122 | * 123 | * @param callback your callback function 124 | * @param user your pointer that will be passed to the callback function 125 | * 126 | * @return Error::NoError on success 127 | */ 128 | EXPORT Error onPatcherLoad(t_patcherLoaded callback, void *user=nullptr); 129 | 130 | /** 131 | * Registers custom provided callbacks for later invocation on kernel patcher initialisation 132 | * Enforced version, which panics on registration failure (assuming your code cannot continue otherwise) 133 | * 134 | * @param callback your callback function 135 | * @param user your pointer that will be passed to the callback function 136 | * 137 | * @return Error::NoError on success 138 | */ 139 | inline void onPatcherLoadForce(t_patcherLoaded callback, void *user=nullptr) { 140 | auto err = onPatcherLoad(callback, user); 141 | if (err != Error::NoError) 142 | PANIC("api", "onPatcherLoad failed with code %d", err); 143 | } 144 | 145 | /** 146 | * Kext loaded callback 147 | * Note that you will get notified of all the requested kexts for speed reasons 148 | * 149 | * @param user user provided pointer at registering 150 | * @param patcher kernel patcher instance 151 | * @param id loaded kinfo id 152 | * @param slide loaded slide 153 | * @param size loaded memory size 154 | */ 155 | using t_kextLoaded = void (*)(void *user, KernelPatcher &patcher, size_t id, mach_vm_address_t slide, size_t size); 156 | 157 | /** 158 | * Registers custom provided callbacks for later invocation on kext load 159 | * 160 | * @param infos your kext list (make sure to point to const memory) 161 | * @param num number of provided kext entries 162 | * @param callback your callback function (optional) 163 | * @param user your pointer that will be passed to the callback function (optional) 164 | * 165 | * @return Error::NoError on success 166 | */ 167 | EXPORT Error onKextLoad(KernelPatcher::KextInfo *infos, size_t num=1, t_kextLoaded callback=nullptr, void *user=nullptr); 168 | 169 | /** 170 | * Registers custom provided callbacks for later invocation on kext load 171 | * Enforced version, which panics on registration failure (assuming your code cannot continue otherwise) 172 | * 173 | * @param infos your kext list (make sure to point to const memory) 174 | * @param num number of provided kext entries 175 | * @param callback your callback function (optional) 176 | * @param user your pointer that will be passed to the callback function (optional) 177 | * 178 | * @return Error::NoError on success 179 | */ 180 | inline void onKextLoadForce(KernelPatcher::KextInfo *infos, size_t num=1, t_kextLoaded callback=nullptr, void *user=nullptr) { 181 | auto err = onKextLoad(infos, num, callback, user); 182 | if (err != Error::NoError) 183 | PANIC("api", "onKextLoad failed with code %d", err); 184 | } 185 | 186 | /** 187 | * Registers custom provided callbacks for later invocation on binary load 188 | * 189 | * @param infos your binary list (make sure to point to const memory) 190 | * @param num number of provided binary entries 191 | * @param callback your callback function (could be null) 192 | * @param user your pointer that will be passed to the callback function 193 | * @param mods optional mod list (make sure to point to const memory) 194 | * @param modnum number of provided mod entries 195 | * 196 | * @return Error::NoError on success 197 | */ 198 | EXPORT Error onProcLoad(UserPatcher::ProcInfo *infos, size_t num=1, UserPatcher::t_BinaryLoaded callback=nullptr, void *user=nullptr, UserPatcher::BinaryModInfo *mods=nullptr, size_t modnum=0); 199 | 200 | /** 201 | * Registers custom provided callbacks for later invocation on binary load 202 | * Enforced version, which panics on registration failure (assuming your code cannot continue otherwise) 203 | * 204 | * @param infos your binary list (make sure to point to const memory) 205 | * @param num number of provided binary entries 206 | * @param callback your callback function (could be null) 207 | * @param user your pointer that will be passed to the callback function 208 | * @param mods optional mod list (make sure to point to const memory) 209 | * @param modnum number of provided mod entries 210 | * 211 | * @return Error::NoError on success 212 | */ 213 | inline void onProcLoadForce(UserPatcher::ProcInfo *infos, size_t num=1, UserPatcher::t_BinaryLoaded callback=nullptr, void *user=nullptr, UserPatcher::BinaryModInfo *mods=nullptr, size_t modnum=0) { 214 | auto err = onProcLoad(infos, num, callback, user, mods, modnum); 215 | if (err != Error::NoError) 216 | PANIC("api", "onProcLoad failed with code %d", err); 217 | } 218 | 219 | /** 220 | * Kext loaded callback 221 | * Note that you will get notified of all the requested kexts for speed reasons 222 | * 223 | * @param user user provided pointer at registering 224 | * @param task task 225 | * @param entitlement loaded kinfo id 226 | * @param original original entitlement value 227 | */ 228 | using t_entitlementRequested = void (*)(void *user, task_t task, const char *entitlement, OSObject *&original); 229 | 230 | /** 231 | * Registers custom provided callbacks for later invocation on entitlement registration 232 | * 233 | * @param callback your callback function 234 | * @param user your pointer that will be passed to the callback function 235 | * 236 | * @return Error::NoError on success 237 | */ 238 | EXPORT Error onEntitlementRequest(t_entitlementRequested callback, void *user=nullptr); 239 | 240 | /** 241 | * Registers custom provided callbacks for later invocation on entitlement registration 242 | * Enforced version, which panics on registration failure (assuming your code cannot continue otherwise) 243 | * 244 | * @param callback your callback function 245 | * @param user your pointer that will be passed to the callback function 246 | * 247 | * @return Error::NoError on success 248 | */ 249 | inline void onEntitlementRequestForce(t_entitlementRequested callback, void *user=nullptr) { 250 | auto err = onEntitlementRequest(callback, user); 251 | if (err != Error::NoError) 252 | PANIC("api", "onEntitlementRequest failed with code %d", err); 253 | } 254 | 255 | /** 256 | * Processes all the registered patcher load callbacks 257 | * 258 | * @param patcher kernel patcher instance 259 | */ 260 | void processPatcherLoadCallbacks(KernelPatcher &patcher); 261 | 262 | /** 263 | * Processes all the registered kext load callbacks 264 | * 265 | * @param patcher kernel patcher instance 266 | * @param id loaded kinfo id 267 | * @param slide loaded slide 268 | * @param size loaded memory size 269 | * @param reloadable kinfo could be unloaded 270 | */ 271 | void processKextLoadCallbacks(KernelPatcher &patcher, size_t id, mach_vm_address_t slide, size_t size, bool reloadable); 272 | 273 | /** 274 | * Processes all the registered user patcher load callbacks 275 | * 276 | * @param patcher user patcher instance 277 | */ 278 | void processUserLoadCallbacks(UserPatcher &patcher); 279 | 280 | /** 281 | * Processes all the registered binary load callbacks 282 | * 283 | * @param patcher kernel patcher instance 284 | * @param map process image vm_map 285 | * @param path path to the binary absolute or relative 286 | * @param len path length excluding null terminator 287 | */ 288 | void processBinaryLoadCallbacks(UserPatcher &patcher, vm_map_t map, const char *path, size_t len); 289 | 290 | /** 291 | * Activates patchers 292 | * 293 | * @param kpatcher kernel patcher instance 294 | * @param upatcher user patcher instance 295 | */ 296 | void activate(KernelPatcher &kpatcher, UserPatcher &upatcher); 297 | 298 | private: 299 | 300 | /** 301 | * Api lock 302 | */ 303 | IOLock *access {nullptr}; 304 | 305 | /** 306 | * Defines current running modes 307 | */ 308 | uint32_t currentRunMode {}; 309 | 310 | /** 311 | * No longer accept any requests 312 | */ 313 | bool apiRequestsOver {false}; 314 | 315 | /** 316 | * Stores call function and user pointer 317 | */ 318 | template 319 | using stored_pair = ppair; 320 | 321 | /** 322 | * Stores multiple callbacks 323 | */ 324 | template 325 | using stored_vector = evector *, stored_pair::deleter>; 326 | 327 | /** 328 | * List of patcher callbacks 329 | */ 330 | stored_vector patcherLoadedCallbacks; 331 | 332 | /** 333 | * List of kext callbacks 334 | */ 335 | stored_vector kextLoadedCallbacks; 336 | 337 | /** 338 | * List of binary callbacks 339 | */ 340 | stored_vector binaryLoadedCallbacks; 341 | 342 | /** 343 | * List of entitlement callbacks 344 | */ 345 | stored_vector entitlementRequestedCallbacks; 346 | 347 | /** 348 | * List of processed kexts 349 | */ 350 | stored_vector storedKexts; 351 | 352 | /** 353 | * List of processed procs 354 | */ 355 | evector storedProcs; 356 | 357 | /** 358 | * List of processed binary mods 359 | */ 360 | evector storedBinaryMods; 361 | 362 | /** 363 | * Copy client entitlement type (see IOUserClient) 364 | */ 365 | using t_copyClientEntitlement = OSObject *(*)(task_t, const char *); 366 | 367 | /** 368 | * Hooked entitlement copying method 369 | */ 370 | static OSObject *copyClientEntitlement(task_t task, const char *entitlement); 371 | 372 | /** 373 | * Trampoline for original entitlement copying method 374 | */ 375 | t_copyClientEntitlement orgCopyClientEntitlement {nullptr}; 376 | }; 377 | 378 | EXPORT extern LiluAPI lilu; 379 | 380 | #endif /* kern_api_h */ 381 | --------------------------------------------------------------------------------