Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _ISOFS_FS_H |
| 20 | #define _ISOFS_FS_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/magic.h> |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | #define ISODCL(from,to) (to - from + 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | struct iso_volume_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 25 | char type[ISODCL(1, 1)]; |
| 26 | char id[ISODCL(2, 6)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | char version[ISODCL(7, 7)]; |
| 28 | char data[ISODCL(8, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | }; |
| 30 | #define ISO_VD_PRIMARY 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define ISO_VD_SUPPLEMENTARY 2 |
| 32 | #define ISO_VD_END 255 |
| 33 | #define ISO_STANDARD_ID "CD001" |
| 34 | struct iso_primary_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | char type[ISODCL(1, 1)]; |
| 36 | char id[ISODCL(2, 6)]; |
| 37 | char version[ISODCL(7, 7)]; |
| 38 | char unused1[ISODCL(8, 8)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | char system_id[ISODCL(9, 40)]; |
| 40 | char volume_id[ISODCL(41, 72)]; |
| 41 | char unused2[ISODCL(73, 80)]; |
| 42 | char volume_space_size[ISODCL(81, 88)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | char unused3[ISODCL(89, 120)]; |
| 44 | char volume_set_size[ISODCL(121, 124)]; |
| 45 | char volume_sequence_number[ISODCL(125, 128)]; |
| 46 | char logical_block_size[ISODCL(129, 132)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | char path_table_size[ISODCL(133, 140)]; |
| 48 | char type_l_path_table[ISODCL(141, 144)]; |
| 49 | char opt_type_l_path_table[ISODCL(145, 148)]; |
| 50 | char type_m_path_table[ISODCL(149, 152)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | char opt_type_m_path_table[ISODCL(153, 156)]; |
| 52 | char root_directory_record[ISODCL(157, 190)]; |
| 53 | char volume_set_id[ISODCL(191, 318)]; |
| 54 | char publisher_id[ISODCL(319, 446)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | char preparer_id[ISODCL(447, 574)]; |
| 56 | char application_id[ISODCL(575, 702)]; |
| 57 | char copyright_file_id[ISODCL(703, 739)]; |
| 58 | char abstract_file_id[ISODCL(740, 776)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | char bibliographic_file_id[ISODCL(777, 813)]; |
| 60 | char creation_date[ISODCL(814, 830)]; |
| 61 | char modification_date[ISODCL(831, 847)]; |
| 62 | char expiration_date[ISODCL(848, 864)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | char effective_date[ISODCL(865, 881)]; |
| 64 | char file_structure_version[ISODCL(882, 882)]; |
| 65 | char unused4[ISODCL(883, 883)]; |
| 66 | char application_data[ISODCL(884, 1395)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | char unused5[ISODCL(1396, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | }; |
| 69 | struct iso_supplementary_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | char type[ISODCL(1, 1)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | char id[ISODCL(2, 6)]; |
| 72 | char version[ISODCL(7, 7)]; |
| 73 | char flags[ISODCL(8, 8)]; |
| 74 | char system_id[ISODCL(9, 40)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | char volume_id[ISODCL(41, 72)]; |
| 76 | char unused2[ISODCL(73, 80)]; |
| 77 | char volume_space_size[ISODCL(81, 88)]; |
| 78 | char escape[ISODCL(89, 120)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | char volume_set_size[ISODCL(121, 124)]; |
| 80 | char volume_sequence_number[ISODCL(125, 128)]; |
| 81 | char logical_block_size[ISODCL(129, 132)]; |
| 82 | char path_table_size[ISODCL(133, 140)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | char type_l_path_table[ISODCL(141, 144)]; |
| 84 | char opt_type_l_path_table[ISODCL(145, 148)]; |
| 85 | char type_m_path_table[ISODCL(149, 152)]; |
| 86 | char opt_type_m_path_table[ISODCL(153, 156)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | char root_directory_record[ISODCL(157, 190)]; |
| 88 | char volume_set_id[ISODCL(191, 318)]; |
| 89 | char publisher_id[ISODCL(319, 446)]; |
| 90 | char preparer_id[ISODCL(447, 574)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | char application_id[ISODCL(575, 702)]; |
| 92 | char copyright_file_id[ISODCL(703, 739)]; |
| 93 | char abstract_file_id[ISODCL(740, 776)]; |
| 94 | char bibliographic_file_id[ISODCL(777, 813)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | char creation_date[ISODCL(814, 830)]; |
| 96 | char modification_date[ISODCL(831, 847)]; |
| 97 | char expiration_date[ISODCL(848, 864)]; |
| 98 | char effective_date[ISODCL(865, 881)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | char file_structure_version[ISODCL(882, 882)]; |
| 100 | char unused4[ISODCL(883, 883)]; |
| 101 | char application_data[ISODCL(884, 1395)]; |
| 102 | char unused5[ISODCL(1396, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 103 | }; |
| 104 | #define HS_STANDARD_ID "CDROM" |
| 105 | struct hs_volume_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | char foo[ISODCL(1, 8)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | char type[ISODCL(9, 9)]; |
| 108 | char id[ISODCL(10, 14)]; |
| 109 | char version[ISODCL(15, 15)]; |
| 110 | char data[ISODCL(16, 2048)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | }; |
| 112 | struct hs_primary_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 113 | char foo[ISODCL(1, 8)]; |
| 114 | char type[ISODCL(9, 9)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 115 | char id[ISODCL(10, 14)]; |
| 116 | char version[ISODCL(15, 15)]; |
| 117 | char unused1[ISODCL(16, 16)]; |
| 118 | char system_id[ISODCL(17, 48)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | char volume_id[ISODCL(49, 80)]; |
| 120 | char unused2[ISODCL(81, 88)]; |
| 121 | char volume_space_size[ISODCL(89, 96)]; |
| 122 | char unused3[ISODCL(97, 128)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 123 | char volume_set_size[ISODCL(129, 132)]; |
| 124 | char volume_sequence_number[ISODCL(133, 136)]; |
| 125 | char logical_block_size[ISODCL(137, 140)]; |
| 126 | char path_table_size[ISODCL(141, 148)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | char type_l_path_table[ISODCL(149, 152)]; |
| 128 | char unused4[ISODCL(153, 180)]; |
| 129 | char root_directory_record[ISODCL(181, 214)]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 130 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 | struct iso_path_table { |
| 132 | unsigned char name_len[2]; |
| 133 | char extent[4]; |
| 134 | char parent[2]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 | char name[0]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 136 | } __attribute__((packed)); |
| 137 | struct iso_directory_record { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 138 | char length[ISODCL(1, 1)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 | char ext_attr_length[ISODCL(2, 2)]; |
| 140 | char extent[ISODCL(3, 10)]; |
| 141 | char size[ISODCL(11, 18)]; |
| 142 | char date[ISODCL(19, 25)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | char flags[ISODCL(26, 26)]; |
| 144 | char file_unit_size[ISODCL(27, 27)]; |
| 145 | char interleave[ISODCL(28, 28)]; |
| 146 | char volume_sequence_number[ISODCL(29, 32)]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | unsigned char name_len[ISODCL(33, 33)]; |
| 148 | char name[0]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 149 | } __attribute__((packed)); |
| 150 | #define ISOFS_BLOCK_BITS 11 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 151 | #define ISOFS_BLOCK_SIZE 2048 |
| 152 | #define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) |
| 153 | #define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) |
| 154 | #endif |