]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for GenericBdsLib
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Jul 2008 04:17:51 +0000 (04:17 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Jul 2008 04:17:51 +0000 (04:17 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5545 6f19259b-4bc3-4df7-8a09-765794883524

13 files changed:
MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
MdeModulePkg/Library/GenericBdsLib/BdsConnect.c
MdeModulePkg/Library/GenericBdsLib/BdsConsole.c
MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
MdeModulePkg/Library/GenericBdsLib/DevicePath.c
MdeModulePkg/Library/GenericBdsLib/Ebc/BmMachine.h [deleted file]
MdeModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
MdeModulePkg/Library/GenericBdsLib/Ia32/BmMachine.h [deleted file]
MdeModulePkg/Library/GenericBdsLib/InternalBdsLib.h
MdeModulePkg/Library/GenericBdsLib/Ipf/BmMachine.h [deleted file]
MdeModulePkg/Library/GenericBdsLib/Performance.c
MdeModulePkg/Library/GenericBdsLib/x64/BmMachine.h [deleted file]
MdeModulePkg/MdeModulePkg.dec

index 14df23af353dc024306440e5a3df80512fd70ba1..18738be8a85bb452f7f03af6d434df8f2e75b8de 100644 (file)
@@ -17,10 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 BOOLEAN mEnumBootDevice = FALSE;\r
 \r
-//\r
-// This GUID is used for an EFI Variable that stores the front device pathes\r
-// for a partial device path that starts with the HD node.\r
-//\r
+///\r
+/// This GUID is used for an EFI Variable that stores the front device pathes\r
+/// for a partial device path that starts with the HD node.\r
+///\r
 EFI_GUID  mHdBootVariablePrivateGuid = { 0xfab7e9e1, 0x39dd, 0x4f2b, { 0x84, 0x8, 0xe2, 0xe, 0x90, 0x6c, 0xb6, 0xde } };\r
 \r
 \r
@@ -182,10 +182,11 @@ BdsLibBootViaBootOption (
     //\r
     InitializeListHead (&TempBootLists);\r
     BdsLibRegisterNewOption (&TempBootLists, DevicePath, L"EFI Internal Shell", L"BootOrder");\r
+    \r
     //\r
     // free the temporary device path created by BdsLibUpdateFvFileDevicePath()\r
     //\r
-    gBS->FreePool (DevicePath); \r
+    SafeFreePool (DevicePath); \r
     DevicePath = Option->DevicePath;\r
   }\r
 \r
@@ -222,7 +223,7 @@ BdsLibBootViaBootOption (
     // Load the default boot file \EFI\BOOT\boot{machinename}.EFI from removable Media\r
     //  machinename is ia32, ia64, x64, ...\r
     //\r
-    FilePath = FileDevicePath (Handle, DEFAULT_REMOVABLE_FILE_NAME);\r
+    FilePath = FileDevicePath (Handle, (CONST CHAR16*)PcdGetPtr(PcdDefaultBootFileName));\r
     if (FilePath != NULL) {\r
       Status = gBS->LoadImage (\r
                       TRUE,\r
@@ -340,6 +341,7 @@ BdsExpandPartitionPartialDevicePathToFull (
                       &mHdBootVariablePrivateGuid,\r
                       &CachedDevicePathSize\r
                       );\r
+                      \r
   if (CachedDevicePath != NULL) {\r
     TempNewDevicePath = CachedDevicePath;\r
     DeviceExist = FALSE;\r
@@ -374,7 +376,7 @@ BdsExpandPartitionPartialDevicePathToFull (
       // Find the matched device path.\r
       // Append the file path infomration from the boot option and return the fully expanded device path.\r
       //\r
-      DevicePath    = NextDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *) HardDriveDevicePath);\r
+      DevicePath     = NextDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *) HardDriveDevicePath);\r
       FullDevicePath = AppendDevicePath (Instance, DevicePath);\r
 \r
       //\r
@@ -385,13 +387,14 @@ BdsExpandPartitionPartialDevicePathToFull (
         // First delete the matched instance.\r
         //\r
         TempNewDevicePath = CachedDevicePath;\r
-        CachedDevicePath = BdsLibDelPartMatchInstance ( CachedDevicePath, Instance );\r
+        CachedDevicePath  = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );\r
         SafeFreePool (TempNewDevicePath);\r
+        \r
         //\r
         // Second, append the remaining parth after the matched instance\r
         //\r
         TempNewDevicePath = CachedDevicePath;\r
-        CachedDevicePath = AppendDevicePathInstance ( Instance, CachedDevicePath );\r
+        CachedDevicePath = AppendDevicePathInstance (Instance, CachedDevicePath );\r
         SafeFreePool (TempNewDevicePath);\r
         //\r
         // Save the matching Device Path so we don't need to do a connect all next time\r
@@ -404,8 +407,9 @@ BdsExpandPartitionPartialDevicePathToFull (
                         CachedDevicePath\r
                         );\r
       }\r
-      SafeFreePool(Instance);\r
-      gBS->FreePool (CachedDevicePath);\r
+      \r
+      SafeFreePool (Instance);\r
+      SafeFreePool (CachedDevicePath);\r
       return FullDevicePath;\r
     }\r
   }\r
@@ -501,12 +505,12 @@ BdsExpandPartitionPartialDevicePathToFull (
       break;\r
     }\r
   }\r
-  gBS->FreePool (CachedDevicePath);\r
-  gBS->FreePool (BlockIoBuffer);\r
+  \r
+  SafeFreePool (CachedDevicePath);\r
+  SafeFreePool (BlockIoBuffer);\r
   return FullDevicePath;\r
 }\r
 \r
-\r
 /**\r
   Check whether there is a instance in BlockIoDevicePath, which contain multi device path\r
   instances, has the same partition node with HardDriveDevicePath device path\r
@@ -516,7 +520,7 @@ BdsExpandPartitionPartialDevicePathToFull (
                                  device path.\r
 \r
   @retval TRUE                   There is a matched device path instance FALSE\r
-                                 -There is no matched device path instance\r
+  @retval FALSE                  There is no matched device path instance\r
 \r
 **/\r
 BOOLEAN\r
