From 1476a8662b9e9de215376e2fecd07a6c0352f8fb Mon Sep 17 00:00:00 2001 From: jief666 Date: Thu, 17 Sep 2020 02:01:36 +0300 Subject: [PATCH] Remove OcBooter, just call it Quirks. --- rEFIt_UEFI/Platform/Settings.cpp | 116 +++++++++++++++---------------- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index c34a949b0..1eeffa14e 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -2900,66 +2900,64 @@ GetEarlyUserSettings ( } } - const TagDict* DictPointer = CfgDict->dictPropertyForKey("OcBooter"); - if (DictPointer != NULL) { - const TagDict* OcQuirksDict = DictPointer->dictPropertyForKey("Quirks"); - if (OcQuirksDict != NULL) { - const TagStruct* Prop; - Prop = OcQuirksDict->propertyForKey( "AvoidRuntimeDefrag"); - gSettings.ocBooterQuirks.AvoidRuntimeDefrag = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.AvoidRuntimeDefrag? QUIRK_DEFRAG:0; - Prop = OcQuirksDict->propertyForKey( "DevirtualiseMmio"); - gSettings.ocBooterQuirks.DevirtualiseMmio = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.DevirtualiseMmio? QUIRK_MMIO:0; - Prop = OcQuirksDict->propertyForKey( "DisableSingleUser"); - gSettings.ocBooterQuirks.DisableSingleUser = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.DisableSingleUser? QUIRK_SU:0; - Prop = OcQuirksDict->propertyForKey( "DisableVariableWrite"); - gSettings.ocBooterQuirks.DisableVariableWrite = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.DisableVariableWrite? QUIRK_VAR:0; - Prop = OcQuirksDict->propertyForKey( "DiscardHibernateMap"); - gSettings.ocBooterQuirks.DiscardHibernateMap = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.DiscardHibernateMap? QUIRK_HIBER:0; - Prop = OcQuirksDict->propertyForKey( "EnableSafeModeSlide"); - gSettings.ocBooterQuirks.EnableSafeModeSlide = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.EnableSafeModeSlide? QUIRK_SAFE:0; - Prop = OcQuirksDict->propertyForKey( "EnableWriteUnprotector"); - gSettings.ocBooterQuirks.EnableWriteUnprotector = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.EnableWriteUnprotector? QUIRK_UNPROT:0; - Prop = OcQuirksDict->propertyForKey( "ForceExitBootServices"); - gSettings.ocBooterQuirks.ForceExitBootServices = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.ForceExitBootServices? QUIRK_EXIT:0; - Prop = OcQuirksDict->propertyForKey( "ProtectMemoryRegions"); - gSettings.ocBooterQuirks.ProtectMemoryRegions = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectMemoryRegions? QUIRK_REGION:0; - Prop = OcQuirksDict->propertyForKey( "ProtectSecureBoot"); - gSettings.ocBooterQuirks.ProtectSecureBoot = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectMemoryRegions? QUIRK_SECURE:0; - Prop = OcQuirksDict->propertyForKey( "ProtectUefiServices"); - gSettings.ocBooterQuirks.ProtectUefiServices = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectUefiServices? QUIRK_UEFI:0; - Prop = OcQuirksDict->propertyForKey( "ProvideConsoleGopEnable"); - gProvideConsoleGopEnable = IsPropertyNotNullAndTrue(Prop); - Prop = OcQuirksDict->propertyForKey( "ProvideCustomSlide"); - gSettings.ocBooterQuirks.ProvideCustomSlide = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProvideCustomSlide? QUIRK_CUSTOM:0; - Prop = OcQuirksDict->propertyForKey( "ProvideMaxSlide"); - gSettings.ocBooterQuirks.ProvideMaxSlide = GetPropertyAsInteger(Prop, 0); - Prop = OcQuirksDict->propertyForKey( "RebuildAppleMemoryMap"); - gSettings.ocBooterQuirks.RebuildAppleMemoryMap = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.RebuildAppleMemoryMap? QUIRK_MAP:0; - Prop = OcQuirksDict->propertyForKey( "SetupVirtualMap"); - gSettings.ocBooterQuirks.SetupVirtualMap = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.SetupVirtualMap? QUIRK_VIRT:0; - Prop = OcQuirksDict->propertyForKey( "SignalAppleOS"); - gSettings.ocBooterQuirks.SignalAppleOS = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.SignalAppleOS? QUIRK_OS:0; - Prop = OcQuirksDict->propertyForKey( "SyncRuntimePermissions"); - gSettings.ocBooterQuirks.SyncRuntimePermissions = IsPropertyNotNullAndTrue(Prop); - gSettings.QuirksMask |= gSettings.ocBooterQuirks.SyncRuntimePermissions? QUIRK_PERM:0; - } + const TagDict* OcQuirksDict = CfgDict->dictPropertyForKey("Quirks"); + if (OcQuirksDict != NULL) { + const TagStruct* Prop; + Prop = OcQuirksDict->propertyForKey("AvoidRuntimeDefrag"); + gSettings.ocBooterQuirks.AvoidRuntimeDefrag = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.AvoidRuntimeDefrag? QUIRK_DEFRAG:0; + Prop = OcQuirksDict->propertyForKey( "DevirtualiseMmio"); + gSettings.ocBooterQuirks.DevirtualiseMmio = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.DevirtualiseMmio? QUIRK_MMIO:0; + Prop = OcQuirksDict->propertyForKey( "DisableSingleUser"); + gSettings.ocBooterQuirks.DisableSingleUser = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.DisableSingleUser? QUIRK_SU:0; + Prop = OcQuirksDict->propertyForKey( "DisableVariableWrite"); + gSettings.ocBooterQuirks.DisableVariableWrite = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.DisableVariableWrite? QUIRK_VAR:0; + Prop = OcQuirksDict->propertyForKey( "DiscardHibernateMap"); + gSettings.ocBooterQuirks.DiscardHibernateMap = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.DiscardHibernateMap? QUIRK_HIBER:0; + Prop = OcQuirksDict->propertyForKey( "EnableSafeModeSlide"); + gSettings.ocBooterQuirks.EnableSafeModeSlide = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.EnableSafeModeSlide? QUIRK_SAFE:0; + Prop = OcQuirksDict->propertyForKey( "EnableWriteUnprotector"); + gSettings.ocBooterQuirks.EnableWriteUnprotector = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.EnableWriteUnprotector? QUIRK_UNPROT:0; + Prop = OcQuirksDict->propertyForKey( "ForceExitBootServices"); + gSettings.ocBooterQuirks.ForceExitBootServices = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.ForceExitBootServices? QUIRK_EXIT:0; + Prop = OcQuirksDict->propertyForKey( "ProtectMemoryRegions"); + gSettings.ocBooterQuirks.ProtectMemoryRegions = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectMemoryRegions? QUIRK_REGION:0; + Prop = OcQuirksDict->propertyForKey( "ProtectSecureBoot"); + gSettings.ocBooterQuirks.ProtectSecureBoot = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectMemoryRegions? QUIRK_SECURE:0; + Prop = OcQuirksDict->propertyForKey( "ProtectUefiServices"); + gSettings.ocBooterQuirks.ProtectUefiServices = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProtectUefiServices? QUIRK_UEFI:0; + Prop = OcQuirksDict->propertyForKey( "ProvideConsoleGopEnable"); + gProvideConsoleGopEnable = IsPropertyNotNullAndTrue(Prop); + Prop = OcQuirksDict->propertyForKey( "ProvideCustomSlide"); + gSettings.ocBooterQuirks.ProvideCustomSlide = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.ProvideCustomSlide? QUIRK_CUSTOM:0; + Prop = OcQuirksDict->propertyForKey( "ProvideMaxSlide"); + gSettings.ocBooterQuirks.ProvideMaxSlide = GetPropertyAsInteger(Prop, 0); + Prop = OcQuirksDict->propertyForKey( "RebuildAppleMemoryMap"); + gSettings.ocBooterQuirks.RebuildAppleMemoryMap = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.RebuildAppleMemoryMap? QUIRK_MAP:0; + Prop = OcQuirksDict->propertyForKey( "SetupVirtualMap"); + gSettings.ocBooterQuirks.SetupVirtualMap = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.SetupVirtualMap? QUIRK_VIRT:0; + Prop = OcQuirksDict->propertyForKey( "SignalAppleOS"); + gSettings.ocBooterQuirks.SignalAppleOS = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.SignalAppleOS? QUIRK_OS:0; + Prop = OcQuirksDict->propertyForKey( "SyncRuntimePermissions"); + gSettings.ocBooterQuirks.SyncRuntimePermissions = IsPropertyNotNullAndTrue(Prop); + gSettings.QuirksMask |= gSettings.ocBooterQuirks.SyncRuntimePermissions? QUIRK_PERM:0; gSettings.mmioWhiteListArray.setEmpty(); - const TagArray* Dict2 = DictPointer->arrayPropertyForKey("MmioWhitelist"); // array of dict + + const TagArray* Dict2 = OcQuirksDict->arrayPropertyForKey("MmioWhitelist"); // array of dict if (Dict2 != NULL) { INTN Count = Dict2->arrayContent().size(); //OC_SCHEMA_INTEGER_IN ("Address", OC_MMIO_WL_STRUCT, Address),