blob: 887291487860c2f16b06681e59f6796e4a691193 [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 _UAPI__CRAMFS_H
20#define _UAPI__CRAMFS_H
21#include <linux/types.h>
22#include <linux/magic.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define CRAMFS_SIGNATURE "Compressed ROMFS"
24#define CRAMFS_MODE_WIDTH 16
25#define CRAMFS_UID_WIDTH 16
26#define CRAMFS_SIZE_WIDTH 24
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define CRAMFS_GID_WIDTH 8
28#define CRAMFS_NAMELEN_WIDTH 6
29#define CRAMFS_OFFSET_WIDTH 26
30#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070031struct cramfs_inode {
Tao Baod7db5942015-01-28 10:07:51 -080032 __u32 mode : CRAMFS_MODE_WIDTH, uid : CRAMFS_UID_WIDTH;
33 __u32 size : CRAMFS_SIZE_WIDTH, gid : CRAMFS_GID_WIDTH;
34 __u32 namelen : CRAMFS_NAMELEN_WIDTH, offset : CRAMFS_OFFSET_WIDTH;
Ben Cheng655a7c02013-10-16 16:09:24 -070035};
36struct cramfs_info {
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 crc;
38 __u32 edition;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 blocks;
40 __u32 files;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42struct cramfs_super {
Tao Baod7db5942015-01-28 10:07:51 -080043 __u32 magic;
44 __u32 size;
45 __u32 flags;
46 __u32 future;
Tao Baod7db5942015-01-28 10:07:51 -080047 __u8 signature[16];
48 struct cramfs_info fsid;
49 __u8 name[16];
50 struct cramfs_inode root;
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001
53#define CRAMFS_FLAG_SORTED_DIRS 0x00000002
54#define CRAMFS_FLAG_HOLES 0x00000100
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200
56#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400
Christopher Ferris934ec942018-01-31 15:29:16 -080057#define CRAMFS_FLAG_EXT_BLOCK_POINTERS 0x00000800
58#define CRAMFS_SUPPORTED_FLAGS (0x000000ff | CRAMFS_FLAG_HOLES | CRAMFS_FLAG_WRONG_SIGNATURE | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET | CRAMFS_FLAG_EXT_BLOCK_POINTERS)
59#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1 << 31)
60#define CRAMFS_BLK_FLAG_DIRECT_PTR (1 << 30)
61#define CRAMFS_BLK_FLAGS (CRAMFS_BLK_FLAG_UNCOMPRESSED | CRAMFS_BLK_FLAG_DIRECT_PTR)
62#define CRAMFS_BLK_DIRECT_PTR_SHIFT 2
Ben Cheng655a7c02013-10-16 16:09:24 -070063#endif