]>
Commit | Line | Data |
---|---|---|
6a161fa9 | 1 | /* |
4b13b216 | 2 | * GRUB -- GRand Unified Bootloader |
f36cc108 | 3 | * Copyright (C) 2002,2005,2006,2007,2008 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 | |
25 | /* The module header. */ | |
4b13b216 | 26 | struct grub_module_header |
6a161fa9 | 27 | { |
3bd0a12a | 28 | /* The type of object. */ |
29 | grub_int8_t type; | |
30 | enum | |
31 | { | |
32 | OBJ_TYPE_ELF, | |
33 | OBJ_TYPE_MEMDISK, | |
34 | } grub_module_header_types; | |
35 | ||
36 | /* The size of object (including this header). */ | |
b786f3b5 | 37 | grub_target_size_t size; |
6a161fa9 | 38 | }; |
39 | ||
0b412211 | 40 | /* "gmim" (GRUB Module Info Magic). */ |
41 | #define GRUB_MODULE_MAGIC 0x676d696d | |
6a161fa9 | 42 | |
0b412211 | 43 | struct grub_module_info |
44 | { | |
45 | /* Magic number so we know we have modules present. */ | |
46 | grub_uint32_t magic; | |
20011694 | 47 | #if GRUB_TARGET_SIZEOF_VOID_P == 8 |
48 | grub_uint32_t padding; | |
49 | #endif | |
0b412211 | 50 | /* The offset of the modules. */ |
b786f3b5 | 51 | grub_target_off_t offset; |
0b412211 | 52 | /* The size of all modules plus this header. */ |
b786f3b5 | 53 | grub_target_size_t size; |
0b412211 | 54 | }; |
6a161fa9 | 55 | |
0b412211 | 56 | extern grub_addr_t grub_arch_modules_addr (void); |
6a161fa9 | 57 | |
3bd0a12a | 58 | extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *)); |
59 | ||
6a161fa9 | 60 | /* The start point of the C code. */ |
4b13b216 | 61 | void grub_main (void); |
6a161fa9 | 62 | |
63 | /* The machine-specific initialization. This must initialize memory. */ | |
4b13b216 | 64 | void grub_machine_init (void); |
6a161fa9 | 65 | |
e6b92c8a | 66 | /* The machine-specific finalization. */ |
67 | void grub_machine_fini (void); | |
68 | ||
2965c7cc | 69 | /* The machine-specific prefix initialization. */ |
70 | void grub_machine_set_prefix (void); | |
71 | ||
6a161fa9 | 72 | /* Register all the exported symbols. This is automatically generated. */ |
4b13b216 | 73 | void grub_register_exported_symbols (void); |
6a161fa9 | 74 | |
4b13b216 | 75 | #endif /* ! GRUB_KERNEL_HEADER */ |