blob: 8fcd13962d62e169db4d31d3b0d2be084edfe991 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Cheng655a7c02013-10-16 16:09:24 -07007#ifndef __LINUX_ROMFS_FS_H
8#define __LINUX_ROMFS_FS_H
9#include <linux/types.h>
10#include <linux/fs.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define ROMBSIZE BLOCK_SIZE
12#define ROMBSBITS BLOCK_SIZE_BITS
Tao Baod7db5942015-01-28 10:07:51 -080013#define ROMBMASK (ROMBSIZE - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070014#define ROMFS_MAGIC 0x7275
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define ROMFS_MAXFN 128
Tao Baod7db5942015-01-28 10:07:51 -080016#define __mkw(h,l) (((h) & 0x00ff) << 8 | ((l) & 0x00ff))
17#define __mkl(h,l) (((h) & 0xffff) << 16 | ((l) & 0xffff))
18#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a, b), __mkw(c, d)))
Tao Baod7db5942015-01-28 10:07:51 -080019#define ROMSB_WORD0 __mk4('-', 'r', 'o', 'm')
20#define ROMSB_WORD1 __mk4('1', 'f', 's', '-')
Ben Cheng655a7c02013-10-16 16:09:24 -070021struct romfs_super_block {
Tao Baod7db5942015-01-28 10:07:51 -080022 __be32 word0;
Tao Baod7db5942015-01-28 10:07:51 -080023 __be32 word1;
24 __be32 size;
25 __be32 checksum;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070026 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -070027};
28struct romfs_inode {
Tao Baod7db5942015-01-28 10:07:51 -080029 __be32 next;
30 __be32 spec;
Tao Baod7db5942015-01-28 10:07:51 -080031 __be32 size;
32 __be32 checksum;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070033 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -070034};
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define ROMFH_TYPE 7
36#define ROMFH_HRD 0
37#define ROMFH_DIR 1
38#define ROMFH_REG 2
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define ROMFH_SYM 3
40#define ROMFH_BLK 4
41#define ROMFH_CHR 5
42#define ROMFH_SCK 6
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define ROMFH_FIF 7
44#define ROMFH_EXEC 8
45#define ROMFH_SIZE 16
Tao Baod7db5942015-01-28 10:07:51 -080046#define ROMFH_PAD (ROMFH_SIZE - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define ROMFH_MASK (~ROMFH_PAD)
48#endif