|
|
f731ee |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
f731ee |
From: Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f731ee |
Date: Fri, 28 Feb 2014 10:07:11 +0100
|
|
|
f731ee |
Subject: [PATCH] * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map
|
|
|
f731ee |
if E820 failed to return any regions.
|
|
|
f731ee |
|
|
|
f731ee |
---
|
|
|
f731ee |
grub-core/kern/i386/pc/mmap.c | 40 +++++++++++++++++++++-------------------
|
|
|
f731ee |
ChangeLog | 5 +++++
|
|
|
f731ee |
2 files changed, 26 insertions(+), 19 deletions(-)
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/grub-core/kern/i386/pc/mmap.c b/grub-core/kern/i386/pc/mmap.c
|
|
|
f731ee |
index 8009e833c1a..f1375f3e12d 100644
|
|
|
f731ee |
--- a/grub-core/kern/i386/pc/mmap.c
|
|
|
f731ee |
+++ b/grub-core/kern/i386/pc/mmap.c
|
|
|
f731ee |
@@ -141,33 +141,35 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry,
|
|
|
f731ee |
grub_err_t
|
|
|
f731ee |
grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
|
|
f731ee |
{
|
|
|
f731ee |
- grub_uint32_t cont;
|
|
|
f731ee |
+ grub_uint32_t cont = 0;
|
|
|
f731ee |
struct grub_machine_mmap_entry *entry
|
|
|
f731ee |
= (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
|
|
f731ee |
+ int e820_works = 0;
|
|
|
f731ee |
|
|
|
f731ee |
- grub_memset (entry, 0, sizeof (entry));
|
|
|
f731ee |
+ while (1)
|
|
|
f731ee |
+ {
|
|
|
f731ee |
+ grub_memset (entry, 0, sizeof (entry));
|
|
|
f731ee |
|
|
|
f731ee |
- /* Check if grub_get_mmap_entry works. */
|
|
|
f731ee |
- cont = grub_get_mmap_entry (entry, 0);
|
|
|
f731ee |
+ cont = grub_get_mmap_entry (entry, cont);
|
|
|
f731ee |
|
|
|
f731ee |
- if (entry->size)
|
|
|
f731ee |
- do
|
|
|
f731ee |
- {
|
|
|
f731ee |
- if (hook (entry->addr, entry->len,
|
|
|
f731ee |
- /* GRUB mmaps have been defined to match with the E820 definition.
|
|
|
f731ee |
- Therefore, we can just pass type through. */
|
|
|
f731ee |
- entry->type, hook_data))
|
|
|
f731ee |
- break;
|
|
|
f731ee |
+ if (!entry->size)
|
|
|
f731ee |
+ break;
|
|
|
f731ee |
|
|
|
f731ee |
- if (! cont)
|
|
|
f731ee |
- break;
|
|
|
f731ee |
+ if (entry->len)
|
|
|
f731ee |
+ e820_works = 1;
|
|
|
f731ee |
+ if (entry->len
|
|
|
f731ee |
+ && hook (entry->addr, entry->len,
|
|
|
f731ee |
+ /* GRUB mmaps have been defined to match with
|
|
|
f731ee |
+ the E820 definition.
|
|
|
f731ee |
+ Therefore, we can just pass type through. */
|
|
|
f731ee |
+ entry->type, hook_data))
|
|
|
f731ee |
+ break;
|
|
|
f731ee |
|
|
|
f731ee |
- grub_memset (entry, 0, sizeof (entry));
|
|
|
f731ee |
+ if (! cont)
|
|
|
f731ee |
+ break;
|
|
|
f731ee |
+ }
|
|
|
f731ee |
|
|
|
f731ee |
- cont = grub_get_mmap_entry (entry, cont);
|
|
|
f731ee |
- }
|
|
|
f731ee |
- while (entry->size);
|
|
|
f731ee |
- else
|
|
|
f731ee |
+ if (!e820_works)
|
|
|
f731ee |
{
|
|
|
f731ee |
grub_uint32_t eisa_mmap = grub_get_eisa_mmap ();
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/ChangeLog b/ChangeLog
|
|
|
f731ee |
index 6ed6cf4ec2b..97cf57e253d 100644
|
|
|
f731ee |
--- a/ChangeLog
|
|
|
f731ee |
+++ b/ChangeLog
|
|
|
f731ee |
@@ -1,3 +1,8 @@
|
|
|
f731ee |
+2014-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f731ee |
+
|
|
|
f731ee |
+ * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map
|
|
|
f731ee |
+ if E820 failed to return any regions.
|
|
|
f731ee |
+
|
|
|
f731ee |
2014-02-28 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
f731ee |
|
|
|
f731ee |
* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low
|