review fixes

This commit is contained in:
BVK Chaitanya 2010-06-02 13:51:05 +05:30
parent 13d7b4b0de
commit e508977630
10 changed files with 49 additions and 45 deletions

View File

@ -31,6 +31,10 @@
#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;
@ -175,7 +179,9 @@ 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");

View File

@ -54,12 +54,14 @@ case "$target_cpu" in
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
@ -134,29 +136,25 @@ case "$host_os" in
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)

View File

@ -23,8 +23,7 @@
#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)))

View File

@ -49,4 +49,7 @@ 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 */

View File

@ -50,9 +50,6 @@
/* 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);

View File

@ -2,17 +2,13 @@
#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)
#elif defined(__mips__)
#include "../mips/cache.S"
#elif defined(GRUB_CPU_MIPSEL)
#include "../mips/cache.S"
#elif defined(GRUB_CPU_POWERPC)
#elif defined(__powerpc__)
#include "../powerpc/cache.S"
#else
#error "No target cpu type is defined"

View File

@ -5,17 +5,15 @@
#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"

View File

@ -51,6 +51,9 @@ 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
grub_arch_modules_addr (void)
{

View File

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

View File

@ -32,6 +32,10 @@
#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;
@ -476,7 +480,9 @@ 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);