]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootOption.c
ArmPlatformPkg/Bds: Fixed condition on LOAD_OPTION_CATEGORY_BOOT
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootOption.c
index 52c9d831b77bab7963ec90abdc8c9eb5830022ab..8ed636b53bbbd744d7628e34f70ca86396bcb3e2 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,8 +15,6 @@
 #include <Guid/ArmGlobalVariableHob.h>\r
 #include "BdsInternal.h"\r
 \r
-extern EFI_HANDLE mImageHandle;\r
-\r
 EFI_STATUS\r
 BootOptionStart (\r
   IN BDS_LOAD_OPTION *BootOption\r
@@ -41,12 +39,12 @@ BootOptionStart (
     LoaderType = ReadUnaligned32 ((CONST UINT32*)&OptionalData->Header.LoaderType);\r
 \r
     if (LoaderType == BDS_LOADER_EFI_APPLICATION) {\r
-      if ((BootOption->Attributes & LOAD_OPTION_CATEGORY_BOOT) == 0) {\r
+      if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {\r
         // Need to connect every drivers to ensure no dependencies are missing for the application\r
         BdsConnectAllDrivers ();\r
       }\r
 \r
-      Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList, 0, NULL);\r
+      Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, 0, NULL);\r
     } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {\r
       LinuxArguments = &(OptionalData->Arguments.LinuxArguments);\r
       CmdLineSize = ReadUnaligned16 ((CONST UINT16*)&LinuxArguments->CmdLineSize);\r
@@ -93,7 +91,7 @@ BootOptionStart (
     }\r
   } else {\r
     // Connect all the drivers if the EFI Application is not a EFI OS Loader\r
-    if ((BootOption->Attributes & LOAD_OPTION_CATEGORY_BOOT) == 0) {\r
+    if ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_APP) {\r
       BdsConnectAllDrivers ();\r
     }\r
 \r
@@ -103,7 +101,7 @@ BootOptionStart (
               EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
               LoadOptionIndexSize, &(BootOption->LoadOptionIndex));\r
 \r
-    Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);\r
+    Status = BdsStartEfiApplication (gImageHandle, BootOption->FilePathList, BootOption->OptionalDataSize, BootOption->OptionalData);\r
 \r
     // Clear BootCurrent variable\r
     LoadOptionIndexSize = sizeof(UINT16);\r