]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkFvbServiceLib/Ipf/Fvb.c
changed the guid assignment from constant array to hi and low UINT64s (Intel compiler...
[mirror_edk2.git] / EdkModulePkg / Library / EdkFvbServiceLib / Ipf / Fvb.c
index 58ad6f538c382654980ca94412b6688fc9a08afa..fe596e6a36b16f17c7f57dbc7679cf2b168c82fc 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \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
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006, Intel Corporation\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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
   \r
@@ -26,6 +26,7 @@ Abstract:
 --*/\r
 \r
 EFI_STATUS\r
+EFIAPI\r
 FvbLibInitialize (\r
   IN EFI_HANDLE         ImageHandle,\r
   IN EFI_SYSTEM_TABLE   *SystemTable\r
@@ -38,7 +39,7 @@ Routine Description:
 Arguments:\r
   None\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS\r
 \r
 --*/\r
@@ -81,7 +82,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, Read, Instance, Lba, Offset, (UINT64) NumBytes, (UINT64) Buffer, 0, 0).Status;\r
 }\r
@@ -114,7 +118,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, Write, Instance, Lba, Offset, (UINT64) NumBytes, (UINT64) Buffer, 0, 0).Status;\r
 }\r
@@ -138,7 +145,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, EraseBlock, Instance, Lba, 0, 0, 0, 0, 0).Status;\r
 }\r
@@ -155,7 +165,7 @@ Routine Description:
   resulting attributes in output parameter\r
 \r
 Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
+  Instance              - The FV instance whose attributes is going to be\r
                           returned\r
   Attributes            - Output buffer which contains attributes\r
 \r
@@ -164,7 +174,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, SetVolumeAttributes, Instance, (UINT64) Attributes, 0, 0, 0, 0, 0).Status;\r
 }\r
@@ -177,13 +190,13 @@ EfiFvbSetVolumeAttributes (
 /*++\r
 \r
 Routine Description:\r
-  Modifies the current settings of the firmware volume according to the \r
+  Modifies the current settings of the firmware volume according to the\r
   input parameter, and returns the new setting of the volume\r
 \r
 Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
+  Instance              - The FV instance whose attributes is going to be\r
                           modified\r
-  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES \r
+  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES\r
                           containing the desired firmware volume settings.\r
                           On successful return, it contains the new settings\r
                           of the firmware volume\r
@@ -193,7 +206,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, SetVolumeAttributes, Instance, (UINT64) Attributes, 0, 0, 0, 0, 0).Status;\r
 }\r
@@ -211,16 +227,19 @@ Routine Description:
 Arguments:\r
   Instance              - The FV instance whose base address is going to be\r
                           returned\r
-  BaseAddress           - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r
+  BaseAddress           - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
                           that on successful return, contains the base address\r
-                          of the firmware volume. \r
+                          of the firmware volume.\r
 \r
 Returns:\r
   Status code\r
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (&Guid, GetPhysicalAddress, Instance, (UINT64) BaseAddress, 0, 0, 0, 0, 0).Status;\r
 }\r
@@ -249,12 +268,15 @@ Arguments:
                           BlockSize\r
 \r
 Returns:\r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
+  EFI_SUCCESS           - The firmware volume was read successfully and\r
                           contents are in Buffer\r
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (\r
           &Guid,\r
@@ -285,7 +307,7 @@ Routine Description:
 Arguments:\r
   Instance              - The FV instance to be erased\r
   StartLba              - The starting logical block index to be erased\r
-  OffsetStartLba        - Offset into the starting block at which to \r
+  OffsetStartLba        - Offset into the starting block at which to\r
                           begin erasing\r
   LastLba               - The last logical block index to be erased\r
   OffsetLastLba         - Offset into the last block at which to end erasing\r
@@ -295,7 +317,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;\r
+  EFI_GUID Guid;\r
+\r
+  *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_LO;\r
+  *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID_HI;\r
 \r
   return EfiCallEsalService (\r
           &Guid,\r