1
linux/arch/powerpc/platforms/powermac
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
..
backlight.c
bootx_init.c
cache.S
cpufreq_32.c calibrate_delay() must be __cpuinit 2008-02-06 10:41:08 -08:00
cpufreq_64.c
feature.c powerpc: Fix duplicate test of MACIO_FLAG_SCCB_ON 2008-09-15 11:07:35 -07:00
Kconfig
low_i2c.c [POWERPC] powermac: Use machine_*_initcall() hooks in platform code 2008-01-17 14:57:14 +11:00
Makefile powerpc: Work around gcc's -fno-omit-frame-pointer bug 2008-09-03 20:53:34 +10:00
nvram.c
pci.c ppc/pmac: remove no longer needed IDE quirk 2008-04-18 00:46:32 +02:00
pfunc_base.c [POWERPC] powermac: Use machine_*_initcall() hooks in platform code 2008-01-17 14:57:14 +11:00
pfunc_core.c arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
pic.c [POWERPC] Move xmon_irq() declaration into xmon.h 2008-05-14 22:31:54 +10:00
pic.h
pmac.h ppc/pmac: remove ppc_ide_md hooks 2008-04-18 00:46:29 +02:00
setup.c powerpc/powermac: Fixup default serial port device for pmac_zilog 2008-07-28 16:30:53 +10:00
sleep.S
smp.c powerpc: Make the 64-bit kernel as a position-independent executable 2008-09-15 11:08:38 -07:00
time.c powerpc: Guard from_rtc_time() in platforms/powermac/time.c 2008-08-20 16:34:57 +10:00
udbg_adb.c
udbg_scc.c powerpc/powermac: Use sane default baudrate for SCC debugging 2008-07-28 16:30:52 +10:00