Merge mainline.
This commit is contained in:
commit
90eb90e24c
263 changed files with 5295 additions and 865 deletions
|
@ -21,6 +21,8 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/aout.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
int
|
||||
grub_aout_get_type (union grub_aout_header *header)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
static grub_efi_handle_t image_handle;
|
||||
|
@ -67,165 +69,60 @@ struct piwg_full_device_path
|
|||
struct grub_efi_device_path end;
|
||||
};
|
||||
|
||||
/* early 2006 Core Duo / Core Solo models */
|
||||
static struct piwg_full_device_path devpath_1 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff9ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
#define MAKE_PIWG_PATH(st, en) \
|
||||
{ \
|
||||
.comp1 = \
|
||||
{ \
|
||||
.header = { \
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE, \
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE, \
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0} \
|
||||
}, \
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO, \
|
||||
.start_address = st, \
|
||||
.end_address = en \
|
||||
}, \
|
||||
.comp2 = \
|
||||
{ \
|
||||
.header = { \
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE, \
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE, \
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0} \
|
||||
}, \
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B, \
|
||||
0x01, 0xAE, 0xF2, 0xB7}} \
|
||||
}, \
|
||||
.end = \
|
||||
{ \
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE, \
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE, \
|
||||
.length = {sizeof (struct grub_efi_device_path), 0} \
|
||||
} \
|
||||
}
|
||||
};
|
||||
|
||||
/* early 2006 Core Duo / Core Solo models */
|
||||
static struct piwg_full_device_path devpath_1 = MAKE_PIWG_PATH (0xffe00000,
|
||||
0xfff9ffff);
|
||||
|
||||
/* mid-2006 Mac Pro (and probably other Core 2 models) */
|
||||
static struct piwg_full_device_path devpath_2 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff7ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
static struct piwg_full_device_path devpath_2 = MAKE_PIWG_PATH (0xffe00000,
|
||||
0xfff7ffff);
|
||||
|
||||
/* mid-2007 MBP ("Santa Rosa" based models) */
|
||||
static struct piwg_full_device_path devpath_3 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff8ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
static struct piwg_full_device_path devpath_3 = MAKE_PIWG_PATH (0xffe00000,
|
||||
0xfff8ffff);
|
||||
|
||||
/* early-2008 MBA */
|
||||
static struct piwg_full_device_path devpath_4 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffc00000,
|
||||
.end_address = 0xfff8ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
static struct piwg_full_device_path devpath_4 = MAKE_PIWG_PATH (0xffc00000,
|
||||
0xfff8ffff);
|
||||
|
||||
/* late-2008 MB/MBP (NVidia chipset) */
|
||||
static struct piwg_full_device_path devpath_5 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffcb4000,
|
||||
.end_address = 0xffffbfff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
static struct piwg_full_device_path devpath_5 = MAKE_PIWG_PATH (0xffcb4000,
|
||||
0xffffbfff);
|
||||
|
||||
/* mid-2010 MB/MBP (NVidia chipset) */
|
||||
static struct piwg_full_device_path devpath_6 = MAKE_PIWG_PATH (0xffcc4000,
|
||||
0xffffbfff);
|
||||
|
||||
struct devdata
|
||||
{
|
||||
|
@ -240,6 +137,7 @@ struct devdata devs[] =
|
|||
{"MBP", (grub_efi_device_path_t *) &devpath_3},
|
||||
{"MBA", (grub_efi_device_path_t *) &devpath_4},
|
||||
{"MB NV", (grub_efi_device_path_t *) &devpath_5},
|
||||
{"MB NV2", (grub_efi_device_path_t *) &devpath_6},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
static grub_efi_physical_address_t address;
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include <grub/i18n.h>
|
||||
#include <grub/ns8250.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#include <grub/video.h>
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
#include <grub/machine/biosnum.h>
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <grub/i18n.h>
|
||||
#include <grub/lib/cmdline.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
#include <grub/i386/pc/vesa_modes_table.h>
|
||||
#endif
|
||||
|
@ -547,6 +549,7 @@ grub_linux_boot (void)
|
|||
#ifdef GRUB_MACHINE_EFI
|
||||
{
|
||||
grub_efi_uintn_t efi_desc_size;
|
||||
grub_size_t efi_mmap_target;
|
||||
grub_efi_uint32_t efi_desc_version;
|
||||
err = grub_efi_finish_boot_services (&efi_mmap_size, efi_mmap_buf, NULL,
|
||||
&efi_desc_size, &efi_desc_version);
|
||||
|
@ -554,23 +557,24 @@ grub_linux_boot (void)
|
|||
return err;
|
||||
|
||||
/* Note that no boot services are available from here. */
|
||||
|
||||
efi_mmap_target = real_mode_target
|
||||
+ ((grub_uint8_t *) efi_mmap_buf - (grub_uint8_t *) real_mode_mem);
|
||||
/* Pass EFI parameters. */
|
||||
if (grub_le_to_cpu16 (params->version) >= 0x0206)
|
||||
{
|
||||
params->v0206.efi_mem_desc_size = efi_desc_size;
|
||||
params->v0206.efi_mem_desc_version = efi_desc_version;
|
||||
params->v0206.efi_mmap = (grub_uint32_t) (unsigned long) efi_mmap_buf;
|
||||
params->v0206.efi_mmap = efi_mmap_target;
|
||||
params->v0206.efi_mmap_size = efi_mmap_size;
|
||||
#ifdef __x86_64__
|
||||
params->v0206.efi_mmap_hi = (grub_uint32_t) ((grub_uint64_t) efi_mmap_buf >> 32);
|
||||
params->v0206.efi_mmap_hi = (efi_mmap_target >> 32);
|
||||
#endif
|
||||
}
|
||||
else if (grub_le_to_cpu16 (params->version) >= 0x0204)
|
||||
{
|
||||
params->v0204.efi_mem_desc_size = efi_desc_size;
|
||||
params->v0204.efi_mem_desc_version = efi_desc_version;
|
||||
params->v0204.efi_mmap = (grub_uint32_t) (unsigned long) efi_mmap_buf;
|
||||
params->v0204.efi_mmap = efi_mmap_target;
|
||||
params->v0204.efi_mmap_size = efi_mmap_size;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -448,7 +448,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
|||
bufsize = grub_multiboot_get_mbi_size ();
|
||||
|
||||
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch,
|
||||
0, 0xffffffff - bufsize,
|
||||
0x10000, 0x100000 - bufsize,
|
||||
bufsize, 4,
|
||||
GRUB_RELOCATOR_PREFERENCE_NONE);
|
||||
if (err)
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <grub/video.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
static int boot_drive;
|
||||
static void *boot_part_addr;
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
#include <grub/i386/floppy.h>
|
||||
#include <grub/lib/cmdline.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define GRUB_LINUX_CL_OFFSET 0x9000
|
||||
#define GRUB_LINUX_CL_END_OFFSET 0x90FF
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/cpu/relocator.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
static struct grub_relocator *rel;
|
||||
static grub_uint32_t edx = 0xffffffff;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <grub/memory.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* For frequencies. */
|
||||
#include <grub/pci.h>
|
||||
#include <grub/machine/time.h>
|
||||
|
@ -379,8 +381,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_relocator_chunk_t ch;
|
||||
|
||||
err = grub_relocator_alloc_chunk_align (relocator, &ch,
|
||||
target_addr + linux_size + 0x10000,
|
||||
(0xffffffff - size) + 1,
|
||||
(target_addr & 0x1fffffff)
|
||||
+ linux_size + 0x10000,
|
||||
(0x10000000 - size),
|
||||
size, 0x10000,
|
||||
GRUB_RELOCATOR_PREFERENCE_NONE);
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
#include <grub/memory.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
#include <grub/efi/efi.h>
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <grub/memory.h>
|
||||
#include <grub/lib/cmdline.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define ELF32_LOADMASK (0xc0000000UL)
|
||||
#define ELF64_LOADMASK (0xc000000000000000ULL)
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <grub/memory.h>
|
||||
#include <grub/lib/cmdline.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_dl_t my_mod;
|
||||
|
||||
static int loaded;
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include <grub/env.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#if defined (__i386) && !defined (GRUB_MACHINE_EFI)
|
||||
#include <grub/autoefi.h>
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue