From aa863d357aa830c8068b4539975fe17eb4359d48 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 9 Sep 2011 10:55:26 +0000 Subject: ArmPkg/BdsLib: Fix MemMap Device Path node support The previous version was only checking if the Remaining Device Path node was a MemMap DevicePath node. This fix also checks if the Root DevicePath node is a MemMap DevicePath node. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12315 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Library/BdsLib/BdsFilePath.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ArmPkg/Library/BdsLib') diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c index 9136941ede..ac1fb0eaf2 100644 --- a/ArmPkg/Library/BdsLib/BdsFilePath.c +++ b/ArmPkg/Library/BdsLib/BdsFilePath.c @@ -471,7 +471,8 @@ BdsMemoryMapSupport ( IN EFI_DEVICE_PATH *RemainingDevicePath ) { - return IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP); + return IS_DEVICE_PATH_NODE(DevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP) || + IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP); } EFI_STATUS @@ -488,9 +489,12 @@ BdsMemoryMapLoadImage ( MEMMAP_DEVICE_PATH* MemMapPathDevicePath; UINTN Size; - ASSERT (IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP)); - - MemMapPathDevicePath = (MEMMAP_DEVICE_PATH*)RemainingDevicePath; + if (IS_DEVICE_PATH_NODE(RemainingDevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP)) { + MemMapPathDevicePath = (MEMMAP_DEVICE_PATH*)RemainingDevicePath; + } else { + ASSERT (IS_DEVICE_PATH_NODE(DevicePath,HARDWARE_DEVICE_PATH,HW_MEMMAP_DP)); + MemMapPathDevicePath = (MEMMAP_DEVICE_PATH*)DevicePath; + } Size = MemMapPathDevicePath->EndingAddress - MemMapPathDevicePath->StartingAddress; if (Size == 0) { -- cgit v1.2.3