blob: 698f95318a3606b6c92808fee052aee95e90a1bd [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_JFFS2_H__
20#define __LINUX_JFFS2_H__
21#include <linux/types.h>
22#include <linux/magic.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define JFFS2_OLD_MAGIC_BITMASK 0x1984
24#define JFFS2_MAGIC_BITMASK 0x1985
25#define KSAMTIB_CIGAM_2SFFJ 0x8519
26#define JFFS2_EMPTY_BITMASK 0xffff
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define JFFS2_DIRTY_BITMASK 0x0000
28#define JFFS2_SUM_MAGIC 0x02851885
29#define JFFS2_MAX_NAME_LEN 254
30#define JFFS2_MIN_DATA_LEN 128
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define JFFS2_COMPR_NONE 0x00
32#define JFFS2_COMPR_ZERO 0x01
33#define JFFS2_COMPR_RTIME 0x02
34#define JFFS2_COMPR_RUBINMIPS 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define JFFS2_COMPR_COPY 0x04
36#define JFFS2_COMPR_DYNRUBIN 0x05
37#define JFFS2_COMPR_ZLIB 0x06
38#define JFFS2_COMPR_LZO 0x07
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define JFFS2_COMPAT_MASK 0xc000
40#define JFFS2_NODE_ACCURATE 0x2000
41#define JFFS2_FEATURE_INCOMPAT 0xc000
42#define JFFS2_FEATURE_ROCOMPAT 0x8000
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
44#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
45#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
46#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
48#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
49#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
50#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
52#define JFFS2_XPREFIX_USER 1
53#define JFFS2_XPREFIX_SECURITY 2
54#define JFFS2_XPREFIX_ACL_ACCESS 3
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define JFFS2_XPREFIX_ACL_DEFAULT 4
56#define JFFS2_XPREFIX_TRUSTED 5
57#define JFFS2_ACL_VERSION 0x0001
58#define JFFS2_INO_FLAG_PREREAD 1
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define JFFS2_INO_FLAG_USERCOMPR 2
60typedef struct {
Tao Baod7db5942015-01-28 10:07:51 -080061 __u32 v32;
Ben Cheng655a7c02013-10-16 16:09:24 -070062} __attribute__((packed)) jint32_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070063typedef struct {
Tao Baod7db5942015-01-28 10:07:51 -080064 __u32 m;
Ben Cheng655a7c02013-10-16 16:09:24 -070065} __attribute__((packed)) jmode_t;
66typedef struct {
Tao Baod7db5942015-01-28 10:07:51 -080067 __u16 v16;
Ben Cheng655a7c02013-10-16 16:09:24 -070068} __attribute__((packed)) jint16_t;
Tao Baod7db5942015-01-28 10:07:51 -080069struct jffs2_unknown_node {
70 jint16_t magic;
Tao Baod7db5942015-01-28 10:07:51 -080071 jint16_t nodetype;
72 jint32_t totlen;
73 jint32_t hdr_crc;
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
Tao Baod7db5942015-01-28 10:07:51 -080075struct jffs2_raw_dirent {
76 jint16_t magic;
77 jint16_t nodetype;
78 jint32_t totlen;
Tao Baod7db5942015-01-28 10:07:51 -080079 jint32_t hdr_crc;
80 jint32_t pino;
81 jint32_t version;
82 jint32_t ino;
Tao Baod7db5942015-01-28 10:07:51 -080083 jint32_t mctime;
84 __u8 nsize;
85 __u8 type;
86 __u8 unused[2];
Tao Baod7db5942015-01-28 10:07:51 -080087 jint32_t node_crc;
88 jint32_t name_crc;
89 __u8 name[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
Tao Baod7db5942015-01-28 10:07:51 -080091struct jffs2_raw_inode {
92 jint16_t magic;
93 jint16_t nodetype;
94 jint32_t totlen;
Tao Baod7db5942015-01-28 10:07:51 -080095 jint32_t hdr_crc;
96 jint32_t ino;
97 jint32_t version;
98 jmode_t mode;
Tao Baod7db5942015-01-28 10:07:51 -080099 jint16_t uid;
100 jint16_t gid;
101 jint32_t isize;
102 jint32_t atime;
Tao Baod7db5942015-01-28 10:07:51 -0800103 jint32_t mtime;
104 jint32_t ctime;
105 jint32_t offset;
106 jint32_t csize;
Tao Baod7db5942015-01-28 10:07:51 -0800107 jint32_t dsize;
108 __u8 compr;
109 __u8 usercompr;
110 jint16_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800111 jint32_t data_crc;
112 jint32_t node_crc;
113 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700114};
115struct jffs2_raw_xattr {
Tao Baod7db5942015-01-28 10:07:51 -0800116 jint16_t magic;
117 jint16_t nodetype;
118 jint32_t totlen;
Tao Baod7db5942015-01-28 10:07:51 -0800119 jint32_t hdr_crc;
120 jint32_t xid;
121 jint32_t version;
122 __u8 xprefix;
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u8 name_len;
124 jint16_t value_len;
125 jint32_t data_crc;
126 jint32_t node_crc;
Tao Baod7db5942015-01-28 10:07:51 -0800127 __u8 data[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700128} __attribute__((packed));
Tao Baod7db5942015-01-28 10:07:51 -0800129struct jffs2_raw_xref {
130 jint16_t magic;
Tao Baod7db5942015-01-28 10:07:51 -0800131 jint16_t nodetype;
132 jint32_t totlen;
133 jint32_t hdr_crc;
134 jint32_t ino;
Tao Baod7db5942015-01-28 10:07:51 -0800135 jint32_t xid;
136 jint32_t xseqno;
137 jint32_t node_crc;
Ben Cheng655a7c02013-10-16 16:09:24 -0700138} __attribute__((packed));
Tao Baod7db5942015-01-28 10:07:51 -0800139struct jffs2_raw_summary {
140 jint16_t magic;
141 jint16_t nodetype;
142 jint32_t totlen;
Tao Baod7db5942015-01-28 10:07:51 -0800143 jint32_t hdr_crc;
144 jint32_t sum_num;
145 jint32_t cln_mkr;
146 jint32_t padded;
Tao Baod7db5942015-01-28 10:07:51 -0800147 jint32_t sum_crc;
148 jint32_t node_crc;
149 jint32_t sum[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700150};
Tao Baod7db5942015-01-28 10:07:51 -0800151union jffs2_node_union {
152 struct jffs2_raw_inode i;
153 struct jffs2_raw_dirent d;
154 struct jffs2_raw_xattr x;
Tao Baod7db5942015-01-28 10:07:51 -0800155 struct jffs2_raw_xref r;
156 struct jffs2_raw_summary s;
157 struct jffs2_unknown_node u;
Ben Cheng655a7c02013-10-16 16:09:24 -0700158};
159union jffs2_device_node {
Tao Baod7db5942015-01-28 10:07:51 -0800160 jint16_t old_id;
161 jint32_t new_id;
Ben Cheng655a7c02013-10-16 16:09:24 -0700162};
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#endif