5 Copyright © 2003-2007, The AROS Development Team. All rights reserved.
9 #include <devices/trackdisk.h>
10 #include <dos/filehandler.h>
11 #include <utility/tagitem.h>
12 #include <exec/lists.h>
13 #include <exec/nodes.h>
14 #include <exec/types.h>
15 #include <exec/ports.h>
16 #include <libcore/base.h>
18 struct PartitionTableInfo
24 struct PartitionBlockDevice
27 struct IOExtTD
*ioreq
;
32 struct PartitionTableHandler
35 struct List list
; /* list of partitions */
36 void *handler
; /* the handler which handles this partition table */
37 void *data
; /* private field for the table */
40 struct PartitionHandle
43 struct PartitionHandle
*root
; /* root partition handle */
44 struct PartitionBlockDevice
*bd
; /* block device info */
46 struct PartitionTableHandler
*table
;
47 void *data
; /* a private field for the partition */
48 struct DriveGeometry dg
; /* geometry of whole partition */
49 struct DosEnvec de
; /* info about HD/partition including */
50 /* position within root->dg */
51 /* (de_Surfaces==root->dg.Heads,...!!!) */
60 /* partition table types */
61 #define PHPTT_UNKNOWN (0)
67 //nothing defined here ...
69 /* commands for DoPartition() */
71 /* Tags for partition tables */
72 #define PTT_TYPE (TAG_USER | 1L) /* ULONG - partition table type */
73 #define PTT_MAXLEADIN (TAG_USER | 3L) /* ULONG - maximum number of
74 reserved blocks that may be need to precede a partition for metadata */
75 #define PTT_RESERVED (TAG_USER | 32L) /* ULONG - number of reserved blocks at
76 begining of a partition table */
77 #define PTT_MAX_PARTITIONS (TAG_USER | 33L) /* ULONG - max number of partitions in table */
80 /* Tags for partitions */
81 #define PT_GEOMETRY (TAG_USER | 1L) /* struct DriveGeometry * - geometry of partition */
82 #define PT_DOSENVEC (TAG_USER | 2L) /* struct DosEnvec * - partition layout info */
83 #define PT_TYPE (TAG_USER | 3L) /* struct PartitionType * - type of partition */
84 #define PT_LEADIN (TAG_USER | 4L) /* ULONG - number of reserved blocks
85 preceding partition for metadata */
86 #define PT_POSITION (TAG_USER | 32L) /* ULONG - 1st partition, 2nd ... (Linux: hdX0, hdX1, ... */
87 #define PT_ACTIVE (TAG_USER | 33L) /* BOOL - MBR: set/get partition as active */
88 #define PT_NAME (TAG_USER | 34L) /* STRPTR - name of partition */
89 #define PT_BOOTABLE (TAG_USER | 35L) /* BOOL - partition is bootable */
90 #define PT_AUTOMOUNT (TAG_USER | 36L) /* BOOL - partition will be auto mounted */
95 struct PartitionAttribute
101 /* are attributes readable/writeable */
102 #define PLAM_READ (1<<0)
103 #define PLAM_WRITE (1<<1)
105 /* partition table attributes */
106 #define PTTA_DONE 0 /* no more attributes */
107 #define PTTA_TYPE 100 /* partition table type */
108 #define PTTA_MAXLEADIN 1
109 #define PTTA_RESERVED 101 /* reserved blocks */
110 #define PTTA_MAX_PARTITIONS 102 /* max numbers of partitions in table */
112 /* partition attributes */
113 #define PTA_DONE PTTA_DONE /* no more attributes */
114 #define PTA_GEOMETRY 1 /* geometry of partition (virtual HD) */
115 #define PTA_DOSENVEC 2 /* whole struct DosEnvec support */
116 #define PTA_DOSENVEC_GEOMETRY 3 /* only low/high cyl, sizeblock support in struct DosEnvec */
118 #define PTA_TYPE 100 /* type of partition */
119 #define PTA_POSITION 101 /* position of table within partition table */
120 #define PTA_ACTIVE 102 /* make partition active (whatever that means ;) */
121 #define PTA_NAME 103 /* device name support */
122 #define PTA_BOOTABLE 104 /* bootable flag support */
123 #define PTA_AUTOMOUNT 105
128 struct PartitionTableInfo
**tables
;
131 #endif /* PARTITION_H */