]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c
Remove all blanks lines to avoid build errors.
[mirror_edk2.git] / EdkNt32Pkg / Library / EdkGenericBdsLib / BdsBoot.c
index c9b1eede1c4a2794fa5e5bb4d9d414529afd380c..05c8e7d1e3de2ed879a5e7e00b1e5bd28e0b6c9c 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 - 2007, 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
@@ -30,7 +30,7 @@ BdsLibDoLegacyBoot (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Boot the legacy system with the boot option\r
 \r
 Arguments:\r
@@ -41,7 +41,7 @@ Returns:
 \r
   EFI_UNSUPPORTED  - There is no legacybios protocol, do not support\r
                      legacy boot.\r
-                         \r
+\r
   EFI_STATUS       - Return the status of LegacyBios->LegacyBoot ().\r
 \r
 --*/\r
@@ -89,15 +89,15 @@ BdsLibBootViaBootOption (
 \r
 Routine Description:\r
 \r
-  Process the boot option follow the EFI 1.1 specification and \r
+  Process the boot option follow the EFI 1.1 specification and\r
   special treat the legacy boot option with BBS_DEVICE_PATH.\r
 \r
 Arguments:\r
 \r
   Option       - The boot option need to be processed\r
-  \r
-  DevicePath   - The device path which describe where to load \r
-                 the boot image or the legcy BBS device path \r
+\r
+  DevicePath   - The device path which describe where to load\r
+                 the boot image or the legcy BBS device path\r
                  to boot the legacy OS\r
 \r
   ExitDataSize - Returned directly from gBS->StartImage ()\r
@@ -120,6 +120,13 @@ Returns:
   EFI_DEVICE_PATH_PROTOCOL  *FilePath;\r
   EFI_LOADED_IMAGE_PROTOCOL *ImageInfo;\r
   EFI_ACPI_S3_SAVE_PROTOCOL *AcpiS3Save;\r
+  EFI_BLOCK_IO_PROTOCOL     *BlkIo;\r
+  VOID                      *Buffer;\r
+\r
+  //\r
+  // Record the performance data for End of BDS\r
+  //\r
+  PERF_END (0, BDS_TOK, NULL, 0);\r
 \r
   *ExitDataSize = 0;\r
   *ExitData     = NULL;\r
@@ -156,7 +163,9 @@ Returns:
     //\r
     return EFI_SUCCESS;\r
   }\r
-\r
+  //\r
+  // Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event\r
+  //\r
   EfiSignalEventReadyToBoot ();\r
 \r
   //\r
@@ -209,6 +218,32 @@ Returns:
     if (!EFI_ERROR (Status) && IsDevicePathEnd (TempDevicePath)) {\r
       FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);\r
       if (FilePath) {\r
+        //\r
+        // Issue a dummy read to the device to check for media change.\r
+        // When the removable media is changed, any Block IO read/write will\r
+        // cause the BlockIo protocol be reinstalled and EFI_MEDIA_CHANGED is\r
+        // returned. After the Block IO protocol is reinstalled, subsequent\r
+        // Block IO read/write will success.\r
+        //\r
+        Status = gBS->HandleProtocol (\r
+                        Handle,\r
+                        &gEfiBlockIoProtocolGuid,\r
+                        (VOID **) &BlkIo\r
+                        );\r
+        if (!EFI_ERROR (Status)) {\r
+          Buffer = AllocatePool (BlkIo->Media->BlockSize);\r
+          if (Buffer != NULL) {\r
+            BlkIo->ReadBlocks (\r
+                     BlkIo,\r
+                     BlkIo->Media->MediaId,\r
+                     0,\r
+                     BlkIo->Media->BlockSize,\r
+                     Buffer\r
+                     );\r
+            FreePool (Buffer);\r
+          }\r
+        }\r
+\r
         Status = gBS->LoadImage (\r
                         TRUE,\r
                         mBdsImageHandle,\r
@@ -289,8 +324,8 @@ BdsBootByDiskSignatureAndPartition (
 Routine Description:\r
 \r
   Check to see if a hard ware device path was passed in. If it was then search\r
-  all the block IO devices for the passed in hard drive device path. \r
-  \r
+  all the block IO devices for the passed in hard drive device path.\r
+\r
 Arguments:\r
 \r
   Option - The current processing boot option.\r
@@ -312,7 +347,7 @@ Returns:
 \r
   EFI_SUCCESS   - Status from gBS->StartImage (),\r
                   or BootByDiskSignatureAndPartition ()\r
-                  \r
+\r
   EFI_NOT_FOUND - If the Device Path is not found in the system\r
 \r
 --*/\r
@@ -371,7 +406,7 @@ Returns:
     // find HardDriver device path node\r
     //\r
     while (!IsDevicePathEnd (DevicePath)) {\r
-      if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && \r
+      if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) &&\r
           (DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)\r
           ) {\r
         BlockIoHdDevicePath = DevicePath;\r
@@ -425,7 +460,291 @@ Returns:
     }\r
   }\r
 \r
-  gBS->FreePool (BlockIoBuffer);\r
+  FreePool (BlockIoBuffer);\r
+  return Status;\r
+}\r
+\r
+EFI_STATUS\r
+BdsLibDeleteOptionFromHandle (\r
+  IN  EFI_HANDLE                 Handle\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Delete the boot option associated with the handle passed in\r
+\r
+Arguments:\r
+\r
+  Handle - The handle which present the device path to create boot option\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS           - Delete the boot option success\r
+\r
+  EFI_NOT_FOUND         - If the Device Path is not found in the system\r
+\r
+  EFI_OUT_OF_RESOURCES  - Lack of memory resource\r
+\r
+  Other                 - Error return value from SetVariable()\r
+\r
+--*/\r
+{\r
+  UINT16                    *BootOrder;\r
+  UINT8                     *BootOptionVar;\r
+  UINTN                     BootOrderSize;\r
+  UINTN                     BootOptionSize;\r
+  EFI_STATUS                Status;\r
+  UINTN                     Index;\r
+  UINT16                    BootOption[BOOT_OPTION_MAX_CHAR];\r
+  UINTN                     DevicePathSize;\r
+  UINTN                     OptionDevicePathSize;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *OptionDevicePath;\r
+  UINT8                     *TempPtr;\r
+  CHAR16                    *Description;\r
+\r
+  Status        = EFI_SUCCESS;\r
+  BootOrder     = NULL;\r
+  BootOrderSize = 0;\r
+\r
+  BootOrder = BdsLibGetVariableAndSize (\r
+                L"BootOrder",\r
+                &gEfiGlobalVariableGuid,\r
+                &BootOrderSize\r
+                );\r
+  if (NULL == BootOrder) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  DevicePath = DevicePathFromHandle (Handle);\r
+  if (DevicePath == NULL) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  DevicePathSize = GetDevicePathSize (DevicePath);\r
+\r
+  Index = 0;\r
+  while (Index < BootOrderSize / sizeof (UINT16)) {\r
+    UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", BootOrder[Index]);\r
+    BootOptionVar = BdsLibGetVariableAndSize (\r
+                      BootOption,\r
+                      &gEfiGlobalVariableGuid,\r
+                      &BootOptionSize\r
+                      );\r
+    if (NULL == BootOptionVar) {\r
+      FreePool (BootOrder);\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+\r
+    TempPtr = BootOptionVar;\r
+    TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
+    Description = (CHAR16 *) TempPtr;\r
+    TempPtr += StrSize ((CHAR16 *) TempPtr);\r
+    OptionDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
+    OptionDevicePathSize = GetDevicePathSize (OptionDevicePath);\r
+\r
+    //\r
+    // Check whether the device path match\r
+    //\r
+    if ((OptionDevicePathSize == DevicePathSize) &&\r
+        (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {\r
+      BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);\r
+      FreePool (BootOptionVar);\r
+      break;\r
+    }\r
+\r
+    FreePool (BootOptionVar);\r
+    Index++;\r
+  }\r
+\r
+  Status = gRT->SetVariable (\r
+                  L"BootOrder",\r
+                  &gEfiGlobalVariableGuid,\r
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                  BootOrderSize,\r
+                  BootOrder\r
+                  );\r
+\r
+  FreePool (BootOrder);\r
+\r
+  return Status;\r
+}\r
+\r
+EFI_STATUS\r
+BdsDeleteAllInvalidEfiBootOption (\r
+  VOID\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Delete all invalid EFI boot options. The probable invalid boot option could\r
+  be Removable media or Network boot device.\r
+\r
+Arguments:\r
+\r
+  VOID\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS           - Delete all invalid boot option success\r
+\r
+  EFI_NOT_FOUND         - Variable "BootOrder" is not found\r
+\r
+  EFI_OUT_OF_RESOURCES  - Lack of memory resource\r
+\r
+  Other                 - Error return value from SetVariable()\r
+\r
+--*/\r
+{\r
+  UINT16                    *BootOrder;\r
+  UINT8                     *BootOptionVar;\r
+  UINTN                     BootOrderSize;\r
+  UINTN                     BootOptionSize;\r
+  EFI_STATUS                Status;\r
+  UINTN                     Index;\r
+  UINTN                     Index2;\r
+  UINT16                    BootOption[BOOT_OPTION_MAX_CHAR];\r
+  UINTN                     OptionDevicePathSize;\r
+  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *LastDeviceNode;\r
+  EFI_DEVICE_PATH_PROTOCOL  *OptionDevicePath;\r
+  UINT8                     *TempPtr;\r
+  CHAR16                    *Description;\r
+  EFI_HANDLE                Handle;\r
+  BOOLEAN                   NeedDelete;\r
+\r
+  Status        = EFI_SUCCESS;\r
+  BootOrder     = NULL;\r
+  BootOrderSize = 0;\r
+\r
+  BootOrder = BdsLibGetVariableAndSize (\r
+                L"BootOrder",\r
+                &gEfiGlobalVariableGuid,\r
+                &BootOrderSize\r
+                );\r
+  if (NULL == BootOrder) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  Index = 0;\r
+  while (Index < BootOrderSize / sizeof (UINT16)) {\r
+    UnicodeSPrint (BootOption, sizeof (BootOption), L"Boot%04x", BootOrder[Index]);\r
+    BootOptionVar = BdsLibGetVariableAndSize (\r
+                      BootOption,\r
+                      &gEfiGlobalVariableGuid,\r
+                      &BootOptionSize\r
+                      );\r
+    if (NULL == BootOptionVar) {\r
+      FreePool (BootOrder);\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+\r
+    TempPtr = BootOptionVar;\r
+    TempPtr += sizeof (UINT32) + sizeof (UINT16);\r
+    Description = (CHAR16 *) TempPtr;\r
+    TempPtr += StrSize ((CHAR16 *) TempPtr);\r
+    OptionDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) TempPtr;\r
+    OptionDevicePathSize = GetDevicePathSize (OptionDevicePath);\r
+\r
+    //\r
+    // Skip legacy boot option (BBS boot device)\r
+    //\r
+    if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
+        (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
+      FreePool (BootOptionVar);\r
+      Index++;\r
+      continue;\r
+    }\r
+\r
+    TempDevicePath = OptionDevicePath;\r
+    LastDeviceNode = OptionDevicePath;\r
+    while (!EfiIsDevicePathEnd (TempDevicePath)) {\r
+      LastDeviceNode = TempDevicePath;\r
+      TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
+    }\r
+    //\r
+    // Skip the boot option that point to a file, since the device path in\r
+    // removable media boot option doesn't contains a file name.\r
+    //\r
+    if (((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&\r
+         (DevicePathSubType (LastDeviceNode) == MEDIA_FILEPATH_DP)) ||\r
+        //\r
+        // Skip boot option for internal Shell, it's always valid\r
+        //\r
+        (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) {\r
+      FreePool (BootOptionVar);\r
+      Index++;\r
+      continue;\r
+    }\r
+\r
+    NeedDelete = TRUE;\r
+    //\r
+    // Check if it's a valid boot option for removable media\r
+    //\r
+    TempDevicePath = OptionDevicePath;\r
+    Status = gBS->LocateDevicePath (\r
+                    &gEfiSimpleFileSystemProtocolGuid,\r
+                    &TempDevicePath,\r
+                    &Handle\r
+                    );\r
+    if (!EFI_ERROR (Status)) {\r
+      NeedDelete = FALSE;\r
+    }\r
+    //\r
+    // Check if it's a valid boot option for network boot device\r
+    //\r
+    TempDevicePath = OptionDevicePath;\r
+    Status = gBS->LocateDevicePath (\r
+                    &gEfiLoadFileProtocolGuid,\r
+                    &TempDevicePath,\r
+                    &Handle\r
+                    );\r
+    if (!EFI_ERROR (Status)) {\r
+      NeedDelete = FALSE;\r
+    }\r
+\r
+    if (NeedDelete) {\r
+      //\r
+      // Delete this invalid boot option "Boot####"\r
+      //\r
+      Status = gRT->SetVariable (\r
+                      BootOption,\r
+                      &gEfiGlobalVariableGuid,\r
+                      EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                      0,\r
+                      NULL\r
+                      );\r
+      //\r
+      // Mark this boot option in boot order as deleted\r
+      //\r
+      BootOrder[Index] = 0xffff;\r
+    }\r
+\r
+    FreePool (BootOptionVar);\r
+    Index++;\r
+  }\r
+\r
+  //\r
+  // Adjust boot order array\r
+  //\r
+  Index2 = 0;\r
+  for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {\r
+    if (BootOrder[Index] != 0xffff) {\r
+      BootOrder[Index2] = BootOrder[Index];\r
+      Index2 ++;\r
+    }\r
+  }\r
+  Status = gRT->SetVariable (\r
+                  L"BootOrder",\r
+                  &gEfiGlobalVariableGuid,\r
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                  Index2 * sizeof (UINT16),\r
+                  BootOrder\r
+                  );\r
+\r
+  FreePool (BootOrder);\r
+\r
   return Status;\r
 }\r
 \r
@@ -456,11 +775,8 @@ Returns:
   UINT16                        BootOptionNumber;\r
   UINTN                         NumberFileSystemHandles;\r
   EFI_HANDLE                    *FileSystemHandles;\r
-  UINTN                         NumberBlkIoHandles;\r
-  EFI_HANDLE                    *BlkIoHandles;\r
   EFI_BLOCK_IO_PROTOCOL         *BlkIo;\r
   UINTN                         Index;\r
-  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
   UINTN                         NumberLoadFileHandles;\r
   EFI_HANDLE                    *LoadFileHandles;\r
   VOID                          *ProtocolInstance;\r
@@ -471,6 +787,10 @@ Returns:
   UINTN                         Size;\r
   EFI_FV_FILE_ATTRIBUTES        Attributes;\r
   UINT32                        AuthenticationStatus;\r
+  EFI_DEVICE_PATH_PROTOCOL      *FilePath;\r
+  EFI_HANDLE                    ImageHandle;\r
+  EFI_LOADED_IMAGE_PROTOCOL     *ImageInfo;\r
+  BOOLEAN                       NeedDelete;\r
 \r
   BootOptionNumber = 0;\r
 \r
@@ -490,49 +810,11 @@ Returns:
   REFRESH_LEGACY_BOOT_OPTIONS;\r
 \r
   //\r
-  // Check all the block IO to create boot option\r
+  // Delete invalid boot option\r
   //\r
-  gBS->LocateHandleBuffer (\r
-        ByProtocol,\r
-        &gEfiBlockIoProtocolGuid,\r
-        NULL,\r
-        &NumberBlkIoHandles,\r
-        &BlkIoHandles\r
-        );\r
-  for (Index = 0; Index < NumberBlkIoHandles; Index++) {\r
-    Status = gBS->HandleProtocol (\r
-                    BlkIoHandles[Index],\r
-                    &gEfiBlockIoProtocolGuid,\r
-                    (VOID **) &BlkIo\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      continue;\r
-    }\r
-\r
-    if (!BlkIo->Media->RemovableMedia) {\r
-      //\r
-      // Skip fixed Media device on first loop interration\r
-      //\r
-      continue;\r
-    }\r
-\r
-    DevicePath = DevicePathFromHandle (BlkIoHandles[Index]);\r
-    if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && \r
-        (DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)\r
-        ) {\r
-      //\r
-      // Build the boot option\r
-      //\r
-      BdsLibBuildOptionFromHandle (BlkIoHandles[Index], BdsBootOptionList);\r
-      BootOptionNumber++;\r
-    }\r
-  }\r
-\r
-  if (NumberBlkIoHandles) {\r
-    gBS->FreePool (BlkIoHandles);\r
-  }\r
+  BdsDeleteAllInvalidEfiBootOption ();\r
   //\r
-  // Parse Fixed Disk Devices.\r
+  // Parse removable media\r
   //\r
   gBS->LocateHandleBuffer (\r
         ByProtocol,\r
@@ -548,7 +830,7 @@ Returns:
                     (VOID **) &BlkIo\r
                     );\r
     if (!EFI_ERROR (Status)) {\r
-      if (BlkIo->Media->RemovableMedia) {\r
+      if (!BlkIo->Media->RemovableMedia) {\r
         //\r
         // If the file system handle supports a BlkIo protocol,\r
         // skip the removable media devices\r
@@ -557,21 +839,45 @@ Returns:
       }\r
     }\r
 \r
-    DevicePath = DevicePathFromHandle (FileSystemHandles[Index]);\r
-    if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && \r
-        (DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)\r
-        ) {\r
+    //\r
+    // Do the removable Media thing. \EFI\BOOT\boot{machinename}.EFI\r
+    //  machinename is ia32, ia64, x64, ...\r
+    //\r
+    FilePath = FileDevicePath (FileSystemHandles[Index], EFI_REMOVABLE_MEDIA_FILE_NAME);\r
+    NeedDelete = TRUE;\r
+    Status = gBS->LoadImage (\r
+                    TRUE,\r
+                    mBdsImageHandle,\r
+                    FilePath,\r
+                    NULL,\r
+                    0,\r
+                    &ImageHandle\r
+                    );\r
+    if (!EFI_ERROR(Status)) {\r
+      //\r
+      // Verify the image is a EFI application (and not a driver)\r
       //\r
-      // If the FileSystem protocol does not contain a BlkIo protocol,\r
-      // then build it\r
+      Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &ImageInfo);\r
+      ASSERT (!EFI_ERROR(Status));\r
+\r
+      if (ImageInfo->ImageCodeType == EfiLoaderCode) {\r
+        NeedDelete = FALSE;\r
+      }\r
+    }\r
+\r
+    if (NeedDelete) {\r
       //\r
+      // No such file or the file is not a EFI application, delete this boot option\r
+      //\r
+      BdsLibDeleteOptionFromHandle (FileSystemHandles[Index]);\r
+    } else {\r
       BdsLibBuildOptionFromHandle (FileSystemHandles[Index], BdsBootOptionList);\r
       BootOptionNumber++;\r
     }\r
   }\r
 \r
   if (NumberFileSystemHandles) {\r
-    gBS->FreePool (FileSystemHandles);\r
+    FreePool (FileSystemHandles);\r
   }\r
   //\r
   // Parse Network Boot Device\r
@@ -598,7 +904,7 @@ Returns:
   }\r
 \r
   if (NumberLoadFileHandles) {\r
-    gBS->FreePool (LoadFileHandles);\r
+    FreePool (LoadFileHandles);\r
   }\r
   //\r
   // Check if we have on flash shell\r
@@ -640,7 +946,7 @@ Returns:
   }\r
 \r
   if (FvHandleCount) {\r
-    gBS->FreePool (FvHandleBuffer);\r
+   FreePool (FvHandleBuffer);\r
   }\r
   //\r
   // Make sure every boot only have one time\r
@@ -660,13 +966,13 @@ BdsLibBuildOptionFromHandle (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Build the boot option with the handle parsed in\r
-  \r
+\r
 Arguments:\r
 \r
   Handle - The handle which present the device path to create boot option\r
-  \r
+\r
   BdsBootOptionList - The header of the link list which indexed all current\r
                       boot options\r
 \r
@@ -696,14 +1002,14 @@ BdsLibBuildOptionFromShell (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Build the on flash shell boot option with the handle parsed in\r
-  \r
+\r
 Arguments:\r
 \r
   Handle - The handle which present the device path to create on flash shell\r
            boot option\r
-  \r
+\r
   BdsBootOptionList - The header of the link list which indexed all current\r
                       boot options\r
 \r
@@ -738,13 +1044,13 @@ BdsLibBootNext (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Boot from the EFI1.1 spec defined "BootNext" variable\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
-  \r
+\r
 Returns:\r
 \r
   None\r