Init control word to zero, cdrom-handler reads this and will crash if it is non-zero...
[AROS.git] / rom / partition / partition_support.h
blob6b8d5f01295b6aae6f89974a8ce88c2b8e7f6c92
1 #ifndef PARTITION_SUPPORT_H
2 #define PARTITION_SUPPORT_H
4 /*
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 $Id$
8 */
10 #include <exec/types.h>
11 #include <libraries/partition.h>
12 #include <utility/tagitem.h>
14 #include "partition_intern.h"
16 struct FSFunctionTable;
18 struct FileSysHandle
20 struct Node ln;
21 const struct FSFunctionTable *handler;
22 BOOL boot;
23 /* Handler's private data follows */
26 struct FSFunctionTable
28 BPTR (*loadFileSystem) (struct PartitionBase_intern *, struct FileSysHandle *);
29 LONG (*getFileSystemAttr)(struct Library *, struct FileSysHandle *, const struct TagItem *);
30 void (*freeFileSystem) (struct FileSysHandle *);
33 struct PTFunctionTable
35 ULONG type; /* Partition Table Type */
36 CONST_STRPTR name;
37 LONG (*checkPartitionTable) (struct Library *, struct PartitionHandle *);
38 LONG (*openPartitionTable) (struct Library *, struct PartitionHandle *);
39 void (*closePartitionTable) (struct Library *, struct PartitionHandle *);
40 LONG (*writePartitionTable) (struct Library *, struct PartitionHandle *);
41 LONG (*createPartitionTable) (struct Library *, struct PartitionHandle *);
42 struct PartitionHandle *(*addPartition)(struct Library *, struct PartitionHandle *, struct TagItem *);
43 void (*deletePartition) (struct Library *, struct PartitionHandle *);
44 LONG (*getPartitionTableAttr) (struct Library *, struct PartitionHandle *, struct TagItem *);
45 LONG (*setPartitionTableAttrs) (struct Library *, struct PartitionHandle *, struct TagItem *);
46 LONG (*getPartitionAttr) (struct Library *, struct PartitionHandle *, struct TagItem *);
47 LONG (*setPartitionAttrs) (struct Library *, struct PartitionHandle *, const struct TagItem *);
48 const struct PartitionAttribute *partitionTableAttrs;
49 const struct PartitionAttribute *partitionAttrs;
50 ULONG (*destroyPartitionTable) (struct Library *, struct PartitionHandle *);
51 struct Node *(*findFileSystem) (struct Library *, struct PartitionHandle *, struct TagItem *);
54 struct BootFileSystem
56 struct Node ln;
57 struct FileSysHandle *handle;
60 extern const struct PTFunctionTable * const PartitionSupport[];
62 extern const struct PTFunctionTable PartitionEBR;
63 extern const struct PTFunctionTable PartitionMBR;
64 extern const struct PTFunctionTable PartitionRDB;
65 extern const struct PTFunctionTable PartitionGPT;
66 extern const struct FSFunctionTable FilesystemRDB;
68 LONG PartitionGetGeometry(struct Library *, struct IOExtTD *, struct DriveGeometry *);
69 void PartitionNsdCheck(struct Library *, struct PartitionHandle *);
70 ULONG getStartBlock(struct PartitionHandle *);
71 LONG readBlock(struct Library *, struct PartitionHandle *, ULONG, void *);
72 LONG readDataFromBlock(struct PartitionHandle *ph, UQUAD block, ULONG size, void *mem);
73 LONG PartitionWriteBlock(struct Library *, struct PartitionHandle *, ULONG, void *);
74 LONG writeDataFromBlock(struct PartitionHandle *ph, UQUAD block, ULONG size, void *mem);
75 LONG deviceError(LONG err);
77 void initPartitionHandle(struct PartitionHandle *root, struct PartitionHandle *ph, ULONG first_sector, ULONG count_sector);
78 void setDosType(struct DosEnvec *de, ULONG type);
80 unsigned int Crc32_ComputeBuf(unsigned int inCrc32, const void *buf, unsigned int bufLen);
82 #define getGeometry PartitionGetGeometry
83 #define writeBlock PartitionWriteBlock
85 #endif /* PARTITION_SUPPORT_H */