source: grub-pc/trunk/fuentes/include/grub/loader.h @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 2.7 KB
Line 
1/* loader.h - OS loaders */
2/*
3 *  GRUB  --  GRand Unified Bootloader
4 *  Copyright (C) 2002,2003,2004,2006,2007,2009  Free Software Foundation, Inc.
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20#ifndef GRUB_LOADER_HEADER
21#define GRUB_LOADER_HEADER      1
22
23#include <grub/file.h>
24#include <grub/symbol.h>
25#include <grub/err.h>
26#include <grub/types.h>
27
28/* Check if a loader is loaded.  */
29int EXPORT_FUNC (grub_loader_is_loaded) (void);
30
31/* Set loader functions.  */
32enum
33{
34  GRUB_LOADER_FLAG_NORETURN = 1,
35  GRUB_LOADER_FLAG_PXE_NOT_UNLOAD = 2,
36};
37
38void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void),
39                                    grub_err_t (*unload) (void),
40                                    int flags);
41
42/* Unset current loader, if any.  */
43void EXPORT_FUNC (grub_loader_unset) (void);
44
45/* Call the boot hook in current loader. This may or may not return,
46   depending on the setting by grub_loader_set.  */
47grub_err_t grub_loader_boot (void);
48
49/* The space between numbers is intentional for the simplicity of adding new
50   values even if external modules use them. */
51typedef 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;
62
63/* Register a preboot hook. */
64struct grub_preboot;
65
66struct 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);
69
70/* Unregister given preboot hook. */
71void EXPORT_FUNC (grub_loader_unregister_preboot_hook) (struct grub_preboot *hnd);
72
73#ifndef GRUB_MACHINE_EMU
74void grub_boot_init (void);
75void grub_boot_fini (void);
76#endif
77
78#endif /* ! GRUB_LOADER_HEADER */
Note: See TracBrowser for help on using the repository browser.