* grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map

if E820 failed to return any regions.
This commit is contained in:
Vladimir Serbinenko 2014-02-28 10:07:11 +01:00
parent dfc5ccfa97
commit bec35dad2a
2 changed files with 26 additions and 19 deletions

View file

@ -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>
* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low

View file

@ -141,33 +141,35 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry,
grub_err_t
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 *) 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, 0);
cont = grub_get_mmap_entry (entry, cont);
if (entry->size)
do
{
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 (!entry->size)
break;
if (! cont)
break;
if (entry->len)
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);
}
while (entry->size);
else
if (!e820_works)
{
grub_uint32_t eisa_mmap = grub_get_eisa_mmap ();