提交 0fb09c22 编写于 作者: V vit9696

OcConfigurationLib: Replace `Block` with `Delete` to reduce confusion

上级 ac4752a8
......@@ -28,7 +28,8 @@ OpenCore Changelog
- Fixed assertions on log exhaustion causing boot failures
- Fixed builtin text renderer failing to provide ConsoleControl
- Fixed compatibility with blit-only GOP (e.g. OVMF Bochs)
- Fixed ignoring `#` in DeviceProperty and NVRAM `Block`
- Fixed ignoring `#` in DeviceProperty and NVRAM `Delete`
- Renamed `Block` to `Delete` in `ACPI`,`DeviceProperties`, and `NVRAM`
#### v0.5.8
- Fixed invalid CPU object reference in SSDT-PLUG
......
......@@ -326,9 +326,11 @@ idiomatically to group similar actions in subsections:
\begin{itemize}
\tightlist
\item
\texttt{Add} provides support for data addition.
\texttt{Add} provides support for data addition. Existing data will
not be overridden, and needs to be handled separately with
\texttt{Delete} if necessary.
\item
\texttt{Block} provides support for data removal or ignorance.
\texttt{Delete} provides support for data removal.
\item
\texttt{Patch} provides support for data modification.
\item
......@@ -770,17 +772,17 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\textbf{Description}: Load selected tables from \texttt{OC/ACPI}
directory.
Designed to be filled with \texttt{plist\ dict} values, describing each block entry.
Designed to be filled with \texttt{plist\ dict} values, describing each add entry.
See \hyperref[acpipropsadd]{Add Properties} section below.
\item
\texttt{Block}\\
\texttt{Delete}\\
\textbf{Type}: \texttt{plist\ array}\\
\textbf{Failsafe}: Empty\\
\textbf{Description}: Remove selected tables from ACPI stack.
Designed to be filled with \texttt{plist\ dict} values, describing each block entry.
See \hyperref[acpipropsblock]{Block Properties} section below.
Designed to be filled with \texttt{plist\ dict} values, describing each delete entry.
See \hyperref[acpipropsdelete]{Delete Properties} section below.
\item
\texttt{Patch}\\
......@@ -835,7 +837,7 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\end{enumerate}
\subsection{Block Properties}\label{acpipropsblock}
\subsection{Delete Properties}\label{acpipropsdelete}
\begin{enumerate}
\item
......@@ -843,7 +845,7 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: If set to \texttt{true}, all ACPI tables matching the
condition will be dropped. Otherwise only first matched table.
condition will be deleted. Otherwise only first matched table.
\item
\texttt{Comment}\\
......@@ -1118,7 +1120,7 @@ list of checks to do first. Prior to starting please ensure that you have:
with the same issue are known, consider this option to be first to check if you
have erratic boot failures.
\item \texttt{DisableIoMapper} quirk enabled, or \texttt{VT-d} disabled in
firmware settings if present, or ACPI DMAR table dropped.
firmware settings if present, or ACPI DMAR table deleted.
\item \textbf{No} `slide` boot argument present in NVRAM or anywhere else.
It is not necessary unless you cannot boot at all or see
\texttt{No slide values are usable! Use custom slide!} message in the log.
......@@ -1508,13 +1510,13 @@ ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties |
of deivce paths to a map (\texttt{plist\ dict}) of variable names and their values
in \texttt{plist\ metadata} format. Device paths must be provided in canonic string
format (e.g. \texttt{PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)}). Properties will only
be set if not present and not blocked.
be set if not present and not deleted.
\emph{Note}: Currently properties may only be (formerly) added by the original driver,
so unless a separate driver was installed, there is no reason to block the variables.
so unless a separate driver was installed, there is no reason to delete the variables.
\item
\texttt{Block}\\
\texttt{Delete}\\
\textbf{Type}: \texttt{plist\ dict}\\
\textbf{Description}: Removes device properties from a map (\texttt{plist\ dict})
of deivce paths to an array (\texttt{plist\ array}) of variable names in
......@@ -1993,7 +1995,7 @@ blocking.
\textbf{Description}: Disables \texttt{IOMapper} support in XNU (VT-d),
which may conflict with the firmware implementation.
\emph{Note}: This option is a preferred alternative to dropping \texttt{DMAR}
\emph{Note}: This option is a preferred alternative to deleting \texttt{DMAR}
ACPI table and disabling VT-d in firmware preferences, which does not break
VT-d support in other systems in case they need it.
......@@ -2189,7 +2191,7 @@ option is enabled or the firmware does not control UEFI boot options (\texttt{Du
custom BDS). Without \texttt{BootProtect} it also is possible that other operating systems
overwrite OpenCore, make sure to enable it if you plan to use them.
\emph{Note 2}: UEFI variable boot options' boot arguments will be dropped if present as they
\emph{Note 2}: UEFI variable boot options' boot arguments will be removed if present as they
may contain arguments compromising the operating system, which is undesired once secure boot
is enabled.
......@@ -3030,8 +3032,8 @@ use.
Created variables get \texttt{EFI\_VARIABLE\_BOOTSERVICE\_ACCESS} and
\texttt{EFI\_VARIABLE\_RUNTIME\_ACCESS} attributes set.
Variables will only be set if not present or blocked. I.e. to overwrite
an existing variable value add the variable name to the \texttt{Block} section.
Variables will only be set if not present or deleted. I.e. to overwrite
an existing variable value add the variable name to the \texttt{Delete} section.
This approach enables to provide default values till the operating system
takes the lead.
......@@ -3039,7 +3041,7 @@ use.
behaviour is undefined.
\item
\texttt{Block}\\
\texttt{Delete}\\
\textbf{Type}: \texttt{plist\ dict}\\
\textbf{Description}: Removes NVRAM variables from a map (\texttt{plist\ dict})
of GUIDs to an array (\texttt{plist\ array}) of variable names in
......@@ -3060,7 +3062,7 @@ use.
\texttt{config.plist}.
\end{itemize}
Variable loading happens prior to \texttt{Block} (and \texttt{Add}) phases. Unless
Variable loading happens prior to \texttt{Delete} (and \texttt{Add}) phases. Unless
\texttt{LegacyOverwrite} is enabled, it will not overwrite any existing variable.
Variables allowed to be set must be specified in \texttt{LegacySchema}.
Third-party scripts may be used to create \texttt{nvram.plist}
......@@ -5028,14 +5030,14 @@ functioning. Feature highlights:
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Reinstalls Data Hub protocol with a builtin version.
This will drop all previous properties if the protocol was already installed.
This will delete all previous properties if the protocol was already installed.
\item
\texttt{DeviceProperties}\\
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Reinstalls Device Property protocol with a builtin
version. This will drop all previous properties if it was already installed.
version. This will delete all previous properties if it was already installed.
This may be used to ensure full compatibility on VMs or legacy Macs.
\item
......
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Fri May 15 23:18:56 2020
%DIF ADD ../Configuration.tex Sat May 16 00:25:16 2020
%DIF DEL PreviousConfiguration.tex Mon May 11 17:11:58 2020
%DIF ADD ../Configuration.tex Sun May 17 01:56:11 2020
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
......@@ -392,9 +392,11 @@ idiomatically to group similar actions in subsections:
\begin{itemize}
\tightlist
\item
\texttt{Add} provides support for data addition.
\item
\texttt{Block} provides support for data removal or ignorance.
\texttt{Add} provides support for data addition. \DIFaddbegin \DIFadd{Existing data will
not be overridden, and needs to be handled separately with
}\texttt{\DIFadd{Delete}} \DIFadd{if necessary.
}\DIFaddend \item
\texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend } provides support for data removal\DIFdelbegin \DIFdel{or ignorance}\DIFdelend .
\item
\texttt{Patch} provides support for data modification.
\item
......@@ -937,17 +939,18 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\textbf{Description}: Load selected tables from \texttt{OC/ACPI}
directory.
Designed to be filled with \texttt{plist\ dict} values, describing each block entry.
Designed to be filled with \texttt{plist\ dict} values, describing each \DIFdelbegin \DIFdel{block }\DIFdelend \DIFaddbegin \DIFadd{add }\DIFaddend entry.
See \hyperref[acpipropsadd]{Add Properties} section below.
\item
\texttt{Block}\\
\texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend }\\
\textbf{Type}: \texttt{plist\ array}\\
\textbf{Failsafe}: Empty\\
\textbf{Description}: Remove selected tables from ACPI stack.
Designed to be filled with \texttt{plist\ dict} values, describing each block entry.
See \hyperref[acpipropsblock]{Block Properties} section below.
Designed to be filled with \texttt{plist\ dict} values, describing each \DIFdelbegin \DIFdel{block }\DIFdelend \DIFaddbegin \DIFadd{delete }\DIFaddend entry.
See \DIFdelbegin %DIFDELCMD < \hyperref[acpipropsblock]{Block Properties} %%%
\DIFdelend \DIFaddbegin \hyperref[acpipropsdelete]{Delete Properties} \DIFaddend section below.
\item
\texttt{Patch}\\
......@@ -1002,7 +1005,10 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\end{enumerate}
\subsection{Block Properties}\label{acpipropsblock}
\subsection{\DIFdelbegin \DIFdel{Block }\DIFdelend \DIFaddbegin \DIFadd{Delete }\DIFaddend Properties}\DIFdelbegin %DIFDELCMD < \label{acpipropsblock}
%DIFDELCMD < %%%
\DIFdelend \DIFaddbegin \label{acpipropsdelete}
\DIFaddend
\begin{enumerate}
\item
......@@ -1010,7 +1016,7 @@ can be downloaded from \href{https://github.com/acidanthera/MaciASL/releases}{Ac
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: If set to \texttt{true}, all ACPI tables matching the
condition will be dropped. Otherwise only first matched table.
condition will be \DIFdelbegin \DIFdel{dropped}\DIFdelend \DIFaddbegin \DIFadd{deleted}\DIFaddend . Otherwise only first matched table.
\item
\texttt{Comment}\\
......@@ -1285,7 +1291,7 @@ list of checks to do first. Prior to starting please ensure that you have:
with the same issue are known, consider this option to be first to check if you
have erratic boot failures.
\item \texttt{DisableIoMapper} quirk enabled, or \texttt{VT-d} disabled in
firmware settings if present, or ACPI DMAR table dropped.
firmware settings if present, or ACPI DMAR table \DIFdelbegin \DIFdel{dropped}\DIFdelend \DIFaddbegin \DIFadd{deleted}\DIFaddend .
\item \textbf{No} `slide` boot argument present in NVRAM or anywhere else.
It is not necessary unless you cannot boot at all or see
\texttt{No slide values are usable! Use custom slide!} message in the log.
......@@ -1676,13 +1682,13 @@ ioreg -lw0 -p IODeviceTree -n efi -r -x | grep device-properties |
of deivce paths to a map (\texttt{plist\ dict}) of variable names and their values
in \texttt{plist\ metadata} format. Device paths must be provided in canonic string
format (e.g. \texttt{PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)}). Properties will only
be set if not present and not blocked.
be set if not present and not \DIFdelbegin \DIFdel{blocked}\DIFdelend \DIFaddbegin \DIFadd{deleted}\DIFaddend .
\emph{Note}: Currently properties may only be (formerly) added by the original driver,
so unless a separate driver was installed, there is no reason to block the variables.
so unless a separate driver was installed, there is no reason to \DIFdelbegin \DIFdel{block }\DIFdelend \DIFaddbegin \DIFadd{delete }\DIFaddend the variables.
\item
\texttt{Block}\\
\texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend }\\
\textbf{Type}: \texttt{plist\ dict}\\
\textbf{Description}: Removes device properties from a map (\texttt{plist\ dict})
of deivce paths to an array (\texttt{plist\ array}) of variable names in
......@@ -2161,7 +2167,7 @@ blocking.
\textbf{Description}: Disables \texttt{IOMapper} support in XNU (VT-d),
which may conflict with the firmware implementation.
\emph{Note}: This option is a preferred alternative to dropping \texttt{DMAR}
\emph{Note}: This option is a preferred alternative to \DIFdelbegin \DIFdel{dropping }\DIFdelend \DIFaddbegin \DIFadd{deleting }\DIFaddend \texttt{DMAR}
ACPI table and disabling VT-d in firmware preferences, which does not break
VT-d support in other systems in case they need it.
......@@ -2364,7 +2370,7 @@ custom BDS). Without }\texttt{\DIFadd{BootProtect}} \DIFadd{it also is possible
overwrite OpenCore, make sure to enable it if you plan to use them.
}
\emph{\DIFadd{Note 2}}\DIFadd{: UEFI variable boot options' boot arguments will be dropped if present as they
\emph{\DIFadd{Note 2}}\DIFadd{: UEFI variable boot options' boot arguments will be removed if present as they
may contain arguments compromising the operating system, which is undesired once secure boot
is enabled.
}
......@@ -3243,8 +3249,8 @@ use.
Created variables get \texttt{EFI\_VARIABLE\_BOOTSERVICE\_ACCESS} and
\texttt{EFI\_VARIABLE\_RUNTIME\_ACCESS} attributes set.
Variables will only be set if not present or blocked. I.e. to overwrite
an existing variable value add the variable name to the \texttt{Block} section.
Variables will only be set if not present or \DIFdelbegin \DIFdel{blocked}\DIFdelend \DIFaddbegin \DIFadd{deleted}\DIFaddend . I.e. to overwrite
an existing variable value add the variable name to the \texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend } section.
This approach enables to provide default values till the operating system
takes the lead.
......@@ -3252,7 +3258,7 @@ use.
behaviour is undefined.
\item
\texttt{Block}\\
\texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend }\\
\textbf{Type}: \texttt{plist\ dict}\\
\textbf{Description}: Removes NVRAM variables from a map (\texttt{plist\ dict})
of GUIDs to an array (\texttt{plist\ array}) of variable names in
......@@ -3273,7 +3279,7 @@ use.
\texttt{config.plist}.
\end{itemize}
Variable loading happens prior to \texttt{Block} (and \texttt{Add}) phases. Unless
Variable loading happens prior to \texttt{\DIFdelbegin \DIFdel{Block}\DIFdelend \DIFaddbegin \DIFadd{Delete}\DIFaddend } (and \texttt{Add}) phases. Unless
\texttt{LegacyOverwrite} is enabled, it will not overwrite any existing variable.
Variables allowed to be set must be specified in \texttt{LegacySchema}.
Third-party scripts may be used to create \texttt{nvram.plist}
......@@ -5283,14 +5289,14 @@ functioning. Feature highlights:
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Reinstalls Data Hub protocol with a builtin version.
This will drop all previous properties if the protocol was already installed.
This will \DIFdelbegin \DIFdel{drop }\DIFdelend \DIFaddbegin \DIFadd{delete }\DIFaddend all previous properties if the protocol was already installed.
\item
\texttt{DeviceProperties}\\
\textbf{Type}: \texttt{plist\ boolean}\\
\textbf{Failsafe}: \texttt{false}\\
\textbf{Description}: Reinstalls Device Property protocol with a builtin
version. This will drop all previous properties if it was already installed.
version. This will \DIFdelbegin \DIFdel{drop }\DIFdelend \DIFaddbegin \DIFadd{delete }\DIFaddend all previous properties if it was already installed.
This may be used to ensure full compatibility on VMs or legacy Macs.
\item
......
......@@ -121,13 +121,13 @@
<string>SSDT-IMEI.aml</string>
</dict>
</array>
<key>Block</key>
<key>Delete</key>
<array>
<dict>
<key>All</key>
<false/>
<key>Comment</key>
<string>Drop CpuPm</string>
<string>Delete CpuPm</string>
<key>Enabled</key>
<false/>
<key>OemTableId</key>
......@@ -141,7 +141,7 @@
<key>All</key>
<false/>
<key>Comment</key>
<string>Drop Cpu0Ist</string>
<string>Delete Cpu0Ist</string>
<key>Enabled</key>
<false/>
<key>OemTableId</key>
......@@ -288,7 +288,7 @@
<data>AQAAAA==</data>
</dict>
</dict>
<key>Block</key>
<key>Delete</key>
<dict/>
</dict>
<key>Kernel</key>
......@@ -705,7 +705,7 @@
<data>cnUtUlU6MjUy</data>
</dict>
</dict>
<key>Block</key>
<key>Delete</key>
<dict>
<key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
<array>
......
......@@ -121,13 +121,13 @@
<string>SSDT-IMEI.aml</string>
</dict>
</array>
<key>Block</key>
<key>Delete</key>
<array>
<dict>
<key>All</key>
<false/>
<key>Comment</key>
<string>Drop CpuPm</string>
<string>Delete CpuPm</string>
<key>Enabled</key>
<false/>
<key>OemTableId</key>
......@@ -141,7 +141,7 @@
<key>All</key>
<false/>
<key>Comment</key>
<string>Drop Cpu0Ist</string>
<string>Delete Cpu0Ist</string>
<key>Enabled</key>
<false/>
<key>OemTableId</key>
......@@ -705,7 +705,7 @@
<data>cnUtUlU6MjUy</data>
</dict>
</dict>
<key>Block</key>
<key>Delete</key>
<dict>
<key>4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14</key>
<array>
......
......@@ -185,16 +185,16 @@ AcpiApplyContext (
);
/**
Drop one ACPI table.
Delete one ACPI table.
@param Context ACPI library context.
@param Signature Table signature or 0.
@param Length Table length or 0.
@param OemTableId Table Id or 0.
@param All Drop all tables or first matched.
@param All Delete all tables or first matched.
**/
EFI_STATUS
AcpiDropTable (
AcpiDeleteTable (
IN OUT OC_ACPI_CONTEXT *Context,
IN UINT32 Signature,
IN UINT32 Length,
......
......@@ -37,20 +37,20 @@
OC_DECLARE (OC_ACPI_ADD_ARRAY)
///
/// ACPI table blocks.
/// ACPI table deletion.
///
#define OC_ACPI_BLOCK_ENTRY_FIELDS(_, __) \
#define OC_ACPI_DELETE_ENTRY_FIELDS(_, __) \
_(BOOLEAN , All , , FALSE , () ) \
_(BOOLEAN , Enabled , , FALSE , () ) \
_(OC_STRING , Comment , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) ) \
_(UINT8 , OemTableId , [8] , {0} , () ) \
_(UINT32 , TableLength , , 0 , () ) \
_(UINT8 , TableSignature , [4] , {0} , () )
OC_DECLARE (OC_ACPI_BLOCK_ENTRY)
OC_DECLARE (OC_ACPI_DELETE_ENTRY)
#define OC_ACPI_BLOCK_ARRAY_FIELDS(_, __) \
OC_ARRAY (OC_ACPI_BLOCK_ENTRY, _, __)
OC_DECLARE (OC_ACPI_BLOCK_ARRAY)
#define OC_ACPI_DELETE_ARRAY_FIELDS(_, __) \
OC_ARRAY (OC_ACPI_DELETE_ENTRY, _, __)
OC_DECLARE (OC_ACPI_DELETE_ARRAY)
///
/// ACPI patches.
......@@ -87,7 +87,7 @@
#define OC_ACPI_CONFIG_FIELDS(_, __) \
_(OC_ACPI_ADD_ARRAY , Add , , OC_CONSTR2 (OC_ACPI_ADD_ARRAY, _, __) , OC_DESTR (OC_ACPI_ADD_ARRAY)) \
_(OC_ACPI_BLOCK_ARRAY , Block , , OC_CONSTR2 (OC_ACPI_BLOCK_ARRAY, _, __) , OC_DESTR (OC_ACPI_BLOCK_ARRAY)) \
_(OC_ACPI_DELETE_ARRAY , Delete , , OC_CONSTR2 (OC_ACPI_DELETE_ARRAY, _, __) , OC_DESTR (OC_ACPI_DELETE_ARRAY)) \
_(OC_ACPI_PATCH_ARRAY , Patch , , OC_CONSTR2 (OC_ACPI_PATCH_ARRAY, _, __) , OC_DESTR (OC_ACPI_PATCH_ARRAY)) \
_(OC_ACPI_QUIRKS , Quirks , , OC_CONSTR2 (OC_ACPI_QUIRKS, _, __) , OC_DESTR (OC_ACPI_QUIRKS))
OC_DECLARE (OC_ACPI_CONFIG)
......@@ -149,17 +149,17 @@
OC_MAP (OC_STRING, OC_ASSOC, _, __)
OC_DECLARE (OC_DEV_PROP_ADD_MAP)
#define OC_DEV_PROP_BLOCK_ENTRY_FIELDS(_, __) \
#define OC_DEV_PROP_DELETE_ENTRY_FIELDS(_, __) \
OC_ARRAY (OC_STRING, _, __)
OC_DECLARE (OC_DEV_PROP_BLOCK_ENTRY)
OC_DECLARE (OC_DEV_PROP_DELETE_ENTRY)
#define OC_DEV_PROP_BLOCK_MAP_FIELDS(_, __) \
OC_MAP (OC_STRING, OC_DEV_PROP_BLOCK_ENTRY, _, __)
OC_DECLARE (OC_DEV_PROP_BLOCK_MAP)
#define OC_DEV_PROP_DELETE_MAP_FIELDS(_, __) \
OC_MAP (OC_STRING, OC_DEV_PROP_DELETE_ENTRY, _, __)
OC_DECLARE (OC_DEV_PROP_DELETE_MAP)
#define OC_DEV_PROP_CONFIG_FIELDS(_, __) \
_(OC_DEV_PROP_ADD_MAP , Add , , OC_CONSTR2 (OC_DEV_PROP_ADD_MAP, _, __) , OC_DESTR (OC_DEV_PROP_ADD_MAP)) \
_(OC_DEV_PROP_BLOCK_MAP , Block , , OC_CONSTR2 (OC_DEV_PROP_BLOCK_MAP, _, __) , OC_DESTR (OC_DEV_PROP_BLOCK_MAP))
_(OC_DEV_PROP_ADD_MAP , Add , , OC_CONSTR2 (OC_DEV_PROP_ADD_MAP, _, __) , OC_DESTR (OC_DEV_PROP_ADD_MAP)) \
_(OC_DEV_PROP_DELETE_MAP , Delete , , OC_CONSTR2 (OC_DEV_PROP_DELETE_MAP, _, __) , OC_DESTR (OC_DEV_PROP_DELETE_MAP))
OC_DECLARE (OC_DEV_PROP_CONFIG)
/**
......@@ -352,13 +352,13 @@ typedef enum {
OC_MAP (OC_STRING, OC_ASSOC, _, __)
OC_DECLARE (OC_NVRAM_ADD_MAP)
#define OC_NVRAM_BLOCK_ENTRY_FIELDS(_, __) \
#define OC_NVRAM_DELETE_ENTRY_FIELDS(_, __) \
OC_ARRAY (OC_STRING, _, __)
OC_DECLARE (OC_NVRAM_BLOCK_ENTRY)
OC_DECLARE (OC_NVRAM_DELETE_ENTRY)
#define OC_NVRAM_BLOCK_MAP_FIELDS(_, __) \
OC_MAP (OC_STRING, OC_NVRAM_BLOCK_ENTRY, _, __)
OC_DECLARE (OC_NVRAM_BLOCK_MAP)
#define OC_NVRAM_DELETE_MAP_FIELDS(_, __) \
OC_MAP (OC_STRING, OC_NVRAM_DELETE_ENTRY, _, __)
OC_DECLARE (OC_NVRAM_DELETE_MAP)
#define OC_NVRAM_LEGACY_ENTRY_FIELDS(_, __) \
OC_ARRAY (OC_STRING, _, __)
......@@ -370,7 +370,7 @@ typedef enum {
#define OC_NVRAM_CONFIG_FIELDS(_, __) \
_(OC_NVRAM_ADD_MAP , Add , , OC_CONSTR2 (OC_NVRAM_ADD_MAP, _, __) , OC_DESTR (OC_NVRAM_ADD_MAP)) \
_(OC_NVRAM_BLOCK_MAP , Block , , OC_CONSTR2 (OC_NVRAM_BLOCK_MAP, _, __) , OC_DESTR (OC_NVRAM_BLOCK_MAP)) \
_(OC_NVRAM_DELETE_MAP , Delete , , OC_CONSTR2 (OC_NVRAM_DELETE_MAP, _, __) , OC_DESTR (OC_NVRAM_DELETE_MAP)) \
_(OC_NVRAM_LEGACY_MAP , Legacy , , OC_CONSTR2 (OC_NVRAM_LEGACY_MAP, _, __) , OC_DESTR (OC_NVRAM_LEGACY_MAP)) \
_(BOOLEAN , LegacyEnable , , FALSE , () ) \
_(BOOLEAN , LegacyOverwrite , , FALSE , () ) \
......
......@@ -703,7 +703,7 @@ AcpiApplyContext (
}
EFI_STATUS
AcpiDropTable (
AcpiDeleteTable (
IN OUT OC_ACPI_CONTEXT *Context,
IN UINT32 Signature,
IN UINT32 Length,
......@@ -731,7 +731,7 @@ AcpiDropTable (
if (OemTableId == 0 || CurrOemTableId == OemTableId) {
DEBUG ((
DEBUG_INFO,
"OCA: Dropping table %08x (%016Lx) of %u bytes with %016Lx ID at index %u\n",
"OCA: Deleting table %08x (%016Lx) of %u bytes with %016Lx ID at index %u\n",
Context->Tables[Index]->Signature,
AcpiReadOemTableId (Context->Tables[Index]),
Context->Tables[Index]->Length,
......
......@@ -16,8 +16,8 @@
OC_STRUCTORS (OC_ACPI_ADD_ENTRY, ())
OC_ARRAY_STRUCTORS (OC_ACPI_ADD_ARRAY)
OC_STRUCTORS (OC_ACPI_BLOCK_ENTRY, ())
OC_ARRAY_STRUCTORS (OC_ACPI_BLOCK_ARRAY)
OC_STRUCTORS (OC_ACPI_DELETE_ENTRY, ())
OC_ARRAY_STRUCTORS (OC_ACPI_DELETE_ARRAY)
OC_STRUCTORS (OC_ACPI_PATCH_ENTRY, ())
OC_ARRAY_STRUCTORS (OC_ACPI_PATCH_ARRAY)
OC_STRUCTORS (OC_ACPI_QUIRKS, ())
......@@ -29,8 +29,8 @@ OC_STRUCTORS (OC_BOOTER_QUIRKS, ())
OC_STRUCTORS (OC_BOOTER_CONFIG, ())
OC_MAP_STRUCTORS (OC_DEV_PROP_ADD_MAP)
OC_STRUCTORS (OC_DEV_PROP_BLOCK_ENTRY, ())
OC_MAP_STRUCTORS (OC_DEV_PROP_BLOCK_MAP)
OC_STRUCTORS (OC_DEV_PROP_DELETE_ENTRY, ())
OC_MAP_STRUCTORS (OC_DEV_PROP_DELETE_MAP)
OC_STRUCTORS (OC_DEV_PROP_CONFIG, ())
OC_STRUCTORS (OC_KERNEL_ADD_ENTRY, ())
......@@ -52,8 +52,8 @@ OC_ARRAY_STRUCTORS (OC_MISC_TOOLS_ARRAY)
OC_STRUCTORS (OC_MISC_CONFIG, ())
OC_MAP_STRUCTORS (OC_NVRAM_ADD_MAP)
OC_STRUCTORS (OC_NVRAM_BLOCK_ENTRY, ())
OC_MAP_STRUCTORS (OC_NVRAM_BLOCK_MAP)
OC_STRUCTORS (OC_NVRAM_DELETE_ENTRY, ())
OC_MAP_STRUCTORS (OC_NVRAM_DELETE_MAP)
OC_STRUCTORS (OC_NVRAM_LEGACY_ENTRY, ())
OC_MAP_STRUCTORS (OC_NVRAM_LEGACY_MAP)
OC_STRUCTORS (OC_NVRAM_CONFIG, ())
......@@ -95,18 +95,18 @@ mAcpiAddSchema = OC_SCHEMA_DICT (NULL, mAcpiAddSchemaEntry);
STATIC
OC_SCHEMA
mAcpiBlockSchemaEntry[] = {
OC_SCHEMA_BOOLEAN_IN ("All", OC_ACPI_BLOCK_ENTRY, All),
OC_SCHEMA_STRING_IN ("Comment", OC_ACPI_BLOCK_ENTRY, Comment),
OC_SCHEMA_BOOLEAN_IN ("Enabled", OC_ACPI_BLOCK_ENTRY, Enabled),
OC_SCHEMA_DATAF_IN ("OemTableId", OC_ACPI_BLOCK_ENTRY, OemTableId),
OC_SCHEMA_INTEGER_IN ("TableLength", OC_ACPI_BLOCK_ENTRY, TableLength),
OC_SCHEMA_DATAF_IN ("TableSignature", OC_ACPI_BLOCK_ENTRY, TableSignature),
mAcpiDeleteSchemaEntry[] = {
OC_SCHEMA_BOOLEAN_IN ("All", OC_ACPI_DELETE_ENTRY, All),
OC_SCHEMA_STRING_IN ("Comment", OC_ACPI_DELETE_ENTRY, Comment),
OC_SCHEMA_BOOLEAN_IN ("Enabled", OC_ACPI_DELETE_ENTRY, Enabled),
OC_SCHEMA_DATAF_IN ("OemTableId", OC_ACPI_DELETE_ENTRY, OemTableId),
OC_SCHEMA_INTEGER_IN ("TableLength", OC_ACPI_DELETE_ENTRY, TableLength),
OC_SCHEMA_DATAF_IN ("TableSignature", OC_ACPI_DELETE_ENTRY, TableSignature),
};
STATIC
OC_SCHEMA
mAcpiBlockSchema = OC_SCHEMA_DICT (NULL, mAcpiBlockSchemaEntry);
mAcpiDeleteSchema = OC_SCHEMA_DICT (NULL, mAcpiDeleteSchemaEntry);
STATIC
OC_SCHEMA
......@@ -143,7 +143,7 @@ STATIC
OC_SCHEMA
mAcpiConfigurationSchema[] = {
OC_SCHEMA_ARRAY_IN ("Add", OC_GLOBAL_CONFIG, Acpi.Add, &mAcpiAddSchema),
OC_SCHEMA_ARRAY_IN ("Block", OC_GLOBAL_CONFIG, Acpi.Block, &mAcpiBlockSchema),
OC_SCHEMA_ARRAY_IN ("Delete", OC_GLOBAL_CONFIG, Acpi.Delete, &mAcpiDeleteSchema),
OC_SCHEMA_ARRAY_IN ("Patch", OC_GLOBAL_CONFIG, Acpi.Patch, &mAcpiPatchSchema),
OC_SCHEMA_DICT ("Quirks", mAcpiQuirksSchema),
};
......@@ -208,17 +208,17 @@ mDevicePropertiesAddSchema = OC_SCHEMA_MAP (NULL, &mDevicePropertiesAddEntrySche
STATIC
OC_SCHEMA
mDevicePropertiesBlockEntrySchema = OC_SCHEMA_STRING (NULL);
mDevicePropertiesDeleteEntrySchema = OC_SCHEMA_STRING (NULL);
STATIC
OC_SCHEMA
mDevicePropertiesBlockSchema = OC_SCHEMA_ARRAY (NULL, &mDevicePropertiesBlockEntrySchema);
mDevicePropertiesDeleteSchema = OC_SCHEMA_ARRAY (NULL, &mDevicePropertiesDeleteEntrySchema);
STATIC
OC_SCHEMA
mDevicePropertiesSchema[] = {
OC_SCHEMA_MAP_IN ("Add", OC_GLOBAL_CONFIG, DeviceProperties.Add, &mDevicePropertiesAddSchema),
OC_SCHEMA_MAP_IN ("Block", OC_GLOBAL_CONFIG, DeviceProperties.Block, &mDevicePropertiesBlockSchema)
OC_SCHEMA_MAP_IN ("Delete", OC_GLOBAL_CONFIG, DeviceProperties.Delete, &mDevicePropertiesDeleteSchema)
};
//
......@@ -405,11 +405,11 @@ mNvramAddSchema = OC_SCHEMA_MAP (NULL, &mNvramAddEntrySchema);
STATIC
OC_SCHEMA
mNvramBlockEntrySchema = OC_SCHEMA_STRING (NULL);
mNvramDeleteEntrySchema = OC_SCHEMA_STRING (NULL);
STATIC
OC_SCHEMA
mNvramBlockSchema = OC_SCHEMA_ARRAY (NULL, &mNvramBlockEntrySchema);
mNvramDeleteSchema = OC_SCHEMA_ARRAY (NULL, &mNvramDeleteEntrySchema);
STATIC
OC_SCHEMA
......@@ -423,7 +423,7 @@ STATIC
OC_SCHEMA
mNvramConfigurationSchema[] = {
OC_SCHEMA_MAP_IN ("Add", OC_GLOBAL_CONFIG, Nvram.Add, &mNvramAddSchema),
OC_SCHEMA_MAP_IN ("Block", OC_GLOBAL_CONFIG, Nvram.Block, &mNvramBlockSchema),
OC_SCHEMA_MAP_IN ("Delete", OC_GLOBAL_CONFIG, Nvram.Delete, &mNvramDeleteSchema),
OC_SCHEMA_BOOLEAN_IN ("LegacyEnable", OC_GLOBAL_CONFIG, Nvram.LegacyEnable),
OC_SCHEMA_BOOLEAN_IN ("LegacyOverwrite", OC_GLOBAL_CONFIG, Nvram.LegacyOverwrite),
OC_SCHEMA_MAP_IN ("LegacySchema", OC_GLOBAL_CONFIG, Nvram.Legacy, &mNvramLegacySchema),
......
......@@ -87,7 +87,7 @@ OcAcpiAddTables (
STATIC
VOID
OcAcpiBlockTables (
OcAcpiDeleteTables (
IN OC_GLOBAL_CONFIG *Config,
IN OC_ACPI_CONTEXT *Context
)
......@@ -96,10 +96,10 @@ OcAcpiBlockTables (
UINT32 Index;
UINT32 Signature;
UINT64 OemTableId;
OC_ACPI_BLOCK_ENTRY *Table;
OC_ACPI_DELETE_ENTRY *Table;
for (Index = 0; Index < Config->Acpi.Block.Count; ++Index) {
Table = Config->Acpi.Block.Values[Index];
for (Index = 0; Index < Config->Acpi.Delete.Count; ++Index) {
Table = Config->Acpi.Delete.Values[Index];
if (!Table->Enabled) {
continue;
......@@ -108,7 +108,7 @@ OcAcpiBlockTables (
CopyMem (&Signature, Table->TableSignature, sizeof (Table->TableSignature));
CopyMem (&OemTableId, Table->OemTableId, sizeof (Table->OemTableId));
Status = AcpiDropTable (
Status = AcpiDeleteTable (
Context,
Signature,
Table->TableLength,
......@@ -213,7 +213,7 @@ OcLoadAcpiSupport (
OcAcpiPatchTables (Config, &Context);
OcAcpiBlockTables (Config, &Context);
OcAcpiDeleteTables (Config, &Context);
OcAcpiAddTables (Config, Storage, &Context);
......
......@@ -50,8 +50,8 @@ OcLoadDevPropsSupport (
return;
}
for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Block.Count; ++DeviceIndex) {
AsciiDevicePath = OC_BLOB_GET (Config->DeviceProperties.Block.Keys[DeviceIndex]);
for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Delete.Count; ++DeviceIndex) {
AsciiDevicePath = OC_BLOB_GET (Config->DeviceProperties.Delete.Keys[DeviceIndex]);
UnicodeDevicePath = AsciiStrCopyToUnicode (AsciiDevicePath, 0);
DevicePath = NULL;
......@@ -65,13 +65,13 @@ OcLoadDevPropsSupport (
continue;
}
for (PropertyIndex = 0; PropertyIndex < Config->DeviceProperties.Block.Values[DeviceIndex]->Count; ++PropertyIndex) {
AsciiProperty = OC_BLOB_GET (Config->DeviceProperties.Block.Values[DeviceIndex]->Values[PropertyIndex]);
for (PropertyIndex = 0; PropertyIndex < Config->DeviceProperties.Delete.Values[DeviceIndex]->Count; ++PropertyIndex) {
AsciiProperty = OC_BLOB_GET (Config->DeviceProperties.Delete.Values[DeviceIndex]->Values[PropertyIndex]);
//
// '#' is filtered in all keys, but for values we need to do it ourselves.
//
if (AsciiProperty[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Device property skip blocking %a\n", AsciiProperty));
DEBUG ((DEBUG_INFO, "OC: Device property skip deleting %a\n", AsciiProperty));
continue;
}
......
......@@ -336,14 +336,14 @@ OcLoadLegacyNvram (
STATIC
VOID
OcBlockNvram (
OcDeleteNvram (
IN OC_GLOBAL_CONFIG *Config
)
{
EFI_STATUS Status;
UINT32 BlockGuidIndex;
UINT32 DeleteGuidIndex;
UINT32 AddGuidIndex;
UINT32 BlockVariableIndex;
UINT32 DeleteVariableIndex;
UINT32 AddVariableIndex;
CONST CHAR8 *AsciiVariableName;
CHAR16 *UnicodeVariableName;
......@@ -353,9 +353,9 @@ OcBlockNvram (
UINTN CurrentValueSize;
BOOLEAN SameContents;
for (BlockGuidIndex = 0; BlockGuidIndex < Config->Nvram.Block.Count; ++BlockGuidIndex) {
for (DeleteGuidIndex = 0; DeleteGuidIndex < Config->Nvram.Delete.Count; ++DeleteGuidIndex) {
Status = OcProcessVariableGuid (
OC_BLOB_GET (Config->Nvram.Block.Keys[BlockGuidIndex]),
OC_BLOB_GET (Config->Nvram.Delete.Keys[DeleteGuidIndex]),
&VariableGuid,
NULL,
NULL
......@@ -373,20 +373,20 @@ OcBlockNvram (
//
for (AddGuidIndex = 0; AddGuidIndex < Config->Nvram.Add.Count; ++AddGuidIndex) {
if (AsciiStrCmp (
OC_BLOB_GET (Config->Nvram.Block.Keys[BlockGuidIndex]),
OC_BLOB_GET (Config->Nvram.Delete.Keys[DeleteGuidIndex]),
OC_BLOB_GET (Config->Nvram.Add.Keys[AddGuidIndex])) == 0) {
break;
}
}
for (BlockVariableIndex = 0; BlockVariableIndex < Config->Nvram.Block.Values[BlockGuidIndex]->Count; ++BlockVariableIndex) {
AsciiVariableName = OC_BLOB_GET (Config->Nvram.Block.Values[BlockGuidIndex]->Values[BlockVariableIndex]);
for (DeleteVariableIndex = 0; DeleteVariableIndex < Config->Nvram.Delete.Values[DeleteGuidIndex]->Count; ++DeleteVariableIndex) {
AsciiVariableName = OC_BLOB_GET (Config->Nvram.Delete.Values[DeleteGuidIndex]->Values[DeleteVariableIndex]);
//
// '#' is filtered in all keys, but for values we need to do it ourselves.
//
if (AsciiVariableName[0] == '#') {
DEBUG ((DEBUG_INFO, "OC: Variable skip blocking %a\n", AsciiVariableName));
DEBUG ((DEBUG_INFO, "OC: Variable skip deleting %a\n", AsciiVariableName));
continue;
}
......@@ -491,7 +491,7 @@ OcLoadNvramSupport (
OcLoadLegacyNvram (Storage->FileSystem, Config);
}
OcBlockNvram (Config);
OcDeleteNvram (Config);
OcAddNvram (Config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册