Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _ISOFS_FS_H |
| 8 | #define _ISOFS_FS_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/magic.h> |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 11 | #define ISODCL(from,to) (to - from + 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 12 | struct iso_volume_descriptor { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 13 | __u8 type[ISODCL(1, 1)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 14 | char id[ISODCL(2, 6)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 15 | __u8 version[ISODCL(7, 7)]; |
| 16 | __u8 data[ISODCL(8, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 17 | }; |
| 18 | #define ISO_VD_PRIMARY 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 19 | #define ISO_VD_SUPPLEMENTARY 2 |
| 20 | #define ISO_VD_END 255 |
| 21 | #define ISO_STANDARD_ID "CD001" |
| 22 | struct iso_primary_descriptor { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 23 | __u8 type[ISODCL(1, 1)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 24 | char id[ISODCL(2, 6)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 25 | __u8 version[ISODCL(7, 7)]; |
| 26 | __u8 unused1[ISODCL(8, 8)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | char system_id[ISODCL(9, 40)]; |
| 28 | char volume_id[ISODCL(41, 72)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 29 | __u8 unused2[ISODCL(73, 80)]; |
| 30 | __u8 volume_space_size[ISODCL(81, 88)]; |
| 31 | __u8 unused3[ISODCL(89, 120)]; |
| 32 | __u8 volume_set_size[ISODCL(121, 124)]; |
| 33 | __u8 volume_sequence_number[ISODCL(125, 128)]; |
| 34 | __u8 logical_block_size[ISODCL(129, 132)]; |
| 35 | __u8 path_table_size[ISODCL(133, 140)]; |
| 36 | __u8 type_l_path_table[ISODCL(141, 144)]; |
| 37 | __u8 opt_type_l_path_table[ISODCL(145, 148)]; |
| 38 | __u8 type_m_path_table[ISODCL(149, 152)]; |
| 39 | __u8 opt_type_m_path_table[ISODCL(153, 156)]; |
| 40 | __u8 root_directory_record[ISODCL(157, 190)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | char volume_set_id[ISODCL(191, 318)]; |
| 42 | char publisher_id[ISODCL(319, 446)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | char preparer_id[ISODCL(447, 574)]; |
| 44 | char application_id[ISODCL(575, 702)]; |
| 45 | char copyright_file_id[ISODCL(703, 739)]; |
| 46 | char abstract_file_id[ISODCL(740, 776)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | char bibliographic_file_id[ISODCL(777, 813)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 48 | __u8 creation_date[ISODCL(814, 830)]; |
| 49 | __u8 modification_date[ISODCL(831, 847)]; |
| 50 | __u8 expiration_date[ISODCL(848, 864)]; |
| 51 | __u8 effective_date[ISODCL(865, 881)]; |
| 52 | __u8 file_structure_version[ISODCL(882, 882)]; |
| 53 | __u8 unused4[ISODCL(883, 883)]; |
| 54 | __u8 application_data[ISODCL(884, 1395)]; |
| 55 | __u8 unused5[ISODCL(1396, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | }; |
| 57 | struct iso_supplementary_descriptor { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 58 | __u8 type[ISODCL(1, 1)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | char id[ISODCL(2, 6)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 60 | __u8 version[ISODCL(7, 7)]; |
| 61 | __u8 flags[ISODCL(8, 8)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 62 | char system_id[ISODCL(9, 40)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | char volume_id[ISODCL(41, 72)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 64 | __u8 unused2[ISODCL(73, 80)]; |
| 65 | __u8 volume_space_size[ISODCL(81, 88)]; |
| 66 | __u8 escape[ISODCL(89, 120)]; |
| 67 | __u8 volume_set_size[ISODCL(121, 124)]; |
| 68 | __u8 volume_sequence_number[ISODCL(125, 128)]; |
| 69 | __u8 logical_block_size[ISODCL(129, 132)]; |
| 70 | __u8 path_table_size[ISODCL(133, 140)]; |
| 71 | __u8 type_l_path_table[ISODCL(141, 144)]; |
| 72 | __u8 opt_type_l_path_table[ISODCL(145, 148)]; |
| 73 | __u8 type_m_path_table[ISODCL(149, 152)]; |
| 74 | __u8 opt_type_m_path_table[ISODCL(153, 156)]; |
| 75 | __u8 root_directory_record[ISODCL(157, 190)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | char volume_set_id[ISODCL(191, 318)]; |
| 77 | char publisher_id[ISODCL(319, 446)]; |
| 78 | char preparer_id[ISODCL(447, 574)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | char application_id[ISODCL(575, 702)]; |
| 80 | char copyright_file_id[ISODCL(703, 739)]; |
| 81 | char abstract_file_id[ISODCL(740, 776)]; |
| 82 | char bibliographic_file_id[ISODCL(777, 813)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 83 | __u8 creation_date[ISODCL(814, 830)]; |
| 84 | __u8 modification_date[ISODCL(831, 847)]; |
| 85 | __u8 expiration_date[ISODCL(848, 864)]; |
| 86 | __u8 effective_date[ISODCL(865, 881)]; |
| 87 | __u8 file_structure_version[ISODCL(882, 882)]; |
| 88 | __u8 unused4[ISODCL(883, 883)]; |
| 89 | __u8 application_data[ISODCL(884, 1395)]; |
| 90 | __u8 unused5[ISODCL(1396, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | }; |
| 92 | #define HS_STANDARD_ID "CDROM" |
| 93 | struct hs_volume_descriptor { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 94 | __u8 foo[ISODCL(1, 8)]; |
| 95 | __u8 type[ISODCL(9, 9)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | char id[ISODCL(10, 14)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 97 | __u8 version[ISODCL(15, 15)]; |
| 98 | __u8 data[ISODCL(16, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | }; |
| 100 | struct hs_primary_descriptor { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 101 | __u8 foo[ISODCL(1, 8)]; |
| 102 | __u8 type[ISODCL(9, 9)]; |
| 103 | __u8 id[ISODCL(10, 14)]; |
| 104 | __u8 version[ISODCL(15, 15)]; |
| 105 | __u8 unused1[ISODCL(16, 16)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | char system_id[ISODCL(17, 48)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | char volume_id[ISODCL(49, 80)]; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 108 | __u8 unused2[ISODCL(81, 88)]; |
| 109 | __u8 volume_space_size[ISODCL(89, 96)]; |
| 110 | __u8 unused3[ISODCL(97, 128)]; |
| 111 | __u8 volume_set_size[ISODCL(129, 132)]; |
| 112 | __u8 volume_sequence_number[ISODCL(133, 136)]; |
| 113 | __u8 logical_block_size[ISODCL(137, 140)]; |
| 114 | __u8 path_table_size[ISODCL(141, 148)]; |
| 115 | __u8 type_l_path_table[ISODCL(149, 152)]; |
| 116 | __u8 unused4[ISODCL(153, 180)]; |
| 117 | __u8 root_directory_record[ISODCL(181, 214)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 118 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | struct iso_path_table { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 120 | __u8 name_len[2]; |
| 121 | __u8 extent[4]; |
| 122 | __u8 parent[2]; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 123 | char name[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | } __attribute__((packed)); |
| 125 | struct iso_directory_record { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 126 | __u8 length[ISODCL(1, 1)]; |
| 127 | __u8 ext_attr_length[ISODCL(2, 2)]; |
| 128 | __u8 extent[ISODCL(3, 10)]; |
| 129 | __u8 size[ISODCL(11, 18)]; |
| 130 | __u8 date[ISODCL(19, 25)]; |
| 131 | __u8 flags[ISODCL(26, 26)]; |
| 132 | __u8 file_unit_size[ISODCL(27, 27)]; |
| 133 | __u8 interleave[ISODCL(28, 28)]; |
| 134 | __u8 volume_sequence_number[ISODCL(29, 32)]; |
| 135 | __u8 name_len[ISODCL(33, 33)]; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 136 | char name[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 137 | } __attribute__((packed)); |
| 138 | #define ISOFS_BLOCK_BITS 11 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 139 | #define ISOFS_BLOCK_SIZE 2048 |
| 140 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) |
| 141 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) |
| 142 | #endif |