]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/ReadOnlyVariableOnReadOnlyVariable2Thunk/ReadOnlyVariableOnReadOnlyVariable2Thunk.c
Update code to match EDKII coding style.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / ReadOnlyVariableOnReadOnlyVariable2Thunk / ReadOnlyVariableOnReadOnlyVariable2Thunk.c
index 3eaa929c7c7dd9194b99b59ef65afd0b388b7edc..6ee3c55ab58d9d2112b3564979156f8d38840dac 100644 (file)
@@ -10,7 +10,7 @@ UEFI PI Spec supersedes Intel's Framework Specs.
 \r
 This module can't be used together with ReadOnlyVariable2ToReadOnlyVariableThunk module.\r
 \r
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -28,80 +28,18 @@ Module Name:
 #include <Library/DebugLib.h>\r
 #include <Library/PeiServicesLib.h>\r
 \r
-//\r
-// Function Prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-PeiGetVariable (\r
-  IN  EFI_PEI_SERVICES  **PeiServices,\r
-  IN  CHAR16            *VariableName,\r
-  IN  EFI_GUID          *VendorGuid,\r
-  OUT UINT32            *Attributes OPTIONAL,\r
-  IN  OUT UINTN         *DataSize,\r
-  OUT VOID              *Data\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeiGetNextVariableName (\r
-  IN EFI_PEI_SERVICES  **PeiServices,\r
-  IN OUT UINTN         *VariableNameSize,\r
-  IN OUT CHAR16        *VariableName,\r
-  IN OUT EFI_GUID      *VendorGuid\r
-  );\r
-\r
-//\r
-// Module globals\r
-//\r
-EFI_PEI_READ_ONLY_VARIABLE_PPI mVariablePpi = {\r
-  PeiGetVariable,\r
-  PeiGetNextVariableName\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR     mPpiListVariable = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiReadOnlyVariablePpiGuid,\r
-  &mVariablePpi\r
-};\r
-\r
-\r
-\r
-/**\r
-  Standard entry point of a PEIM.\r
-\r
-  @param FfsHeadher  The FFS file header\r
-  @param PeiServices  General purpose services available to every PEIM.\r
-\r
-  @retval EFI_SUCCESS If the gEfiPeiReadOnlyVariablePpiGuid interface could be successfully installed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeReadOnlyVariable (\r
-  IN EFI_PEI_FILE_HANDLE     FfsHeader,\r
-  IN CONST EFI_PEI_SERVICES  **PeiServices\r
-  )\r
-{\r
-  //\r
-  //Developer should make sure ReadOnlyVariableToReadOnlyVariable2 module is not present. If so, the call chain will form a\r
-  // infinite loop: ReadOnlyVariable -> ReadOnlyVariable2 -> ReadOnlyVariable -> ....\r
-  //\r
-  //\r
-  // Publish the variable capability to other modules\r
-  //\r
-  return (*PeiServices)->InstallPpi (PeiServices, &mPpiListVariable);\r
-}\r
-\r
 /**\r
   Provide the read variable functionality of the variable services.\r
 \r
-  @param  PeiServices           General purpose services available to every PEIM.\r
-  @param  VariableName          The variable name\r
-  @param  VendorGuid            The vendor's GUID\r
-  @param  Attributes            Pointer to the attribute\r
-  @param  DataSize              Size of data\r
-  @param  Data                  Pointer to data\r
+  @param[in]  PeiServices    An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+  @param[in]  VariableName   A NULL-terminated Unicode string that is the name of the vendor's variable.\r
+  @param[in]  VendorGuid     A unique identifier for the vendor.\r
+  @param[out] Attributes     This OPTIONAL parameter may be either NULL or\r
+                             a pointer to the location in which to return\r
+                             the attributes bitmask for the variable.\r
+  @param[in, out]  DataSize   On input, the size in bytes of the return Data buffer.\r
+                             On output, the size of data returned in Data.\r
+  @param[out] Data           The buffer to return the contents of the variable.\r
 \r
   @retval EFI_SUCCESS           The interface could be successfully installed\r
   @retval EFI_NOT_FOUND         The variable could not be discovered\r
@@ -144,13 +82,14 @@ PeiGetVariable (
 /**\r
   Provide the get next variable functionality of the variable services.\r
 \r
-  @param  PeiServices           General purpose services available to every PEIM.\r
-  @param  VariabvleNameSize     The variable name's size.\r
-  @param  VariableName          A pointer to the variable's name.\r
-  @param  VariableGuid          A pointer to the EFI_GUID structure.\r
-  @param  VariableNameSize      Size of the variable name\r
-  @param  VariableName          The variable name\r
-  @param  VendorGuid            The vendor's GUID\r
+  @param[in]     PeiServices       An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
+  @param[in, out] VariableNameSize  The size of the VariableName buffer.\r
+  @param[in, out] VariableName      On input, supplies the last VariableName that was\r
+                                   returned by GetNextVariableName(). On output, returns the Null-terminated\r
+                                   Unicode string of the current variable.\r
+  @param[in, out] VendorGuid        On input, supplies the last VendorGuid that was\r
+                                   returned by GetNextVariableName(). On output, returns the VendorGuid\r
+                                   of the current variable.\r
 \r
   @retval EFI_SUCCESS           The interface could be successfully installed\r
   @retval EFI_NOT_FOUND         The variable could not be discovered\r
@@ -184,3 +123,43 @@ PeiGetNextVariableName (
                               VendorGuid\r
                               );\r
 }\r
+\r
+//\r
+// Module globals\r
+//\r
+EFI_PEI_READ_ONLY_VARIABLE_PPI mVariablePpi = {\r
+  PeiGetVariable,\r
+  PeiGetNextVariableName\r
+};\r
+\r
+EFI_PEI_PPI_DESCRIPTOR     mPpiListVariable = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEfiPeiReadOnlyVariablePpiGuid,\r
+  &mVariablePpi\r
+};\r
+\r
+/**\r
+  Standard entry point of a PEIM.\r
+\r
+  @param FileHandle   Handle of the file being invoked.\r
+  @param PeiServices  General purpose services available to every PEIM.\r
+\r
+  @retval EFI_SUCCESS If the gEfiPeiReadOnlyVariablePpiGuid interface could be successfully installed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeimInitializeReadOnlyVariable (\r
+  IN EFI_PEI_FILE_HANDLE     FileHandle,\r
+  IN CONST EFI_PEI_SERVICES  **PeiServices\r
+  )\r
+{\r
+  //\r
+  //Developer should make sure ReadOnlyVariableToReadOnlyVariable2 module is not present. If so, the call chain will form a\r
+  // infinite loop: ReadOnlyVariable -> ReadOnlyVariable2 -> ReadOnlyVariable -> ....\r
+  //\r
+  //\r
+  // Publish the variable capability to other modules\r
+  //\r
+  return (*PeiServices)->InstallPpi (PeiServices, &mPpiListVariable);\r
+}\r