review fixes
This commit is contained in:
parent
13d7b4b0de
commit
e508977630
10 changed files with 49 additions and 45 deletions
|
@ -31,6 +31,10 @@
|
||||||
#include <grub/command.h>
|
#include <grub/command.h>
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
|
|
||||||
|
#if defined (GRUB_MACHINE_EMU)
|
||||||
|
#include <grub/emu/misc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct grub_parttool *parts = 0;
|
static struct grub_parttool *parts = 0;
|
||||||
static int curhandle = 0;
|
static int curhandle = 0;
|
||||||
static grub_dl_t mymod;
|
static grub_dl_t mymod;
|
||||||
|
@ -175,7 +179,9 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load modules. */
|
/* Load modules. */
|
||||||
|
#if defined(GRUB_MACHINE_EMU)
|
||||||
if (! grub_no_autoload)
|
if (! grub_no_autoload)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
prefix = grub_env_get ("prefix");
|
prefix = grub_env_get ("prefix");
|
||||||
|
|
44
configure.ac
44
configure.ac
|
@ -54,12 +54,14 @@ case "$target_cpu" in
|
||||||
amd64) target_cpu=x86_64 ;;
|
amd64) target_cpu=x86_64 ;;
|
||||||
sparc) target_cpu=sparc64 ;;
|
sparc) target_cpu=sparc64 ;;
|
||||||
mipsel|mips64el)
|
mipsel|mips64el)
|
||||||
target_cpu=mips;
|
target_cpu=mips;
|
||||||
cpu_CPPFLAGS="-DGRUB_CPU_MIPSEL=1";
|
TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1";
|
||||||
|
CFLAGS="$CFLAGS -DGRUB_CPU_MIPSEL=1";
|
||||||
;;
|
;;
|
||||||
mips|mips64)
|
mips|mips64)
|
||||||
target_cpu=mips;
|
target_cpu=mips;
|
||||||
cpu_CPPFLAGS="-DGRUB_CPU_MIPS=1";
|
TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1";
|
||||||
|
CFLAGS="$CFLAGS -DGRUB_CPU_MIPS=1";
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -134,29 +136,25 @@ case "$host_os" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$platform" in
|
case "$platform" in
|
||||||
coreboot) machine_CPPFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
|
coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
|
||||||
multiboot) machine_CPPFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
|
multiboot) machine_CFLAGS="-DGRUB_MACHINE_MULTIBOOT=1" ;;
|
||||||
efi) machine_CPPFLAGS="-DGRUB_MACHINE_EFI=1" ;;
|
efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
|
||||||
ieee1275) machine_CPPFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
|
ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
|
||||||
qemu) machine_CPPFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
|
qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
|
||||||
pc) machine_CPPFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
|
pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
|
||||||
emu) machine_CPPFLAGS="-DGRUB_MACHINE_EMU=1" ;;
|
emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
|
||||||
yeeloong) machine_CPPFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
|
yeeloong) machine_CFLAGS="-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" ;;
|
qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
|
||||||
esac
|
esac
|
||||||
case "$target_cpu" in
|
case "$target_cpu" in
|
||||||
i386) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_I386";;
|
mips) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_MIPS=1" ;;
|
||||||
x86_64) cpu_CPPFLAGS="$cpu_CPPFLAGS -DGRUB_CPU_X86_64";;
|
sparc64) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
|
||||||
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" ;;
|
|
||||||
esac
|
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"
|
CFLAGS="$CFLAGS $machine_CFLAGS"
|
||||||
TARGET_ASFLAGS="$TARGET_ASFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
|
TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
|
||||||
TARGET_CFLAGS="$TARGET_CFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
|
TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
|
||||||
|
|
||||||
AC_SUBST(host_cpu)
|
AC_SUBST(host_cpu)
|
||||||
AC_SUBST(host_os)
|
AC_SUBST(host_os)
|
||||||
|
|
|
@ -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)))
|
||||||
|
|
|
@ -49,4 +49,7 @@ int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...);
|
||||||
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
||||||
extern char * canonicalize_file_name (const char *path);
|
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 */
|
#endif /* GRUB_EMU_MISC_H */
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -51,6 +51,9 @@ 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;
|
||||||
|
|
||||||
|
/* Flag to control module autoloading in normal mode. */
|
||||||
|
int grub_no_autoload;
|
||||||
|
|
||||||
grub_addr_t
|
grub_addr_t
|
||||||
grub_arch_modules_addr (void)
|
grub_arch_modules_addr (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
#include <grub/charset.h>
|
#include <grub/charset.h>
|
||||||
|
|
||||||
|
#if defined (GRUB_MACHINE_EMU)
|
||||||
|
#include <grub/emu/misc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define GRUB_DEFAULT_HISTORY_SIZE 50
|
#define GRUB_DEFAULT_HISTORY_SIZE 50
|
||||||
|
|
||||||
static int nested_level = 0;
|
static int nested_level = 0;
|
||||||
|
@ -476,7 +480,9 @@ grub_normal_init_page (struct grub_term_output *term)
|
||||||
static void
|
static void
|
||||||
read_lists (const char *val)
|
read_lists (const char *val)
|
||||||
{
|
{
|
||||||
|
#if defined(GRUB_MACHINE_EMU)
|
||||||
if (! grub_no_autoload)
|
if (! grub_no_autoload)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
read_command_list (val);
|
read_command_list (val);
|
||||||
read_fs_list (val);
|
read_fs_list (val);
|
||||||
|
|
Loading…
Reference in a new issue