From 8dd2a792d66d9f98d8b0a5dc57be42da087f3a1f Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 17 Nov 2008 12:46:35 +0000 Subject: [PATCH] Add a workaround to judge the end-of-device path type: We used to have type EFI_END_ENTIRE_DEVICE_PATH (0xff) to tag the end of entire device path. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6562 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/DevicePathLib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Library/DevicePathLib.h b/MdePkg/Include/Library/DevicePathLib.h index a5bf96be9e..05e98a4d3d 100644 --- a/MdePkg/Include/Library/DevicePathLib.h +++ b/MdePkg/Include/Library/DevicePathLib.h @@ -20,9 +20,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL)) #define DevicePathNodeLength(Node) ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0]) #define NextDevicePathNode(Node) ((EFI_DEVICE_PATH_PROTOCOL *)((UINT8 *)(Node) + DevicePathNodeLength(Node))) -#define DevicePathType(Node) (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Type) +#define DevicePathType(Node) (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Type) #define DevicePathSubType(Node) (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->SubType) -#define IsDevicePathEndType(Node) (DevicePathType (Node) == END_DEVICE_PATH_TYPE) +#define IsDevicePathEndType(Node) ((DevicePathType (Node) & 0x7f) == END_DEVICE_PATH_TYPE) #define IsDevicePathEnd(Node) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE) #define IsDevicePathEndInstance(Node) (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE) @@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define SetDevicePathEndNode(Node) { \ DevicePathType (Node) = END_DEVICE_PATH_TYPE; \ DevicePathSubType (Node) = END_ENTIRE_DEVICE_PATH_SUBTYPE; \ - SetDevicePathNodeLength ((Node), END_DEVICE_PATH_LENGTH); \ + SetDevicePathNodeLength ((Node), END_DEVICE_PATH_LENGTH); \ } /** -- 2.39.2