Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / multiboot.h
blobe13c0843b72a4eb877e687616c2b2a2cdc07e399
1 /* multiboot.h - multiboot header file with grub definitions. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2003,2007,2008,2010 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_MULTIBOOT_HEADER
21 #define GRUB_MULTIBOOT_HEADER 1
23 #include <grub/file.h>
25 #ifdef GRUB_USE_MULTIBOOT2
26 #include <multiboot2.h>
27 /* Same thing as far as our loader is concerned. */
28 #define MULTIBOOT_BOOTLOADER_MAGIC MULTIBOOT2_BOOTLOADER_MAGIC
29 #define MULTIBOOT_HEADER_MAGIC MULTIBOOT2_HEADER_MAGIC
30 #else
31 #include <multiboot.h>
32 #endif
34 #include <grub/types.h>
35 #include <grub/err.h>
37 #ifndef GRUB_USE_MULTIBOOT2
38 typedef enum
40 GRUB_MULTIBOOT_QUIRKS_NONE = 0,
41 GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE = 1,
42 GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL = 2
43 } grub_multiboot_quirks_t;
44 extern grub_multiboot_quirks_t grub_multiboot_quirks;
45 #endif
47 extern struct grub_relocator *grub_multiboot_relocator;
49 void grub_multiboot (int argc, char *argv[]);
50 void grub_module (int argc, char *argv[]);
52 void grub_multiboot_set_accepts_video (int val);
53 grub_err_t grub_multiboot_make_mbi (grub_uint32_t *target);
54 void grub_multiboot_free_mbi (void);
55 grub_err_t grub_multiboot_init_mbi (int argc, char *argv[]);
56 grub_err_t grub_multiboot_add_module (grub_addr_t start, grub_size_t size,
57 int argc, char *argv[]);
58 void grub_multiboot_set_bootdev (void);
59 void
60 grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize,
61 unsigned shndx, void *data);
63 grub_uint32_t grub_get_multiboot_mmap_count (void);
64 grub_err_t grub_multiboot_set_video_mode (void);
66 /* FIXME: support coreboot as well. */
67 #if defined (GRUB_MACHINE_PCBIOS)
68 #define GRUB_MACHINE_HAS_VBE 1
69 #else
70 #define GRUB_MACHINE_HAS_VBE 0
71 #endif
73 #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU)
74 #define GRUB_MACHINE_HAS_VGA_TEXT 1
75 #else
76 #define GRUB_MACHINE_HAS_VGA_TEXT 0
77 #endif
79 #if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT)
80 #define GRUB_MACHINE_HAS_ACPI 1
81 #else
82 #define GRUB_MACHINE_HAS_ACPI 0
83 #endif
85 #define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT 1
86 #define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER 2
88 grub_err_t
89 grub_multiboot_set_console (int console_type, int accepted_consoles,
90 int width, int height, int depth,
91 int console_required);
92 grub_err_t
93 grub_multiboot_load (grub_file_t file, const char *filename);
94 /* Load ELF32 or ELF64. */
95 grub_err_t
96 grub_multiboot_load_elf (grub_file_t file, const char *filename,
97 void *buffer);
98 extern grub_size_t grub_multiboot_pure_size;
99 extern grub_size_t grub_multiboot_alloc_mbi;
100 extern grub_uint32_t grub_multiboot_payload_eip;
103 #endif /* ! GRUB_MULTIBOOT_HEADER */