]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootOption.c
ArmPkg: update BdsLib to updated definition of EFI_LOAD_OPTION
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootOption.c
index 80982222e160fad51cc14805622ed4ff5a67f04f..bb218f82aaf4d4f8eb5b1aaf467ca8d0484d775a 100644 (file)
@@ -21,13 +21,9 @@ BootOptionStart (
   )\r
 {\r
   EFI_STATUS                            Status;\r
-  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL*   EfiDevicePathFromTextProtocol;\r
   UINT32                                LoaderType;\r
   ARM_BDS_LOADER_OPTIONAL_DATA*         OptionalData;\r
   ARM_BDS_LINUX_ARGUMENTS*              LinuxArguments;\r
-  EFI_DEVICE_PATH_PROTOCOL*             FdtDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL*             DefaultFdtDevicePath;\r
-  UINTN                                 FdtDevicePathSize;\r
   UINTN                                 CmdLineSize;\r
   UINTN                                 InitrdSize;\r
   EFI_DEVICE_PATH*                      Initrd;\r
@@ -69,25 +65,11 @@ BootOptionStart (
       } else {\r
         Initrd = NULL;\r
       }\r
-\r
-      // Get the default FDT device path\r
-      Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r
-      ASSERT_EFI_ERROR(Status);\r
-      DefaultFdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));\r
-\r
-      // Get the FDT device path\r
-      FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);\r
-      Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,\r
-                 DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);\r
-      ASSERT_EFI_ERROR(Status);\r
-\r
-      Status = BdsBootLinuxFdt (BootOption->FilePathList,\r
-                                Initrd, // Initrd\r
-                                (CHAR8*)(LinuxArguments + 1),\r
-                                FdtDevicePath);\r
-\r
-      FreePool (DefaultFdtDevicePath);\r
-      FreePool (FdtDevicePath);\r
+      Status = BdsBootLinuxFdt (\r
+                 BootOption->FilePathList,\r
+                 Initrd,\r
+                 (CHAR8*)(LinuxArguments + 1)\r
+                 );\r
     }\r
   } else {\r
     // Connect all the drivers if the EFI Application is not a EFI OS Loader\r
@@ -159,7 +141,7 @@ BootOptionSetFields (
   IN UINTN                      OptionalDataSize\r
   )\r
 {\r
-  EFI_LOAD_OPTION               EfiLoadOption;\r
+  EFI_LOAD_OPTION               *EfiLoadOption;\r
   UINTN                         EfiLoadOptionSize;\r
   UINTN                         BootDescriptionSize;\r
   UINT16                        FilePathListLength;\r
@@ -186,8 +168,8 @@ BootOptionSetFields (
 \r
   // Allocate the memory for the EFI Load Option\r
   EfiLoadOptionSize = sizeof(UINT32) + sizeof(UINT16) + BootDescriptionSize + FilePathListLength + OptionalDataSize;\r
-  EfiLoadOption = (EFI_LOAD_OPTION)AllocatePool(EfiLoadOptionSize);\r
-  EfiLoadOptionPtr = EfiLoadOption;\r
+  EfiLoadOption = (EFI_LOAD_OPTION *)AllocatePool(EfiLoadOptionSize);\r
+  EfiLoadOptionPtr = (UINT8 *)EfiLoadOption;\r
 \r
   //\r
   // Populate the EFI Load Option and BDS Boot Option structures\r