FreeCalypso > hg > freecalypso-tools
annotate ffstools/tiffs-mkfs/struct.h @ 982:1c5b485f10ba
fc-loadtool flash: do AMD reset after PL-J PPB write operations
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 02 Dec 2023 06:04:37 +0000 |
parents | 178ed445021d |
children |
rev | line source |
---|---|
705
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* some general limits */ |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #define MAX_FN_COMPONENT 20 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #define MAX_DIR_NEST 6 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #define MAX_DIR_ENTRIES 128 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 /* tree of content to be written */ |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 struct tree_object { |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 char name[MAX_FN_COMPONENT+1]; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 int is_dir; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 union { |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 struct { |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 struct tree_object *children[MAX_DIR_ENTRIES]; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 unsigned nchildren; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 uint16_t *ffs_link_ptr; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 } d; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 struct { |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 char host_pathname[MAXPATHLEN]; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 } f; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 } u; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 }; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 /* actual TIFFS on-media structure */ |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 struct tiffs_inode { |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 uint16_t size; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 uint8_t reserved1; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 uint8_t type; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 uint16_t child; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 uint16_t sibling; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 uint32_t location; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 uint16_t sequence; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 uint16_t updates; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 }; |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 /* TIFFS object types */ |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #define OBJTYPE_FILE 0xF1 |
717
178ed445021d
tiffs-mkfs: journal creation implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
705
diff
changeset
|
36 #define OBJTYPE_FILE_RO 0xE1 |
705
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #define OBJTYPE_DIR 0xF2 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #define OBJTYPE_SYMLINK 0xF3 |
12ae93940467
tiffs-mkfs program written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #define OBJTYPE_SEGMENT 0xF4 |