~psusi/ubuntu/precise/dmraid/fix-gpt

« back to all changes in this revision

Viewing changes to 1.0.0.rc14/lib/format/partition/dos.h

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano, 6af052c
  • Date: 2009-03-25 22:34:59 UTC
  • mfrom: (2.1.9 sid)
  • mto: (2.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090325223459-y54f0rmxem7htn6r
Tags: 1.0.0.rc15-6
[6af052c] Remove 15_isw_incorrect_status_fix.patch, it causes a
segfault. (Closes: #521104)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2004,2005  Heinz Mauelshagen, Red Hat GmbH.
3
 
 *                          All rights reserved.
4
 
 *
5
 
 * See file LICENSE at the top of this source tree for license information.
6
 
 */
7
 
 
8
 
/*
9
 
 * DOS partition defintion.
10
 
 *
11
 
 * Profited from libparted.
12
 
 */
13
 
 
14
 
#ifndef _DOS_H_
15
 
#define _DOS_H_
16
 
 
17
 
#ifdef  FORMAT_HANDLER
18
 
#undef  FORMAT_HANDLER
19
 
 
20
 
#include <stdint.h>
21
 
 
22
 
#define DOS_CONFIGOFFSET        0
23
 
#define DOS_DATAOFFSET          0
24
 
 
25
 
struct chs {
26
 
        uint8_t         head;
27
 
        uint8_t         sector;
28
 
        uint8_t         cylinder;
29
 
} __attribute__ ((packed));
30
 
 
31
 
struct dos_partition {
32
 
        uint8_t         boot_ind;       /* 00:  0x80 - active */
33
 
        struct chs      chs_start;      /* 01: */
34
 
        uint8_t         type;           /* 04: partition type */
35
 
#define PARTITION_EMPTY         0x00
36
 
#define PARTITION_EXT           0x05
37
 
#define PARTITION_EXT_LBA       0x0f
38
 
#define PARTITION_LINUX_EXT     0x85
39
 
#define PARTITION_GPT           0xee
40
 
        struct chs      chs_end;        /* 05: */
41
 
        uint32_t        start;          /* 08: starting sector from 0 */
42
 
        uint32_t        length;         /* 0c: nr of sectors in partition */
43
 
} __attribute__ ((packed));
44
 
 
45
 
struct dos {
46
 
        uint8_t                 boot_code [446];
47
 
        struct dos_partition    partitions [4];
48
 
        uint16_t                magic;
49
 
#define DOS_MAGIC       0xAA55
50
 
#define PARTITION_MAGIC_MAGIC   0xF6F6
51
 
} __attribute__ ((packed));
52
 
 
53
 
#endif /* FORMAT_HANDLER */
54
 
 
55
 
/* Prototype of the register function for this metadata format handler */
56
 
int register_dos(struct lib_context *lc);
57
 
 
58
 
#endif