]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Variable/RuntimeDxe: move MOR func. declarations to header
authorLaszlo Ersek <lersek@redhat.com>
Sat, 30 Sep 2017 14:04:31 +0000 (16:04 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 10 Oct 2017 09:25:19 +0000 (11:25 +0200)
The MorLockInit() and SetVariableCheckHandlerMor() functions have separate
implementations for VariableRuntimeDxe (= unprivileged, unified
DXE_RUNTIME driver) and VariableSmm (= privileged, DXE_SMM back-end of the
split variable driver).

Move their declarations from "Variable.c" to "PrivilegePolymorphic.h", so
that the compiler enforce that the declarations and the definitions match.
(All C source files with the call sites and the function definitions
already include "PrivilegePolymorphic.h" via "Variable.h".)

At the same time:

- replace two typos in the MorLockInit() description:
  - replace "EFI_SUCEESS" with "EFI_SUCCESS",
  - replace "MOR Lock Control" with "MOR Control Lock";

- in the SetVariableCheckHandlerMor() description:
  - replace @param with @param[in],
  - correct the description of the Attributes parameter (suggested by Star
    Zeng <star.zeng@intel.com>),
  - rewrap the comment to 80 columns.

This change cleans up commit 2f6aa774fe38 ("MdeModulePkg: Add MorLock to
variable driver.", 2016-01-19).

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ladi Prosek <lprosek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Ladi Prosek <lprosek@redhat.com>
MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c
MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index 0aa0d4f48f10a08db1dd7acac30fa2b21b44b52a..cf0d237195781db7a8a8341c4ccb03827fa3b6f6 100644 (file)
@@ -35,4 +35,43 @@ SecureBootHook (
   IN EFI_GUID                               *VendorGuid\r
   );\r
 \r
+/**\r
+  Initialization for MOR Control Lock.\r
+\r
+  @retval EFI_SUCCESS     MorLock initialization success.\r
+  @return Others          Some error occurs.\r
+**/\r
+EFI_STATUS\r
+MorLockInit (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  This service is an MOR/MorLock checker handler for the SetVariable().\r
+\r
+  @param[in]  VariableName the name of the vendor's variable, as a\r
+                           Null-Terminated Unicode String\r
+  @param[in]  VendorGuid   Unify identifier for vendor.\r
+  @param[in]  Attributes   Attributes bitmask to set for the variable.\r
+  @param[in]  DataSize     The size in bytes of Data-Buffer.\r
+  @param[in]  Data         Point to the content of the variable.\r
+\r
+  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable\r
+                                  driver can store the variable data.\r
+  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or\r
+                                  attributes is not allowed for MOR variable.\r
+  @retval  EFI_ACCESS_DENIED      The MOR/MorLock is locked.\r
+  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this\r
+                                  function. Variable driver can just return\r
+                                  EFI_SUCCESS.\r
+**/\r
+EFI_STATUS\r
+SetVariableCheckHandlerMor (\r
+  IN CHAR16     *VariableName,\r
+  IN EFI_GUID   *VendorGuid,\r
+  IN UINT32     Attributes,\r
+  IN UINTN      DataSize,\r
+  IN VOID       *Data\r
+  );\r
+\r
 #endif\r
index c32eb3b1ac4b07e63b529437b6e082d6f979068f..dfdc1febc86869d2bfdce2dd96ea1a5251e64c52 100644 (file)
@@ -28,19 +28,21 @@ extern EDKII_VARIABLE_LOCK_PROTOCOL     mVariableLock;
 /**\r
   This service is an MOR/MorLock checker handler for the SetVariable().\r
 \r
-  @param  VariableName the name of the vendor's variable, as a\r
-                       Null-Terminated Unicode String\r
-  @param  VendorGuid   Unify identifier for vendor.\r
-  @param  Attributes   Point to memory location to return the attributes of variable. If the point\r
-                       is NULL, the parameter would be ignored.\r
-  @param  DataSize     The size in bytes of Data-Buffer.\r
-  @param  Data         Point to the content of the variable.\r
+  @param[in]  VariableName the name of the vendor's variable, as a\r
+                           Null-Terminated Unicode String\r
+  @param[in]  VendorGuid   Unify identifier for vendor.\r
+  @param[in]  Attributes   Attributes bitmask to set for the variable.\r
+  @param[in]  DataSize     The size in bytes of Data-Buffer.\r
+  @param[in]  Data         Point to the content of the variable.\r
 \r
-  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable driver can store the variable data.\r
-  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or attributes is not allowed for MOR variable.\r
+  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable\r
+                                  driver can store the variable data.\r
+  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or\r
+                                  attributes is not allowed for MOR variable.\r
   @retval  EFI_ACCESS_DENIED      The MOR/MorLock is locked.\r
-  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this function.\r
-                                  Variable driver can just return EFI_SUCCESS.\r
+  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this\r
+                                  function. Variable driver can just return\r
+                                  EFI_SUCCESS.\r
 **/\r
 EFI_STATUS\r
 SetVariableCheckHandlerMor (\r
@@ -58,9 +60,9 @@ SetVariableCheckHandlerMor (
 }\r
 \r
 /**\r
-  Initialization for MOR Lock Control.\r
+  Initialization for MOR Control Lock.\r
 \r
-  @retval EFI_SUCEESS     MorLock initialization success.\r
+  @retval EFI_SUCCESS     MorLock initialization success.\r
   @return Others          Some error occurs.\r
 **/\r
 EFI_STATUS\r
index d06317ca9cf4ea6a947e7b5058f7be3c0aaafdc0..20ec98e8e8800997500dffdef5c083e64ac9108d 100644 (file)
@@ -309,19 +309,21 @@ SetVariableCheckHandlerMorLock (
 /**\r
   This service is an MOR/MorLock checker handler for the SetVariable().\r
 \r
-  @param  VariableName the name of the vendor's variable, as a\r
-                       Null-Terminated Unicode String\r
-  @param  VendorGuid   Unify identifier for vendor.\r
-  @param  Attributes   Point to memory location to return the attributes of variable. If the point\r
-                       is NULL, the parameter would be ignored.\r
-  @param  DataSize     The size in bytes of Data-Buffer.\r
-  @param  Data         Point to the content of the variable.\r
-\r
-  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable driver can store the variable data.\r
-  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or attributes is not allowed for MOR variable.\r
+  @param[in]  VariableName the name of the vendor's variable, as a\r
+                           Null-Terminated Unicode String\r
+  @param[in]  VendorGuid   Unify identifier for vendor.\r
+  @param[in]  Attributes   Attributes bitmask to set for the variable.\r
+  @param[in]  DataSize     The size in bytes of Data-Buffer.\r
+  @param[in]  Data         Point to the content of the variable.\r
+\r
+  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable\r
+                                  driver can store the variable data.\r
+  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or\r
+                                  attributes is not allowed for MOR variable.\r
   @retval  EFI_ACCESS_DENIED      The MOR/MorLock is locked.\r
-  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this function.\r
-                                  Variable driver can just return EFI_SUCCESS.\r
+  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this\r
+                                  function. Variable driver can just return\r
+                                  EFI_SUCCESS.\r
 **/\r
 EFI_STATUS\r
 SetVariableCheckHandlerMor (\r
@@ -377,9 +379,9 @@ SetVariableCheckHandlerMor (
 }\r
 \r
 /**\r
-  Initialization for MOR Lock Control.\r
+  Initialization for MOR Control Lock.\r
 \r
-  @retval EFI_SUCEESS     MorLock initialization success.\r
+  @retval EFI_SUCCESS     MorLock initialization success.\r
   @return Others          Some error occurs.\r
 **/\r
 EFI_STATUS\r
index 28e4ac8f3819d4ea1582ce747b71275574484444..d68dfbe648ce570bf614f717f251e44c0293075b 100644 (file)
@@ -97,43 +97,6 @@ AUTH_VAR_LIB_CONTEXT_IN mAuthContextIn = {
 \r
 AUTH_VAR_LIB_CONTEXT_OUT mAuthContextOut;\r
 \r
-/**\r
-  Initialization for MOR Lock Control.\r
-\r
-  @retval EFI_SUCEESS     MorLock initialization success.\r
-  @return Others          Some error occurs.\r
-**/\r
-EFI_STATUS\r
-MorLockInit (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  This service is an MOR/MorLock checker handler for the SetVariable().\r
-\r
-  @param  VariableName the name of the vendor's variable, as a\r
-                       Null-Terminated Unicode String\r
-  @param  VendorGuid   Unify identifier for vendor.\r
-  @param  Attributes   Point to memory location to return the attributes of variable. If the point\r
-                       is NULL, the parameter would be ignored.\r
-  @param  DataSize     The size in bytes of Data-Buffer.\r
-  @param  Data         Point to the content of the variable.\r
-\r
-  @retval  EFI_SUCCESS            The MOR/MorLock check pass, and Variable driver can store the variable data.\r
-  @retval  EFI_INVALID_PARAMETER  The MOR/MorLock data or data size or attributes is not allowed for MOR variable.\r
-  @retval  EFI_ACCESS_DENIED      The MOR/MorLock is locked.\r
-  @retval  EFI_ALREADY_STARTED    The MorLock variable is handled inside this function.\r
-                                  Variable driver can just return EFI_SUCCESS.\r
-**/\r
-EFI_STATUS\r
-SetVariableCheckHandlerMor (\r
-  IN CHAR16     *VariableName,\r
-  IN EFI_GUID   *VendorGuid,\r
-  IN UINT32     Attributes,\r
-  IN UINTN      DataSize,\r
-  IN VOID       *Data\r
-  );\r
-\r
 /**\r
   Routine used to track statistical information about variable usage.\r
   The data is stored in the EFI system table so it can be accessed later.\r