@@ -535,10 +539,11 @@ MatchPartitionDevicePathNode (
   if ((BlockIoDevicePath == NULL) || (HardDriveDevicePath == NULL)) {\r
     return FALSE;\r
   }\r
+  \r
   //\r
   // Make PreviousDevicePath == the device path node before the end node\r
   //\r
-  DevicePath          = BlockIoDevicePath;\r
+  DevicePath              = BlockIoDevicePath;\r
   BlockIoHdDevicePathNode = NULL;\r
 \r
   //\r
@@ -564,6 +569,7 @@ MatchPartitionDevicePathNode (
   TmpHdPath = (HARDDRIVE_DEVICE_PATH *) BlockIoHdDevicePathNode;\r
   TempPath  = (HARDDRIVE_DEVICE_PATH *) BdsLibUnpackDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) HardDriveDevicePath);\r
   Match = FALSE;\r
+  \r
   //\r
   // Check for the match\r
   //\r
@@ -585,7 +591,6 @@ MatchPartitionDevicePathNode (
   return Match;\r
 }\r
 \r
-\r
 /**\r
   Delete the boot option associated with the handle passed in.\r
 \r
@@ -620,21 +625,30 @@ BdsLibDeleteOptionFromHandle (
   BootOrder     = NULL;\r
   BootOrderSize = 0;\r
 \r
+  //\r
+  // Check "BootOrder" variable, if no, means there is no any boot order.\r
+  //\r
   BootOrder = BdsLibGetVariableAndSize (\r
                 L"BootOrder",\r
                 &gEfiGlobalVariableGuid,\r
                 &BootOrderSize\r
                 );\r
-  if (NULL == BootOrder) {\r
+  if (BootOrder == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
+  //\r
+  // Convert device handle to device path protocol instance\r
+  //\r
   DevicePath = DevicePathFromHandle (Handle);\r
   if (DevicePath == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
   DevicePathSize = GetDevicePathSize (DevicePath);\r
 \r
+  //\r
+  // Loop all boot order variable and find the matching device path\r
+  //\r
   Index = 0;\r
   while (Index < BootOrderSize / sizeof (UINT16)) {\r
     UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", BootOrder[Index]);\r
@@ -643,8 +657,9 @@ BdsLibDeleteOptionFromHandle (
                       &gEfiGlobalVariableGuid,\r
                       &BootOptionSize\r
                       );\r
-    if (NULL == BootOptionVar) {\r
-      gBS->FreePool (BootOrder);\r
+                      \r
+    if (BootOptionVar == NULL) {\r
+      SafeFreePool (BootOrder);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -660,14 +675,17 @@ BdsLibDeleteOptionFromHandle (
     if ((OptionDevicePathSize == DevicePathSize) &&\r
         (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {\r
       BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);\r
-      gBS->FreePool (BootOptionVar);\r
+      SafeFreePool (BootOptionVar);\r
       break;\r
     }\r
 \r
-    gBS->FreePool (BootOptionVar);\r
+    SafeFreePool (BootOptionVar);\r
     Index++;\r
   }\r
 \r
+  //\r
+  // Adjust number of boot option for "BootOrder" variable.\r
+  //\r
   Status = gRT->SetVariable (\r
                   L"BootOrder",\r
                   &gEfiGlobalVariableGuid,\r
@@ -676,7 +694,7 @@ BdsLibDeleteOptionFromHandle (
                   BootOrder\r
                   );\r
 \r
-  gBS->FreePool (BootOrder);\r
+  SafeFreePool (BootOrder);\r
 \r
   return Status;\r
 }\r
@@ -686,8 +704,6 @@ BdsLibDeleteOptionFromHandle (
   Delete all invalid EFI boot options. The probable invalid boot option could\r
   be Removable media or Network boot device.\r
 \r
-  VOID\r
-\r
   @retval EFI_SUCCESS            Delete all invalid boot option success\r
   @retval EFI_NOT_FOUND          Variable "BootOrder" is not found\r
   @retval EFI_OUT_OF_RESOURCES   Lack of memory resource\r
@@ -714,6 +730,9 @@ BdsDeleteAllInvalidEfiBootOption (
   BootOrder     = NULL;\r
   BootOrderSize = 0;\r
 \r
+  //\r
+  // Check "BootOrder" variable firstly, this variable hold the number of boot options\r
+  //\r
   BootOrder = BdsLibGetVariableAndSize (\r
                 L"BootOrder",\r
                 &gEfiGlobalVariableGuid,\r
@@ -732,7 +751,7 @@ BdsDeleteAllInvalidEfiBootOption (
                       &BootOptionSize\r
                       );\r
     if (NULL == BootOptionVar) {\r
-      gBS->FreePool (BootOrder);\r
+      SafeFreePool (BootOrder);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -746,7 +765,7 @@ BdsDeleteAllInvalidEfiBootOption (
     //\r
     if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
         (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
-      gBS->FreePool (BootOptionVar);\r
+      SafeFreePool (BootOptionVar);\r
       Index++;\r
       continue;\r
     }\r
@@ -768,7 +787,7 @@ BdsDeleteAllInvalidEfiBootOption (
       BootOrder[Index] = 0xffff;\r
     }\r
 \r
-    gBS->FreePool (BootOptionVar);\r
+    SafeFreePool (BootOptionVar);\r
     Index++;\r
   }\r
 \r
@@ -790,7 +809,7 @@ BdsDeleteAllInvalidEfiBootOption (
                   BootOrder\r
                   );\r
 \r
-  gBS->FreePool (BootOrder);\r
+  SafeFreePool (BootOrder);\r
 \r
   return Status;\r
 }\r
@@ -842,11 +861,12 @@ BdsLibEnumerateAllBootOption (
   EFI_IMAGE_OPTIONAL_HEADER_UNION       HdrData;\r
   EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
 \r
-  FloppyNumber = 0;\r
-  CdromNumber = 0;\r
-  UsbNumber = 0;\r
-  MiscNumber = 0;\r
+  FloppyNumber  = 0;\r
+  CdromNumber   = 0;\r
+  UsbNumber     = 0;\r
+  MiscNumber    = 0;\r
   ZeroMem (Buffer, sizeof (Buffer));\r
+  \r
   //\r
   // If the boot device enumerate happened, just get the boot\r
   // device from the boot order variable\r
@@ -855,6 +875,7 @@ BdsLibEnumerateAllBootOption (
     BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");\r
     return EFI_SUCCESS;\r
   }\r
+  \r
   //\r
   // Notes: this dirty code is to get the legacy boot option from the\r
   // BBS table and create to variable as the EFI boot option, it should\r
@@ -866,6 +887,7 @@ BdsLibEnumerateAllBootOption (
   // Delete invalid boot option\r
   //\r
   BdsDeleteAllInvalidEfiBootOption ();\r
+  \r
   //\r
   // Parse removable media\r
   //\r
@@ -876,6 +898,7 @@ BdsLibEnumerateAllBootOption (
         &NumberBlockIoHandles,\r
         &BlockIoHandles\r
         );\r
+        \r
   for (Index = 0; Index < NumberBlockIoHandles; Index++) {\r
     Status = gBS->HandleProtocol (\r
                     BlockIoHandles[Index],\r
@@ -950,7 +973,7 @@ BdsLibEnumerateAllBootOption (
   }\r
 \r
   if (NumberBlockIoHandles != 0) {\r
-    gBS->FreePool (BlockIoHandles);\r
+    SafeFreePool (BlockIoHandles);\r
   }\r
 \r
   //\r
@@ -985,7 +1008,7 @@ BdsLibEnumerateAllBootOption (
     NeedDelete = TRUE;\r
     Status     = BdsLibGetImageHeader (\r
                    FileSystemHandles[Index],\r
-                   DEFAULT_REMOVABLE_FILE_NAME,\r
+                   (CHAR16*)PcdGetPtr (PcdDefaultBootFileName),\r
                    &DosHeader,\r
                    Hdr\r
                    );\r
@@ -1012,7 +1035,7 @@ BdsLibEnumerateAllBootOption (
   }\r
 \r
   if (NumberFileSystemHandles != 0) {\r
-    gBS->FreePool (FileSystemHandles);\r
+    SafeFreePool (FileSystemHandles);\r
   }\r
 \r
   //\r
@@ -1035,7 +1058,7 @@ BdsLibEnumerateAllBootOption (
   }\r
 \r
   if (NumberSimpleNetworkHandles != 0) {\r
-    gBS->FreePool (SimpleNetworkHandles);\r
+    SafeFreePool (SimpleNetworkHandles);\r
   }\r
 \r
   //\r
@@ -1089,7 +1112,7 @@ BdsLibEnumerateAllBootOption (
   }\r
 \r
   if (FvHandleCount != 0) {\r
-    gBS->FreePool (FvHandleBuffer);\r
+    SafeFreePool (FvHandleBuffer);\r
   }\r
   //\r
   // Make sure every boot only have one time\r
@@ -1101,7 +1124,6 @@ BdsLibEnumerateAllBootOption (
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
 /**\r
   Build the boot option with the handle parsed in.\r
 \r
@@ -1156,12 +1178,7 @@ BdsLibBuildOptionFromShell (
   // Build the shell device path\r
   //\r
   EfiInitializeFwVolDevicepathNode (&ShellNode, &gEfiShellFileGuid);\r
-  //\r
-  //ShellNode.Header.Type     = MEDIA_DEVICE_PATH;\r
-  //ShellNode.Header.SubType  = MEDIA_FV_FILEPATH_DP;\r
-  //SetDevicePathNodeLength (&ShellNode.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
-  //CopyMem (&ShellNode.NameGuid, &gEfiShellFileGuid, sizeof (EFI_GUID));\r
-  //\r
+\r
   DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &ShellNode);\r
 \r
   //\r
@@ -1171,7 +1188,6 @@ BdsLibBuildOptionFromShell (
 \r
 }\r
 \r
-\r
 /**\r
   Boot from the EFI1.1 spec defined "BootNext" variable\r
 \r
@@ -1225,8 +1241,6 @@ BdsLibBootNext (
 \r
 }\r
 \r
-\r
-\r
 /**\r
   Return the bootable media handle.\r
   First, check the device is connected\r
@@ -1264,6 +1278,7 @@ BdsLibGetBootableHandle (
   EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr;\r
 \r
   UpdatedDevicePath = DevicePath;\r
+  \r
   //\r
   // Check whether the device is connected\r
   //\r
@@ -1278,7 +1293,7 @@ BdsLibGetBootableHandle (
       // Fail to find the proper BlockIo and simple file protocol, maybe because device not present,  we need to connect it firstly\r
       //\r
       UpdatedDevicePath = DevicePath;\r
-      Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);\r
+      Status            = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);\r
       gBS->ConnectController (Handle, NULL, NULL, TRUE);\r
     }\r
   } else {\r
@@ -1302,7 +1317,7 @@ BdsLibGetBootableHandle (
                BlockIo->Media->BlockSize,\r
                Buffer\r
                );\r
-      gBS->FreePool (Buffer);\r
+      SafeFreePool(Buffer);\r
     }\r
   }\r
 \r
@@ -1361,7 +1376,7 @@ BdsLibGetBootableHandle (
       Hdr.Union = &HdrData;\r
       Status = BdsLibGetImageHeader (\r
                  SimpleFileSystemHandles[Index],\r
-                 DEFAULT_REMOVABLE_FILE_NAME,\r
+                 (CHAR16*)PcdGetPtr(PcdDefaultBootFileName),\r
                  &DosHeader,\r
                  Hdr\r
                  );\r
@@ -1374,19 +1389,13 @@ BdsLibGetBootableHandle (
     }\r
   }\r
 \r
-  if (DupDevicePath != NULL) {\r
-    SafeFreePool(DupDevicePath);\r
-  }\r
-  if (SimpleFileSystemHandles !=NULL ) {\r
-    gBS->FreePool (SimpleFileSystemHandles);\r
-  }\r
+  SafeFreePool(DupDevicePath);\r
+\r
+  SafeFreePool(SimpleFileSystemHandles);\r
 \r
   return ReturnHandle;\r
 }\r
 \r
-\r
-\r
-\r
 /**\r
   Check to see if the network cable is plugged in. If the DevicePath is not\r
   connected it will be connected.\r
@@ -1458,8 +1467,6 @@ BdsLibNetworkBootWithMediaPresent (
   return MediaPresent;\r
 }\r
 \r
-\r
-\r
 /**\r
   For a bootable Device path, return its boot type.\r
 \r
@@ -1554,16 +1561,15 @@ BdsGetBootTypeFromDevicePath (
   return BDS_EFI_UNSUPPORT;\r
 }\r
 \r
-\r
 /**\r
   Check whether the Device path in a boot option point to a valide bootable device,\r
   And if CheckMedia is true, check the device is ready to boot now.\r
 \r
-  @param DevPath -- the Device path in a boot option\r
-  @param CheckMedia -- if true, check the device is ready to boot now.\r
+  @param DevPath        the Device path in a boot option\r
+  @param CheckMedia     if true, check the device is ready to boot now.\r
 \r
-  @return TRUE      -- the Device path  is valide\r
-  @return FALSE   -- the Device path  is invalide .\r
+  @retval TRUE          the Device path  is valide\r
+  @retval FALSE         the Device path  is invalide .\r
 \r
 **/\r
 BOOLEAN\r
