[PATCH] [POWERPC] Update linker script to properly set physical addresses

Kumar Gala galak at kernel.crashing.org
Mon Apr 7 23:00:35 EST 2008


On Apr 7, 2008, at 1:01 AM, Paul Mackerras wrote:
> Kumar Gala writes:
>
>> We can set LOAD_OFFSET and use the AT attribute on sections and the
>> linker will properly set the physical address of the LOAD program
>> header for us.
>
> Nice...
>
>> #define KERNELBASE      ASM_CONST(CONFIG_KERNEL_START)
>> #define PAGE_OFFSET	ASM_CONST(CONFIG_PAGE_OFFSET)
>> +#define LOAD_OFFSET	ASM_CONST((CONFIG_KERNEL_START- 
>> CONFIG_PHYSICAL_START))
>
> I think this should be CONFIG_PAGE_OFFSET - CONFIG_PHYSICAL_START
> though.

Disagree (assuming I'm thinking straight first thing in the morning).

PAGE_OFFSET is virt address of the beginning of memory, where  
KERNEL_START is virt address of start of kernel text.
PHYSICAL_START is physical address of KERNEL_START.

(I tried to match x86's definitions here as per Milton's request to be  
consistent).

- k



More information about the Linuxppc-dev mailing list