aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-03-12 13:50:03 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-03-12 13:54:08 -0700
commit14b47f77ec944c0cc8cb56d5e220ce67846dcf4d (patch)
tree3de5406d966903a82bc418b3ff97606bcb735fdc /com32/lib
parentd16e5e8e8ea526326ed6f8880464399624bfe171 (diff)
downloadsyslinux.git-14b47f77ec944c0cc8cb56d5e220ce67846dcf4d.tar.gz
syslinux.git-14b47f77ec944c0cc8cb56d5e220ce67846dcf4d.tar.xz
syslinux.git-14b47f77ec944c0cc8cb56d5e220ce67846dcf4d.zip
linux.c32: fix initrd alignment
Impact: fix boot failure on Dell E6500 and possibly other platforms Linux may not be able to access a part of an initrd which resides in a page that is part RAM, part non-RAM. Make sure we round the end of the memory range we want to use down to a page boundary (as well as round the start up.) Reported-by: Pierre-Alexandre Meyer <pierre@mouraf.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib')
-rw-r--r--com32/lib/syslinux/load_linux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index b7720562..cca2efd0 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@@ -290,9 +290,9 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
if (irf_size) {
for (ml = amap; ml->type != SMT_END; ml = ml->next) {
addr_t adj_start = (ml->start+align_mask) & ~align_mask;
- if (ml->type == SMT_FREE &&
- ml->next->start - adj_start >= irf_size)
- best_addr = (ml->next->start - irf_size) & ~align_mask;
+ addr_t adj_end = ml->next->start & ~align_mask;
+ if (ml->type == SMT_FREE && adj_end-adj_start >= irf_size)
+ best_addr = (adj_end - irf_size) & ~align_mask;
}
if (!best_addr)