summaryrefslogtreecommitdiff
path: root/util/cbfstool/linux_trampoline.S
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/linux_trampoline.S')
-rw-r--r--util/cbfstool/linux_trampoline.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/util/cbfstool/linux_trampoline.S b/util/cbfstool/linux_trampoline.S
index 941ab3f2e0..6a62ff0ed5 100644
--- a/util/cbfstool/linux_trampoline.S
+++ b/util/cbfstool/linux_trampoline.S
@@ -61,9 +61,22 @@ jne .testAcpiRsdp
mov 4(%ebx), %eax
sub $8, %eax
shr $2, %eax /* eax = number of dwords of e820 data */
+/*
+ * Historically linux had space for 32 entries. This limit was increased in
+ * the year 2005 (Linux 2.6.11) to hold up to 128 entries.
+ * Assume 128 entries when the boot protocol version is 2.04+.
+ */
+cmpw $0x0204, (LINUX_PARAM_LOC + PROTOCOL_VERSION)
+jge .e820big /* protocol version >= 2.04 can handle 128 entries of 5 dwords */
cmp $(32 * 5), %eax /* linux wants at most 32 entries of 5 dwords */
jng 1f
mov $(32 * 5), %eax /* only copy 32 entries */
+jmp 1f
+
+.e820big:
+cmp $(128 * 5), %eax /* linux wants at most 128 entries of 5 dwords */
+jng 1f
+mov $(128 * 5), %eax /* only copy 128 entries */
1:
mov %eax, %esi
mov $5, %edi