]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFv/GenFv.c
PcAtChipsetPkg AcpiTimerLib: Get more accurate TSC Frequency
[mirror_edk2.git] / BaseTools / Source / C / GenFv / GenFv.c
index e080422e5488134eec0066fd28c7f4f579b1d1c9..01ae37acd738fcaa40b04e7c3acf16c3d3ca6eaf 100644 (file)
@@ -1,7 +1,11 @@
 /** @file\r
+  This contains all code necessary to build the GenFvImage.exe utility.       \r
+  This utility relies heavily on the GenFvImage Lib.  Definitions for both\r
+  can be found in the Tiano Firmware Volume Generation Utility \r
+  Specification, review draft.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+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
@@ -9,17 +13,6 @@ http://opensource.org/licenses/bsd-license.php
 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
-  GenFv.c\r
-\r
-Abstract:\r
-\r
-  This contains all code necessary to build the GenFvImage.exe utility.       \r
-  This utility relies heavily on the GenFvImage Lib.  Definitions for both\r
-  can be found in the Tiano Firmware Volume Generation Utility \r
-  Specification, review draft.\r
-\r
 **/\r
 \r
 //\r
@@ -40,9 +33,9 @@ Abstract:
 //\r
 #define UTILITY_MAJOR_VERSION 0\r
 #define UTILITY_MINOR_VERSION 1\r
-#define GENFV_UPDATE_TIME           " updated on 2008/11/21"\r
 \r
 EFI_GUID  mEfiFirmwareFileSystem2Guid = EFI_FIRMWARE_FILE_SYSTEM2_GUID;\r
+EFI_GUID  mEfiFirmwareFileSystem3Guid = EFI_FIRMWARE_FILE_SYSTEM3_GUID;\r
 \r
 STATIC\r
 VOID \r
