Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / eltorito.h
1 #ifndef _IPXE_ELTORITO_H
2 #define _IPXE_ELTORITO_H
3
4 /**
5  * @file
6  *
7  * El Torito bootable CD-ROM specification
8  *
9  */
10
11 FILE_LICENCE ( GPL2_OR_LATER );
12
13 #include <stdint.h>
14 #include <ipxe/iso9660.h>
15
16 /** An El Torito Boot Record Volume Descriptor (fixed portion) */
17 struct eltorito_descriptor_fixed {
18         /** Descriptor type */
19         uint8_t type;
20         /** Identifier ("CD001") */
21         uint8_t id[5];
22         /** Version, must be 1 */
23         uint8_t version;
24         /** Boot system indicator; must be "EL TORITO SPECIFICATION" */
25         uint8_t system_id[32];
26 } __attribute__ (( packed ));
27
28 /** An El Torito Boot Record Volume Descriptor */
29 struct eltorito_descriptor {
30         /** Fixed portion */
31         struct eltorito_descriptor_fixed fixed;
32         /** Unused */
33         uint8_t unused[32];
34         /** Boot catalog sector */
35         uint32_t sector;
36 } __attribute__ (( packed ));
37
38 /** El Torito Boot Record Volume Descriptor block address */
39 #define ELTORITO_LBA 17
40
41 /** An El Torito Boot Catalog Validation Entry */
42 struct eltorito_validation_entry {
43         /** Header ID; must be 1 */
44         uint8_t header_id;
45         /** Platform ID
46          *
47          * 0 = 80x86
48          * 1 = PowerPC
49          * 2 = Mac
50          */
51         uint8_t platform_id;
52         /** Reserved */
53         uint16_t reserved;
54         /** ID string */
55         uint8_t id_string[24];
56         /** Checksum word */
57         uint16_t checksum;
58         /** Signature; must be 0xaa55 */
59         uint16_t signature;
60 } __attribute__ (( packed ));
61
62 /** El Torito platform IDs */
63 enum eltorito_platform_id {
64         ELTORITO_PLATFORM_X86 = 0x00,
65         ELTORITO_PLATFORM_POWERPC = 0x01,
66         ELTORITO_PLATFORM_MAC = 0x02,
67 };
68
69 /** A bootable entry in the El Torito Boot Catalog */
70 struct eltorito_boot_entry {
71         /** Boot indicator
72          *
73          * Must be @c ELTORITO_BOOTABLE for a bootable ISO image
74          */
75         uint8_t indicator;
76         /** Media type
77          *
78          */
79         uint8_t media_type;
80         /** Load segment */
81         uint16_t load_segment;
82         /** System type */
83         uint8_t filesystem;
84         /** Unused */
85         uint8_t reserved_a;
86         /** Sector count */
87         uint16_t length;
88         /** Starting sector */
89         uint32_t start;
90         /** Unused */
91         uint8_t reserved_b[20];
92 } __attribute__ (( packed ));
93
94 /** Boot indicator for a bootable ISO image */
95 #define ELTORITO_BOOTABLE 0x88
96
97 /** El Torito media types */
98 enum eltorito_media_type {
99         /** No emulation */
100         ELTORITO_NO_EMULATION = 0,
101 };
102
103 #endif /* _IPXE_ELTORITO_H */