blob: 77baccebd86f2ac073ed9c717ef18a29e98bd807 [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 _UAPI__CRAMFS_H
8#define _UAPI__CRAMFS_H
9#include <linux/types.h>
10#include <linux/magic.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define CRAMFS_SIGNATURE "Compressed ROMFS"
12#define CRAMFS_MODE_WIDTH 16
13#define CRAMFS_UID_WIDTH 16
14#define CRAMFS_SIZE_WIDTH 24
Ben Cheng655a7c02013-10-16 16:09:24 -070015#define CRAMFS_GID_WIDTH 8
16#define CRAMFS_NAMELEN_WIDTH 6
17#define CRAMFS_OFFSET_WIDTH 26
18#define CRAMFS_MAXPATHLEN (((1 << CRAMFS_NAMELEN_WIDTH) - 1) << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -070019struct cramfs_inode {
Tao Baod7db5942015-01-28 10:07:51 -080020 __u32 mode : CRAMFS_MODE_WIDTH, uid : CRAMFS_UID_WIDTH;
21 __u32 size : CRAMFS_SIZE_WIDTH, gid : CRAMFS_GID_WIDTH;
22 __u32 namelen : CRAMFS_NAMELEN_WIDTH, offset : CRAMFS_OFFSET_WIDTH;
Ben Cheng655a7c02013-10-16 16:09:24 -070023};
24struct cramfs_info {
Tao Baod7db5942015-01-28 10:07:51 -080025 __u32 crc;
26 __u32 edition;
Tao Baod7db5942015-01-28 10:07:51 -080027 __u32 blocks;
28 __u32 files;
Ben Cheng655a7c02013-10-16 16:09:24 -070029};
30struct cramfs_super {
Tao Baod7db5942015-01-28 10:07:51 -080031 __u32 magic;
32 __u32 size;
33 __u32 flags;
34 __u32 future;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 signature[16];
36 struct cramfs_info fsid;
37 __u8 name[16];
38 struct cramfs_inode root;
Ben Cheng655a7c02013-10-16 16:09:24 -070039};
40#define CRAMFS_FLAG_FSID_VERSION_2 0x00000001
41#define CRAMFS_FLAG_SORTED_DIRS 0x00000002
42#define CRAMFS_FLAG_HOLES 0x00000100
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200
44#define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400
Christopher Ferris934ec942018-01-31 15:29:16 -080045#define CRAMFS_FLAG_EXT_BLOCK_POINTERS 0x00000800
46#define CRAMFS_SUPPORTED_FLAGS (0x000000ff | CRAMFS_FLAG_HOLES | CRAMFS_FLAG_WRONG_SIGNATURE | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET | CRAMFS_FLAG_EXT_BLOCK_POINTERS)
47#define CRAMFS_BLK_FLAG_UNCOMPRESSED (1 << 31)
48#define CRAMFS_BLK_FLAG_DIRECT_PTR (1 << 30)
49#define CRAMFS_BLK_FLAGS (CRAMFS_BLK_FLAG_UNCOMPRESSED | CRAMFS_BLK_FLAG_DIRECT_PTR)
50#define CRAMFS_BLK_DIRECT_PTR_SHIFT 2
Ben Cheng655a7c02013-10-16 16:09:24 -070051#endif