Replace --enable-grub-emu-modules with grub-emu-lite.
* kern/emu/cache.S: New file. Wrapper for $target_cpu specific cache.S. * include/grub/emu/misc.h (grub_emu_init): New prototype. * kern/emu/full.c: New file. For grub-emu specific initialization. * kern/emu/lite.c: New file. For grub-emu-lite initialization. * kern/emu/main.c: Call initialization function grub_emu_init. * Makefile.in: Include grub-emu-lite in install. * commands/parttool.c: Use grub_no_autoload to differentiate between grub-emu and grub-emu-lite. * include/grub/misc.h: New variable grub_no_autoload. * conf/any-emu.rmk: New rules for grub-emu-lite. * configure.ac: Remove --enable-grub-emu-modules. * genmk.rb: Cleanup unnecessary rules. * include/grub/dl.h: Remove GRUB_NO_MODULES macro. * normal/main.c: Don't load list files on grub-emu-lite. * util/misc.c (grub_arch_sync_caches): Removed.
This commit is contained in:
commit
645586e686
15 changed files with 191 additions and 117 deletions
15
kern/emu/cache.S
Normal file
15
kern/emu/cache.S
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef GRUB_MACHINE_EMU
|
||||
#error "This source is only meant for grub-emu platform"
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
/* Nothing is necessary. */
|
||||
#elif defined(__sparc__)
|
||||
#include "../sparc64/cache.S"
|
||||
#elif defined(__mips__)
|
||||
#include "../mips/cache.S"
|
||||
#elif defined(__powerpc__)
|
||||
#include "../powerpc/cache.S"
|
||||
#else
|
||||
#error "No target cpu type is defined"
|
||||
#endif
|
50
kern/emu/full.c
Normal file
50
kern/emu/full.c
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/kernel.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/emu/misc.h>
|
||||
|
||||
void
|
||||
grub_register_exported_symbols (void)
|
||||
{
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_arch_dl_check_header (void *ehdr)
|
||||
{
|
||||
(void) ehdr;
|
||||
return GRUB_ERR_BAD_MODULE;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
||||
{
|
||||
(void) mod;
|
||||
(void) ehdr;
|
||||
return GRUB_ERR_BAD_MODULE;
|
||||
}
|
||||
|
||||
void
|
||||
grub_emu_init (void)
|
||||
{
|
||||
grub_no_autoload = 1;
|
||||
}
|
40
kern/emu/lite.c
Normal file
40
kern/emu/lite.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <config.h>
|
||||
#include <grub/emu/misc.h>
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
#error "This source is only meant for grub-emu platform"
|
||||
#endif
|
||||
|
||||
#if defined(__i386__)
|
||||
#include "../i386/dl.c"
|
||||
#elif defined(__x86_64__)
|
||||
#include "../x86_64/dl.c"
|
||||
#elif defined(__sparc__)
|
||||
#include "../sparc64/dl.c"
|
||||
#elif defined(__mips__)
|
||||
#include "../mips/dl.c"
|
||||
#elif defined(__powerpc__)
|
||||
#include "../powerpc/dl.c"
|
||||
#else
|
||||
#error "No target cpu type is defined"
|
||||
#endif
|
||||
|
||||
/* grub-emu-lite supports dynamic module loading, so it won't have any
|
||||
embedded modules. */
|
||||
void
|
||||
grub_init_all (void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
grub_fini_all (void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
grub_emu_init (void)
|
||||
{
|
||||
return;
|
||||
}
|
|
@ -51,31 +51,14 @@ static jmp_buf main_env;
|
|||
/* Store the prefix specified by an argument. */
|
||||
static char *prefix = NULL;
|
||||
|
||||
int grub_no_autoload;
|
||||
|
||||
grub_addr_t
|
||||
grub_arch_modules_addr (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if GRUB_NO_MODULES
|
||||
grub_err_t
|
||||
grub_arch_dl_check_header (void *ehdr)
|
||||
{
|
||||
(void) ehdr;
|
||||
|
||||
return GRUB_ERR_BAD_MODULE;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
||||
{
|
||||
(void) mod;
|
||||
(void) ehdr;
|
||||
|
||||
return GRUB_ERR_BAD_MODULE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
grub_reboot (void)
|
||||
{
|
||||
|
@ -154,10 +137,7 @@ void grub_hostfs_init (void);
|
|||
void grub_hostfs_fini (void);
|
||||
void grub_host_init (void);
|
||||
void grub_host_fini (void);
|
||||
#if GRUB_NO_MODULES
|
||||
void grub_init_all (void);
|
||||
void grub_fini_all (void);
|
||||
#endif
|
||||
void grub_emu_init (void);
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
|
@ -216,6 +196,7 @@ main (int argc, char *argv[])
|
|||
}
|
||||
|
||||
signal (SIGINT, SIG_IGN);
|
||||
grub_emu_init ();
|
||||
grub_console_init ();
|
||||
grub_host_init ();
|
||||
grub_hostfs_init ();
|
||||
|
@ -223,9 +204,7 @@ main (int argc, char *argv[])
|
|||
/* XXX: This is a bit unportable. */
|
||||
grub_util_biosdisk_init (dev_map);
|
||||
|
||||
#if GRUB_NO_MODULES
|
||||
grub_init_all ();
|
||||
#endif
|
||||
|
||||
/* Make sure that there is a root device. */
|
||||
if (! root_dev)
|
||||
|
@ -255,9 +234,7 @@ main (int argc, char *argv[])
|
|||
if (setjmp (main_env) == 0)
|
||||
grub_main ();
|
||||
|
||||
#if GRUB_NO_MODULES
|
||||
grub_fini_all ();
|
||||
#endif
|
||||
grub_hostfs_fini ();
|
||||
grub_host_fini ();
|
||||
|
||||
|
@ -287,10 +264,3 @@ grub_millisleep (grub_uint32_t ms)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if GRUB_NO_MODULES
|
||||
void
|
||||
grub_register_exported_symbols (void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue