diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf
index cf1cc7105a03c4658d123cab259f0ec9b9bbae71..c5cf5b0fa5580d50c97b4260c18a1d07a395ce20 100644
Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ
diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex
index 4991def60609a56adf78f20451facf1908327175..350027ea0390e54a8a233559090a079cbb207c0c 100644
--- a/Docs/Configuration.tex
+++ b/Docs/Configuration.tex
@@ -1137,6 +1137,7 @@ blocking.
\subsection{Quirks Properties}\label{kernelpropsquirks}
\begin{enumerate}
+
\item
\texttt{AppleCpuPmCfgLock}\\
\textbf{Type}: \texttt{plist\ boolean}\\
@@ -2523,6 +2524,19 @@ build -a X64 -b RELEASE -t XCODE5 -p IntelFrameworkModulePkg/IntelFrameworkModul
\begin{enumerate}
+\item
+ \texttt{ExitBootServicesDelay}\\
+ \textbf{Type}: \texttt{plist\ integer}\\
+ \textbf{Default value}: \texttt{0}\\
+ \textbf{Description}: Adds delay in microseconds after \texttt{EXIT\_BOOT\_SERVICES}
+ event.
+
+ This is a very ugly quirk to circumvent "Still waiting for root device" message
+ on select APTIO IV firmwares, namely ASUS Z87-Pro, when using FileVault 2 in particular.
+ It seems that for some reason they execute code in parallel to \texttt{EXIT\_BOOT\_SERVICES},
+ which results in SATA controller being inaccessible from macOS. A better approach should be
+ found in some future. Expect 3-5 seconds to be enough in case the quirk is needed.
+
\item
\texttt{IgnoreInvalidFlexRatio}\\
\textbf{Type}: \texttt{plist\ boolean}\\
diff --git a/Docs/Sample.plist b/Docs/Sample.plist
index 445cfaaaecf73367966c37a1ea3deaa28be4efbe..c679cdf45842787c53abded349d3ea1b6eb8a936 100644
--- a/Docs/Sample.plist
+++ b/Docs/Sample.plist
@@ -444,38 +444,7 @@
PlatformInfo
Automatic
-
- DataHub
-
- ARTFrequency
- 0
- BoardProduct
- Mac-F221BEC8
- BoardRevision
- AQ==
- DevicePathsSupported
- AQ==
- FSBFrequency
- 0
- InitialTSC
- 0
- PlatformName
- platform
- SmcBranch
- AAAAAAAAAAA=
- SmcPlatform
- AAAAAAAAAAA=
- SmcRevision
- ATkPAAAF
- StartupPowerEvents
- 0
- SystemProductName
- MacPro5,1
- SystemSerialNumber
- W0000000001
- SystemUUID
- 00000000-0000-0000-0000-000000000000
-
+
Generic
SystemUUID
@@ -489,76 +458,6 @@
SystemSerialNumber
W0000000001
- PlatformNVRAM
-
- BID
- Mac-F221BEC8
- MLB
- M000000000001
- ROM
- ESIzAAAA
- FirmwareFeatures
- N+EP6AAAAAA=
- FirmwareFeaturesMask
- P/8f/wAAAAA=
-
- SMBIOS
-
- BIOSVendor
-
- BIOSVersion
- 142.0.0.0.0
- BIOSReleaseDate
- 02/14/2019
- SystemManufacturer
-
- SystemProductName
- MacPro5,1
- SystemVersion
- 1.1
- SystemSerialNumber
- W0000000001
- SystemUUID
- 00000000-0000-0000-0000-000000000000
- SystemSKUNumber
- Mac-F221BEC8
- SystemFamily
- MacPro
- BoardManufacturer
-
- BoardProduct
- Mac-F221BEC8
- BoardVersion
- MacPro5,1
- BoardSerialNumber
- M000000000001
- BoardAssetTag
-
- BoardType
- 11
- BoardLocationInChassis
- Part Component
- ChassisManufacturer
-
- ChassisType
- 7
- ChassisVersion
- Mac-F221BEC8
- ChassisSerialNumber
- W0000000001
- ChassisAssetTag
-
- PlatformFeature
- 0
- FirmwareFeatures
- N+EP6AAAAAA=
- FirmwareFeaturesMask
- P/8f/wAAAAA=
- ProcessorType
- 0
- MemoryFormFactor
- 9
-
UpdateDataHub
UpdateNVRAM
@@ -590,6 +489,8 @@
Quirks
+ ExitBootServicesDelay
+ 0
IgnoreInvalidFlexRatio
IgnoreTextInGraphics
diff --git a/Docs/SampleSimple.plist b/Docs/SampleFull.plist
similarity index 79%
rename from Docs/SampleSimple.plist
rename to Docs/SampleFull.plist
index 02950074a6f81313531f81a454ae7f4728e920cd..195a6f6f04350d67c5880b8f65b3122cb6a4cff8 100644
--- a/Docs/SampleSimple.plist
+++ b/Docs/SampleFull.plist
@@ -444,7 +444,38 @@
PlatformInfo
Automatic
-
+
+ DataHub
+
+ ARTFrequency
+ 0
+ BoardProduct
+ Mac-F221BEC8
+ BoardRevision
+ AQ==
+ DevicePathsSupported
+ AQ==
+ FSBFrequency
+ 0
+ InitialTSC
+ 0
+ PlatformName
+ platform
+ SmcBranch
+ AAAAAAAAAAA=
+ SmcPlatform
+ AAAAAAAAAAA=
+ SmcRevision
+ ATkPAAAF
+ StartupPowerEvents
+ 0
+ SystemProductName
+ MacPro5,1
+ SystemSerialNumber
+ W0000000001
+ SystemUUID
+ 00000000-0000-0000-0000-000000000000
+
Generic
SystemUUID
@@ -458,6 +489,76 @@
SystemSerialNumber
W0000000001
+ PlatformNVRAM
+
+ BID
+ Mac-F221BEC8
+ MLB
+ M000000000001
+ ROM
+ ESIzAAAA
+ FirmwareFeatures
+ N+EP6AAAAAA=
+ FirmwareFeaturesMask
+ P/8f/wAAAAA=
+
+ SMBIOS
+
+ BIOSVendor
+
+ BIOSVersion
+ 142.0.0.0.0
+ BIOSReleaseDate
+ 02/14/2019
+ SystemManufacturer
+
+ SystemProductName
+ MacPro5,1
+ SystemVersion
+ 1.1
+ SystemSerialNumber
+ W0000000001
+ SystemUUID
+ 00000000-0000-0000-0000-000000000000
+ SystemSKUNumber
+ Mac-F221BEC8
+ SystemFamily
+ MacPro
+ BoardManufacturer
+
+ BoardProduct
+ Mac-F221BEC8
+ BoardVersion
+ MacPro5,1
+ BoardSerialNumber
+ M000000000001
+ BoardAssetTag
+
+ BoardType
+ 11
+ BoardLocationInChassis
+ Part Component
+ ChassisManufacturer
+
+ ChassisType
+ 7
+ ChassisVersion
+ Mac-F221BEC8
+ ChassisSerialNumber
+ W0000000001
+ ChassisAssetTag
+
+ PlatformFeature
+ 0
+ FirmwareFeatures
+ N+EP6AAAAAA=
+ FirmwareFeaturesMask
+ P/8f/wAAAAA=
+ ProcessorType
+ 0
+ MemoryFormFactor
+ 9
+
UpdateDataHub
UpdateNVRAM
@@ -489,6 +590,8 @@
Quirks
+ ExitBootServicesDelay
+ 0
IgnoreInvalidFlexRatio
IgnoreTextInGraphics
diff --git a/Platform/OpenCore/OpenCoreUefi.c b/Platform/OpenCore/OpenCoreUefi.c
index b7ff934599a20567345f4359edee9fbbdaad4a99..8dd9fe28d46986f0f8c9ef1f1ba1098397ada5ec 100644
--- a/Platform/OpenCore/OpenCoreUefi.c
+++ b/Platform/OpenCore/OpenCoreUefi.c
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include
#include
-STATIC EFI_EVENT mReleaseUsbOwnershipEvent;
+STATIC EFI_EVENT mOcExitBootServicesEvent;
STATIC
VOID
@@ -209,16 +209,33 @@ OcProvideConsoleGop (
STATIC
VOID
EFIAPI
-OcReleaseUsbOwnership (
+OcExitBootServicesHandler (
IN EFI_EVENT Event,
IN VOID *Context
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ OC_GLOBAL_CONFIG *Config;
- Status = ReleaseUsbOwnership ();
+ Config = (OC_GLOBAL_CONFIG *) Context;
- DEBUG ((DEBUG_INFO, "OC: ReleaseUsbOwnership status - %r\n", Status));
+ if (Config->Uefi.Quirks.ReleaseUsbOwnership) {
+ Status = ReleaseUsbOwnership ();
+ DEBUG ((DEBUG_INFO, "OC: ReleaseUsbOwnership status - %r\n", Status));
+ }
+
+ //
+ // FIXME: This is a very ugly hack for (at least) ASUS Z87-Pro.
+ // This board results in still waiting for root devices due to firmware
+ // performing some timer(?) actions in parallel to ExitBootServices.
+ // Some day we should figure out what exactly happens there.
+ // It is not the first time I face this, check AptioInputFix timer code:
+ // https://github.com/acidanthera/AptioFixPkg/blob/e54c185/Platform/AptioInputFix/Timer/AIT.c#L72-L73
+ // Roughly 5 seconds is good enough.
+ //
+ if (Config->Uefi.Quirks.ExitBootServicesDelay > 0) {
+ gBS->Stall (Config->Uefi.Quirks.ExitBootServicesDelay);
+ }
}
STATIC
@@ -269,13 +286,14 @@ OcLoadUefiSupport (
&Config->Uefi.Quirks.RequestBootVarRouting
);
- if (Config->Uefi.Quirks.ReleaseUsbOwnership) {
+ if (Config->Uefi.Quirks.ReleaseUsbOwnership
+ || Config->Uefi.Quirks.ExitBootServicesDelay > 0) {
gBS->CreateEvent (
EVT_SIGNAL_EXIT_BOOT_SERVICES,
TPL_NOTIFY,
- OcReleaseUsbOwnership,
- NULL,
- &mReleaseUsbOwnershipEvent
+ OcExitBootServicesHandler,
+ Config,
+ &mOcExitBootServicesEvent
);
}