Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / loader.h
blob7f82a499fd9c025643b7f757ecb489bbac2a285c
1 /* loader.h - OS loaders */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2002,2003,2004,2006,2007,2009 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_LOADER_HEADER
21 #define GRUB_LOADER_HEADER 1
23 #include <grub/file.h>
24 #include <grub/symbol.h>
25 #include <grub/err.h>
26 #include <grub/types.h>
28 /* Check if a loader is loaded. */
29 int EXPORT_FUNC (grub_loader_is_loaded) (void);
31 /* Set loader functions. */
32 enum
34 GRUB_LOADER_FLAG_NORETURN = 1,
35 GRUB_LOADER_FLAG_PXE_NOT_UNLOAD = 2,
38 void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void),
39 grub_err_t (*unload) (void),
40 int flags);
42 /* Unset current loader, if any. */
43 void EXPORT_FUNC (grub_loader_unset) (void);
45 /* Call the boot hook in current loader. This may or may not return,
46 depending on the setting by grub_loader_set. */
47 grub_err_t grub_loader_boot (void);
49 /* The space between numbers is intentional for the simplicity of adding new
50 values even if external modules use them. */
51 typedef enum {
52 /* A preboot hook which can use everything and turns nothing off. */
53 GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL = 400,
54 /* A preboot hook which can't use disks and may stop disks. */
55 GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK = 300,
56 /* A preboot hook which can't use disks or console and may stop console. */
57 GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE = 200,
58 /* A preboot hook which can't use disks or console, can't modify memory map
59 and may stop memory services or finalize memory map. */
60 GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY = 100,
61 } grub_loader_preboot_hook_prio_t;
63 /* Register a preboot hook. */
64 struct grub_preboot;
66 struct grub_preboot *EXPORT_FUNC(grub_loader_register_preboot_hook) (grub_err_t (*preboot_func) (int noret),
67 grub_err_t (*preboot_rest_func) (void),
68 grub_loader_preboot_hook_prio_t prio);
70 /* Unregister given preboot hook. */
71 void EXPORT_FUNC (grub_loader_unregister_preboot_hook) (struct grub_preboot *hnd);
73 #ifndef GRUB_MACHINE_EMU
74 void grub_boot_init (void);
75 void grub_boot_fini (void);
76 #endif
78 #endif /* ! GRUB_LOADER_HEADER */