MdePkg: Add UDF volume structure definitions
authorPaulo Alcantara <pcacjr@zytor.com>
Fri, 22 Sep 2017 18:11:31 +0000 (02:11 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 25 Sep 2017 07:36:19 +0000 (15:36 +0800)
This patch adds a few more UDF volume structures in order to detect an
UDF file system which is supported by current EDK2 UDF file system
implementation in Partition driver.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Build-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Tested-by: Hao Wu <hao.a.wu@intel.com>
Build-tested-by: Star Zeng <star.zeng@intel.com>
Build-tested-by: Paulo Alcantara <paulo@hp.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdePkg/Include/IndustryStandard/Udf.h

index 0febb4bcda667ac72ab765f1d4c03a94b9582660..5806560aee66d61531888fdcc5369918a7aa855d 100644 (file)
 #define UDF_LOGICAL_SECTOR_SIZE   ((UINT64)(1ULL << UDF_LOGICAL_SECTOR_SHIFT))\r
 #define UDF_VRS_START_OFFSET      ((UINT64)(16ULL << UDF_LOGICAL_SECTOR_SHIFT))\r
 \r
-#define _GET_TAG_ID(_Pointer) \\r
-  (((UDF_DESCRIPTOR_TAG *)(_Pointer))->TagIdentifier)\r
-\r
-#define IS_AVDP(_Pointer) \\r
-  ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 2))\r
+typedef enum {\r
+  UdfPrimaryVolumeDescriptor = 1,\r
+  UdfAnchorVolumeDescriptorPointer = 2,\r
+  UdfVolumeDescriptorPointer = 3,\r
+  UdfImplemenationUseVolumeDescriptor = 4,\r
+  UdfPartitionDescriptor = 5,\r
+  UdfLogicalVolumeDescriptor = 6,\r
+  UdfUnallocatedSpaceDescriptor = 7,\r
+  UdfTerminatingDescriptor = 8,\r
+  UdfLogicalVolumeIntegrityDescriptor = 9,\r
+  UdfFileSetDescriptor = 256,\r
+  UdfFileIdentifierDescriptor = 257,\r
+  UdfAllocationExtentDescriptor = 258,\r
+  UdfFileEntry = 261,\r
+  UdfExtendedFileEntry = 266,\r
+} UDF_VOLUME_DESCRIPTOR_ID;\r
 \r
 #pragma pack(1)\r
 \r
@@ -48,6 +59,66 @@ typedef struct {
   UINT32  ExtentLocation;\r
 } UDF_EXTENT_AD;\r
 \r
+typedef struct {\r
+  UINT8           CharacterSetType;\r
+  UINT8           CharacterSetInfo[63];\r
+} UDF_CHAR_SPEC;\r
+\r
+typedef struct {\r
+  UINT8           Flags;\r
+  UINT8           Identifier[23];\r
+  union {\r
+    //\r
+    // Domain Entity Identifier\r
+    //\r
+    struct {\r
+      UINT16      UdfRevision;\r
+      UINT8       DomainFlags;\r
+      UINT8       Reserved[5];\r
+    } Domain;\r
+    //\r
+    // UDF Entity Identifier\r
+    //\r
+    struct {\r
+      UINT16      UdfRevision;\r
+      UINT8       OSClass;\r
+      UINT8       OSIdentifier;\r
+      UINT8       Reserved[4];\r
+    } Entity;\r
+    //\r
+    // Implementation Entity Identifier\r
+    //\r
+    struct {\r
+      UINT8       OSClass;\r
+      UINT8       OSIdentifier;\r
+      UINT8       ImplementationUseArea[6];\r
+    } ImplementationEntity;\r
+    //\r
+    // Application Entity Identifier\r
+    //\r
+    struct {\r
+      UINT8       ApplicationUseArea[8];\r
+    } ApplicationEntity;\r
+    //\r
+    // Raw Identifier Suffix\r
+    //\r
+    struct {\r
+      UINT8       Data[8];\r
+    } Raw;\r
+  } Suffix;\r
+} UDF_ENTITY_ID;\r
+\r
+typedef struct {\r
+  UINT32        LogicalBlockNumber;\r
+  UINT16        PartitionReferenceNumber;\r
+} UDF_LB_ADDR;\r
+\r
+typedef struct {\r
+  UINT32                           ExtentLength;\r
+  UDF_LB_ADDR                      ExtentLocation;\r
+  UINT8                            ImplementationUse[6];\r
+} UDF_LONG_ALLOCATION_DESCRIPTOR;\r
+\r
 typedef struct {\r
   UDF_DESCRIPTOR_TAG  DescriptorTag;\r
   UDF_EXTENT_AD       MainVolumeDescriptorSequenceExtent;\r
@@ -55,6 +126,22 @@ typedef struct {
   UINT8               Reserved[480];\r
 } UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER;\r
 \r
+typedef struct {\r
+  UDF_DESCRIPTOR_TAG              DescriptorTag;\r
+  UINT32                          VolumeDescriptorSequenceNumber;\r
+  UDF_CHAR_SPEC                   DescriptorCharacterSet;\r
+  UINT8                           LogicalVolumeIdentifier[128];\r
+  UINT32                          LogicalBlockSize;\r
+  UDF_ENTITY_ID                   DomainIdentifier;\r
+  UDF_LONG_ALLOCATION_DESCRIPTOR  LogicalVolumeContentsUse;\r
+  UINT32                          MapTableLength;\r
+  UINT32                          NumberOfPartitionMaps;\r
+  UDF_ENTITY_ID                   ImplementationIdentifier;\r
+  UINT8                           ImplementationUse[128];\r
+  UDF_EXTENT_AD                   IntegritySequenceExtent;\r
+  UINT8                           PartitionMaps[6];\r
+} UDF_LOGICAL_VOLUME_DESCRIPTOR;\r
+\r
 #pragma pack()\r
 \r
 #endif\r