#include <grub/command.h>
#include <grub/i18n.h>
+#if defined (GRUB_MACHINE_EMU)
+#include <grub/emu/misc.h>
+#endif
+
static struct grub_parttool *parts = 0;
static int curhandle = 0;
static grub_dl_t mymod;
}
/* Load modules. */
+#if defined(GRUB_MACHINE_EMU)
if (! grub_no_autoload)
+#endif
{
const char *prefix;
prefix = grub_env_get ("prefix");
amd64) target_cpu=x86_64 ;;
sparc) target_cpu=sparc64 ;;
mipsel|mips64el)
- target_cpu=mips;
- cpu_CPPFLAGS="-DGRUB_CPU_MIPSEL=1";
+ target_cpu=mips;
+ TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1";
+ CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1";
;;
mips|mips64)
- target_cpu=mips;
- cpu_CPPFLAGS="-DGRUB_CPU_MIPS=1";
+ target_cpu=mips;
+ TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1";
+ CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1";
;;
esac
esac
case "$platform" in
- coreboot) machine_CPPFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
- multiboot) machine_CPPFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
- efi) machine_CPPFLAGS="-DGRUB_MACHINE_EFI=1" ;;
- ieee1275) machine_CPPFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
- qemu) machine_CPPFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
- pc) machine_CPPFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
- emu) machine_CPPFLAGS="-DGRUB_MACHINE_EMU=1" ;;
- yeeloong) machine_CPPFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
- qemu-mips) machine_CPPFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
+ coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
+ multiboot) machine_CFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
+ efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
+ ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
+ qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
+ pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
+ emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
+ yeeloong) machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
+ qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
esac
case "$target_cpu" in
- i386) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_I386";;
- x86_64) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_X86_64";;
- powerpc) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_POWERPC";;
- mips) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;; # cpu_CPPFLAGS handled above
- sparc64) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_SPARC64";
- machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
+ mips) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_MIPS=1" ;;
+ sparc64) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
-machine_CPPFLAGS="$machine_CPPFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
+machine_CFLAGS="$machine_CFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
-CPPFLAGS="$CPPFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
-TARGET_ASFLAGS="$TARGET_ASFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
-TARGET_CFLAGS="$TARGET_CFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
+CFLAGS="$CFLAGS $machine_CFLAGS"
+TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
+TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
AC_SUBST(host_cpu)
AC_SUBST(host_os)
#include <grub/symbol.h>
#include <grub/types.h>
-#if defined (__i386__) || defined (__x86_64__) || \
- (defined (GRUB_MACHINE_EMU) && GRUB_MACHINE_EMU)
+#if defined (__i386__) || defined (__x86_64__)
static inline void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
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 */
/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
#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);
char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
#error "This source is only meant for grub-emu platform"
#endif
-#if defined(GRUB_CPU_I386)
+#if defined(__i386__) || defined(__x86_64__)
/* Nothing is necessary. */
-#elif defined(GRUB_CPU_X86_64)
-/* Nothing is necessary. */
-#elif defined(GRUB_CPU_SPARC64)
+#elif defined(__sparc__)
#include "../sparc64/cache.S"
-#elif defined(GRUB_CPU_MIPS)
-#include "../mips/cache.S"
-#elif defined(GRUB_CPU_MIPSEL)
+#elif defined(__mips__)
#include "../mips/cache.S"
-#elif defined(GRUB_CPU_POWERPC)
+#elif defined(__powerpc__)
#include "../powerpc/cache.S"
#else
#error "No target cpu type is defined"
#error "This source is only meant for grub-emu platform"
#endif
-#if defined(GRUB_CPU_I386)
+#if defined(__i386__)
#include "../i386/dl.c"
-#elif defined(GRUB_CPU_X86_64)
+#elif defined(__x86_64__)
#include "../x86_64/dl.c"
-#elif defined(GRUB_CPU_SPARC64)
+#elif defined(__sparc__)
#include "../sparc64/dl.c"
-#elif defined(GRUB_CPU_MIPS)
+#elif defined(__mips__)
#include "../mips/dl.c"
-#elif defined(GRUB_CPU_MIPSEL)
-#include "../mips/dl.c"
-#elif defined(GRUB_CPU_POWERPC)
+#elif defined(__powerpc__)
#include "../powerpc/dl.c"
#else
#error "No target cpu type is defined"
/* 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
grub_arch_modules_addr (void)
{
#include <grub/reader.h>
#include <grub/parser.h>
-int grub_no_autoload;
-
void
grub_module_iterate (int (*hook) (struct grub_module_header *header))
{
#include <grub/i18n.h>
#include <grub/charset.h>
+#if defined (GRUB_MACHINE_EMU)
+#include <grub/emu/misc.h>
+#endif
+
#define GRUB_DEFAULT_HISTORY_SIZE 50
static int nested_level = 0;
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);