@@ -1581,6 +1587,7 @@ BdsLibIsValidEFIBootOptDevicePath (
 \r
   TempDevicePath = DevPath;\r
   LastDeviceNode = DevPath;\r
+  \r
   //\r
   // Check if it's a valid boot option for network boot device\r
   // Only check if there is SimpleNetworkProtocol installed. If yes, that means\r
@@ -1603,6 +1610,7 @@ BdsLibIsValidEFIBootOptDevicePath (
                     &Handle\r
                     );\r
   }\r
+  \r
   if (!EFI_ERROR (Status)) {\r
     if (CheckMedia) {\r
       //\r
@@ -1642,7 +1650,7 @@ BdsLibIsValidEFIBootOptDevicePath (
       return TRUE;\r
     } else {\r
       if (Status == EFI_SUCCESS) {\r
-        gBS->FreePool (TempDevicePath); \r
+        SafeFreePool (TempDevicePath); \r
       }\r
       return FALSE;\r
     }\r
@@ -1666,6 +1674,7 @@ BdsLibIsValidEFIBootOptDevicePath (
       Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);\r
     }\r
   }\r
+  \r
   if (!EFI_ERROR (Status)) {\r
     Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);\r
     if (!EFI_ERROR (Status)) {\r
@@ -1727,7 +1736,7 @@ EFI_STATUS
 EFIAPI\r
 BdsLibUpdateFvFileDevicePath (\r
   IN  OUT EFI_DEVICE_PATH_PROTOCOL      ** DevicePath,\r
-  IN  EFI_GUID                          *FileGuid\r
+  IN      EFI_GUID                      *FileGuid\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL      *TempDevicePath;\r
@@ -1754,6 +1763,7 @@ BdsLibUpdateFvFileDevicePath (
   if (FileGuid == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+  \r
   //\r
   // Check whether the device path point to the default the input Fv file\r
   //\r
@@ -1885,9 +1895,8 @@ BdsLibUpdateFvFileDevicePath (
       FoundFvHandle = FvHandleBuffer[Index];\r
       break;\r
     }\r
-    if (FvHandleBuffer !=NULL ) {\r
-      FreePool (FvHandleBuffer);  \r
-    }\r
+    \r
+    SafeFreePool (FvHandleBuffer);  \r
   }\r
 \r
   if (FindFvFile) {\r
index 07d5c3832033771cbb92c61fe107d4bc73be5e13..5e7d13fb826ed2b0f530648ae9bb9c36b5a593fe 100644 (file)
@@ -52,10 +52,6 @@ BdsLibConnectAll (
   have. After this we should get all the device work and console avariable\r
   if the system have console device.\r
 \r
-  None\r
-\r
-  @return None\r
-\r
 **/\r
 VOID\r
 BdsLibGenericConnectAll (\r
@@ -180,7 +176,7 @@ BdsLibConnectDevicePath (
   } while (DevicePath != NULL);\r
 \r
   if (CopyOfDevicePath != NULL) {\r
-    gBS->FreePool (CopyOfDevicePath);\r
+    SafeFreePool (CopyOfDevicePath);\r
   }\r
   //\r
   // All handle with DevicePath exists in the handle database\r
@@ -224,7 +220,7 @@ BdsLibConnectAllEfi (
     Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  SafeFreePool (HandleBuffer);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -267,7 +263,7 @@ BdsLibDisconnectAllEfi (
     Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  SafeFreePool (HandleBuffer);\r
 \r
   return EFI_SUCCESS;\r
 }\r
index 9f77553ec2e2dbb2a67da7bbaa9f11e11eee9524..dacc9c22d19eca8d47d6ba5e50c1d001acf1e511 100644 (file)
@@ -40,7 +40,7 @@ IsNvNeed (
     Ptr++;\r
   }\r
 \r
-  if ((*(Ptr-3) == 'D') && (*(Ptr-2) == 'e') && (*(Ptr-1) == 'v')) {\r
+  if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {\r
     return FALSE;\r
   } else {\r
     return TRUE;\r
@@ -261,7 +261,7 @@ BdsLibConnectConsoleVariable (
     SafeFreePool(Instance);\r
   } while (CopyOfDevicePath != NULL);\r
 \r
-  gBS->FreePool (StartDevicePath);\r
+  SafeFreePool (StartDevicePath);\r
 \r
   if (!DeviceExist) {\r
     return EFI_NOT_FOUND;\r
@@ -340,7 +340,6 @@ BdsLibConnectAllConsoles (
 \r
 }\r
 \r
-\r
 /**\r
   This function will connect console device base on the console\r
   device variable ConIn, ConOut and ErrOut.\r
index c96aa23cabde29c6536e1ecdc5c0292098b2a2c4..56b9f8537ee0ed0bb0c22d8de0aec61c3e28b30c 100644 (file)
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define MAX_STRING_LEN        200\r
 \r
 BOOLEAN   mFeaturerSwitch = TRUE;\r
-BOOLEAN   mResetRequired = FALSE;\r
+BOOLEAN   mResetRequired  = FALSE;\r
 \r
 extern UINT16 gPlatformBootTimeOutDefault;\r
 \r
@@ -69,7 +69,6 @@ BdsLibGetTimeout (
   return Timeout;\r
 }\r
 \r
-\r
 /**\r
   The function will go through the driver optoin link list, load and start\r
   every driver the driver optoin device path point to.\r
@@ -99,6 +98,7 @@ BdsLibLoadDrivers (
   //\r
   for (Link = BdsDriverLists->ForwardLink; Link != BdsDriverLists; Link = Link->ForwardLink) {\r
     Option = CR (Link, BDS_COMMON_OPTION, Link, BDS_LOAD_OPTION_SIGNATURE);\r
+    \r
     //\r
     // If a load option is not marked as LOAD_OPTION_ACTIVE,\r
     // the boot manager will not automatically load the option.\r
@@ -106,6 +106,7 @@ BdsLibLoadDrivers (
     if (!IS_LOAD_OPTION_TYPE (Option->Attribute, LOAD_OPTION_ACTIVE)) {\r
       continue;\r
     }\r
+    \r
     //\r
     // If a driver load option is marked as LOAD_OPTION_FORCE_RECONNECT,\r
     // then all of the EFI drivers in the system will be disconnected and\r
@@ -114,6 +115,7 @@ BdsLibLoadDrivers (
     if (IS_LOAD_OPTION_TYPE (Option->Attribute, LOAD_OPTION_FORCE_RECONNECT)) {\r
       ReconnectAll = TRUE;\r
     }\r
+    \r
     //\r
     // Make sure the driver path is connected.\r
     //\r
@@ -162,6 +164,7 @@ BdsLibLoadDrivers (
       gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);\r
     }\r
   }\r
+  \r
   //\r
   // Process the LOAD_OPTION_FORCE_RECONNECT driver option\r
   //\r
@@ -172,7 +175,6 @@ BdsLibLoadDrivers (
 \r
 }\r
 \r
-\r
 /**\r
   Get the Option Number that does not used.\r
   Try to locate the specific option variable one by one untile find a free number.\r
@@ -187,7 +189,6 @@ BdsLibGetFreeOptionNumber (
   IN  CHAR16    *VariableName\r
   )\r
 {\r
-  UINT16        Number;\r
   UINTN         Index;\r
   CHAR16        StrTemp[10];\r
   UINT16        *OptionBuffer;\r
@@ -207,18 +208,17 @@ BdsLibGetFreeOptionNumber (
     // try if the option number is used\r
     //\r
     OptionBuffer = BdsLibGetVariableAndSize (\r
-              StrTemp,\r
-              &gEfiGlobalVariableGuid,\r
-              &OptionSize\r
-              );\r
+                     StrTemp,\r
+                     &gEfiGlobalVariableGuid,\r
+                     &OptionSize\r
+                     );\r
     if (OptionBuffer == NULL) {\r
       break;\r
     }\r
-    Index++;\r
-  } while (1);\r
+    Index ++;\r
+  } while (TRUE);\r
 \r
-  Number = (UINT16) Index;\r
-  return Number;\r
+  return ((UINT16) Index);\r
 }\r
 \r
 \r
@@ -272,6 +272,7 @@ BdsLibRegisterNewOption (
   Description           = NULL;\r
   OptionOrderPtr        = NULL;\r
   UpdateDescription     = FALSE;\r
+  Status                = EFI_SUCCESS;\r
   ZeroMem (OptionName, sizeof (OptionName));\r
 \r
   TempOptionSize = 0;\r
@@ -300,11 +301,11 @@ BdsLibRegisterNewOption (
     if (OptionPtr == NULL) {\r
       continue;\r
     }\r
-    TempPtr = OptionPtr;\r
-    TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
-    Description = (CHAR16 *) TempPtr;\r
-    TempPtr += StrSize ((CHAR16 *) TempPtr);\r
-    OptionDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
+    TempPtr         =   OptionPtr;\r
+    TempPtr         +=  sizeof (UINT32) + sizeof (UINT16);\r
+    Description     =   (CHAR16 *) TempPtr;\r
+    TempPtr         +=  StrSize ((CHAR16 *) TempPtr);\r
+    OptionDevicePath =  (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
 \r
     //\r
     // Notes: the description may will change base on the GetStringToken\r
@@ -314,32 +315,32 @@ BdsLibRegisterNewOption (
         //\r
         // Got the option, so just return\r
         //\r
-        gBS->FreePool (OptionPtr);\r
-        gBS->FreePool (TempOptionPtr);\r
+        SafeFreePool (OptionPtr);\r
+        SafeFreePool (TempOptionPtr);\r
         return EFI_SUCCESS;\r
       } else {\r
         //\r
         // Option description changed, need update.\r
         //\r
         UpdateDescription = TRUE;\r
-        gBS->FreePool (OptionPtr);\r
+        SafeFreePool (OptionPtr);\r
         break;\r
       }\r
     }\r
 \r
-    gBS->FreePool (OptionPtr);\r
+    SafeFreePool (OptionPtr);\r
   }\r
 \r
   OptionSize          = sizeof (UINT32) + sizeof (UINT16) + StrSize (String);\r
-  OptionSize += GetDevicePathSize (DevicePath);\r
+  OptionSize          += GetDevicePathSize (DevicePath);\r
   OptionPtr           = AllocateZeroPool (OptionSize);\r
   TempPtr             = OptionPtr;\r
   *(UINT32 *) TempPtr = LOAD_OPTION_ACTIVE;\r
-  TempPtr += sizeof (UINT32);\r
+  TempPtr             += sizeof (UINT32);\r
   *(UINT16 *) TempPtr = (UINT16) GetDevicePathSize (DevicePath);\r
-  TempPtr += sizeof (UINT16);\r
+  TempPtr             += sizeof (UINT16);\r
   CopyMem (TempPtr, String, StrSize (String));\r
-  TempPtr += StrSize (String);\r
+  TempPtr             += StrSize (String);\r
   CopyMem (TempPtr, DevicePath, GetDevicePathSize (DevicePath));\r
 \r
   if (UpdateDescription) {\r
@@ -371,12 +372,12 @@ BdsLibRegisterNewOption (
   // Return if only need to update a changed description or fail to set option.\r
   //\r
   if (EFI_ERROR (Status) || UpdateDescription) {\r
-    gBS->FreePool (OptionPtr);\r
-    gBS->FreePool (TempOptionPtr);\r
+    SafeFreePool (OptionPtr);\r
+    SafeFreePool (TempOptionPtr);\r
     return Status;\r
   }\r
 \r
-  gBS->FreePool (OptionPtr);\r
+  SafeFreePool (OptionPtr);\r
 \r
   //\r
   // Update the option order variable\r
@@ -394,11 +395,8 @@ BdsLibRegisterNewOption (
                     sizeof (UINT16),\r
                     &BootOrderEntry\r
                     );\r
-    if (EFI_ERROR (Status)) {\r
-      gBS->FreePool (TempOptionPtr);\r
-      return Status;\r
-    }\r
-    return EFI_SUCCESS;\r
+    SafeFreePool (TempOptionPtr);\r
+    return Status;\r
   }\r
 \r
   //\r
@@ -417,16 +415,10 @@ BdsLibRegisterNewOption (
                   OrderItemNum * sizeof (UINT16),\r
                   OptionOrderPtr\r
                   );\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (TempOptionPtr);\r
-    gBS->FreePool (OptionOrderPtr);\r
-    return Status;\r
-  }\r
+  SafeFreePool (TempOptionPtr);\r
+  SafeFreePool (OptionOrderPtr);\r
 \r
-  gBS->FreePool (TempOptionPtr);\r
-  gBS->FreePool (OptionOrderPtr);\r
-\r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 \r
@@ -479,15 +471,15 @@ BdsLibVariableToOption (
   //\r
   // Get the option attribute\r
   //\r
-  TempPtr   = Variable;\r
-  Attribute = *(UINT32 *) Variable;\r
-  TempPtr += sizeof (UINT32);\r
+  TempPtr   =  Variable;\r
+  Attribute =  *(UINT32 *) Variable;\r
+  TempPtr   += sizeof (UINT32);\r
 \r
   //\r
   // Get the option's device path size\r
   //\r
-  FilePathSize = *(UINT16 *) TempPtr;\r
-  TempPtr += sizeof (UINT16);\r
+  FilePathSize =  *(UINT16 *) TempPtr;\r
+  TempPtr      += sizeof (UINT16);\r
 \r
   //\r
   // Get the option's description string\r
@@ -497,13 +489,13 @@ BdsLibVariableToOption (
   //\r
   // Get the option's description string size\r
   //\r
-  TempPtr += StrSize ((CHAR16 *) TempPtr);\r
+  TempPtr     += StrSize ((CHAR16 *) TempPtr);\r
 \r
   //\r
   // Get the option's device path\r
   //\r
-  DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
-  TempPtr += FilePathSize;\r
+  DevicePath =  (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
+  TempPtr    += FilePathSize;\r
 \r
   LoadOptions     = TempPtr;\r
   LoadOptionsSize = (UINT32) (VariableSize - (UINTN) (TempPtr - Variable));\r
@@ -544,17 +536,16 @@ BdsLibVariableToOption (
   //\r
   if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {\r
     InsertTailList (BdsCommonOptionList, &Option->Link);\r
-    gBS->FreePool (Variable);\r
+    SafeFreePool (Variable);\r
     return Option;\r
   }\r
 \r
-  gBS->FreePool (Variable);\r
-  gBS->FreePool (Option);\r
+  SafeFreePool (Variable);\r
+  SafeFreePool (Option);\r
   return NULL;\r
 \r
 }\r
 \r
-\r
 /**\r
   Process BootOrder, or DriverOrder variables, by calling\r
   BdsLibVariableToOption () for each UINT16 in the variables.\r
@@ -611,12 +602,11 @@ BdsLibBuildOptionFromVar (
 \r
   }\r
 \r
-  gBS->FreePool (OptionOrder);\r
+  SafeFreePool (OptionOrder);\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
 /**\r
   Get boot mode by looking up configuration table and parsing HOB list\r
 \r
@@ -636,7 +626,6 @@ BdsLibGetBootMode (
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
 /**\r
   Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r
   buffer, and the size of the buffer. If failure return NULL.\r
@@ -690,7 +679,6 @@ BdsLibGetVariableAndSize (
   return Buffer;\r
 }\r
 \r
-\r
 /**\r
   Delete the instance in Multi which matches partly with Single instance\r
 \r
@@ -749,7 +737,6 @@ BdsLibDelPartMatchInstance (
   return NewDevicePath;\r
 }\r
 \r
-\r
 /**\r
   Function compares a device path data structure to that of all the nodes of a\r
   second device path instance.\r
@@ -790,18 +777,17 @@ BdsLibMatchDevicePaths (
     // return success\r
     //\r
     if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
-      gBS->FreePool (DevicePathInst);\r
+      SafeFreePool (DevicePathInst);\r
       return TRUE;\r
     }\r
 \r
-    gBS->FreePool (DevicePathInst);\r
+    SafeFreePool (DevicePathInst);\r
     DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
   }\r
 \r
   return FALSE;\r
 }\r
 \r
-\r
 /**\r
   This function prints a series of strings.\r
 \r
@@ -977,8 +963,8 @@ SetupResetReminder (
         IfrLibCreatePopUp (2, &Key, StringBuffer1, StringBuffer2);\r
       } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));\r
 \r
-      gBS->FreePool (StringBuffer1);\r
-      gBS->FreePool (StringBuffer2);\r
+      SafeFreePool (StringBuffer1);\r
+      SafeFreePool (StringBuffer2);\r
       //\r
       // If the user hits the YES Response key, reset\r
       //\r
@@ -990,7 +976,6 @@ SetupResetReminder (
   }\r
 }\r
 \r
-\r
 /**\r
   Get the headers (dos, image, optional header) from an image.\r
 \r
@@ -1070,11 +1055,11 @@ BdsLibGetImageHeader (
     if (Status != EFI_BUFFER_TOO_SMALL) {\r
       goto Done;\r
     }\r
-    gBS->FreePool (Info);\r
+    SafeFreePool (Info);\r
   } while (TRUE);\r
 \r
   FileSize = Info->FileSize;\r
-  gBS->FreePool (Info);\r
+  SafeFreePool (Info);\r
 \r
   //\r
   // Read dos header\r
@@ -1139,8 +1124,6 @@ BdsLibGetImageHeader (
   @param Event           The event that triggered this notification function.\r
   @param Context         Pointer to the notification functions context.\r
 \r
-           EDES_TODO: Incomplete Descriptions  None.\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -1244,7 +1227,6 @@ BdsSetMemoryTypeInformationVariable (
   return;\r
 }\r
 \r
-\r
 /**\r
   This routine register a function to adjust the different type memory page number just before booting\r
   and save the updated info into the variable for next boot to use.\r
index fc6d420d5cbd7e38c91698ca5dd7409d3c489b1c..7435d544b6e8a90e7f81c419ff7cf45de5475e2f 100644 (file)
@@ -15,17 +15,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "InternalBdsLib.h"\r
 \r
-\r
-EFI_GUID  mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r
-\r
-EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;\r
-\r
-\r
 /**\r
 \r
   Adjusts the size of a previously allocated buffer.\r
 \r
-\r
   @param OldPool         A pointer to the buffer whose size is being adjusted.\r
   @param OldSize         The size of the current buffer.\r
   @param NewSize         The size of the new buffer.\r
@@ -52,13 +45,12 @@ ReallocatePool (
       CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
     }\r
 \r
-    gBS->FreePool (OldPool);\r
+    SafeFreePool (OldPool);\r
   }\r
 \r
   return NewPool;\r
 }\r
 \r
-\r
 /**\r
   Concatenates a formatted unicode string to allocated pool.\r
   The caller must free the resulting buffer.\r
@@ -116,7 +108,7 @@ CatPrint (
     Str->len = StringSize - sizeof (UINT16);\r
   }\r
 \r
-  gBS->FreePool (AppendStr);\r
+  SafeFreePool (AppendStr);\r
   return Str->str;\r
 }\r
 \r
@@ -314,22 +306,6 @@ DevPathVendor (
   switch (DevicePathType (&Vendor->Header)) {\r
   case HARDWARE_DEVICE_PATH:\r
     Type = L"Hw";\r
-// bugbug: nt 32 specific definition\r
-#if 0\r
-    //\r
-    // If the device is a winntbus device, we will give it a readable device name.\r
-    //\r
-    if (CompareGuid (&Vendor->Guid, &mEfiWinNtThunkProtocolGuid)) {\r
-      CatPrint (Str, L"%s", L"WinNtBus");\r
-      return ;\r
-    } else if (CompareGuid (&Vendor->Guid, &mEfiWinNtGopGuid)) {\r
-      CatPrint (Str, L"%s", L"GOP");\r
-      return ;\r
-    } else if (CompareGuid (&Vendor->Guid, &mEfiWinNtSerialPortGuid)) {\r
-      CatPrint (Str, L"%s", L"Serial");\r
-      return ;\r
-    }\r
-#endif\r
     break;\r
 \r
   case MESSAGING_DEVICE_PATH:\r
@@ -346,7 +322,7 @@ DevPathVendor (
     } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {\r
       CatPrint (Str, L"VenUft8()");\r
       return ;\r
-    } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {\r
+    } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid     )) {\r
       FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);\r
       switch (FlowControlMap & 0x00000003) {\r
       case 0:\r
@@ -367,7 +343,7 @@ DevPathVendor (
 \r
       return ;\r
 \r
-    } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {\r
+    } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {\r
       CatPrint (\r
         Str,\r
         L"SAS(%lx,%lx,%x,",\r
@@ -424,7 +400,6 @@ DevPathVendor (
   CatPrint (Str, L")");\r
 }\r
 \r
-\r
 /**\r
   Convert Device Path to a Unicode string for printing.\r
 \r
@@ -468,6 +443,7 @@ DevPathExtendedAcpi (
   )\r
 {\r
   ACPI_EXTENDED_HID_DEVICE_PATH   *ExtendedAcpi;\r
+  \r
   //\r
   // Index for HID, UID and CID strings, 0 for non-exist\r
   //\r
@@ -1550,7 +1526,7 @@ DevicePathToStr (
   //\r
   // Shrink pool used for string allocation\r
   //\r
-  gBS->FreePool (DevPath);\r
+  SafeFreePool (DevPath);\r
 \r
 Done:\r
   NewSize = (Str.len + 1) * sizeof (CHAR16);\r
@@ -1560,7 +1536,6 @@ Done:
   return Str.str;\r
 }\r
 \r
-\r
 /**\r
   Function creates a device path data structure that identically matches the\r
   device path passed in.\r
diff --git a/MdeModulePkg/Library/GenericBdsLib/Ebc/BmMachine.h b/MdeModulePkg/Library/GenericBdsLib/Ebc/BmMachine.h
deleted file mode 100644 (file)
index c0469d0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/** @file\r
-  Boot Manager Machine type\r
-\r
-Copyright (c) 2007 - 2008, 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
-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
-**/\r
-\r
-#ifndef _BM_MACHINE_H_\r
-#define _BM_MACHINE_H_\r
-\r
-//\r
-// NOTE: This is not defined in UEFI spec.\r
-//\r
-#define DEFAULT_REMOVABLE_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
-\r
-#endif\r
index 92231fef6f2cc04990f591091c589d91cc602588..5b7f753ed961bb759031315e9db2a11f9b24d94d 100644 (file)
   BdsBoot.c\r
   InternalBdsLib.h\r
 \r
-[Sources.Ia32]\r
-  Ia32/BmMachine.h\r
-\r
-[Sources.X64]\r
-  x64/BmMachine.h\r
-\r
 [Sources.IPF]\r
   Ipf/ShadowRom.c\r
-  Ipf/BmMachine.h\r
-\r
-[Sources.EBC]\r
-  Ebc/BmMachine.h\r
-\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
@@ -92,8 +81,9 @@
   gEfiFileInfoGuid                              # ALWAYS_CONSUMED\r
   gEfiPcAnsiGuid                                # ALWAYS_CONSUMED\r
   gEfiGenericPlatformVariableGuid               # ALWAYS_CONSUMED\r
-\r
-\r
+  gEfiUartDevicePathGuid                        # ALWAYS_CONSUMED\r
+  gEfiSasDevicePathGuid                         # ALWAYS_CONSUMED\r
+  \r
 [Protocols]\r
   gEfiSimpleFileSystemProtocolGuid              # PROTOCOL ALWAYS_CONSUMED\r
   gEfiSimpleTextOutProtocolGuid                 # PROTOCOL ALWAYS_CONSUMED\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDefaultBootFileName
\ No newline at end of file
diff --git a/MdeModulePkg/Library/GenericBdsLib/Ia32/BmMachine.h b/MdeModulePkg/Library/GenericBdsLib/Ia32/BmMachine.h
deleted file mode 100644 (file)
index 057717e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/** @file\r
-  Boot Manager Machine type\r
-\r
-Copyright (c) 2004 - 2008, 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
-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
-**/\r
-\r
-#ifndef _BM_MACHINE_H_\r
-#define _BM_MACHINE_H_\r
-\r
-#define DEFAULT_REMOVABLE_FILE_NAME L"\\EFI\\BOOT\\BOOTIA32.EFI"\r
-\r
-#endif\r
index 0ee38eee97ad153c503762d83a18eba81cb8a4c3..f8ff4c27be420aa40a9c93569bc418088b0c8002 100644 (file)
@@ -62,8 +62,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/GenericBdsLib.h>\r
 #include <Library/TimerLib.h>\r
 \r
-#include "BmMachine.h"\r
-\r
 #define PERFORMANCE_SIGNATURE   EFI_SIGNATURE_32 ('P', 'e', 'r', 'f')\r
 #define PERF_TOKEN_SIZE         28\r
 #define PERF_TOKEN_LENGTH       (PERF_TOKEN_SIZE - 1)\r
diff --git a/MdeModulePkg/Library/GenericBdsLib/Ipf/BmMachine.h b/MdeModulePkg/Library/GenericBdsLib/Ipf/BmMachine.h
deleted file mode 100644 (file)
index 06ae3dc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/** @file\r
-  Boot Manager Machine type\r
-\r
-Copyright (c) 2004 - 2008, 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
-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
-**/\r
-\r
-#ifndef _BM_MACHINE_H_\r
-#define _BM_MACHINE_H_\r
-\r
-#define DEFAULT_REMOVABLE_FILE_NAME L"\\EFI\\BOOT\\BOOTIA64.EFI"\r
-\r
-#endif\r
index 3b58351495278eab050b5aade77d90a3bba9012d..e88b50fa6a0066d0e75f6ffa3d7e98d5a1b75fb5 100644 (file)
@@ -221,6 +221,7 @@ WriteBootToOsPerformanceData (
     gBS->FreePages (AcpiLowMemoryBase, 1);\r
     return ;\r
   }\r
+  \r
   //\r
   // Get DXE drivers performance\r
   //\r
@@ -295,7 +296,7 @@ Done:
   mPerfHeader.Signiture = PERFORMANCE_SIGNATURE;\r
 \r
   //\r
-  // Put performance data to memory\r
+  // Put performance data to ACPI memory\r
   //\r
   CopyMem (\r
     (UINTN *) (UINTN) AcpiLowMemoryBase,\r
diff --git a/MdeModulePkg/Library/GenericBdsLib/x64/BmMachine.h b/MdeModulePkg/Library/GenericBdsLib/x64/BmMachine.h
deleted file mode 100644 (file)
index 5e218df..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/** @file\r
-  Boot Manager Machine type\r
-\r
-Copyright (c) 2005 - 2008, 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
-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
-**/\r
-\r
-#ifndef _BM_MACHINE_H_\r
-#define _BM_MACHINE_H_\r
-\r
-#define DEFAULT_REMOVABLE_FILE_NAME L"\\EFI\\BOOT\\BOOTX64.EFI"\r
-\r
-#endif\r
index b4cf2cf83c24686c0b1d2fb252a4b0c8dd32e3d3..afacf2874cf0d2675f0c0c3a9dfdbf2e5b33ebe9 100644 (file)
   gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10|UINT16|0x40000001\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002\r
 \r
+[PcdsFixedAtBuild.IA32]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDefaultBootFileName|L"\\EFI\\BOOT\\BOOTIA32.EFI"|VOID*|0x40000003\r
+\r
+[PcdsFixedAtBuild.X64]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDefaultBootFileName|L"\\EFI\\BOOT\\BOOTX64.EFI"|VOID*|0x40000003\r
+\r
+[PcdsFixedAtBuild.IPF]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDefaultBootFileName|L"\\EFI\\BOOT\\BOOTIA64.EFI"|VOID*|0x40000003\r
+\r
+[PcdsFixedAtBuild.EBC]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdDefaultBootFileName|L"\\EFI\\BOOT\\BOOTEBC.EFI"|VOID*|0x40000003\r
+  \r
 [PcdsDynamic.common]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x0|UINT32|0x30000001\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x0|UINT32|0x30000002\r