]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/DevicePath.h
1, Move device path utility macros from protocol's header file to DevicePathLib libra...
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePath.h
index 2103452909b21e9a96fc8d24f20f3df05b8b5310..23042057546bf2d6795e82a93a86866ee185e54d 100644 (file)
   that make up the Device Path.\r
 **/\r
 typedef struct {\r
-  UINT8 Type;       ///< 0x01 Hardware Device Path\r
-                    ///< 0x02 – ACPI Device Path\r
-                    ///< 0x03 – Messaging Device Path\r
-                    ///< 0x04 – Media Device Path\r
-                    ///< 0x05 – BIOS Boot Specification Device Path\r
-                    ///< 0x7F – End of Hardware Device Path\r
+  UINT8 Type;       ///< 0x01 Hardware Device Path\r
+                    ///< 0x02 ACPI Device Path\r
+                    ///< 0x03 Messaging Device Path\r
+                    ///< 0x04 Media Device Path\r
+                    ///< 0x05 BIOS Boot Specification Device Path\r
+                    ///< 0x7F End of Hardware Device Path\r
                     \r
   UINT8 SubType;    ///< Varies by Type\r
-                    ///< 0xFF – End Entire Device Path, or\r
-                    ///< 0x01 – End This Instance of a Device Path and start a new\r
+                    ///< 0xFF End Entire Device Path, or\r
+                    ///< 0x01 End This Instance of a Device Path and start a new\r
                     ///< Device Path\r
                     \r
   UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define\r
@@ -526,55 +526,9 @@ typedef union {
 \r
 #pragma pack()\r
                                              \r
-#define EFI_DP_TYPE_MASK                     0x7F\r
-#define EFI_DP_TYPE_UNPACKED                 0x80\r
 #define END_DEVICE_PATH_TYPE                 0x7f\r
-                                             \r
-#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
-#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
-#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
-                                             \r
-#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
-#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
-                                             \r
-#define DP_IS_END_TYPE(a)                    \r
-#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define DevicePathSubType(a)                 ((a)->SubType)\r
-#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
-                                             \r
-#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
-#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
-#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
-#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
-                                             \r
-#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
-#define DevicePathType(a)                    (EfiDevicePathType(a))\r
-#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
-#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
-                                             \r
-                                             \r
-#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
-#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
-                                             \r
-#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
-#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
-#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
-\r
-\r
-#define SetDevicePathNodeLength(a,l) {                           \\r
-          (a)->Length[0] = (UINT8) (l);                          \\r
-          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
-          }\r
-\r
-#define SetDevicePathEndNode(a)  {                               \\r
-          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
-          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
-          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
-          (a)->Length[1] = 0;                                    \\r
-          }\r
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE       0xFF\r
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE     0x01\r
 \r
 extern EFI_GUID gEfiDevicePathProtocolGuid;\r
 \r