diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-15 19:56:50 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-15 19:56:50 +0000 |
commit | 6bab33c7b677dea7a67df512ef1a058daeebef57 (patch) | |
tree | e9016ca1b3d736c5a831e72bc43cb466383d1da9 /ArmPkg | |
parent | e862cd50c6a12183204ba0fa93403d88fd2e0376 (diff) | |
download | edk2-6bab33c7b677dea7a67df512ef1a058daeebef57.zip edk2-6bab33c7b677dea7a67df512ef1a058daeebef57.tar.gz edk2-6bab33c7b677dea7a67df512ef1a058daeebef57.tar.bz2 |
ArmPlatformPkg/Bds: Fix various bugs in the new BDS
The errors were:
- uncaught returned error
- used of uninitialized variables
ArmPlatformPkg/Bds: Implement the update of MemMap Boot Device
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11830 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Include/Library/BdsLib.h | 38 | ||||
-rw-r--r-- | ArmPkg/Library/BdsLib/BdsFilePath.c | 28 | ||||
-rw-r--r-- | ArmPkg/Library/BdsLib/BdsInternal.h | 1 |
3 files changed, 65 insertions, 2 deletions
diff --git a/ArmPkg/Include/Library/BdsLib.h b/ArmPkg/Include/Library/BdsLib.h index a6ae2f1..75d0150 100644 --- a/ArmPkg/Include/Library/BdsLib.h +++ b/ArmPkg/Include/Library/BdsLib.h @@ -16,6 +16,25 @@ #define __BDS_ENTRY_H__
/**
+ Connect a Device Path and return the handle of the driver that support this DevicePath
+
+ @param DevicePath Device Path of the File to connect
+ @param Handle Handle of the driver that support this DevicePath
+ @param RemainingDevicePath Remaining DevicePath nodes that do not match the driver DevicePath
+
+ @retval EFI_SUCCESS A driver that matches the Device Path has been found
+ @retval EFI_NOT_FOUND No handles match the search.
+ @retval EFI_INVALID_PARAMETER DevicePath or Handle is NULL
+
+**/
+EFI_STATUS
+BdsConnectDevicePath (
+ IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
+ OUT EFI_HANDLE *Handle,
+ OUT EFI_DEVICE_PATH_PROTOCOL **RemainingDevicePath
+ );
+
+/**
Connect all DXE drivers
@retval EFI_SUCCESS All drivers have been connected
@@ -32,7 +51,7 @@ BdsConnectAllDrivers ( Start a Linux kernel from a Device Path
@param LinuxKernel Device Path to the Linux Kernel
- @param Parameters Linux kernel agruments
+ @param Parameters Linux kernel arguments
@param Fdt Device Path to the Flat Device Tree
@retval EFI_SUCCESS All drivers have been connected
@@ -48,6 +67,23 @@ BdsBootLinux ( );
/**
+ Start an EFI Application from a Device Path
+
+ @param ParentImageHandle Handle of the calling image
+ @param DevicePath Location of the EFI Application
+
+ @retval EFI_SUCCESS All drivers have been connected
+ @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
+ @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results.
+
+**/
+EFI_STATUS
+BdsStartEfiApplication (
+ IN EFI_HANDLE ParentImageHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+/**
Start an EFI Application from any Firmware Volume
@param EfiApp EFI Application Name
diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c index be1a824..69aa255 100644 --- a/ArmPkg/Library/BdsLib/BdsFilePath.c +++ b/ArmPkg/Library/BdsLib/BdsFilePath.c @@ -298,6 +298,18 @@ TryRemovableDevice ( return Status; } +/** + Connect a Device Path and return the handle of the driver that support this DevicePath + + @param DevicePath Device Path of the File to connect + @param Handle Handle of the driver that support this DevicePath + @param RemainingDevicePath Remaining DevicePath nodes that do not match the driver DevicePath + + @retval EFI_SUCCESS A driver that matches the Device Path has been found + @retval EFI_NOT_FOUND No handles match the search. + @retval EFI_INVALID_PARAMETER DevicePath or Handle is NULL + +**/ EFI_STATUS BdsConnectDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL* DevicePath, @@ -335,7 +347,7 @@ BdsConnectDevicePath ( // Now, we have got the whole Device Path connected, call again ConnectController to ensure all the supported Driver // Binding Protocol are connected (such as DiskIo and SimpleFileSystem) Remaining = DevicePath; - Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid,&Remaining,Handle); + Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid,&Remaining,Handle); if (!EFI_ERROR (Status)) { Status = gBS->ConnectController (*Handle, NULL, Remaining, FALSE); if (EFI_ERROR (Status)) { @@ -420,6 +432,9 @@ BdsFileSystemLoadImage ( File = NULL; Status = Fs->Open(Fs, &File, FilePathDevicePath->PathName, EFI_FILE_MODE_READ, 0); + if (EFI_ERROR(Status)) { + return Status; + } Size = 0; File->GetInfo(File, &gEfiFileInfoGuid, &Size, NULL); @@ -811,6 +826,17 @@ BdsLoadImage ( return EFI_UNSUPPORTED; } +/** + Start an EFI Application from a Device Path + + @param ParentImageHandle Handle of the calling image + @param DevicePath Location of the EFI Application + + @retval EFI_SUCCESS All drivers have been connected + @retval EFI_NOT_FOUND The Linux kernel Device Path has not been found + @retval EFI_OUT_OF_RESOURCES There is not enough resource memory to store the matching results. + +**/ EFI_STATUS BdsStartEfiApplication ( IN EFI_HANDLE ParentImageHandle, diff --git a/ArmPkg/Library/BdsLib/BdsInternal.h b/ArmPkg/Library/BdsLib/BdsInternal.h index a497df0..dd961c8 100644 --- a/ArmPkg/Library/BdsLib/BdsInternal.h +++ b/ArmPkg/Library/BdsLib/BdsInternal.h @@ -23,6 +23,7 @@ #include <Library/DevicePathLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/DebugLib.h> +#include <Library/BdsLib.h> #include <Library/BdsUnixLib.h> #include <Library/PerformanceLib.h> |