]> git.proxmox.com Git - grub2.git/blame - include/grub/kernel.h
buffer network files. Fix incorrect net_fini_hw and unregister calls
[grub2.git] / include / grub / kernel.h
CommitLineData
6a161fa9 1/*
4b13b216 2 * GRUB -- GRand Unified Bootloader
0d5d5653 3 * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
6a161fa9 4 *
5a79f472 5 * GRUB is free software: you can redistribute it and/or modify
6a161fa9 6 * it under the terms of the GNU General Public License as published by
5a79f472 7 * the Free Software Foundation, either version 3 of the License, or
6a161fa9 8 * (at your option) any later version.
9 *
5a79f472 10 * GRUB is distributed in the hope that it will be useful,
6a161fa9 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
5a79f472 16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
6a161fa9 17 */
18
4b13b216 19#ifndef GRUB_KERNEL_HEADER
20#define GRUB_KERNEL_HEADER 1
6a161fa9 21
4b13b216 22#include <grub/types.h>
55a581dc 23#include <grub/symbol.h>
6a161fa9 24
6b9b6276 25enum
26{
27 OBJ_TYPE_ELF,
28 OBJ_TYPE_MEMDISK,
11721d19 29 OBJ_TYPE_CONFIG
6b9b6276 30};
31
6a161fa9 32/* The module header. */
4b13b216 33struct grub_module_header
6a161fa9 34{
3bd0a12a 35 /* The type of object. */
6b9b6276 36 grub_uint8_t type;
3bd0a12a 37 /* The size of object (including this header). */
6b9b6276 38 grub_uint32_t size;
6a161fa9 39};
40
0b412211 41/* "gmim" (GRUB Module Info Magic). */
42#define GRUB_MODULE_MAGIC 0x676d696d
6a161fa9 43
0253aeb7
VS
44struct grub_module_info32
45{
46 /* Magic number so we know we have modules present. */
47 grub_uint32_t magic;
48 /* The offset of the modules. */
49 grub_uint32_t offset;
50 /* The size of all modules plus this header. */
51 grub_uint32_t size;
52};
53
54struct grub_module_info64
0b412211 55{
56 /* Magic number so we know we have modules present. */
57 grub_uint32_t magic;
20011694 58 grub_uint32_t padding;
0b412211 59 /* The offset of the modules. */
0253aeb7 60 grub_uint64_t offset;
0b412211 61 /* The size of all modules plus this header. */
0253aeb7 62 grub_uint64_t size;
0b412211 63};
6a161fa9 64
0253aeb7
VS
65#if GRUB_TARGET_SIZEOF_VOID_P == 8
66#define grub_module_info grub_module_info64
67#else
68#define grub_module_info grub_module_info32
69#endif
70
0b412211 71extern grub_addr_t grub_arch_modules_addr (void);
6a161fa9 72
3bd0a12a 73extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *));
74
a49217cf
VS
75grub_addr_t grub_modules_get_end (void);
76
6a161fa9 77/* The start point of the C code. */
4b13b216 78void grub_main (void);
6a161fa9 79
80/* The machine-specific initialization. This must initialize memory. */
4b13b216 81void grub_machine_init (void);
6a161fa9 82
e6b92c8a 83/* The machine-specific finalization. */
0d5d5653 84void EXPORT_FUNC(grub_machine_fini) (void);
e6b92c8a 85
2965c7cc 86/* The machine-specific prefix initialization. */
574618a2
VS
87void
88grub_machine_get_bootlocation (char **device, char **path);
2965c7cc 89
6a161fa9 90/* Register all the exported symbols. This is automatically generated. */
4b13b216 91void grub_register_exported_symbols (void);
6a161fa9 92
574618a2 93#if ! defined (ASM_FILE)
8ea6ecb3
VS
94extern char grub_prefix[];
95#endif
96
4b13b216 97#endif /* ! GRUB_KERNEL_HEADER */