@@ -65,7 +58,7 @@ Returns:
 \r
 --*/\r
 {\r
-  fprintf (stdout, "%s Version %d.%d %s\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, GENFV_UPDATE_TIME);\r
+  fprintf (stdout, "%s Version %d.%d %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
 }\r
 \r
 STATIC\r
@@ -97,7 +90,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -125,23 +118,27 @@ Returns:
                         Address is the rebase start address for drivers that\n\\r
                         run in Flash. It supports DEC or HEX digital format.\n\\r
                         If it is set to zero, no rebase action will be taken\n");\r
+  fprintf (stdout, "  -F ForceRebase, --force-rebase ForceRebase\n\\r
+                        If value is TRUE, will always take rebase action\n\\r
+                        If value is FALSE, will always not take reabse action\n\\r
+                        If not specified, will take rebase action if rebase address greater than zero, \n\\r
+                        will not take rebase action if rebase address is zero.\n");\r
   fprintf (stdout, "  -a AddressFile, --addrfile AddressFile\n\\r
-                        AddressFile is one file used to record boot driver base\n\\r
-                        address and runtime driver base address. And this tool\n\\r
-                        will update these two addresses after it relocates all\n\\r
-                        boot drivers and runtime drivers in this fv iamge to\n\\r
-                        the preferred loaded memory address.\n");\r
+                        AddressFile is one file used to record the child\n\\r
+                        FV base address when current FV base address is set.\n");\r
   fprintf (stdout, "  -m logfile, --map logfile\n\\r
                         Logfile is the output fv map file name. if it is not\n\\r
                         given, the FvName.map will be the default map file name\n"); \r
-  fprintf (stdout, "  -g Guid, --guid GuidValue\n\\r
+  fprintf (stdout, "  -g Guid, --guid Guid\n\\r
                         GuidValue is one specific capsule guid value\n\\r
                         or fv file system guid value.\n\\r
                         Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");\r
-  fprintf (stdout, "  --FvNameGuid          GuidValue is the Fv Name Guid value.\n\\r
+  fprintf (stdout, "  --FvNameGuid Guid     Guid is used to specify Fv Name.\n\\r
                         Its format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n");\r
   fprintf (stdout, "  --capflag CapFlag     Capsule Reset Flag can be PersistAcrossReset,\n\\r
-                        or PopulateSystemTable or not set.\n");\r
+                        or PopulateSystemTable or InitiateReset or not set\n");\r
+  fprintf (stdout, "  --capoemflag CapOEMFlag\n\\r
+                        Capsule OEM Flag is an integer between 0x0000 and 0xffff\n");\r
   fprintf (stdout, "  --capheadsize HeadSize\n\\r
                         HeadSize is one HEX or DEC format value\n\\r
                         HeadSize is required by Capsule Image.\n");                        \r
@@ -194,10 +191,8 @@ Returns:
   CHAR8                 *InfFileImage;\r
   UINT32                InfFileSize;\r
   CHAR8                 *OutFileName;\r
-  CHAR8                 ValueString[_MAX_PATH];\r
   BOOLEAN               CapsuleFlag;\r
   BOOLEAN               DumpCapsule;\r
-  MEMORY_FILE           AddrMemoryFile;\r
   FILE                  *FpFile;\r
   EFI_CAPSULE_HEADER    *CapsuleHeader;\r
   UINT64                LogLevel, TempNumber;\r
@@ -218,6 +213,7 @@ Returns:
   Index         = 0;\r
   mFvTotalSize  = 0;\r
   mFvTakenSize  = 0;\r
+  Status        = EFI_SUCCESS;\r
 \r
   SetUtilityName (UTILITY_NAME);\r
   \r
@@ -232,10 +228,11 @@ Returns:
   //\r
   memset (&mFvDataInfo, 0, sizeof (FV_INFO));\r
   memset (&mCapDataInfo, 0, sizeof (CAP_INFO)); \r
-       //\r
-       // Set the default FvGuid\r
-       //\r
-       memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID));\r
+  //\r
+  // Set the default FvGuid\r
+  //\r
+  memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID));\r
+  mFvDataInfo.ForceRebase = -1;\r
    \r
   //\r
   // Parse command line\r
@@ -312,7 +309,7 @@ Returns:
         return STATUS_ERROR;        \r
       }\r
       mFvDataInfo.FvBlocks[0].Length = (UINT32) TempNumber;\r
-      DebugMsg (NULL, 0, 9, "FV Block Size", "%s = 0x%x", EFI_BLOCK_SIZE_STRING, TempNumber);\r
+      DebugMsg (NULL, 0, 9, "FV Block Size", "%s = 0x%llx", EFI_BLOCK_SIZE_STRING, (unsigned long long) TempNumber);\r
       argc -= 2;\r
       argv += 2;\r
       continue; \r
@@ -329,19 +326,19 @@ Returns:
         return STATUS_ERROR;        \r
       }\r
       mFvDataInfo.FvBlocks[0].NumBlocks = (UINT32) TempNumber;\r
-      DebugMsg (NULL, 0, 9, "FV Number Block", "%s = 0x%x", EFI_NUM_BLOCKS_STRING, TempNumber);\r
+      DebugMsg (NULL, 0, 9, "FV Number Block", "%s = 0x%llx", EFI_NUM_BLOCKS_STRING, (unsigned long long) TempNumber);\r
       argc -= 2;\r
       argv += 2;\r
       continue; \r
     }\r
 \r
-    if ((stricmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {\r
+    if ((strcmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {\r
       if (argv[1] == NULL) {\r
         Error (NULL, 0, 1003, "Invalid option value", "Input Ffsfile can't be null");\r
         return STATUS_ERROR;\r
       }\r
       strcpy (mFvDataInfo.FvFiles[Index], argv[1]);\r
-      DebugMsg (NULL, 0, 9, "FV component file", "the %dth name is %s", Index + 1, argv[1]);\r
+      DebugMsg (NULL, 0, 9, "FV component file", "the %uth name is %s", (unsigned) Index + 1, argv[1]);\r
       argc -= 2;\r
       argv += 2;\r
 \r
@@ -356,8 +353,8 @@ Returns:
                        Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);\r
                        return STATUS_ERROR;        \r
                      }\r
-                     mFvDataInfo.SizeofFvFiles[Index] = TempNumber;\r
-               DebugMsg (NULL, 0, 9, "FV component file size", "the %dth size is %s", Index + 1, argv[1]);\r
+                     mFvDataInfo.SizeofFvFiles[Index] = (UINT32) TempNumber;\r
+               DebugMsg (NULL, 0, 9, "FV component file size", "the %uth size is %s", (unsigned) Index + 1, argv[1]);\r
                argc -= 2;\r
                argv += 2;\r
         }\r
@@ -377,6 +374,26 @@ Returns:
       argv ++;\r
       continue; \r
     }\r
+  \r
+    if ((strcmp (argv[0], "-F") == 0) || (stricmp (argv[0], "--force-rebase") == 0)) {\r
+      if (argv[1] == NULL) {\r
+        Error (NULL, 0, 1003, "Invalid option value", "Froce rebase flag can't be null");\r
+        return STATUS_ERROR;\r
+      }\r
+\r
+      if (stricmp (argv[1], "TRUE") == 0) {\r
+        mFvDataInfo.ForceRebase = 1;\r
+      } else if (stricmp (argv[1], "FALSE") == 0) {\r
+        mFvDataInfo.ForceRebase = 0;\r
+      } else {\r
+        Error (NULL, 0, 1003, "Invalid option value", "froce rebase flag value must be \"TRUE\" or \"FALSE\"");\r
+        return STATUS_ERROR;\r
+      }\r
+\r
+      argc -= 2;\r
+      argv += 2;\r
+      continue; \r
+    } \r
 \r
     if (stricmp (argv[0], "--capheadsize") == 0) {\r
       //\r
@@ -388,7 +405,7 @@ Returns:
         return STATUS_ERROR;        \r
       }\r
       mCapDataInfo.HeaderSize = (UINT32) TempNumber;\r
-      DebugMsg (NULL, 0, 9, "Capsule Header size", "%s = 0x%x", EFI_CAPSULE_HEADER_SIZE_STRING, TempNumber);\r
+      DebugMsg (NULL, 0, 9, "Capsule Header size", "%s = 0x%llx", EFI_CAPSULE_HEADER_SIZE_STRING, (unsigned long long) TempNumber);\r
       argc -= 2;\r
       argv += 2;\r
       continue; \r
@@ -406,6 +423,8 @@ Returns:
         mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE;\r
       } else if (strcmp (argv[1], "PersistAcrossReset") == 0) {\r
         mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET;\r
+      } else if (strcmp (argv[1], "InitiateReset") == 0) {\r
+        mCapDataInfo.Flags |= CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET;\r
       } else {\r
         Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);\r
         return STATUS_ERROR;\r
@@ -416,6 +435,22 @@ Returns:
       continue; \r
     }\r
 \r
+    if (stricmp (argv[0], "--capoemflag") == 0) {\r
+      if (argv[1] == NULL) {\r
+        Error (NULL, 0, 1003, "Invalid option value", "Capsule OEM flag can't be null");\r
+      }\r
+      Status = AsciiStringToUint64(argv[1], FALSE, &TempNumber);\r
+      if (EFI_ERROR (Status) || TempNumber > 0xffff) {\r
+        Error (NULL, 0, 1003, "Invalid option value", "Capsule OEM flag value must be integer value between 0x0000 and 0xffff");\r
+        return STATUS_ERROR;\r
+      }\r
+      mCapDataInfo.Flags |= TempNumber;\r
+      DebugMsg( NULL, 0, 9, "Capsule OEM Flags", argv[1]);\r
+      argc -= 2;\r
+      argv += 2;\r
+      continue;\r
+    }\r
+\r
     if (stricmp (argv[0], "--capguid") == 0) {\r
       //\r
       // Get the Capsule Guid\r
@@ -506,7 +541,7 @@ Returns:
         return STATUS_ERROR;\r
       }\r
       if (LogLevel > 9) {\r
-        Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", LogLevel);\r
+        Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);\r
         return STATUS_ERROR;\r
       }\r
       SetPrintLevel (LogLevel);\r
@@ -542,62 +577,6 @@ Returns:
     VerboseMsg ("the output file name is %s", OutFileName);\r
   }\r
   \r
-  //\r
-  // Read boot and runtime address from address file\r
-  //\r
-  if (AddrFileName != NULL) {\r
-    VerboseMsg ("the input address file name is %s", AddrFileName);\r
-    Status = GetFileImage (AddrFileName, &InfFileImage, &InfFileSize);\r
-    if (EFI_ERROR (Status)) {\r
-      return STATUS_ERROR;\r
-    }\r
-\r
-    AddrMemoryFile.FileImage           = InfFileImage;\r
-    AddrMemoryFile.CurrentFilePointer  = InfFileImage;\r
-    AddrMemoryFile.Eof                 = InfFileImage + InfFileSize;\r
-\r
-    //\r
-    // Read the boot driver base address for this FV image\r
-    //\r
-    Status = FindToken (&AddrMemoryFile, OPTIONS_SECTION_STRING, EFI_FV_BOOT_DRIVER_BASE_ADDRESS_STRING, 0, ValueString);\r
-    if (Status == EFI_SUCCESS) {\r
-      //\r
-      // Get the base address\r
-      //\r
-      Status = AsciiStringToUint64 (ValueString, FALSE, &TempNumber);\r
-      if (EFI_ERROR (Status)) {\r
-        Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_FV_BOOT_DRIVER_BASE_ADDRESS_STRING, ValueString);\r
-        return STATUS_ERROR;\r
-      }\r
-      mFvDataInfo.BootBaseAddress = TempNumber;\r
-      DebugMsg (NULL, 0, 9, "Boot driver base address", "%s = %s", EFI_FV_BOOT_DRIVER_BASE_ADDRESS_STRING, ValueString);\r
-    }\r
-  \r
-    //\r
-    // Read the FV runtime driver base address\r
-    //\r
-    Status = FindToken (&AddrMemoryFile, OPTIONS_SECTION_STRING, EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING, 0, ValueString);\r
-    if (Status == EFI_SUCCESS) {\r
-      //\r
-      // Get the base address\r
-      //\r
-      Status = AsciiStringToUint64 (ValueString, FALSE, &TempNumber);\r
-      if (EFI_ERROR (Status)) {\r
-        Error (NULL, 0, 2000, "Invalid parameter", "%s = %s", EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING, ValueString);\r
-        return STATUS_ERROR;\r
-      }\r
-      mFvDataInfo.RuntimeBaseAddress = TempNumber;\r
-      DebugMsg (NULL, 0, 9, "Runtime driver base address", "%s = %s", EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING, ValueString);\r
-    }\r
-    \r
-    //\r
-    // free the allocated memory space for addr file.\r
-    //\r
-    free (InfFileImage);\r
-    InfFileImage = NULL;\r
-    InfFileSize  = 0;\r
-  }\r
-\r
   //\r
   // Read the INF file image\r
   //\r
@@ -617,7 +596,7 @@ Returns:
     if (OutFileName == NULL) {\r
       FpFile = stdout;\r
     } else {\r
-      FpFile = fopen (OutFileName, "w");\r
+      FpFile = fopen (LongFilePath (OutFileName), "w");\r
       if (FpFile == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", OutFileName);\r
         return STATUS_ERROR;\r
@@ -625,20 +604,20 @@ Returns:
     }\r
     fprintf (FpFile, "Capsule %s Image Header Information\n", InfFileName);\r
     fprintf (FpFile, "  GUID                  %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", \r
-                    CapsuleHeader->CapsuleGuid.Data1,\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data2,\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data3,\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[0],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[1],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[2],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[3],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[4],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[5],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[6],\r
-                    (UINT32) CapsuleHeader->CapsuleGuid.Data4[7]);\r
-    fprintf (FpFile, "  Header size           0x%08X\n", CapsuleHeader->HeaderSize);\r
-    fprintf (FpFile, "  Flags                 0x%08X\n", CapsuleHeader->Flags);\r
-    fprintf (FpFile, "  Capsule image size    0x%08X\n", CapsuleHeader->CapsuleImageSize);\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data1,\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data2,\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data3,\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[0],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[1],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[2],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[3],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[4],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[5],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[6],\r
+                    (unsigned) CapsuleHeader->CapsuleGuid.Data4[7]);\r
+    fprintf (FpFile, "  Header size           0x%08X\n", (unsigned) CapsuleHeader->HeaderSize);\r
+    fprintf (FpFile, "  Flags                 0x%08X\n", (unsigned) CapsuleHeader->Flags);\r
+    fprintf (FpFile, "  Capsule image size    0x%08X\n", (unsigned) CapsuleHeader->CapsuleImageSize);\r
     fclose (FpFile);\r
   } else if (CapsuleFlag) {\r
     VerboseMsg ("Create capsule image");\r
@@ -656,8 +635,13 @@ Returns:
               );\r
   } else {\r
     VerboseMsg ("Create Fv image and its map file");\r
-    if (mFvDataInfo.BaseAddress != 0) {\r
-      VerboseMsg ("FvImage Rebase Address is 0x%X", mFvDataInfo.BaseAddress);\r
+    //\r
+    // Will take rebase action at below situation:\r
+    // 1. ForceRebase Flag specified to TRUE;\r
+    // 2. ForceRebase Flag not specified, BaseAddress greater than zero.\r
+    //\r
+    if (((mFvDataInfo.BaseAddress > 0) && (mFvDataInfo.ForceRebase == -1)) || (mFvDataInfo.ForceRebase == 1)) {\r
+      VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);\r
     }\r
     //\r
     // Call the GenerateFvImage to generate Fv Image\r
@@ -680,31 +664,29 @@ Returns:
   //\r
   //  update boot driver address and runtime driver address in address file\r
   //\r
-  if (Status == EFI_SUCCESS && AddrFileName != NULL) {\r
-    FpFile = fopen (AddrFileName, "w");\r
+  if (Status == EFI_SUCCESS && AddrFileName != NULL && mFvBaseAddressNumber > 0) {\r
+    FpFile = fopen (LongFilePath (AddrFileName), "w");\r
     if (FpFile == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", AddrFileName);\r
       return STATUS_ERROR;\r
     }\r
-    fprintf (FpFile, OPTIONS_SECTION_STRING);\r
+    fprintf (FpFile, FV_BASE_ADDRESS_STRING);\r
     fprintf (FpFile, "\n");\r
-    if (mFvDataInfo.BootBaseAddress != 0) {\r
-      fprintf (FpFile, EFI_FV_BOOT_DRIVER_BASE_ADDRESS_STRING);\r
-      fprintf (FpFile, " = 0x%lx\n", mFvDataInfo.BootBaseAddress);\r
-      DebugMsg (NULL, 0, 9, "Updated boot driver base address", "%s = 0x%x", EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING, mFvDataInfo.BootBaseAddress);\r
-    }\r
-    if (mFvDataInfo.RuntimeBaseAddress != 0) {\r
-      fprintf (FpFile, EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING);\r
-      fprintf (FpFile, " = 0x%lx\n", mFvDataInfo.RuntimeBaseAddress);\r
-      DebugMsg (NULL, 0, 9, "Updated runtime driver base address", "%s = 0x%x", EFI_FV_RUNTIME_DRIVER_BASE_ADDRESS_STRING, mFvDataInfo.RuntimeBaseAddress);\r
+    for (Index = 0; Index < mFvBaseAddressNumber; Index ++) {\r
+      fprintf (\r
+        FpFile,\r
+        "0x%llx\n",\r
+        (unsigned long long)mFvBaseAddress[Index]\r
+        );\r
     }\r
+    fflush (FpFile);\r
     fclose (FpFile);\r
   }\r
   \r
   if (Status == EFI_SUCCESS) {\r
-    DebugMsg (NULL, 0, 9, "The Total Fv Size", "%s = 0x%x", EFI_FV_TOTAL_SIZE_STRING, mFvTotalSize);\r
-    DebugMsg (NULL, 0, 9, "The used Fv Size", "%s = 0x%x", EFI_FV_TAKEN_SIZE_STRING, mFvTakenSize);\r
-    DebugMsg (NULL, 0, 9, "The space Fv size", "%s = 0x%x", EFI_FV_SPACE_SIZE_STRING, mFvTotalSize - mFvTakenSize);\r
+    DebugMsg (NULL, 0, 9, "The Total Fv Size", "%s = 0x%x", EFI_FV_TOTAL_SIZE_STRING, (unsigned) mFvTotalSize);\r
+    DebugMsg (NULL, 0, 9, "The used Fv Size", "%s = 0x%x", EFI_FV_TAKEN_SIZE_STRING, (unsigned) mFvTakenSize);\r
+    DebugMsg (NULL, 0, 9, "The space Fv size", "%s = 0x%x", EFI_FV_SPACE_SIZE_STRING, (unsigned) (mFvTotalSize - mFvTakenSize));\r
   }\r
 \r
   VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());\r