2N/A/*
2N/A * GRUB -- GRand Unified Bootloader
2N/A * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
2N/A *
2N/A * GRUB is free software: you can redistribute it and/or modify
2N/A * it under the terms of the GNU General Public License as published by
2N/A * the Free Software Foundation, either version 3 of the License, or
2N/A * (at your option) any later version.
2N/A *
2N/A * GRUB is distributed in the hope that it will be useful,
2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A * GNU General Public License for more details.
2N/A *
2N/A * You should have received a copy of the GNU General Public License
2N/A * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A */
2N/A
2N/A#ifndef GRUB_KERNEL_HEADER
2N/A#define GRUB_KERNEL_HEADER 1
2N/A
2N/A#include <grub/types.h>
2N/A#include <grub/symbol.h>
2N/A
2N/Aenum
2N/A{
2N/A OBJ_TYPE_ELF,
2N/A OBJ_TYPE_MEMDISK,
2N/A OBJ_TYPE_CONFIG,
2N/A OBJ_TYPE_PREFIX
2N/A};
2N/A
2N/A/* The module header. */
2N/Astruct grub_module_header
2N/A{
2N/A /* The type of object. */
2N/A grub_uint32_t type;
2N/A /* The size of object (including this header). */
2N/A grub_uint32_t size;
2N/A};
2N/A
2N/A/* "gmim" (GRUB Module Info Magic). */
2N/A#define GRUB_MODULE_MAGIC 0x676d696d
2N/A
2N/Astruct grub_module_info32
2N/A{
2N/A /* Magic number so we know we have modules present. */
2N/A grub_uint32_t magic;
2N/A /* The offset of the modules. */
2N/A grub_uint32_t offset;
2N/A /* The size of all modules plus this header. */
2N/A grub_uint32_t size;
2N/A};
2N/A
2N/Astruct grub_module_info64
2N/A{
2N/A /* Magic number so we know we have modules present. */
2N/A grub_uint32_t magic;
2N/A grub_uint32_t padding;
2N/A /* The offset of the modules. */
2N/A grub_uint64_t offset;
2N/A /* The size of all modules plus this header. */
2N/A grub_uint64_t size;
2N/A};
2N/A
2N/A#if GRUB_TARGET_SIZEOF_VOID_P == 8
2N/A#define grub_module_info grub_module_info64
2N/A#else
2N/A#define grub_module_info grub_module_info32
2N/A#endif
2N/A
2N/Aextern grub_addr_t EXPORT_VAR (grub_modbase);
2N/A
2N/A#define FOR_MODULES(var) for (\
2N/A var = grub_modbase ? (struct grub_module_header *) \
2N/A (grub_modbase + (((struct grub_module_info *) grub_modbase)->offset)) : 0;\
2N/A var && (grub_addr_t) var \
2N/A < (grub_modbase + (((struct grub_module_info *) grub_modbase)->size)); \
2N/A var = (struct grub_module_header *) \
2N/A ((grub_uint32_t *) var + ((struct grub_module_header *) var)->size / 4))
2N/A
2N/Agrub_addr_t grub_modules_get_end (void);
2N/A
2N/A/* The start point of the C code. */
2N/Avoid grub_main (void) __attribute__ ((noreturn));
2N/A
2N/A/* The machine-specific initialization. This must initialize memory. */
2N/Avoid grub_machine_init (void);
2N/A
2N/A/* The machine-specific finalization. */
2N/Avoid EXPORT_FUNC(grub_machine_fini) (void);
2N/A
2N/A/* The machine-specific prefix initialization. */
2N/Avoid
2N/Agrub_machine_get_bootlocation (char **device, char **path);
2N/A
2N/A/* Register all the exported symbols. This is automatically generated. */
2N/Avoid grub_register_exported_symbols (void);
2N/A
2N/Aextern void (*EXPORT_VAR(grub_net_poll_cards_idle)) (void);
2N/A
2N/A#endif /* ! GRUB_KERNEL_HEADER */