:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / drivers / storage / disk / partitio.h
1 /**
2 *** Partition.h - defines and structs for harddrive partition info
3 ***
4 ***  05/30/98  RJJ  Created
5 **/
6
7 #ifndef __PARTITION_H
8 #define __PARTITION_H
9
10 #define  PARTITION_MAGIC    0xaa55
11 #define  PART_MAGIC_OFFSET  0x01fe
12 #define  PARTITION_OFFSET   0x01be
13 #define  PARTITION_TBL_SIZE 4
14 #define  PTCHSToLBA(c, h, s, scnt, hcnt) ((s) & 0x3f) + \
15     (scnt) * ( (h) + (hcnt) * ((c) | (((s) & 0xc0) << 2)))
16 #define  PTLBAToCHS(lba, c, h, s, scnt, hcnt) ( \
17     (s) = (lba) % (scnt) + 1,  \
18     (lba) /= (scnt), \
19     (h) = (lba) % (hcnt), \
20     (lba) /= (heads), \
21     (c) = (lba) & 0xff, \
22     (s) |= ((lba) >> 2) & 0xc0)
23
24
25 typedef struct Partition {
26   unsigned char   BootFlags;
27   unsigned char   StartingHead;
28   unsigned char   StartingSector;
29   unsigned char   StartingCylinder;
30   unsigned char   PartitionType;
31   unsigned char   EndingHead;
32   unsigned char   EndingSector;
33   unsigned char   EndingCylinder;
34   unsigned int  StartingBlock;
35   unsigned int  SectorCount;
36
37 } PARTITION;
38
39 #endif  // PARTITION_H
40
41