[Fwd: [PATCH] Make room fails without CONFIG_BLK_DEV_INITRD]
Rusty Russell
rusty at rustcorp.com.au
Sun Apr 25 18:04:50 EST 2004
On Sun, 2004-04-25 at 10:20, Benjamin Herrenschmidt wrote:
> -----Forwarded Message-----
> From: Dave Boutcher <sleddog at us.ibm.com>
> To: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Cc: ppc64 Dev list <linuxppc64-dev at lists.linuxppc.org>
> Subject: [PATCH] Make room fails without CONFIG_BLK_DEV_INITRD
> Date: Sat, 24 Apr 2004 19:14:09 -0500
>
> Hi Ben,
>
> Just FYI, with your make room patches the kernel won't build unless
> CONFIG_BLK_DEV_INITRD is specificed.
Oops. Prefer this fix: does it work for you?
Thanks!
Rusty.
Name: Fix compile for CONFIG_BLK_DEV_INITRD=n
Status: Trivial
Depends: Misc/prom-move-initrd.patch.gz
Doesn't compile with CONFIG_BLK_DEV_INITRD=n. Be more careful with
the conditionals.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .24128-linux-2.6.6-rc2-bk3/arch/ppc64/kernel/prom.c .24128-linux-2.6.6-rc2-bk3.updated/arch/ppc64/kernel/prom.c
--- .24128-linux-2.6.6-rc2-bk3/arch/ppc64/kernel/prom.c 2004-04-25 17:49:51.000000000 +1000
+++ .24128-linux-2.6.6-rc2-bk3.updated/arch/ppc64/kernel/prom.c 2004-04-25 18:02:15.000000000 +1000
@@ -1548,6 +1548,7 @@ static void __init *__make_room(unsigned
*mem_start = ALIGN(*mem_start, align);
if (*mem_start + needed > *mem_end) {
+#ifdef CONFIG_BLK_DEV_INITRD
/* FIXME: Apple OF doesn't map unclaimed mem. If this
* ever happened on G5, we'd need to fix. */
unsigned long initrd_len;
@@ -1563,6 +1564,9 @@ static void __init *__make_room(unsigned
initrd_len);
RELOC(initrd_start) = *mem_end;
RELOC(initrd_end) = RELOC(initrd_start) + initrd_len;
+#else
+ prom_panic(RELOC("No memory for copy_device_tree"));
+#endif
}
ret = (void *)*mem_start;
@@ -1699,11 +1703,14 @@ copy_device_tree(unsigned long mem_start
phandle root;
struct device_node **allnextp;
unsigned long offset = reloc_offset();
- unsigned long mem_end = RELOC(initrd_start);
+ unsigned long mem_end;
/* We pass mem_end-mem_start to OF: keep it well under 32-bit */
- if (!mem_end)
- mem_end = mem_start + 1024*1024*1024;
+ mem_end = mem_start + 1024*1024*1024;
+#ifdef CONFIG_BLK_DEV_INITRD
+ if (RELOC(initrd_start) && RELOC(initrd_start) > mem_start)
+ mem_end = RELOC(initrd_start);
+#endif /* CONFIG_BLK_DEV_INITRD */
root = call_prom(RELOC("peer"), 1, 1, (phandle)0);
if (root == (phandle)0) {
@@ -1964,12 +1971,14 @@ prom_init(unsigned long r3, unsigned lon
prom_print(RELOC("after basic inits, mem=0x"));
prom_print_hex(mem);
prom_print_nl();
+#ifdef CONFIG_BLK_DEV_INITRD
prom_print(RELOC("initrd_start=0x"));
prom_print_hex(RELOC(initrd_start));
prom_print_nl();
prom_print(RELOC("initrd_end=0x"));
prom_print_hex(RELOC(initrd_end));
prom_print_nl();
+#endif /* CONFIG_BLK_DEV_INITRD */
prom_print(RELOC("copying OF device tree...\n"));
#endif /* DEBUG_PROM */
mem = copy_device_tree(mem);
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list