diff --git a/commands/parttool.c b/commands/parttool.c index 3dbe129bf..f2a62e581 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -31,10 +31,6 @@ #include #include -#if defined (GRUB_MACHINE_EMU) -#include -#endif - static struct grub_parttool *parts = 0; static int curhandle = 0; static grub_dl_t mymod; @@ -179,9 +175,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), } /* Load modules. */ -#if defined(GRUB_MACHINE_EMU) if (! grub_no_autoload) -#endif { const char *prefix; prefix = grub_env_get ("prefix"); diff --git a/include/grub/dl.h b/include/grub/dl.h index 9d5f2af2d..b66b7641e 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -95,13 +95,13 @@ int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod); int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod); void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod)); grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name); -grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr, - grub_dl_t mod); +grub_err_t grub_dl_register_symbol (const char *name, void *addr, + grub_dl_t mod); grub_err_t grub_arch_dl_check_header (void *ehdr); grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr); -#if defined (_mips) && (! defined (GRUB_MACHINE_EMU) || ! GRUB_MACHINE_EMU) +#if defined (_mips) #define GRUB_LINKER_HAVE_INIT 1 void grub_arch_dl_init_linker (void); #endif diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h index 32a5e29f8..bad00de71 100644 --- a/include/grub/emu/misc.h +++ b/include/grub/emu/misc.h @@ -49,7 +49,4 @@ int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...); char * EXPORT_FUNC(xasprintf) (const char *fmt, ...); extern char * canonicalize_file_name (const char *path); -/* Flag to control module autoloading in normal mode. */ -extern int EXPORT_VAR(grub_no_autoload); - #endif /* GRUB_EMU_MISC_H */ diff --git a/include/grub/misc.h b/include/grub/misc.h index 9bfc6974e..077069934 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -308,4 +308,11 @@ void EXPORT_FUNC (grub_halt) (int no_apm); void EXPORT_FUNC (grub_halt) (void); #endif +#ifdef GRUB_MACHINE_EMU +/* Flag to control module autoloading in normal mode. */ +extern int EXPORT_VAR(grub_no_autoload); +#else +#define grub_no_autoload 0 +#endif + #endif /* ! GRUB_MISC_HEADER */ diff --git a/kern/emu/main.c b/kern/emu/main.c index 1915e1a7c..e2efd262f 100644 --- a/kern/emu/main.c +++ b/kern/emu/main.c @@ -51,7 +51,6 @@ static jmp_buf main_env; /* Store the prefix specified by an argument. */ static char *prefix = NULL; -/* Flag to control module autoloading in normal mode. */ int grub_no_autoload; grub_addr_t diff --git a/normal/main.c b/normal/main.c index d1e95d9b5..b3544b99f 100644 --- a/normal/main.c +++ b/normal/main.c @@ -32,10 +32,6 @@ #include #include -#if defined (GRUB_MACHINE_EMU) -#include -#endif - #define GRUB_DEFAULT_HISTORY_SIZE 50 static int nested_level = 0; @@ -480,9 +476,7 @@ grub_normal_init_page (struct grub_term_output *term) static void read_lists (const char *val) { -#if defined(GRUB_MACHINE_EMU) if (! grub_no_autoload) -#endif { read_command_list (val); read_fs_list (val);