.. | .. |
---|
2 | 2 | * ecma_167.h |
---|
3 | 3 | * |
---|
4 | 4 | * This file is based on ECMA-167 3rd edition (June 1997) |
---|
5 | | - * http://www.ecma.ch |
---|
| 5 | + * https://www.ecma.ch |
---|
6 | 6 | * |
---|
7 | | - * Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu> |
---|
| 7 | + * Copyright (c) 2001-2002 Ben Fennema |
---|
| 8 | + * Copyright (c) 2017-2019 Pali Rohár <pali@kernel.org> |
---|
8 | 9 | * All rights reserved. |
---|
9 | 10 | * |
---|
10 | 11 | * Redistribution and use in source and binary forms, with or without |
---|
.. | .. |
---|
32 | 33 | * SUCH DAMAGE. |
---|
33 | 34 | */ |
---|
34 | 35 | |
---|
| 36 | +/** |
---|
| 37 | + * @file |
---|
| 38 | + * ECMA-167r3 defines and structure definitions |
---|
| 39 | + */ |
---|
| 40 | + |
---|
35 | 41 | #include <linux/types.h> |
---|
36 | 42 | |
---|
37 | 43 | #ifndef _ECMA_167_H |
---|
38 | 44 | #define _ECMA_167_H 1 |
---|
| 45 | + |
---|
| 46 | +/* Character sets and coding - d-characters (ECMA 167r3 1/7.2) */ |
---|
| 47 | +typedef uint8_t dchars; |
---|
39 | 48 | |
---|
40 | 49 | /* Character set specification (ECMA 167r3 1/7.2.1) */ |
---|
41 | 50 | struct charspec { |
---|
.. | .. |
---|
54 | 63 | #define CHARSPEC_TYPE_CS7 0x07 /* (1/7.2.9) */ |
---|
55 | 64 | #define CHARSPEC_TYPE_CS8 0x08 /* (1/7.2.10) */ |
---|
56 | 65 | |
---|
| 66 | +/* Fixed-length character fields - d-string (EMCA 167r3 1/7.2.12) */ |
---|
57 | 67 | typedef uint8_t dstring; |
---|
58 | 68 | |
---|
59 | 69 | /* Timestamp (ECMA 167r3 1/7.3) */ |
---|
.. | .. |
---|
85 | 95 | } __packed; |
---|
86 | 96 | |
---|
87 | 97 | /* Flags (ECMA 167r3 1/7.4.1) */ |
---|
88 | | -#define ENTITYID_FLAGS_DIRTY 0x00 |
---|
89 | | -#define ENTITYID_FLAGS_PROTECTED 0x01 |
---|
| 98 | +#define ENTITYID_FLAGS_DIRTY 0x01 |
---|
| 99 | +#define ENTITYID_FLAGS_PROTECTED 0x02 |
---|
90 | 100 | |
---|
91 | 101 | /* Volume Structure Descriptor (ECMA 167r3 2/9.1) */ |
---|
92 | 102 | #define VSD_STD_ID_LEN 5 |
---|
.. | .. |
---|
186 | 196 | uint8_t structVersion; |
---|
187 | 197 | uint8_t reserved; |
---|
188 | 198 | uint8_t structData[2040]; |
---|
| 199 | +} __packed; |
---|
| 200 | + |
---|
| 201 | +/* Generic Descriptor */ |
---|
| 202 | +struct genericDesc { |
---|
| 203 | + struct tag descTag; |
---|
| 204 | + __le32 volDescSeqNum; |
---|
| 205 | + uint8_t reserved[492]; |
---|
189 | 206 | } __packed; |
---|
190 | 207 | |
---|
191 | 208 | /* Primary Volume Descriptor (ECMA 167r3 3/10.1) */ |
---|
.. | .. |
---|
302 | 319 | |
---|
303 | 320 | /* Partition Map Type (ECMA 167r3 3/10.7.1.1) */ |
---|
304 | 321 | #define GP_PARTITION_MAP_TYPE_UNDEF 0x00 |
---|
305 | | -#define GP_PARTIITON_MAP_TYPE_1 0x01 |
---|
| 322 | +#define GP_PARTITION_MAP_TYPE_1 0x01 |
---|
306 | 323 | #define GP_PARTITION_MAP_TYPE_2 0x02 |
---|
307 | 324 | |
---|
308 | 325 | /* Type 1 Partition Map (ECMA 167r3 3/10.7.2) */ |
---|
.. | .. |
---|
709 | 726 | #define EXTATTR_DEV_SPEC 12 |
---|
710 | 727 | #define EXTATTR_IMP_USE 2048 |
---|
711 | 728 | #define EXTATTR_APP_USE 65536 |
---|
| 729 | +#define EXTATTR_SUBTYPE 1 |
---|
712 | 730 | |
---|
713 | 731 | /* Unallocated Space Entry (ECMA 167r3 4/14.11) */ |
---|
714 | 732 | struct unallocSpaceEntry { |
---|
.. | .. |
---|
740 | 758 | /* Short Allocation Descriptor (ECMA 167r3 4/14.14.1) */ |
---|
741 | 759 | |
---|
742 | 760 | /* Extent Length (ECMA 167r3 4/14.14.1.1) */ |
---|
| 761 | +#define EXT_LENGTH_MASK 0x3FFFFFFF |
---|
| 762 | +#define EXT_TYPE_MASK 0xC0000000 |
---|
743 | 763 | #define EXT_RECORDED_ALLOCATED 0x00000000 |
---|
744 | 764 | #define EXT_NOT_RECORDED_ALLOCATED 0x40000000 |
---|
745 | 765 | #define EXT_NOT_RECORDED_NOT_ALLOCATED 0x80000000 |
---|
746 | | -#define EXT_NEXT_EXTENT_ALLOCDECS 0xC0000000 |
---|
| 766 | +#define EXT_NEXT_EXTENT_ALLOCDESCS 0xC0000000 |
---|
747 | 767 | |
---|
748 | 768 | /* Long Allocation Descriptor (ECMA 167r3 4/14.14.2) */ |
---|
749 | 769 | |
---|
.. | .. |
---|
760 | 780 | uint8_t componentType; |
---|
761 | 781 | uint8_t lengthComponentIdent; |
---|
762 | 782 | __le16 componentFileVersionNum; |
---|
763 | | - dstring componentIdent[0]; |
---|
| 783 | + dchars componentIdent[0]; |
---|
764 | 784 | } __packed; |
---|
765 | 785 | |
---|
766 | 786 | /* File Entry (ECMA 167r3 4/14.17) */ |
---|