* grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map
if E820 failed to return any regions.
This commit is contained in:
parent
dfc5ccfa97
commit
bec35dad2a
2 changed files with 26 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2014-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map
|
||||||
|
if E820 failed to return any regions.
|
||||||
|
|
||||||
2014-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
2014-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low
|
* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low
|
||||||
|
|
|
@ -141,33 +141,35 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry,
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
||||||
{
|
{
|
||||||
grub_uint32_t cont;
|
grub_uint32_t cont = 0;
|
||||||
struct grub_machine_mmap_entry *entry
|
struct grub_machine_mmap_entry *entry
|
||||||
= (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
= (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
||||||
|
int e820_works = 0;
|
||||||
|
|
||||||
grub_memset (entry, 0, sizeof (entry));
|
while (1)
|
||||||
|
{
|
||||||
|
grub_memset (entry, 0, sizeof (entry));
|
||||||
|
|
||||||
/* Check if grub_get_mmap_entry works. */
|
cont = grub_get_mmap_entry (entry, cont);
|
||||||
cont = grub_get_mmap_entry (entry, 0);
|
|
||||||
|
|
||||||
if (entry->size)
|
if (!entry->size)
|
||||||
do
|
break;
|
||||||
{
|
|
||||||
if (hook (entry->addr, entry->len,
|
|
||||||
/* GRUB mmaps have been defined to match with the E820 definition.
|
|
||||||
Therefore, we can just pass type through. */
|
|
||||||
entry->type, hook_data))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (! cont)
|
if (entry->len)
|
||||||
break;
|
e820_works = 1;
|
||||||
|
if (entry->len
|
||||||
|
&& hook (entry->addr, entry->len,
|
||||||
|
/* GRUB mmaps have been defined to match with
|
||||||
|
the E820 definition.
|
||||||
|
Therefore, we can just pass type through. */
|
||||||
|
entry->type, hook_data))
|
||||||
|
break;
|
||||||
|
|
||||||
grub_memset (entry, 0, sizeof (entry));
|
if (! cont)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
cont = grub_get_mmap_entry (entry, cont);
|
if (!e820_works)
|
||||||
}
|
|
||||||
while (entry->size);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
grub_uint32_t eisa_mmap = grub_get_eisa_mmap ();
|
grub_uint32_t eisa_mmap = grub_get_eisa_mmap ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue