[PATCH 4/5] powerpc: Make the 64-bit kernel as a position-independent executable

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Aug 20 02:20:15 EST 2008


On Wed, 13 Aug 2008, Paul Mackerras wrote:
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -1163,7 +1163,9 @@ void __init early_init_devtree(void *params)
>  	parse_early_param();
>  
>  	/* Reserve LMB regions used by kernel, initrd, dt, etc... */
> -	lmb_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
> +	lmb_reserve(0, __end_interrupts - _stext);
> +	lmb_reserve(__pa(__end_interrupts),
> +		    klimit - (unsigned long)__end_interrupts);
>  	reserve_kdump_trampoline();
>  	reserve_crashkernel();
>  	early_reserve_mem();

This part broke ppc32:

| arch/powerpc/kernel/prom.c: In function 'early_init_devtree':
| arch/powerpc/kernel/prom.c:1166: error: '__end_interrupts' undeclared (first use in this function)
| arch/powerpc/kernel/prom.c:1166: error: (Each undeclared identifier is reported only once
| arch/powerpc/kernel/prom.c:1166: error: for each function it appears in.)

After applying the patch below, I was able to build and boot a kernel for the
Sequoia.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven at sonycom.com>
---
 arch/powerpc/kernel/prom.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1163,9 +1163,13 @@ void __init early_init_devtree(void *par
 	parse_early_param();
 
 	/* Reserve LMB regions used by kernel, initrd, dt, etc... */
+#ifdef CONFIG_PPC64
 	lmb_reserve(0, __end_interrupts - _stext);
 	lmb_reserve(__pa(__end_interrupts),
 		    klimit - (unsigned long)__end_interrupts);
+#else
+	lmb_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
+#endif
 	reserve_kdump_trampoline();
 	reserve_crashkernel();
 	early_reserve_mem();

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010


More information about the Linuxppc-dev mailing list