Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / compiler / include / aros / multiboot2.h
blob404b7d59a46ff033f57308c6d41a04f5890c2d61
1 /*
2 Copyright © 2011-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Multiboot v2 information structures
6 Lang: english
7 */
9 #ifndef _AROS_MULTIBOOT2_H
10 #define _AROS_MULTIBOOT2_H
12 #include <aros/cpu.h> /* For __WORDSIZE */
13 #include <hardware/vbe.h>
15 #if (__WORDSIZE == 64)
16 #ifndef MULTIBOOT_64BIT
19 * Define this in your code if you want to build 32-bit code using full 64-bit pointers.
20 * Useful for building pc-x86_64 bootstrap which runs in 32 bit mode.
22 #define MULTIBOOT_64BIT
24 #endif
25 #endif
27 struct mb2_header
29 ULONG magic; /* MB2_MAGIC */
30 ULONG arch; /* Architecture - see below */
31 ULONG size; /* Total size of the header (including all tags) */
32 ULONG checksum; /* Header checksum */
33 /* Tags follow */
36 #define MB2_MAGIC 0xe85250d6
38 /* Architecture */
39 #define MB2_ARCH_I386 0
40 #define MB2_ARCH_MIPS32 4
42 struct mb2_header_tag
44 UWORD type; /* Tag ID */
45 UWORD flags; /* Flags, see below */
46 ULONG size; /* Size of this tag, including data */
49 /* Tag IDs */
50 #define MB2_HEADER_TAG_END 0
51 #define MB2_HEADER_TAG_INFORMATION_REQUEST 1
52 #define MB2_HEADER_TAG_ADDRESS 2
53 #define MB2_HEADER_TAG_ENTRY_ADDRESS 3
54 #define MB2_HEADER_TAG_CONSOLE_FLAGS 4
55 #define MB2_HEADER_TAG_FRAMEBUFFER 5
56 #define MB2_HEADER_TAG_MODULE_ALIGN 6
58 /* Flags */
59 #define MBTF_OPTIONAL 1
61 struct mb2_header_tag_info_request
63 UWORD type; /* MB2_HEADER_TAG_INFORMATION_REQUEST */
64 UWORD flags;
65 ULONG size;
66 ULONG requests[0];
69 struct mb2_header_tag_address
71 UWORD type; /* MB2_HEADER_TAG_ADDRESS */
72 UWORD flags;
73 ULONG size;
74 ULONG header_addr;
75 ULONG load_addr;
76 ULONG load_end_addr;
77 ULONG bss_end_addr;
80 struct mb2_header_tag_entry_address
82 UWORD type; /* MB2_HEADER_TAG_ENTRY_ADDRESS */
83 UWORD flags;
84 ULONG size;
85 ULONG entry_addr;
88 struct mb2_header_tag_console_flags
90 UWORD type; /* MB2_HEADER_TAG_CONSOLE_FLAGS */
91 UWORD flags;
92 ULONG size;
93 ULONG console_flags;
96 struct mb2_header_tag_framebuffer
98 UWORD type; /* MB2_HEADER_TAG_FRAMEBUFFER */
99 UWORD flags;
100 ULONG size;
101 ULONG width;
102 ULONG height;
103 ULONG depth;
106 struct mb2_header_tag_module_align
108 UWORD type; /* MB2_HEADER_TAG_MODULE_ALIGN */
109 UWORD flags;
110 ULONG size;
111 ULONG width;
112 ULONG height;
113 ULONG depth;
116 /* This value is passed in by the bootloader */
117 #define MB2_STARTUP_MAGIC 0x36d76289
120 * Multiboot v2 data is a UQUAD value representing overall length,
121 * followed by a sequence of tags.
122 * This is the generalized form of a tag.
124 struct mb2_tag
126 ULONG type; /* ID */
127 ULONG size; /* Data size (including header) */
130 /* Known tag IDs */
131 #define MB2_TAG_END 0
132 #define MB2_TAG_CMDLINE 1
133 #define MB2_TAG_BOOTLOADER_NAME 2
134 #define MB2_TAG_MODULE 3
135 #define MB2_TAG_BASIC_MEMINFO 4
136 #define MB2_TAG_BOOTDEV 5
137 #define MB2_TAG_MMAP 6
138 #define MB2_TAG_VBE 7
139 #define MB2_TAG_FRAMEBUFFER 8
140 #define MB2_TAG_ELF_SECTIONS 9
141 #define MB2_TAG_APM 10
142 #define MB2_TAG_EFI32 11
143 #define MB2_TAG_EFI64 12
144 #define MB2_TAG_SMBIOS 13
145 #define MB2_TAG_ACPI_OLD 14
146 #define MB2_TAG_ACPI_NEW 15
147 #define MB2_TAG_NETWORK 16
149 struct mb2_tag_string
151 ULONG type;
152 ULONG size;
153 BYTE string[0];
156 struct mb2_tag_module
158 ULONG type;
159 ULONG size;
160 ULONG mod_start;
161 ULONG mod_end;
162 BYTE cmdline[0];
165 struct mb2_tag_basic_meminfo
167 ULONG type;
168 ULONG size;
169 ULONG mem_lower;
170 ULONG mem_upper;
173 struct mb2_tag_bootdev
175 ULONG type;
176 ULONG size;
177 ULONG biosdev;
178 ULONG slice;
179 ULONG part;
182 struct mb2_mmap
184 #ifdef MULTIBOOT_64BIT
185 UQUAD addr; /* Address and length, 64-bit */
186 UQUAD len;
187 #else
188 ULONG addr;
189 ULONG addr_high;
190 ULONG len;
191 ULONG len_high;
192 #endif
193 ULONG type; /* Entry type, see below */
194 ULONG pad; /* Reserved */
197 /* Memory map entry types */
198 #define MMAP2_TYPE_RAM 1 /* General purpose RAM */
199 #define MMAP2_TYPE_RESERVED 2 /* System private areas */
200 #define MMAP2_TYPE_ACPIDATA 3 /* ACPI data structures */
201 #define MMAP2_TYPE_ACPINVS 4
202 #define MMAP2_TYPE_BAD 5 /* Broken RAM */
204 struct mb2_tag_mmap
206 ULONG type;
207 ULONG size;
208 ULONG entry_size;
209 ULONG entry_version;
210 struct mb2_mmap mmap[0];
213 struct mb2_tag_vbe
215 ULONG type;
216 ULONG size;
218 UWORD vbe_mode;
219 UWORD vbe_interface_seg;
220 UWORD vbe_interface_off;
221 UWORD vbe_interface_len;
223 struct vbe_controller vbe_control_info;
224 struct vbe_mode vbe_mode_info;
227 struct mb2_tag_framebuffer_common
229 ULONG type; /* Tag ID */
230 ULONG size;
231 #ifdef MULTIBOOT_64BIT
232 UQUAD framebuffer_addr; /* Framebuffer address, 64-bit pointer */
233 #else
234 ULONG framebuffer_addr;
235 ULONG framebuffer_addr_high;
236 #endif
237 ULONG framebuffer_pitch; /* Bytes per line */
238 ULONG framebuffer_width; /* Size in pixels or characters */
239 ULONG framebuffer_height;
240 UBYTE framebuffer_bpp; /* Bits per pixel */
241 UBYTE framebuffer_type; /* See below */
242 UWORD reserved;
245 /* Framebuffer types */
246 #define MB2_FRAMEBUFFER_LUT 0
247 #define MB2_FRAMEBUFFER_RGB 1
248 #define MB2_FRAMEBUFFER_TEXT 2
250 struct fb_color
252 UBYTE red;
253 UBYTE green;
254 UBYTE blue;
257 struct mb2_tag_framebuffer
259 struct mb2_tag_framebuffer_common common;
261 union
263 struct
265 UWORD framebuffer_num_colors;
266 struct fb_color framebuffer_palette[0];
268 struct
270 UBYTE framebuffer_red_field_position;
271 UBYTE framebuffer_red_mask_size;
272 UBYTE framebuffer_green_field_position;
273 UBYTE framebuffer_green_mask_size;
274 UBYTE framebuffer_blue_field_position;
275 UBYTE framebuffer_blue_mask_size;
280 struct mb2_tag_elf_sections
282 ULONG type;
283 ULONG size;
284 ULONG num;
285 ULONG entsize;
286 ULONG shndx;
287 BYTE sections[0];
290 struct mb2_tag_apm
292 ULONG type;
293 ULONG size;
294 UWORD version;
295 UWORD cseg;
296 ULONG offset;
297 UWORD cseg_16;
298 UWORD dseg;
299 UWORD flags;
300 UWORD cseg_len;
301 UWORD cseg_16_len;
302 UWORD dseg_len;
305 struct mb2_tag_efi32
307 ULONG type;
308 ULONG size;
309 ULONG pointer;
312 struct mb2_tag_efi64
314 ULONG type;
315 ULONG size;
316 UQUAD pointer;
319 struct mb2_tag_smbios
321 ULONG type;
322 ULONG size;
323 UBYTE major;
324 UBYTE minor;
325 UBYTE reserved[6];
326 UBYTE tables[0];
329 struct mb2_tag_old_acpi
331 ULONG type;
332 ULONG size;
333 UBYTE rsdp[0];
336 struct mb2_tag_new_acpi
338 ULONG type;
339 ULONG size;
340 UBYTE rsdp[0];
343 struct mb2_tag_network
345 ULONG type;
346 ULONG size;
347 UBYTE dhcpack[0];
350 #endif