| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
 | 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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define CRAMFS_SIGNATURE "Compressed ROMFS" | 
 | 24 | #define CRAMFS_MODE_WIDTH 16 | 
 | 25 | #define CRAMFS_UID_WIDTH 16 | 
 | 26 | #define CRAMFS_SIZE_WIDTH 24 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | struct cramfs_inode { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 |   __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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | }; | 
 | 36 | struct cramfs_info { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 37 |   __u32 crc; | 
 | 38 |   __u32 edition; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 |   __u32 blocks; | 
 | 40 |   __u32 files; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | }; | 
 | 42 | struct cramfs_super { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 |   __u32 magic; | 
 | 44 |   __u32 size; | 
 | 45 |   __u32 flags; | 
 | 46 |   __u32 future; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 |   __u8 signature[16]; | 
 | 48 |   struct cramfs_info fsid; | 
 | 49 |   __u8 name[16]; | 
 | 50 |   struct cramfs_inode root; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | }; | 
 | 52 | #define CRAMFS_FLAG_FSID_VERSION_2 0x00000001 | 
 | 53 | #define CRAMFS_FLAG_SORTED_DIRS 0x00000002 | 
 | 54 | #define CRAMFS_FLAG_HOLES 0x00000100 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define CRAMFS_FLAG_WRONG_SIGNATURE 0x00000200 | 
 | 56 | #define CRAMFS_FLAG_SHIFTED_ROOT_OFFSET 0x00000400 | 
| Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 57 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | #endif |