merge mainline into ahci

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-16 17:17:04 +02:00
commit 0670a9751b
385 changed files with 14296 additions and 2152 deletions

View file

@ -33,6 +33,8 @@
#include <grub/efi/api.h>
#endif
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] = {
{"exclude", 'x', 0,
N_("Don't load host tables specified by comma-separated list."),

View file

@ -26,6 +26,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)

View file

@ -25,6 +25,8 @@
#include <grub/mm.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t (*grub_loader_boot_func) (void);
static grub_err_t (*grub_loader_unload_func) (void);
static int grub_loader_noreturn;

View file

@ -25,6 +25,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"dos", -1, 0, N_("Accept DOS-style CR/NL line endings."), 0, 0},

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define BUFFER_SIZE 512
static grub_err_t

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_source (grub_command_t cmd, int argc, char **args)
{

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define GRUB_DATETIME_SET_YEAR 1
#define GRUB_DATETIME_SET_MONTH 2
#define GRUB_DATETIME_SET_DAY 4

View file

@ -23,6 +23,8 @@
#include <grub/i18n.h>
#include <grub/term.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{0, 'n', 0, N_("Do not output the trailing newline."), 0, 0},

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static struct grub_video_patch
{
const char *name;

View file

@ -25,6 +25,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;

View file

@ -23,6 +23,8 @@
#include <grub/efi/efi.h>
#include <grub/command.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define ADD_MEMORY_DESCRIPTOR(desc, size) \
((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size)))

View file

@ -18,12 +18,15 @@
*/
#include <grub/types.h>
#include <grub/mm.h>
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/normal.h>
#include <grub/charset.h>
#include <grub/efi/api.h>
#include <grub/efi/efi.h>
GRUB_MOD_LICENSE ("GPLv3+");
struct guid_mapping
{
grub_efi_guid_t guid;

View file

@ -23,6 +23,9 @@
#include <grub/charset.h>
#include <grub/efi/api.h>
#include <grub/efi/efi.h>
#include <grub/dl.h>
GRUB_MOD_LICENSE ("GPLv3+");
static void
disp_sal (void *table)

View file

@ -22,6 +22,9 @@
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/script_sh.h>
#include <grub/dl.h>
GRUB_MOD_LICENSE ("GPLv3+");
grub_err_t
grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,

View file

@ -29,6 +29,8 @@
#include <grub/fs.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* Convert a LBA address to a CHS address in the INT 13 format. */
/* Taken from grub1. */
/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63.

View file

@ -22,6 +22,8 @@
#include <grub/misc.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -26,6 +26,8 @@
#include <grub/normal.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] = {
{"hash", 'h', 0, N_("Specify hash to use."), N_("HASH"), ARG_TYPE_STRING},
{"check", 'c', 0, N_("Check hash list file."), N_("FILE"), ARG_TYPE_STRING},
@ -36,7 +38,7 @@ static const struct grub_arg_option options[] = {
{0, 0, 0, 0, 0, 0}
};
struct { const char *name; const char *hashname; } aliases[] =
static struct { const char *name; const char *hashname; } aliases[] =
{
{"sha256sum", "sha256"},
{"sha512sum", "sha512"},

View file

@ -27,6 +27,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] = {
{"apm", 'B', 0, N_("Set Advanced Power Management\n"
"(1=low, ..., 254=high, 255=off)."),
@ -77,7 +79,7 @@ grub_hdparm_do_ata_cmd (grub_ata_t ata, grub_uint8_t cmd,
apt.buffer = buffer;
apt.size = size;
if (ata->dev->readwrite (ata, &apt))
if (ata->dev->readwrite (ata, &apt, 0))
return grub_errno;
return GRUB_ERR_NONE;
@ -92,7 +94,7 @@ grub_hdparm_do_check_powermode_cmd (grub_ata_t ata)
apt.taskfile.cmd = GRUB_ATA_CMD_CHECK_POWER_MODE;
apt.taskfile.disk = 0xE0;
if (ata->dev->readwrite (ata, &apt))
if (ata->dev->readwrite (ata, &apt, 0))
return -1;
return apt.taskfile.sectors;
@ -110,7 +112,7 @@ grub_hdparm_do_smart_cmd (grub_ata_t ata, grub_uint8_t features)
apt.taskfile.lba_high = 0xc2;
apt.taskfile.disk = 0xE0;
if (ata->dev->readwrite (ata, &apt))
if (ata->dev->readwrite (ata, &apt, 0))
return -1;
if (features == GRUB_ATA_FEAT_SMART_STATUS)

View file

@ -26,6 +26,8 @@
#include <grub/normal.h>
#include <grub/charset.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc,
char **args)

View file

@ -25,6 +25,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] = {
{"skip", 's', 0, N_("Skip offset bytes from the beginning of file."), 0,
ARG_TYPE_INT},

View file

@ -21,6 +21,8 @@
#include <grub/misc.h>
#include <grub/cmos.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
parse_args (int argc, char *argv[], int *byte, int *bit)
{

View file

@ -27,6 +27,8 @@
#include <grub/i386/cpuid.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define cpuid(num,a,b,c,d) \
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \

View file

@ -29,6 +29,7 @@
#include <grub/memory.h>
#include <grub/machine/memory.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */
static grub_uint32_t *const int13slot = UINT_TO_PTR (4 * 0x13);

View file

@ -24,6 +24,8 @@
#include <grub/machine/int.h>
#include <grub/acpi.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"no-apm", 'n', 0, N_("Do not use APM to halt the computer."), 0, 0},

View file

@ -22,6 +22,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
int
grub_apm_get_info (struct grub_apm_info *info)
{

View file

@ -29,6 +29,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
#define BASE_TEMPO (60 * GRUB_TICKS_PER_SECOND)
/* The speaker port. */

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_pxe_unload (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -27,6 +27,8 @@
#include <grub/cpu/io.h>
#include <grub/loader.h>
GRUB_MOD_LICENSE ("GPLv2+");
static char sendkey[0x20];
/* Length of sendkey. */
static int keylen = 0;

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_suspend (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -24,6 +24,8 @@
#include <grub/cpu/io.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword;
static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword;

View file

@ -28,6 +28,8 @@
#include <grub/i18n.h>
#include <grub/file.h>
GRUB_MOD_LICENSE ("GPLv3+");
static struct grub_keyboard_layout layout_us = {
.keyboard_map = {
/* Keyboard errors. Handled by driver. */

View file

@ -23,6 +23,8 @@
#include <grub/term.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"shift", 's', 0, N_("Check Shift key."), 0, 0},

View file

@ -33,6 +33,8 @@
#include <grub/disk.h>
#include <grub/partition.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
legacy_file (const char *filename)
{
@ -83,9 +85,13 @@ legacy_file (const char *filename)
{
char *oldname = NULL;
char *newsuffix;
char *ptr;
for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++);
oldname = entryname;
parsed = grub_legacy_parse (buf, &entryname, &newsuffix);
parsed = grub_legacy_parse (ptr, &entryname, &newsuffix);
grub_free (buf);
buf = NULL;
if (newsuffix)
{
@ -209,7 +215,7 @@ grub_cmd_legacy_source (struct grub_command *cmd,
grub_menu_t menu;
menu = grub_env_get_menu ();
if (menu && menu->size)
grub_show_menu (menu, 1);
grub_show_menu (menu, 1, 0);
if (!extractor)
grub_env_context_close ();
}
@ -765,12 +771,12 @@ GRUB_MOD_INIT(legacycfg)
= grub_register_command ("extract_legacy_entries_source",
grub_cmd_legacy_source,
N_("FILE"),
N_("Parse legacy config in same context taking onl entries"));
N_("Parse legacy config in same context taking only menu entries"));
cmd_configfile_extract
= grub_register_command ("extract_legacy_entries_configfile",
grub_cmd_legacy_source,
N_("FILE"),
N_("Parse legacy config in new context taking onl entries"));
N_("Parse legacy config in new context taking only menu entries"));
cmd_kernel = grub_register_command ("legacy_kernel",
grub_cmd_legacy_kernel,

View file

@ -28,6 +28,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"file", 'f', 0, N_("Specify filename."), 0, ARG_TYPE_PATHNAME},

View file

@ -32,6 +32,8 @@
#include <grub/datetime.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"long", 'l', 0, N_("Show a long list with more detailed information."), 0, 0},

View file

@ -25,6 +25,8 @@
#include <grub/i18n.h>
#include <grub/dl.h>
GRUB_MOD_LICENSE ("GPLv3+");
static void
print_strn (grub_uint8_t *str, grub_size_t len)
{

View file

@ -22,6 +22,8 @@
#include <grub/i18n.h>
#include <grub/memory.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const char *names[] =
{
[GRUB_MEMORY_AVAILABLE] = "available",

View file

@ -23,6 +23,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
struct grub_pci_classname
{
int class;

View file

@ -23,6 +23,8 @@
#include <grub/env.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword;
static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword;

View file

@ -91,7 +91,7 @@ grub_normal_add_menu_entry (int argc, const char **args, char **classes,
if (! menu_sourcecode)
return grub_errno;
if (classes)
if (classes && classes[0])
{
int i;
for (i = 0; classes[i]; i++); /* count # of menuentry classes */
@ -255,7 +255,8 @@ grub_cmd_menuentry (grub_extcmd_context_t ctxt, int argc, char **args)
if (! ctxt->script)
return grub_normal_add_menu_entry (argc, (const char **) args,
ctxt->state[0].args, ctxt->state[1].arg,
(ctxt->state[0].set ? ctxt->state[0].args
: NULL), ctxt->state[1].arg,
ctxt->state[2].arg, 0,
ctxt->state[3].arg,
ctxt->extcmd->cmd->name[0] == 's');

View file

@ -29,6 +29,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* cat FILE */
static grub_err_t
grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)),

View file

@ -24,6 +24,8 @@
#include <grub/command.h>
#include <grub/cs5536.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_lsspd (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -31,6 +31,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv2+");
static struct grub_parttool *parts = 0;
static int curhandle = 0;
static grub_dl_t mymod;

View file

@ -26,6 +26,8 @@
#include <grub/dl.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_dl_t my_mod;
static grub_err_t

View file

@ -26,6 +26,8 @@
#include <grub/dl.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_dl_t my_mod;
struct pbkdf2_password

View file

@ -32,9 +32,11 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"set", 's', GRUB_ARG_OPTION_OPTIONAL,
{"set", 's', 0,
N_("Set a variable to return value."), "VAR", ARG_TYPE_STRING},
{"driver", 'd', 0, N_("Determine driver."), 0, 0},
{"partmap", 'p', 0, N_("Determine partition map type."), 0, 0},
@ -150,7 +152,7 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT (probe)
{
cmd = grub_register_extcmd ("probe", grub_cmd_probe, 0, N_("[DEVICE]"),
cmd = grub_register_extcmd ("probe", grub_cmd_probe, 0, N_("DEVICE"),
N_("Retrieve device info."), options);
}

View file

@ -26,6 +26,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static char *
grub_getline (void)
{

View file

@ -22,6 +22,8 @@
#include <grub/misc.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -27,6 +27,8 @@
#include <grub/script_sh.h>
#include <regex.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{ "set", 's', GRUB_ARG_OPTION_REPEATABLE,

View file

@ -31,6 +31,8 @@
#include <grub/disk.h>
#include <grub/partition.h>
GRUB_MOD_LICENSE ("GPLv3+");
void
FUNC_NAME (const char *key, const char *var, int no_floppy,
char **hints, unsigned nhints)

View file

@ -27,6 +27,8 @@
#include <grub/search.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"file", 'f', 0, N_("Search devices by a file."), 0, 0},

View file

@ -25,6 +25,8 @@
#include <grub/mm.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
struct pci_register
{
const char *name;
@ -32,7 +34,7 @@ struct pci_register
unsigned size;
};
struct pci_register pci_registers[] =
static struct pci_register pci_registers[] =
{
{"VENDOR_ID", GRUB_PCI_REG_VENDOR , 2},
{"DEVICE_ID", GRUB_PCI_REG_DEVICE , 2},

View file

@ -25,6 +25,8 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const struct grub_arg_option options[] =
{
{"verbose", 'v', 0, N_("Verbose countdown."), 0, 0},

View file

@ -23,6 +23,8 @@
#include <grub/i18n.h>
#include <grub/misc.h>
GRUB_MOD_LICENSE ("GPLv3+");
struct grub_term_autoload *grub_term_input_autoload = NULL;
struct grub_term_autoload *grub_term_output_autoload = NULL;
@ -210,11 +212,11 @@ grub_cmd_terminal_input (grub_command_t cmd __attribute__ ((unused)),
(void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, init);
(void) GRUB_FIELD_MATCH (grub_term_inputs, struct abstract_terminal *, fini);
return handle_command (argc, args,
(struct abstract_terminal **) &grub_term_inputs,
(struct abstract_terminal **) &grub_term_inputs_disabled,
grub_term_input_autoload,
N_ ("Active input terminals:"),
N_ ("Available input terminals:"));
(struct abstract_terminal **) (void *) &grub_term_inputs,
(struct abstract_terminal **) (void *) &grub_term_inputs_disabled,
grub_term_input_autoload,
N_ ("Active input terminals:"),
N_ ("Available input terminals:"));
}
static grub_err_t
@ -225,11 +227,12 @@ grub_cmd_terminal_output (grub_command_t cmd __attribute__ ((unused)),
(void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, name);
(void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, init);
(void) GRUB_FIELD_MATCH (grub_term_outputs, struct abstract_terminal *, fini);
return handle_command (argc, args, (struct abstract_terminal **) &grub_term_outputs,
(struct abstract_terminal **) &grub_term_outputs_disabled,
grub_term_output_autoload,
N_ ("Active output terminals:"),
N_ ("Available output terminals:"));
return handle_command (argc, args,
(struct abstract_terminal **) (void *) &grub_term_outputs,
(struct abstract_terminal **) (void *) &grub_term_outputs_disabled,
grub_term_output_autoload,
N_ ("Active output terminals:"),
N_ ("Available output terminals:"));
}
static grub_command_t cmd_terminal_input, cmd_terminal_output;

View file

@ -27,6 +27,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* A simple implementation for signed numbers. */
static int
grub_strtosl (char *arg, char **end, int base)

View file

@ -29,6 +29,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
int argc, char *argv[])

View file

@ -21,6 +21,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),

View file

@ -27,6 +27,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static const char *usb_classes[] =
{
"Unknown",

View file

@ -25,6 +25,8 @@
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_MOD_LICENSE ("GPLv3+");
static unsigned height, width, depth;
static int

View file

@ -28,6 +28,8 @@
#include <grub/gfxmenu_view.h>
#include <grub/env.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)

View file

@ -34,6 +34,8 @@
#include <grub/i18n.h>
#include <grub/crypto.h>
GRUB_MOD_LICENSE ("GPLv3+");
/* This prefix is used by xnu and boot-132 to hash
together with volume serial. */
static grub_uint8_t hash_prefix[16]