if AROS is compiled for big endian then set the endianess bit in CPSR when creating...
[AROS.git] / rom / partition / partitionmbr.h
blob5a227a12f48a23174a76bfaf3a214d71a73a16f6
1 #ifndef PARTITIONMBR_H
2 #define PARTITIONMBR_H
4 /*
5 Copyright © 2007-2017, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include <exec/types.h>
10 #include <libraries/partition.h>
12 #include "partition_intern.h"
14 struct PCPartitionTable {
15 UBYTE status;
16 UBYTE start_head;
17 UBYTE start_sector;
18 UBYTE start_cylinder;
19 UBYTE type;
20 UBYTE end_head;
21 UBYTE end_sector;
22 UBYTE end_cylinder;
23 ULONG first_sector;
24 ULONG count_sector;
25 } __attribute__((packed));
27 struct MBR {
28 BYTE boot_data[0x1BE];
29 struct PCPartitionTable pcpt[4];
30 UWORD magic;
31 } __attribute__((packed));
33 #define MBR_MAGIC 0xAA55
34 #define MBR_STATUS_VALID(status) ((!(status & 0x0F)) || (status & 0x80))
36 LONG MBRCheckPartitionTable(struct Library *PartitionBase, struct PartitionHandle *root, void *buffer);
37 void PartitionMBRSetGeometry
39 struct PartitionHandle *root,
40 struct PCPartitionTable *entry,
41 ULONG sector,
42 ULONG count,
43 ULONG relative_sector
45 ULONG PartitionMBRDestroyPartitionTable(struct Library *PartitionBase,
46 struct PartitionHandle *root);
48 #define MBR_MAX_PARTITIONS (4)
49 #define MBRT_EXTENDED (0x05)
50 #define MBRT_EXTENDED2 (0x0f)
53 #endif /* PARTITIONMBR_H */