]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Udf.h
0febb4bcda667ac72ab765f1d4c03a94b9582660
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Udf.h
1 /** @file
2 OSTA Universal Disk Format (UDF) definitions.
3
4 Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>
5
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
12 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
14
15 #ifndef __UDF_H__
16 #define __UDF_H__
17
18 #define UDF_BEA_IDENTIFIER "BEA01"
19 #define UDF_NSR2_IDENTIFIER "NSR02"
20 #define UDF_NSR3_IDENTIFIER "NSR03"
21 #define UDF_TEA_IDENTIFIER "TEA01"
22
23 #define UDF_LOGICAL_SECTOR_SHIFT 11
24 #define UDF_LOGICAL_SECTOR_SIZE ((UINT64)(1ULL << UDF_LOGICAL_SECTOR_SHIFT))
25 #define UDF_VRS_START_OFFSET ((UINT64)(16ULL << UDF_LOGICAL_SECTOR_SHIFT))
26
27 #define _GET_TAG_ID(_Pointer) \
28 (((UDF_DESCRIPTOR_TAG *)(_Pointer))->TagIdentifier)
29
30 #define IS_AVDP(_Pointer) \
31 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 2))
32
33 #pragma pack(1)
34
35 typedef struct {
36 UINT16 TagIdentifier;
37 UINT16 DescriptorVersion;
38 UINT8 TagChecksum;
39 UINT8 Reserved;
40 UINT16 TagSerialNumber;
41 UINT16 DescriptorCRC;
42 UINT16 DescriptorCRCLength;
43 UINT32 TagLocation;
44 } UDF_DESCRIPTOR_TAG;
45
46 typedef struct {
47 UINT32 ExtentLength;
48 UINT32 ExtentLocation;
49 } UDF_EXTENT_AD;
50
51 typedef struct {
52 UDF_DESCRIPTOR_TAG DescriptorTag;
53 UDF_EXTENT_AD MainVolumeDescriptorSequenceExtent;
54 UDF_EXTENT_AD ReserveVolumeDescriptorSequenceExtent;
55 UINT8 Reserved[480];
56 } UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER;
57
58 #pragma pack()
59
60 #endif