alsa.audio: build the bridge link lib only for linux architecture
[AROS.git] / arch / ppc-sam440 / boot / parthenope / src / sfs.h
blob64aff8387f9530ffc32ea78bfb26d77c3b75729a
1 /* sfs.h */
3 /* <project_name> -- <project_description>
5 * Copyright (C) 2006 - 2007
6 * Giuseppe Coviello <cjg@cruxppc.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef _SFS_H
24 #define _SFS_H
26 #include "rdb.h"
27 #include "device.h"
28 #include "support.h"
30 struct SfsBlockHeader {
31 uint32_t id;
32 uint32_t checksum;
33 uint32_t ownblock;
35 #define SBH(b) ((struct SfsBlockHeader *) (b))
37 struct SfsRootBlock {
38 struct SfsBlockHeader bheader;
40 uint16_t version;
41 uint16_t sequencenumber;
43 uint32_t datecreated;
44 uint8_t bits;
45 uint8_t pad1;
46 uint16_t pad2;
48 uint32_t reserved1[2];
50 uint32_t firstbyteh;
51 uint32_t firstbyte;
53 uint32_t lastbyteh;
54 uint32_t lastbyte;
56 uint32_t totalblocks;
57 uint32_t blocksize;
59 uint32_t reserved2[2];
60 uint32_t reserved3[8];
62 uint32_t bitmapbase;
63 uint32_t adminspacecontainer;
64 uint32_t rootobjectcontainer;
65 uint32_t extentbnoderoot;
67 uint32_t reserved4[4];
69 #define SRB(b) ((struct SfsRootBlock *) (b))
70 #define SRB_ID 0x53465300
72 struct SfsObject {
73 uint16_t owneruid;
74 uint16_t ownergid;
75 uint32_t objectnode;
76 uint32_t protection;
78 union {
79 struct {
80 uint32_t data;
81 uint32_t size;
82 } file;
84 struct {
85 uint32_t hashtable;
86 uint32_t firstdirblock;
87 } dir;
88 } object;
90 uint32_t datemodified;
91 uint8_t bits; /* see defines below */
93 uint8_t name[0];
94 uint8_t comment[0];
96 #define SO(b) ((struct SfsObject *) (b))
97 #define SO_ID 0x53465300
99 #define OTYPE_DELETED (32)
100 #define OTYPE_LINK (64)
101 #define OTYPE_DIR (128)
103 struct SfsObjectContainer {
104 struct SfsBlockHeader bheader;
105 uint32_t parent;
106 uint32_t next;
107 uint32_t previous;
108 struct SfsObject object[1];
110 #define SOC(b) ((struct SfsObjectContainer *) (b))
111 #define SOC_ID (('O'<<24)|('B'<<16)|('J'<<8)|'C')
113 struct BNode {
114 uint32_t key;
115 uint32_t data;
118 struct BTreeContainer {
119 uint16_t nodecount;
120 uint8_t isleaf;
121 uint8_t nodesize;
123 struct BNode bnode[0];
126 struct SfsBNodeContainer {
127 struct SfsBlockHeader bheader;
128 struct BTreeContainer btc;
130 #define SBNC(b) ((struct SfsBNodeContainer *) (b))
132 struct SfsExtentBNode {
133 uint32_t key;
134 uint32_t next;
135 uint32_t prev;
136 uint16_t blocks;
139 boot_dev_t *sfs_create(struct RdbPartition *partition);
141 #endif /* _SFS_H */