nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Vladimir Serbinenko <phcoder@gmail.com>
f725e3
Date: Fri, 28 Feb 2014 09:50:47 +0100
f725e3
Subject: [PATCH] * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]:
f725e3
 Ignore low tables for low memory calculations.
f725e3
f725e3
---
f725e3
 grub-core/mmap/i386/uppermem.c | 6 +++++-
f725e3
 ChangeLog                      | 5 +++++
f725e3
 2 files changed, 10 insertions(+), 1 deletion(-)
f725e3
f725e3
diff --git a/grub-core/mmap/i386/uppermem.c b/grub-core/mmap/i386/uppermem.c
f725e3
index bd8b429c4be..a6be9896d82 100644
f725e3
--- a/grub-core/mmap/i386/uppermem.c
f725e3
+++ b/grub-core/mmap/i386/uppermem.c
f725e3
@@ -31,8 +31,12 @@ lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
f725e3
 
f725e3
   if (type != GRUB_MEMORY_AVAILABLE)
f725e3
     return 0;
f725e3
+#ifdef GRUB_MACHINE_COREBOOT
f725e3
+  if (addr <= 0x1000)
f725e3
+#else
f725e3
   if (addr == 0)
f725e3
-    *lower = size;
f725e3
+#endif
f725e3
+    *lower = size + addr;
f725e3
   return 0;
f725e3
 }
f725e3
 
f725e3
diff --git a/ChangeLog b/ChangeLog
f725e3
index bbaed2691c7..6ed6cf4ec2b 100644
f725e3
--- a/ChangeLog
f725e3
+++ b/ChangeLog
f725e3
@@ -1,3 +1,8 @@
f725e3
+2014-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
+
f725e3
+	* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low
f725e3
+	tables for low memory calculations.
f725e3
+
f725e3
 2014-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
 
f725e3
 	* grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit