提交 52de2a05 编写于 作者: V vit9696

OpenCoreMisc: Implement hibernate detection

上级 d3888666
......@@ -1469,6 +1469,20 @@ behaviour that does not go to any other sections
\textbf{Description}: Set console control behaviour upon OpenCore user
interface load. Refer to \texttt{ConsoleBehaviourOs} description for details.
\item
\texttt{HibernateMode}\\
\textbf{Type}: \texttt{plist\ string}\\
\textbf{Default value}: \texttt{None}\\
\textbf{Description}: Hibernation detection mode. The following modes are supported:
\begin{itemize}
\tightlist
\item \texttt{None} --- Avoid hibernation for your own good.
\item \texttt{Auto} --- Use RTC and NVRAM detection.
\item \texttt{RTC} --- Use RTC detection.
\item \texttt{NVRAM} --- Use NVRAM detection.
\end{itemize}
\item
\texttt{HideSelf}\\
\textbf{Type}: \texttt{plist\ boolean}\\
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Fri May 24 02:34:39 2019
%DIF ADD ../Configuration.tex Tue Jun 11 09:12:02 2019
%DIF ADD ../Configuration.tex Wed Jun 12 00:44:07 2019
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -1621,7 +1621,22 @@ behaviour that does not go to any other sections
interface load. Refer to \texttt{ConsoleBehaviourOs} description for details.
\item
\texttt{HideSelf}\\
\DIFaddbegin \texttt{\DIFadd{HibernateMode}}\\
\textbf{\DIFadd{Type}}\DIFadd{: }\texttt{\DIFadd{plist\ string}}\\
\textbf{\DIFadd{Default value}}\DIFadd{: }\texttt{\DIFadd{None}}\\
\textbf{\DIFadd{Description}}\DIFadd{: Hibernation detection mode. The following modes are supported:
}
\begin{itemize}
\tightlist
\item \texttt{\DIFadd{None}} \DIFadd{--- Avoid hibernation for your own good.
}\item \texttt{\DIFadd{Auto}} \DIFadd{--- Use RTC and NVRAM detection.
}\item \texttt{\DIFadd{RTC}} \DIFadd{--- Use RTC detection.
}\item \texttt{\DIFadd{NVRAM}} \DIFadd{--- Use NVRAM detection.
}\end{itemize}
\item
\DIFaddend \texttt{HideSelf}\\
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Default value}: \texttt{false}\\
\textbf{Description}: Hides own boot entry from boot picker. This
......
......@@ -388,6 +388,8 @@
<string></string>
<key>ConsoleMode</key>
<string></string>
<key>HibernateMode</key>
<string>None</string>
<key>HideSelf</key>
<true/>
<key>Resolution</key>
......
......@@ -388,6 +388,8 @@
<string></string>
<key>ConsoleMode</key>
<string></string>
<key>HibernateMode</key>
<string>None</string>
<key>HideSelf</key>
<true/>
<key>Resolution</key>
......
......@@ -75,6 +75,7 @@
OcMachoLib|OcSupportPkg/Library/OcMachoLib/OcMachoLib.inf
OcMiscLib|OcSupportPkg/Library/OcMiscLib/OcMiscLib.inf
OcPngLib|OcSupportPkg/Library/OcPngLib/OcPngLib.inf
OcRtcLib|OcSupportPkg/Library/OcRtcLib/OcRtcLib.inf
OcSerializeLib|OcSupportPkg/Library/OcSerializeLib/OcSerializeLib.inf
OcSmbiosLib|OcSupportPkg/Library/OcSmbiosLib/OcSmbiosLib.inf
OcStorageLib|OcSupportPkg/Library/OcStorageLib/OcStorageLib.inf
......
......@@ -219,10 +219,13 @@ OcMiscLateInit (
)
{
EFI_STATUS Status;
EFI_STATUS HibernateStatus;
UINT32 Width;
UINT32 Height;
UINT32 Bpp;
BOOLEAN SetMax;
CONST CHAR8 *HibernateMode;
UINT32 HibernateMask;
if ((Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_BOOT_PATH) != 0) {
OcStoreLoadPath (LoadPath);
......@@ -306,6 +309,27 @@ OcMiscLateInit (
));
}
HibernateMode = OC_BLOB_GET (&Config->Misc.Boot.HibernateMode);
if (AsciiStrCmp (HibernateMode, "None") == 0) {
HibernateMask = HIBERNATE_MODE_NONE;
} else if (AsciiStrCmp (HibernateMode, "Auto") == 0) {
HibernateMask = HIBERNATE_MODE_RTC | HIBERNATE_MODE_NVRAM;
} else if (AsciiStrCmp (HibernateMode, "RTC") == 0) {
HibernateMask = HIBERNATE_MODE_RTC;
} else if (AsciiStrCmp (HibernateMode, "NVRAM") == 0) {
HibernateMask = HIBERNATE_MODE_NVRAM;
} else {
DEBUG ((DEBUG_INFO, "OC: Invalid HibernateMode: %a\n", HibernateMode));
HibernateMask = HIBERNATE_MODE_NONE;
}
DEBUG ((DEBUG_INFO, "OC: Translated HibernateMode %a to %u\n", HibernateMode, HibernateMask));
HibernateStatus = ActivateHibernateWake (HibernateMask);
DEBUG ((DEBUG_INFO, "OC: Hibernation detection status is %r\n", HibernateStatus));
(VOID) HibernateStatus;
return Status;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册