public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Paulo Alcantara <pcacjr@zytor.com>
To: edk2-devel@lists.01.org
Cc: Paulo Alcantara <pcacjr@zytor.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: [PATCH v2 1/6] MdePkg: Add UDF volume structure definitions
Date: Sun, 20 Aug 2017 15:15:52 -0300	[thread overview]
Message-ID: <20170820181557.28761-2-pcacjr@zytor.com> (raw)
In-Reply-To: <20170820181557.28761-1-pcacjr@zytor.com>

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>
---
 MdePkg/Include/IndustryStandard/Udf.h | 60 +++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Udf.h

diff --git a/MdePkg/Include/IndustryStandard/Udf.h b/MdePkg/Include/IndustryStandard/Udf.h
new file mode 100644
index 0000000000..a1f81fc769
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Udf.h
@@ -0,0 +1,60 @@
+/** @file
+  OSTA Universal Disk Format (UDF) definition.
+
+  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
-- 
2.11.0



  reply	other threads:[~2017-08-20 18:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20 18:15 [PATCH v2 0/6] read-only UDF file system support Paulo Alcantara
2017-08-20 18:15 ` Paulo Alcantara [this message]
2017-08-20 18:15 ` [PATCH v2 2/6] MdeModulePkg/PartitionDxe: Add " Paulo Alcantara
2017-08-20 18:15 ` [PATCH v2 3/6] MdeModulePkg: Initial UDF/ECMA-167 " Paulo Alcantara
2017-08-20 18:15 ` [PATCH v2 4/6] OvmfPkg: Enable UDF " Paulo Alcantara
2017-08-21 16:14   ` Laszlo Ersek
2017-08-20 18:15 ` [PATCH v2 5/6] ArmVirtPkg: " Paulo Alcantara
2017-08-21 15:35   ` Ard Biesheuvel
2017-08-21 16:11   ` Laszlo Ersek
2017-08-20 18:15 ` [PATCH v2 6/6] Nt32Pkg: " Paulo Alcantara
2017-08-21  2:29 ` [PATCH v2 0/6] read-only " Ni, Ruiyu
2017-08-21  2:37   ` Gao, Liming
2017-08-22 13:23     ` Paulo Alcantara
2017-08-22 13:14   ` Paulo Alcantara
2017-08-22 17:21     ` Andrew Fish
2017-08-22 17:56       ` Paulo Alcantara
2017-08-22 22:36         ` Andrew Fish
2017-08-22 17:58       ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170820181557.28761-2-pcacjr@zytor.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox