summaryrefslogtreecommitdiff
path: root/gpxe/src/arch/i386/include/bios_disks.h
blob: 0dd7c4ebbb38dea4a286172eeb6bd48362ce4daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef BIOS_DISKS_H
#define BIOS_DISKS_H

#include "dev.h"

/*
 * Constants
 *
 */

#define	BIOS_DISK_MAX_NAME_LEN	6

struct bios_disk_sector {
	char data[512];
};

/*
 * The location of a BIOS disk
 *
 */
struct bios_disk_loc {
	uint8_t drive;
};

/*
 * A physical BIOS disk device
 *
 */
struct bios_disk_device {
	char name[BIOS_DISK_MAX_NAME_LEN];
	uint8_t drive;
	uint8_t type;
};

/*
 * A BIOS disk driver, with a valid device ID range and naming
 * function.
 *
 */
struct bios_disk_driver {
	void ( *fill_drive_name ) ( char *buf, uint8_t drive );
	uint8_t min_drive;
	uint8_t max_drive;
};

/*
 * Define a BIOS disk driver
 *
 */
#define BIOS_DISK_DRIVER( _name, _fill_drive_name, _min_drive, _max_drive )   \
	static struct bios_disk_driver _name = {			      \
		.fill_drive_name = _fill_drive_name,			      \
		.min_drive = _min_drive,				      \
		.max_drive = _max_drive,				      \
	}

/*
 * Functions in bios_disks.c
 *
 */


/*
 * bios_disk bus global definition
 *
 */
extern struct bus_driver bios_disk_driver;

#endif /* BIOS_DISKS_H */