Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openhackware / src / libpart / libpart.h
1 /*
2  * <libpart.h>
3  *
4  * Open Hack'Ware BIOS partitions management definitions
5  * 
6  * Copyright (c) 2004-2005 Jocelyn Mayer
7  * 
8  *   This program is free software; you can redistribute it and/or
9  *   modify it under the terms of the GNU General Public License V2
10  *   as published by the Free Software Foundation
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with this program; if not, write to the Free Software
19  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #if !defined (__OHW_LIBPART_H__)
23 #define __OHW_LIBPART_H__
24
25 /* LBA for IDE is 48 bits long.
26  * For now, I'll use 32 bits to store bloc nr
27  * and 32 bits to store offsets in blocs and will only handle LBA 28.
28  * So, I'll be affected with the well known 128 GB disk barrier bug...
29  */
30
31 struct part_t {
32     bloc_device_t *bd;
33     int partnum;
34     uint32_t start;      /* Partition first bloc             */
35     uint32_t size;       /* Partition size, in blocs         */
36     uint32_t spb;
37     uint32_t bps;
38     uint32_t flags;
39
40     uint32_t bloc_size;  /* Bloc size (may be != bd->seclen) */
41     /* XXX: broken: to be reworked */
42     pos_t boot_start;    /* Boot program start bloc & offset */
43     pos_t boot_size;     /* Boot program size                */
44     uint32_t boot_load;  /* Boot program address load        */
45     uint32_t boot_entry; /* Boot program entry point         */
46
47     unsigned char *name;
48     inode_t *boot_file;
49     fs_t *fs;
50
51     void *private;
52
53     part_t *next;
54     part_t *bnext;
55 };
56
57 int part_register (bloc_device_t *bd, part_t *partition,
58                    const unsigned char *name, int partnum);
59 void part_set_blocsize (bloc_device_t *bd, part_t *part, uint32_t blocsize);
60 void part_private_set (part_t *part, void *private);
61 void *part_private_get (part_t *part);
62
63 part_t *PREP_find_partition (bloc_device_t *bd);
64 part_t *Apple_probe_partitions (bloc_device_t *bd);
65 part_t *isofs_probe_partitions (bloc_device_t *bd);
66
67 #endif /* !defined (__OHW_LIBPART_H__) */