Skip to contentSkip to conversation

Handle big kernels

PATCH New Horst H. von Brand 1 participant 1 message Mar 25, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 Handle big kernels

Apply silo-big-kernel.patch from Aurora's 1.4.13-8 (from davem)

---
 second/main.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
second/main.c +10 -6
index 9644e44..2042f9d 100644
@@ -1204,12 +1204,16 @@ try_again:
 		unsigned int size;
 		unsigned char *mem;
 
-		size = 0x800000;
-		mem = (unsigned char *)image_memory_find(size);
-
-		if (!mem) {
-		    size = 0x400000;
-		    mem = (unsigned char *)image_memory_find(size);
+ 		/* As of 2.6.25-rc6, an "allyesconfig" kernel is around
+ 		 * ~42MB in size.  So we try to carve out up to 64MB of
+ 		 * memory for the kernel.
+ 		 */
+ 		for (size = 64 * 1024 * 1024;
+ 		     size >= 4 * 1024 * 1024;
+ 		     size -= 4 * 1024 * 1024) {
+ 			mem = (unsigned char *)image_memory_find(size);
+ 			if (mem)
+ 				break;
 		}
 
 		if (mem) {
Signature · 1 line
1.5.5.rc0.16.g02b00