synced with mainstream

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-11-22 12:11:17 +01:00
commit 4fe6aa0961
220 changed files with 54340 additions and 18150 deletions

View file

@ -552,7 +552,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
grub_free (exclude);
grub_free (load_only);
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Could allocate table");
"Couldn't allocate table");
}
grub_memcpy (table_dsdt, dsdt, dsdt->length);
}
@ -579,7 +579,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
grub_free (exclude);
grub_free (load_only);
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Could allocate table structure");
"Couldn't allocate table structure");
}
table->size = curtable->length;
table->addr = grub_malloc (table->size);
@ -588,7 +588,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
{
free_tables ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Could allocate table");
"Couldn't allocate table");
}
table->next = acpi_tables;
acpi_tables = table;
@ -675,7 +675,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
{
free_tables ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Could allocate table structure");
"Couldn't allocate table structure");
}
table->size = size;

View file

@ -1,7 +1,7 @@
/* cpuid.c - test for CPU features */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
* Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
* Based on gcc/gcc/config/i386/driver-i386.c
*
* GRUB is free software: you can redistribute it and/or modify
@ -24,6 +24,7 @@
#include <grub/env.h>
#include <grub/command.h>
#include <grub/extcmd.h>
#include <grub/i386/cpuid.h>
#define cpuid(num,a,b,c,d) \
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
@ -38,14 +39,14 @@ static const struct grub_arg_option options[] =
#define bit_LM (1 << 29)
static unsigned char has_longmode = 0;
unsigned char grub_cpuid_has_longmode = 0;
static grub_err_t
grub_cmd_cpuid (grub_extcmd_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char **args __attribute__ ((unused)))
{
return has_longmode ? GRUB_ERR_NONE
return grub_cpuid_has_longmode ? GRUB_ERR_NONE
: grub_error (GRUB_ERR_TEST_FAILURE, "false");
}
@ -55,7 +56,7 @@ GRUB_MOD_INIT(cpuid)
{
#ifdef __x86_64__
/* grub-emu */
has_longmode = 1;
grub_cpuid_has_longmode = 1;
#else
unsigned int eax, ebx, ecx, edx;
unsigned int max_level;
@ -82,7 +83,7 @@ GRUB_MOD_INIT(cpuid)
goto done;
cpuid (0x80000001, eax, ebx, ecx, edx);
has_longmode = !!(edx & bit_LM);
grub_cpuid_has_longmode = !!(edx & bit_LM);
done:
#endif

View file

@ -336,8 +336,19 @@ grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)),
return 0;
}
/* clear */
static grub_err_t
grub_mini_cmd_clear (struct grub_command *cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char *argv[] __attribute__ ((unused)))
{
grub_cls ();
return 0;
}
static grub_command_t cmd_cat, cmd_help, cmd_root;
static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit;
static grub_command_t cmd_clear;
GRUB_MOD_INIT(minicmd)
{
@ -362,6 +373,9 @@ GRUB_MOD_INIT(minicmd)
cmd_exit =
grub_register_command ("exit", grub_mini_cmd_exit,
0, "exit from GRUB");
cmd_clear =
grub_register_command ("clear", grub_mini_cmd_clear,
0, "clear the screen");
}
GRUB_MOD_FINI(minicmd)
@ -373,4 +387,5 @@ GRUB_MOD_FINI(minicmd)
grub_unregister_command (cmd_rmmod);
grub_unregister_command (cmd_lsmod);
grub_unregister_command (cmd_exit);
grub_unregister_command (cmd_clear);
}

View file

@ -349,8 +349,6 @@ grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)),
grub_memcpy (hashme.prefix, hash_prefix, sizeof (hashme.prefix));
md5 ((char *) &hashme, sizeof (hashme), (char *) xnu_uuid);
xnu_uuid[6] = (xnu_uuid[6] & 0xf) | 0x30;
xnu_uuid[8] = (xnu_uuid[8] & 0x3f) | 0x80;
grub_sprintf (uuid_string,
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
(unsigned int) xnu_uuid[0], (unsigned int) xnu_uuid[1],