summaryrefslogtreecommitdiff
path: root/MdePkg/Include/Library/DevicePathLib.h
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-17 12:46:35 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-17 12:46:35 +0000
commit8dd2a792d66d9f98d8b0a5dc57be42da087f3a1f (patch)
tree2f3877a0c4f996a18ea7e581d8962e194decb76f /MdePkg/Include/Library/DevicePathLib.h
parentd5954c618f10c9f75a4d125985550e694c7a3f22 (diff)
downloadedk2-platforms-8dd2a792d66d9f98d8b0a5dc57be42da087f3a1f.tar.xz
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
Diffstat (limited to 'MdePkg/Include/Library/DevicePathLib.h')
-rw-r--r--MdePkg/Include/Library/DevicePathLib.h6
1 files 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); \
}
/**