linux/arch/arm
Uwe Kleine-König de66a97901 ARM: 7187/1: fix unwinding for XIP kernels
The linker places the unwind tables in readonly sections. So when using
an XIP kernel these are located in ROM and cannot be modified.
For that reason the current approach to convert the relative offsets in
the unwind index to absolute addresses early in the boot process doesn't
work with XIP.

The offsets in the unwind index section are signed 31 bit numbers and
the structs are sorted by this offset. So it first has offsets between
0x40000000 and 0x7fffffff (i.e. the negative offsets) and then offsets
between 0x00000000 and 0x3fffffff. When seperating these two blocks the
numbers are sorted even when interpreting the offsets as unsigned longs.

So determine the first non-negative entry once and track that using the
new origin pointer. The actual bisection can then use a plain unsigned
long comparison. The only thing that makes the new bisection more
complicated is that the offsets are relative to their position in the
index section, so the key to search needs to be adapted accordingly in
each step.

Moreover several consts are added to catch future writes and rename the
member "addr" of struct unwind_idx to "addr_offset" to better match the
new semantic. (This has the additional benefit of breaking eventual
users at compile time to make them aware of the change.)

In my tests the new algorithm was a tad faster than the original and has
the additional upside of not needing the initial conversion and so saves
some boot time and it's possible to unwind even earlier.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-12-06 11:16:13 +00:00
..
boot Merge branch 'fixes' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-11-20 14:34:58 -08:00
common ARM: 7177/1: GIC: avoid skipping non-existent PPIs in irq_start calculation 2011-11-26 21:58:55 +00:00
configs Merge branch 'defconfigs-for-arnd' of git://git.linaro.org/people/triad/linux-stericsson into fixes 2011-11-29 14:50:17 +00:00
include/asm ARM: 7187/1: fix unwinding for XIP kernels 2011-12-06 11:16:13 +00:00
kernel ARM: 7187/1: fix unwinding for XIP kernels 2011-12-06 11:16:13 +00:00
lib ARM: 7171/1: unwind: add unwind directives to bitops assembly macros 2011-11-26 21:58:53 +00:00
mach-at91 ARM: at91: Fix USBA gadget registration 2011-11-09 23:02:12 +08:00
mach-bcmring ARM: 7154/1: mach-bcmring: fix build error in dma.c 2011-11-09 21:53:35 +00:00
mach-clps711x Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-cns3xxx Merge branch 'depends/rmk/memory_h' into next/cleanup2 2011-11-01 13:47:27 +01:00
mach-davinci Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2011-11-07 10:13:52 -08:00
mach-dove Merge branch 'depends/rmk/memory_h' into next/cleanup2 2011-11-01 13:47:27 +01:00
mach-ebsa110 Merge branch 'dt/gic' into highbank/soc 2011-10-31 14:11:34 +01:00
mach-ep93xx Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
mach-exynos ARM: EXYNOS: Fix compiler error with THIS_MODULE 2011-11-09 14:07:32 +09:00
mach-footbridge Merge branch 'depends/rmk/memory_h' into next/cleanup2 2011-11-01 13:47:27 +01:00
mach-gemini Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-h720x Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-highbank ARM: highbank: convert logical CPU numbers to physical numbers 2011-11-16 10:56:53 +00:00
mach-imx Merge branch 'imx-for-arnd' of git://git.pengutronix.de/git/imx/linux-2.6 into fixes 2011-11-23 20:26:57 +00:00
mach-integrator Merge branch 'depends/rmk/memory_h' into next/cleanup2 2011-11-01 13:47:27 +01:00
mach-iop13xx arm: Add export.h to ARM specific files as required. 2011-10-31 19:30:50 -04:00
mach-iop32x Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-iop33x Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-ixp4xx Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
mach-ixp23xx Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-ixp2000 arm: Add export.h to ARM specific files as required. 2011-10-31 19:30:50 -04:00
mach-kirkwood Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2011-11-07 10:13:52 -08:00
mach-ks8695 Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-l7200/include/mach ARM: add an extra temp register to the low level debugging addruart macro 2011-09-26 10:11:25 -04:00
mach-lpc32xx Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-mmp ARM: pxa168/gplugd: add the correct SSP device 2011-11-17 08:21:58 +08:00
mach-msm Merge branch 'msm-fix' of git://codeaurora.org/quic/kernel/davidb/linux-msm into fixes 2011-11-09 17:02:13 -08:00
mach-mv78xx0 Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-mx5 Merge branch 'cleanups/assorted' into imx-fixes-for-arnd 2011-11-22 11:32:39 +01:00
mach-mxs arm: mx28: fix bit operation in clock setting 2011-11-23 19:59:12 +00:00
mach-netx arm: Add export.h to ARM specific files as required. 2011-10-31 19:30:50 -04:00
mach-nomadik Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-omap1 ARM: OMAP: Fix reprogramming of dpll1 rate 2011-11-11 10:15:11 -08:00
mach-omap2 Merge branch 'fixes-dss' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes 2011-11-24 15:58:01 +00:00
mach-orion5x Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
mach-picoxcell ARM: picoxcell: add extra temp register to addruart 2011-11-09 09:51:42 +00:00
mach-pnx4008 Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-prima2 Merge branch 'next/pm' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:22:01 -07:00
mach-pxa ARM: pxa: fix inconsistent CONFIG_USB_PXA27X 2011-11-10 15:32:27 +08:00
mach-realview Merge branch 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:34:22 -07:00
mach-rpc Merge branch 'dt/gic' into highbank/soc 2011-10-31 14:11:34 +01:00
mach-s3c64xx ARM: SAMSUNG: inclusion export.h instead of module.h 2011-11-17 01:14:38 +09:00
mach-s3c2410 Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
mach-s3c2412 Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:18:05 -07:00
mach-s3c2416 Merge branch 'next/devel2' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:21:21 -07:00
mach-s3c2440 Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:18:05 -07:00
mach-s3c2443 Merge branch 'next/devel2' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:21:21 -07:00
mach-s5p64x0 Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:18:05 -07:00
mach-s5pc100 Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:18:05 -07:00
mach-s5pv210 Merge branch 'next/cleanup3' of git://git.linaro.org/people/arnd/arm-soc 2011-11-05 18:18:05 -07:00
mach-sa1100 arm: fix implicit use of page.h in several arch/arm files 2011-10-31 19:30:46 -04:00
mach-shark Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-shmobile Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2011-11-20 14:33:02 -08:00
mach-spear3xx Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-spear6xx Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-tcc8k Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mach-tegra arm/tegra: enable headphone detection gpio on seaboard 2011-11-09 11:31:16 -08:00
mach-u300 Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6 2011-11-03 09:40:51 -07:00
mach-ux500 Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6 2011-11-03 09:40:51 -07:00
mach-versatile Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-vexpress Merge branch 'next/cross-platform' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:34:22 -07:00
mach-vt8500 Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
mach-w90x900 ARM: 7158/1: add new MFP implement for NUC900 2011-11-12 11:33:08 +00:00
mach-zynq Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
mm ARM: 7172/1: dma: Drop GFP_COMP for DMA memory allocations 2011-11-26 21:58:53 +00:00
nwfpe
oprofile
plat-iop arm: Add export.h to ARM specific files as required. 2011-10-31 19:30:50 -04:00
plat-mxc Merge branch 'imx-for-arnd' of git://git.pengutronix.de/git/imx/linux-2.6 into fixes 2011-11-23 20:26:57 +00:00
plat-nomadik Merge branch 'next/timer' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 20:18:05 -07:00
plat-omap Merge branch 'fixes-dss' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes 2011-11-24 15:58:01 +00:00
plat-orion ARM: 7063/1: Orion: gpio: add missing include of linux/types.h 2011-08-24 08:29:20 +01:00
plat-pxa Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
plat-s3c24xx ARM: SAMSUNG: inclusion export.h instead of module.h 2011-11-17 01:14:38 +09:00
plat-s5p ARM: S5P: Fix export.h inclusion 2011-11-17 01:13:34 +09:00
plat-samsung ARM: SAMSUNG: include linux/types.h at gpio-cfg.h 2011-11-17 01:17:18 +09:00
plat-spear Merge branch 'depends/rmk/memory_h' into next/fixes 2011-11-01 00:25:01 +01:00
plat-tcc ARM: plat-tcc: remove mach/memory.h 2011-10-13 12:49:42 -04:00
plat-versatile ARM: versatile: convert logical CPU numbers to physical numbers 2011-10-17 10:01:11 +01:00
tools ARM: Update mach-types to fix mxs build breakage 2011-11-17 07:49:17 +08:00
vfp arm: remove several unnecessary module.h include instances 2011-10-31 19:30:48 -04:00
Kconfig ARM: 7186/1: fix Kconfig issue with PHYS_OFFSET and !MMU 2011-12-06 11:16:13 +00:00
Kconfig-nommu
Kconfig.debug Merge branch 'next/soc' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 21:08:03 -07:00
Makefile ARM: EXYNOS: Add ARCH_EXYNOS and reorganize arch/arm/mach-exynos 2011-11-06 13:54:56 +09:00