diff --git a/AppleALC/kern_resources.cpp b/AppleALC/kern_resources.cpp index 02d771b68c..9531b39dc2 100644 --- a/AppleALC/kern_resources.cpp +++ b/AppleALC/kern_resources.cpp @@ -24831,67 +24831,79 @@ const size_t vendorModSize {10}; // ControllerMod section -static const uint8_t patchBuf840[] { 0x0C, 0x0C, }; -static const uint8_t patchBuf841[] { 0x04, 0x0F, }; +static const uint8_t patchBuf840[] { 0x20, 0x8C, }; +static const uint8_t patchBuf841[] { 0x21, 0x8D, }; static const KextPatch patches64[] { { { &kextList[0], patchBuf840, patchBuf841, 2, 4 }, 13, KernelPatcher::KernelAny }, }; static const uint8_t patchBuf842[] { 0x20, 0x8C, }; -static const uint8_t patchBuf843[] { 0xA0, 0x8C, }; +static const uint8_t patchBuf843[] { 0x20, 0x8D, }; static const KextPatch patches65[] { { { &kextList[0], patchBuf842, patchBuf843, 2, 4 }, 13, KernelPatcher::KernelAny }, }; -static const uint8_t patchBuf844[] { 0x0C, 0x0A, 0x00, 0x00, }; -static const uint8_t patchBuf845[] { 0x0C, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf846[] { 0x0B, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf847[] { 0x0C, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf848[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, }; -static const uint8_t patchBuf849[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf850[] { 0x3D, 0x0B, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf851[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; -static const uint8_t patchBuf852[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, }; -static const uint8_t patchBuf853[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf844[] { 0x0C, 0x0C, }; +static const uint8_t patchBuf845[] { 0x04, 0x0F, }; static const KextPatch patches66[] { - { { &kextList[0], patchBuf844, patchBuf845, 4, 4 }, 13, 13 }, - { { &kextList[0], patchBuf846, patchBuf847, 4, 2 }, 13, 13 }, - { { &kextList[0], patchBuf848, patchBuf849, 5, 3 }, 14, 14 }, - { { &kextList[0], patchBuf850, patchBuf851, 5, 1 }, 14, 14 }, - { { &kextList[0], patchBuf852, patchBuf853, 5, 5 }, 15, KernelPatcher::KernelAny }, -}; -static const uint8_t patchBuf854[] { 0x20, 0x8C, }; -static const uint8_t patchBuf855[] { 0x20, 0x8D, }; + { { &kextList[0], patchBuf844, patchBuf845, 2, 4 }, 13, KernelPatcher::KernelAny }, +}; +static const uint8_t patchBuf846[] { 0x20, 0x8C, }; +static const uint8_t patchBuf847[] { 0xA0, 0x8C, }; static const KextPatch patches67[] { - { { &kextList[0], patchBuf854, patchBuf855, 2, 4 }, 13, KernelPatcher::KernelAny }, + { { &kextList[0], patchBuf846, patchBuf847, 2, 4 }, 13, 13 }, }; -static const uint8_t patchBuf856[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, }; -static const uint8_t patchBuf857[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, }; +static const uint8_t patchBuf848[] { 0x0C, 0x0A, 0x00, 0x00, }; +static const uint8_t patchBuf849[] { 0x0C, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf850[] { 0x0B, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf851[] { 0x0C, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf852[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, }; +static const uint8_t patchBuf853[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf854[] { 0x3D, 0x0B, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf855[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; +static const uint8_t patchBuf856[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, }; +static const uint8_t patchBuf857[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, }; static const KextPatch patches68[] { - { { &kextList[1], patchBuf856, patchBuf857, 36, 1 }, 14, KernelPatcher::KernelAny }, -}; -static const uint8_t patchBuf858[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, }; -static const uint8_t patchBuf859[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, }; + { { &kextList[0], patchBuf848, patchBuf849, 4, 4 }, 13, 13 }, + { { &kextList[0], patchBuf850, patchBuf851, 4, 2 }, 13, 13 }, + { { &kextList[0], patchBuf852, patchBuf853, 5, 3 }, 14, 14 }, + { { &kextList[0], patchBuf854, patchBuf855, 5, 1 }, 14, 14 }, + { { &kextList[0], patchBuf856, patchBuf857, 5, 5 }, 15, KernelPatcher::KernelAny }, +}; +static const uint8_t patchBuf858[] { 0x20, 0x8C, }; +static const uint8_t patchBuf859[] { 0x20, 0x8D, }; static const KextPatch patches69[] { - { { &kextList[3], patchBuf858, patchBuf859, 36, 1 }, 13, KernelPatcher::KernelAny }, + { { &kextList[0], patchBuf858, patchBuf859, 2, 4 }, 13, KernelPatcher::KernelAny }, }; -static const uint8_t patchBuf860[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; -static const uint8_t patchBuf861[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const uint8_t patchBuf860[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, }; +static const uint8_t patchBuf861[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, }; static const KextPatch patches70[] { - { { &kextList[3], patchBuf860, patchBuf861, 24, 4 }, 13, KernelPatcher::KernelAny }, + { { &kextList[1], patchBuf860, patchBuf861, 36, 1 }, 14, KernelPatcher::KernelAny }, }; -static const uint8_t patchBuf862[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; -static const uint8_t patchBuf863[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const uint8_t patchBuf862[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, }; +static const uint8_t patchBuf863[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, }; static const KextPatch patches71[] { - { { &kextList[3], patchBuf862, patchBuf863, 24, 4 }, 13, KernelPatcher::KernelAny }, + { { &kextList[3], patchBuf862, patchBuf863, 36, 1 }, 13, KernelPatcher::KernelAny }, +}; +static const uint8_t patchBuf864[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const uint8_t patchBuf865[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const KextPatch patches72[] { + { { &kextList[3], patchBuf864, patchBuf865, 24, 4 }, 13, KernelPatcher::KernelAny }, +}; +static const uint8_t patchBuf866[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const uint8_t patchBuf867[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, }; +static const KextPatch patches73[] { + { { &kextList[3], patchBuf866, patchBuf867, 24, 4 }, 13, KernelPatcher::KernelAny }, }; ControllerModInfo controllerMod[] { - { "Atom Z36xxx/Z37xxx Audio Controller", 0x8086, 0xF04, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches64, 1 }, - { "Z97 HDEF controller", 0x8086, 0x8CA0, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches65, 1 }, - { "HD4600 controller", 0x8086, 0xC0C, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches66, 5 }, - { "X99 HDEF controller", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches67, 1 }, - { "Intel HD4600 HDMI (ig-platform-id 0x0d220003)", 0x8086, 0x412, nullptr, 0, 220332035, IOUtil::ComputerModel::ComputerDesktop, patches68, 1 }, - { "Intel HD4000 HDMI (ig-platform-id 0x01660003)", 0x8086, 0x166, nullptr, 0, 23461891, IOUtil::ComputerModel::ComputerLaptop, patches69, 1 }, - { "Intel HD4000 HDMI (ig-platform-id 0x01660009)", 0x8086, 0x166, nullptr, 0, 23461897, IOUtil::ComputerModel::ComputerLaptop, patches70, 1 }, - { "Intel HD4000 HDMI (ig-platform-id 0x0166000A) Desktop only", 0x8086, 0x166, nullptr, 0, 23461898, IOUtil::ComputerModel::ComputerDesktop, patches71, 1 }, + { "X99 HDEF controller r2", 0x8086, 0x8D21, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches64, 1 }, + { "X99 HDEF controller r1", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches65, 1 }, + { "Atom Z36xxx/Z37xxx Audio Controller", 0x8086, 0xF04, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches66, 1 }, + { "Z97 HDEF controller", 0x8086, 0x24, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches67, 1 }, + { "HD4600 controller", 0x8086, 0xC0C, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches68, 5 }, + { "X99 HDEF controller", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches69, 1 }, + { "Intel HD4600 HDMI (ig-platform-id 0x0d220003)", 0x8086, 0x412, nullptr, 0, 220332035, IOUtil::ComputerModel::ComputerDesktop, patches70, 1 }, + { "Intel HD4000 HDMI (ig-platform-id 0x01660003)", 0x8086, 0x166, nullptr, 0, 23461891, IOUtil::ComputerModel::ComputerLaptop, patches71, 1 }, + { "Intel HD4000 HDMI (ig-platform-id 0x01660009)", 0x8086, 0x166, nullptr, 0, 23461897, IOUtil::ComputerModel::ComputerLaptop, patches72, 1 }, + { "Intel HD4000 HDMI (ig-platform-id 0x0166000A) Desktop only", 0x8086, 0x166, nullptr, 0, 23461898, IOUtil::ComputerModel::ComputerDesktop, patches73, 1 }, }; -const size_t controllerModSize {8}; +const size_t controllerModSize {10}; diff --git a/Changelog.md b/Changelog.md index 474625e7f7..51bb9cf299 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ AppleALC Changelog ================== +#### v1.0.17 +- Added C610/X99 Audio Controller r1 support by masking to 8c20 +- Added C610/X99 Audio Controller r2 support by masking to 8c20 +- Disabled Z97 controller patching on 10.10 and newer because it is supported by default + #### v1.0.16 - Fixed a rare lock acquisition issue on 10.12 - Fixed a rare kernel panic on initialisation failure diff --git a/Resources/Controllers.plist b/Resources/Controllers.plist index d6dcdf72b4..c788249ac0 100755 --- a/Resources/Controllers.plist +++ b/Resources/Controllers.plist @@ -2,6 +2,52 @@ + + Device + 36129 + Name + X99 HDEF controller r2 + Patches + + + Count + 4 + Find + IIw= + MinKernel + 13 + Name + AppleHDAController + Replace + IY0= + + + Vendor + Intel + + + Device + 36128 + Name + X99 HDEF controller r1 + Patches + + + Count + 4 + Find + IIw= + MinKernel + 13 + Name + AppleHDAController + Replace + II0= + + + Vendor + Intel + Device 3844 @@ -27,7 +73,7 @@ Device - 36000 + 36 Name Z97 HDEF controller Patches @@ -39,6 +85,8 @@ IIw= MinKernel 13 + MaxKernel + 13 Name AppleHDAController Replace