summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2017-09-08 09:41:45 -0300
committerLaszlo Ersek <lersek@redhat.com>2017-09-08 20:42:22 +0200
commitfae0d2a2c6eb1c5d25797f85e6400516b2a130e7 (patch)
tree617a578f2dc6785b7086898800baa01dd0674194 /MdePkg
parent7aee391fa3d01a9413e173686d04dac5842e7499 (diff)
downloadedk2-fae0d2a2c6eb1c5d25797f85e6400516b2a130e7.zip
edk2-fae0d2a2c6eb1c5d25797f85e6400516b2a130e7.tar.gz
edk2-fae0d2a2c6eb1c5d25797f85e6400516b2a130e7.tar.bz2
MdePkg: Add UDF volume structure definitions
This patch adds basic volume structure definitions necessary to identify a valid UDF file system on a block device, as specified by OSTA Universal Disk Format Specification 2.60. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/IndustryStandard/Udf.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/MdePkg/Include/IndustryStandard/Udf.h b/MdePkg/Include/IndustryStandard/Udf.h
new file mode 100644
index 0000000..0febb4b
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Udf.h
@@ -0,0 +1,60 @@
+/** @file
+ OSTA Universal Disk Format (UDF) definitions.
+
+ Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>
+
+ This program and the accompanying materials are licensed and made available
+ under the terms and conditions of the BSD License which accompanies this
+ distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __UDF_H__
+#define __UDF_H__
+
+#define UDF_BEA_IDENTIFIER "BEA01"
+#define UDF_NSR2_IDENTIFIER "NSR02"
+#define UDF_NSR3_IDENTIFIER "NSR03"
+#define UDF_TEA_IDENTIFIER "TEA01"
+
+#define UDF_LOGICAL_SECTOR_SHIFT 11
+#define UDF_LOGICAL_SECTOR_SIZE ((UINT64)(1ULL << UDF_LOGICAL_SECTOR_SHIFT))
+#define UDF_VRS_START_OFFSET ((UINT64)(16ULL << UDF_LOGICAL_SECTOR_SHIFT))
+
+#define _GET_TAG_ID(_Pointer) \
+ (((UDF_DESCRIPTOR_TAG *)(_Pointer))->TagIdentifier)
+
+#define IS_AVDP(_Pointer) \
+ ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 2))
+
+#pragma pack(1)
+
+typedef struct {
+ UINT16 TagIdentifier;
+ UINT16 DescriptorVersion;
+ UINT8 TagChecksum;
+ UINT8 Reserved;
+ UINT16 TagSerialNumber;
+ UINT16 DescriptorCRC;
+ UINT16 DescriptorCRCLength;
+ UINT32 TagLocation;
+} UDF_DESCRIPTOR_TAG;
+
+typedef struct {
+ UINT32 ExtentLength;
+ UINT32 ExtentLocation;
+} UDF_EXTENT_AD;
+
+typedef struct {
+ UDF_DESCRIPTOR_TAG DescriptorTag;
+ UDF_EXTENT_AD MainVolumeDescriptorSequenceExtent;
+ UDF_EXTENT_AD ReserveVolumeDescriptorSequenceExtent;
+ UINT8 Reserved[480];
+} UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER;
+
+#pragma pack()
+
+#endif