]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add a workaround to judge the end-of-device path type:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Nov 2008 12:46:35 +0000 (12:46 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Nov 2008 12:46:35 +0000 (12:46 +0000)
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

index a5bf96be9e755d5f8f37bfcfcd0989539faa5fe3..05e98a4d3dcc54504dd6e935b7b297fb46453a85 100644 (file)
@@ -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))\r
 #define DevicePathNodeLength(Node)           ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0])\r
 #define NextDevicePathNode(Node)             ((EFI_DEVICE_PATH_PROTOCOL *)((UINT8 *)(Node) + DevicePathNodeLength(Node)))\r
-#define DevicePathType(Node)                 (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Type) \r
+#define DevicePathType(Node)                 (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Type)\r
 #define DevicePathSubType(Node)              (((EFI_DEVICE_PATH_PROTOCOL *)(Node))->SubType)\r
-#define IsDevicePathEndType(Node)            (DevicePathType (Node) == END_DEVICE_PATH_TYPE)\r
+#define IsDevicePathEndType(Node)            ((DevicePathType (Node) & 0x7f) == END_DEVICE_PATH_TYPE)\r
 #define IsDevicePathEnd(Node)                (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
 #define IsDevicePathEndInstance(Node)        (IsDevicePathEndType (Node) && DevicePathSubType(Node) == END_INSTANCE_DEVICE_PATH_SUBTYPE)\r
 \r
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define SetDevicePathEndNode(Node)  {                                   \\r
           DevicePathType (Node)    = END_DEVICE_PATH_TYPE;              \\r
           DevicePathSubType (Node) = END_ENTIRE_DEVICE_PATH_SUBTYPE;    \\r
-          SetDevicePathNodeLength ((Node), END_DEVICE_PATH_LENGTH);       \\r
+          SetDevicePathNodeLength ((Node), END_DEVICE_PATH_LENGTH);     \\r
           }\r
 \r
 /**\r