linux/arch/powerpc/platforms
Paul Mackerras 549e8152de powerpc: Make the 64-bit kernel as a position-independent executable
This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
a position-independent executable (PIE) when it is set.  This involves
processing the dynamic relocations in the image in the early stages of
booting, even if the kernel is being run at the address it is linked at,
since the linker does not necessarily fill in words in the image for
which there are dynamic relocations.  (In fact the linker does fill in
such words for 64-bit executables, though not for 32-bit executables,
so in principle we could avoid calling relocate() entirely when we're
running a 64-bit kernel at the linked address.)

The dynamic relocations are processed by a new function relocate(addr),
where the addr parameter is the virtual address where the image will be
run.  In fact we call it twice; once before calling prom_init, and again
when starting the main kernel.  This means that reloc_offset() returns
0 in prom_init (since it has been relocated to the address it is running
at), which necessitated a few adjustments.

This also changes __va and __pa to use an equivalent definition that is
simpler.  With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
constants (for 64-bit) whereas PHYSICAL_START is a variable (and
KERNELBASE ideally should be too, but isn't yet).

With this, relocatable kernels still copy themselves down to physical
address 0 and run there.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-09-15 11:08:38 -07:00
..
8xx powerpc: implement GPIO LIB API on CPM1 Freescale SoC. 2008-07-28 07:42:09 -05:00
40x [POWERPC] 4xx: Create common ppc4xx_reset_system() in ppc4xx_soc.c 2008-04-02 20:44:56 -05:00
44x powerpc/4xx: Cleanup Warp for i2c driver changes. 2008-08-04 21:42:07 -04:00
52xx powerpc: Remove use of CONFIG_PPC_MERGE 2008-08-04 13:18:17 +10:00
82xx Revert "powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET" 2008-07-16 17:59:47 -05:00
83xx powerpc/fsl: proliferate simple-bus compatibility to soc nodes 2008-07-29 17:48:35 -05:00
85xx powerpc/fsl: proliferate simple-bus compatibility to soc nodes 2008-07-29 17:48:35 -05:00
86xx powerpc: Move include files to arch/powerpc/include/asm 2008-08-04 12:02:00 +10:00
512x powerpc/mpc5121: Add support for CPLD on MPC5121ADS board 2008-07-12 12:10:55 -06:00
cell powerpc/spufs: Fix possible scheduling of a context to multiple SPEs 2008-09-08 09:44:43 +10:00
chrp powerpc: Use bcd2bin/bin2bcd 2008-08-20 16:34:58 +10:00
embedded6xx powerpc: Add C2K to configuration 2008-06-09 13:42:29 +10:00
iseries powerpc: Use LOAD_REG_IMMEDIATE only for constants on 64-bit 2008-09-15 11:08:35 -07:00
maple powerpc: Use bcd2bin/bin2bcd 2008-08-20 16:34:58 +10:00
pasemi powerpc/pseries: iommu enablement for CMO 2008-07-25 15:44:43 +10:00
powermac powerpc: Make the 64-bit kernel as a position-independent executable 2008-09-15 11:08:38 -07:00
prep [POWERPC] Split several platforms into their respective Kconfig file 2007-03-22 10:07:32 -05:00
ps3 powerpc/ps3: Fix ioremap of spu shadow regs 2008-08-26 10:24:46 +10:00
pseries powerpc: Check rc of notifier chain for memory remove 2008-09-15 11:07:52 -07:00
fsl_uli1575.c powerpc/85xx/86xx: some refactoring for fsl_uli1575 code 2008-07-16 17:57:42 -05:00
Kconfig cpm_uart: Add generic clock API support to set baudrates 2008-07-28 08:47:32 -05:00
Kconfig.cputype powerpc: Remove duplicate 6xx option in Kconfig 2008-07-22 10:39:35 +10:00
Makefile powerpc: Remove use of CONFIG_PPC_MERGE 2008-08-04 13:18:17 +10:00