pull-in emu-lite fixes

This commit is contained in:
BVK Chaitanya 2010-06-02 15:18:33 +05:30
commit bd7390ee84
8 changed files with 37 additions and 24 deletions

View file

@ -762,6 +762,23 @@ AC_SUBST([enable_grub_mkfont])
AC_SUBST([freetype_cflags]) AC_SUBST([freetype_cflags])
AC_SUBST([freetype_libs]) AC_SUBST([freetype_libs])
AC_ARG_ENABLE([device-mapper],
[AS_HELP_STRING([--enable-device-mapper],
[enable Linux device-mapper support (default=guessed)])])
if test x"$enable_device_mapper" = xno ; then
device_mapper_excuse="explicitly disabled"
fi
if test x"$device_mapper_excuse" = x ; then
# Check for device-mapper library.
AC_CHECK_LIB([devmapper], [dm_task_create],
[LDFLAGS="$LDFLAGS -ldevmapper"
AC_DEFINE([HAVE_DEVICE_MAPPER], [1],
[Define to 1 if you have the devmapper library.])],
[device_mapper_excuse="need devmapper library"])
fi
AC_SUBST(ASFLAGS)
AC_SUBST([FONT_SOURCE]) AC_SUBST([FONT_SOURCE])
AS_IF([test x$target_cpu = xi386 -a x$platform = xpc], AS_IF([test x$target_cpu = xi386 -a x$platform = xpc],
[AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)])

View file

@ -23,8 +23,7 @@
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/types.h> #include <grub/types.h>
#if defined (__i386__) || defined (__x86_64__) || \ #if defined (__i386__) || defined (__x86_64__)
(defined (GRUB_MACHINE_EMU) && GRUB_MACHINE_EMU)
static inline void static inline void
grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused))) grub_size_t len __attribute__ ((unused)))

View file

@ -111,7 +111,7 @@ grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr,
grub_err_t grub_arch_dl_check_header (void *ehdr); grub_err_t grub_arch_dl_check_header (void *ehdr);
grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, 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 #define GRUB_LINKER_HAVE_INIT 1
void grub_arch_dl_init_linker (void); void grub_arch_dl_init_linker (void);
#endif #endif

View file

@ -50,9 +50,6 @@
/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
#define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n)) #define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n))
/* Flag to control module autoloading in normal mode. */
extern int EXPORT_VAR(grub_no_autoload);
void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src); char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c); char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
@ -311,4 +308,11 @@ void EXPORT_FUNC (grub_halt) (int no_apm);
void EXPORT_FUNC (grub_halt) (void); void EXPORT_FUNC (grub_halt) (void);
#endif #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 */ #endif /* ! GRUB_MISC_HEADER */

View file

@ -2,17 +2,13 @@
#error "This source is only meant for grub-emu platform" #error "This source is only meant for grub-emu platform"
#endif #endif
#if defined(GRUB_CPU_I386) #if defined(__i386__) || defined(__x86_64__)
/* Nothing is necessary. */ /* Nothing is necessary. */
#elif defined(GRUB_CPU_X86_64) #elif defined(__sparc__)
/* Nothing is necessary. */
#elif defined(GRUB_CPU_SPARC64)
#include "../sparc64/cache.S" #include "../sparc64/cache.S"
#elif defined(GRUB_CPU_MIPS) #elif defined(__mips__)
#include "../mips/cache.S" #include "../mips/cache.S"
#elif defined(GRUB_CPU_MIPSEL) #elif defined(__powerpc__)
#include "../mips/cache.S"
#elif defined(GRUB_CPU_POWERPC)
#include "../powerpc/cache.S" #include "../powerpc/cache.S"
#else #else
#error "No target cpu type is defined" #error "No target cpu type is defined"

View file

@ -5,17 +5,15 @@
#error "This source is only meant for grub-emu platform" #error "This source is only meant for grub-emu platform"
#endif #endif
#if defined(GRUB_CPU_I386) #if defined(__i386__)
#include "../i386/dl.c" #include "../i386/dl.c"
#elif defined(GRUB_CPU_X86_64) #elif defined(__x86_64__)
#include "../x86_64/dl.c" #include "../x86_64/dl.c"
#elif defined(GRUB_CPU_SPARC64) #elif defined(__sparc__)
#include "../sparc64/dl.c" #include "../sparc64/dl.c"
#elif defined(GRUB_CPU_MIPS) #elif defined(__mips__)
#include "../mips/dl.c" #include "../mips/dl.c"
#elif defined(GRUB_CPU_MIPSEL) #elif defined(__powerpc__)
#include "../mips/dl.c"
#elif defined(GRUB_CPU_POWERPC)
#include "../powerpc/dl.c" #include "../powerpc/dl.c"
#else #else
#error "No target cpu type is defined" #error "No target cpu type is defined"

View file

@ -52,6 +52,8 @@ static jmp_buf main_env;
/* Store the prefix specified by an argument. */ /* Store the prefix specified by an argument. */
static char *prefix = NULL; static char *prefix = NULL;
int grub_no_autoload;
grub_addr_t grub_addr_t
grub_arch_modules_addr (void) grub_arch_modules_addr (void)
{ {
@ -203,7 +205,6 @@ main (int argc, char *argv[])
/* XXX: This is a bit unportable. */ /* XXX: This is a bit unportable. */
grub_util_biosdisk_init (dev_map); grub_util_biosdisk_init (dev_map);
/* Initialize all embedded modules. */
grub_init_all (); grub_init_all ();
/* Make sure that there is a root device. */ /* Make sure that there is a root device. */

View file

@ -30,8 +30,6 @@
#include <grub/reader.h> #include <grub/reader.h>
#include <grub/parser.h> #include <grub/parser.h>
int grub_no_autoload;
void void
grub_module_iterate (int (*hook) (struct grub_module_header *header)) grub_module_iterate (int (*hook) (struct grub_module_header *header))
{ {