blob: 8e987148054172357f286ff2c828e1e63611c7c2 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 __LINUX_ROMFS_FS_H
20#define __LINUX_ROMFS_FS_H
21#include <linux/types.h>
22#include <linux/fs.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define ROMBSIZE BLOCK_SIZE
24#define ROMBSBITS BLOCK_SIZE_BITS
Tao Baod7db5942015-01-28 10:07:51 -080025#define ROMBMASK (ROMBSIZE - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define ROMFS_MAGIC 0x7275
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define ROMFS_MAXFN 128
Tao Baod7db5942015-01-28 10:07:51 -080028#define __mkw(h,l) (((h) & 0x00ff) << 8 | ((l) & 0x00ff))
29#define __mkl(h,l) (((h) & 0xffff) << 16 | ((l) & 0xffff))
30#define __mk4(a,b,c,d) cpu_to_be32(__mkl(__mkw(a, b), __mkw(c, d)))
Tao Baod7db5942015-01-28 10:07:51 -080031#define ROMSB_WORD0 __mk4('-', 'r', 'o', 'm')
32#define ROMSB_WORD1 __mk4('1', 'f', 's', '-')
Ben Cheng655a7c02013-10-16 16:09:24 -070033struct romfs_super_block {
Tao Baod7db5942015-01-28 10:07:51 -080034 __be32 word0;
Tao Baod7db5942015-01-28 10:07:51 -080035 __be32 word1;
36 __be32 size;
37 __be32 checksum;
38 char name[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070039};
40struct romfs_inode {
Tao Baod7db5942015-01-28 10:07:51 -080041 __be32 next;
42 __be32 spec;
Tao Baod7db5942015-01-28 10:07:51 -080043 __be32 size;
44 __be32 checksum;
45 char name[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define ROMFH_TYPE 7
48#define ROMFH_HRD 0
49#define ROMFH_DIR 1
50#define ROMFH_REG 2
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define ROMFH_SYM 3
52#define ROMFH_BLK 4
53#define ROMFH_CHR 5
54#define ROMFH_SCK 6
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define ROMFH_FIF 7
56#define ROMFH_EXEC 8
57#define ROMFH_SIZE 16
Tao Baod7db5942015-01-28 10:07:51 -080058#define ROMFH_PAD (ROMFH_SIZE - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define ROMFH_MASK (~ROMFH_PAD)
60#endif