xref: /openbmc/linux/fs/affs/amigaffs.h (revision 65417d9f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef AMIGAFFS_H
3 #define AMIGAFFS_H
4 
5 #include <linux/types.h>
6 #include <asm/byteorder.h>
7 
8 #define FS_OFS		0x444F5300
9 #define FS_FFS		0x444F5301
10 #define FS_INTLOFS	0x444F5302
11 #define FS_INTLFFS	0x444F5303
12 #define FS_DCOFS	0x444F5304
13 #define FS_DCFFS	0x444F5305
14 #define MUFS_FS		0x6d754653   /* 'muFS' */
15 #define MUFS_OFS	0x6d754600   /* 'muF\0' */
16 #define MUFS_FFS	0x6d754601   /* 'muF\1' */
17 #define MUFS_INTLOFS	0x6d754602   /* 'muF\2' */
18 #define MUFS_INTLFFS	0x6d754603   /* 'muF\3' */
19 #define MUFS_DCOFS	0x6d754604   /* 'muF\4' */
20 #define MUFS_DCFFS	0x6d754605   /* 'muF\5' */
21 
22 #define T_SHORT		2
23 #define T_LIST		16
24 #define T_DATA		8
25 
26 #define ST_LINKFILE	-4
27 #define ST_FILE		-3
28 #define ST_ROOT		1
29 #define ST_USERDIR	2
30 #define ST_SOFTLINK	3
31 #define ST_LINKDIR	4
32 
33 #define AFFS_ROOT_BMAPS		25
34 
35 struct affs_date {
36 	__be32 days;
37 	__be32 mins;
38 	__be32 ticks;
39 };
40 
41 struct affs_short_date {
42 	__be16 days;
43 	__be16 mins;
44 	__be16 ticks;
45 };
46 
47 struct affs_root_head {
48 	__be32 ptype;
49 	__be32 spare1;
50 	__be32 spare2;
51 	__be32 hash_size;
52 	__be32 spare3;
53 	__be32 checksum;
54 	__be32 hashtable[1];
55 };
56 
57 struct affs_root_tail {
58 	__be32 bm_flag;
59 	__be32 bm_blk[AFFS_ROOT_BMAPS];
60 	__be32 bm_ext;
61 	struct affs_date root_change;
62 	u8 disk_name[32];
63 	__be32 spare1;
64 	__be32 spare2;
65 	struct affs_date disk_change;
66 	struct affs_date disk_create;
67 	__be32 spare3;
68 	__be32 spare4;
69 	__be32 dcache;
70 	__be32 stype;
71 };
72 
73 struct affs_head {
74 	__be32 ptype;
75 	__be32 key;
76 	__be32 block_count;
77 	__be32 spare1;
78 	__be32 first_data;
79 	__be32 checksum;
80 	__be32 table[1];
81 };
82 
83 struct affs_tail {
84 	__be32 spare1;
85 	__be16 uid;
86 	__be16 gid;
87 	__be32 protect;
88 	__be32 size;
89 	u8 comment[92];
90 	struct affs_date change;
91 	u8 name[32];
92 	__be32 spare2;
93 	__be32 original;
94 	__be32 link_chain;
95 	__be32 spare[5];
96 	__be32 hash_chain;
97 	__be32 parent;
98 	__be32 extension;
99 	__be32 stype;
100 };
101 
102 struct slink_front
103 {
104 	__be32 ptype;
105 	__be32 key;
106 	__be32 spare1[3];
107 	__be32 checksum;
108 	u8 symname[1];	/* depends on block size */
109 };
110 
111 struct affs_data_head
112 {
113 	__be32 ptype;
114 	__be32 key;
115 	__be32 sequence;
116 	__be32 size;
117 	__be32 next;
118 	__be32 checksum;
119 	u8 data[1];	/* depends on block size */
120 };
121 
122 /* Permission bits */
123 
124 #define FIBF_OTR_READ		0x8000
125 #define FIBF_OTR_WRITE		0x4000
126 #define FIBF_OTR_EXECUTE	0x2000
127 #define FIBF_OTR_DELETE		0x1000
128 #define FIBF_GRP_READ		0x0800
129 #define FIBF_GRP_WRITE		0x0400
130 #define FIBF_GRP_EXECUTE	0x0200
131 #define FIBF_GRP_DELETE		0x0100
132 
133 #define FIBF_HIDDEN		0x0080
134 #define FIBF_SCRIPT		0x0040
135 #define FIBF_PURE		0x0020		/* no use under linux */
136 #define FIBF_ARCHIVED		0x0010		/* never set, always cleared on write */
137 #define FIBF_NOREAD		0x0008		/* 0 means allowed */
138 #define FIBF_NOWRITE		0x0004		/* 0 means allowed */
139 #define FIBF_NOEXECUTE		0x0002		/* 0 means allowed, ignored under linux */
140 #define FIBF_NODELETE		0x0001		/* 0 means allowed */
141 
142 #define FIBF_OWNER		0x000F		/* Bits pertaining to owner */
143 #define FIBF_MASK		0xEE0E		/* Bits modified by Linux */
144 
145 #endif
146