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

23d2ea
From 623002084c7550214ae9740547a557ffb31c3658 Mon Sep 17 00:00:00 2001
39700a
From: Vladimir Serbinenko <phcoder@gmail.com>
39700a
Date: Fri, 28 Feb 2014 09:50:47 +0100
27a4da
Subject: [PATCH 063/260] * grub-core/mmap/i386/uppermem.c (lower_hook)
23d2ea
 [COREBOOT]: Ignore low tables for low memory calculations.
39700a
39700a
---
39700a
 ChangeLog                      | 5 +++++
39700a
 grub-core/mmap/i386/uppermem.c | 6 +++++-
39700a
 2 files changed, 10 insertions(+), 1 deletion(-)
39700a
39700a
diff --git a/ChangeLog b/ChangeLog
27a4da
index bbaed2691..6ed6cf4ec 100644
39700a
--- a/ChangeLog
39700a
+++ b/ChangeLog
39700a
@@ -1,5 +1,10 @@
39700a
 2014-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
39700a
 
39700a
+	* grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low
39700a
+	tables for low memory calculations.
39700a
+
39700a
+2014-02-28  Vladimir Serbinenko  <phcoder@gmail.com>
39700a
+
39700a
 	* grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit
39700a
 	location to 640K.
39700a
 
39700a
diff --git a/grub-core/mmap/i386/uppermem.c b/grub-core/mmap/i386/uppermem.c
27a4da
index bd8b429c4..a6be9896d 100644
39700a
--- a/grub-core/mmap/i386/uppermem.c
39700a
+++ b/grub-core/mmap/i386/uppermem.c
39700a
@@ -31,8 +31,12 @@ lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
39700a
 
39700a
   if (type != GRUB_MEMORY_AVAILABLE)
39700a
     return 0;
39700a
+#ifdef GRUB_MACHINE_COREBOOT
39700a
+  if (addr <= 0x1000)
39700a
+#else
39700a
   if (addr == 0)
39700a
-    *lower = size;
39700a
+#endif
39700a
+    *lower = size + addr;
39700a
   return 0;
39700a
 }
39700a
 
39700a
-- 
27a4da
2.13.0
39700a