dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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