linux/arch/arm
Simon Glass 87e040b645 ARM: 7017/1: Use generic BUG() handler
ARM uses its own BUG() handler which makes its output slightly different
from other archtectures.

One of the problems is that the ARM implementation doesn't report the function
with the BUG() in it, but always reports the PC being in __bug(). The generic
implementation doesn't have this problem.

Currently we get something like:

kernel BUG at fs/proc/breakme.c:35!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
...
PC is at __bug+0x20/0x2c

With this patch it displays:

kernel BUG at fs/proc/breakme.c:35!
Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP
...
PC is at write_breakme+0xd0/0x1b4

This implementation uses an undefined instruction to implement BUG, and sets up
a bug table containing the relevant information. Many versions of gcc do not
support %c properly for ARM (inserting a # when they shouldn't) so we work
around this using distasteful macro magic.

v1: Initial version to replace existing ARM BUG() implementation with something
more similar to other architectures.

v2: Add Thumb support, remove backtrace whitespace output changes. Change to
use macros instead of requiring the asm %d flag to work (thanks to
Dave Martin <dave.martin@linaro.org>)

v3: Remove old BUG() implementation in favor of this one.
Remove the Backtrace: message (will submit this separately).
Use ARM_EXIT_KEEP() so that some architectures can dump exit text at link time
thanks to Stephen Boyd <sboyd@codeaurora.org> (although since we always
define GENERIC_BUG this might be academic.)
Rebase to linux-2.6.git master.

v4: Allow BUGS in modules (these were not reported correctly in v3)
(thanks to Stephen Boyd <sboyd@codeaurora.org> for suggesting that.)
Remove __bug() as this is no longer needed.

v5: Add %progbits as the section flags.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-10-17 09:13:41 +01:00
..
boot ARM: 7021/1: Check for multiple load addresses before building a uImage 2011-10-17 09:12:40 +01:00
common Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2011-07-29 23:35:05 -07:00
configs ARM: 7102/1: mach-integrator: update defconfig 2011-10-17 09:13:40 +01:00
include/asm ARM: 7017/1: Use generic BUG() handler 2011-10-17 09:13:41 +01:00
kernel ARM: 7017/1: Use generic BUG() handler 2011-10-17 09:13:41 +01:00
lib ARM: 7068/1: process: change from __backtrace to dump_stack in show_regs 2011-10-17 09:12:41 +01:00
mach-at91 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-bcmring ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-clps711x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-cns3xxx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-davinci ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-dove ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ebsa110 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ep93xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-exynos4 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-footbridge ARM: 7078/1: Footbridge: Sort KConfig Options alphabetically 2011-10-17 09:12:42 +01:00
mach-gemini ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-h720x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-imx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-integrator ARM: 7087/2: mach-integrator: get timer frequency from clock 2011-10-17 09:12:43 +01:00
mach-iop13xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-iop32x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-iop33x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ixp4xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ixp23xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ixp2000 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-kirkwood ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ks8695 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-l7200/include/mach
mach-lpc32xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-mmp ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-msm ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-mv78xx0 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-mx5 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-mxs ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-netx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-nomadik ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-nuc93x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-omap1 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-omap2 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-orion5x ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-pnx4008 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-prima2 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-pxa ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-realview ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-rpc ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-s3c64xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-s3c2400/include/mach ARM: mach-s3c2400: delete 2011-07-18 10:59:26 -04:00
mach-s3c2410 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-s3c2412 Merge branch 'next/deletion' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-25 12:43:28 -07:00
mach-s3c2416 Merge branch 'next/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-25 12:38:42 -07:00
mach-s3c2440 atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
mach-s3c2443 ARM: S3C24XX: Add clkdev support 2011-07-20 19:11:29 +09:00
mach-s5p64x0 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-s5pc100 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-s5pv210 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-sa1100 ARM: 7026/1: simpad: replace ARM specific LED code 2011-10-17 09:12:42 +01:00
mach-shark ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-shmobile ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-spear3xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-spear6xx ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-tcc8k ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-tegra ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-u300 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-ux500 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-versatile ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-vexpress ARM: 7064/1: vexpress: Use wfi macro in platform_do_lowpower. 2011-10-17 09:12:41 +01:00
mach-vt8500 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-w90x900 ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mach-zynq ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mm ARM: 7088/1: entry: fix wrong parameter name used in do_thumb_abort 2011-09-10 23:39:56 +01:00
nwfpe
oprofile
plat-iop ARM: convert PCI defines to variables 2011-07-12 11:19:29 -05:00
plat-mxc iMX: Fix build for iMX53 2011-08-08 08:38:45 +02:00
plat-nomadik net: remove mm.h inclusion from netdevice.h 2011-06-21 19:17:20 -07:00
plat-omap OMAP: omap_device: only override _noirq methods, not normal suspend/resume 2011-08-25 15:31:14 +02:00
plat-orion genirq: replace irq_gc_ack() with {set,clr}_bit variants (fwd) 2011-07-07 16:02:26 +00:00
plat-pxa mmc: sdhci-pxa: move platform data to include/linux/platform_data 2011-07-20 17:20:52 -04:00
plat-s3c24xx Merge branch 'next/deletion' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-25 12:43:28 -07:00
plat-s5p ARM: S5P: fix bug in spdif_clk_get_rate 2011-08-19 21:21:08 +09:00
plat-samsung ARM: SAMSUNG: Add chained enrty/exit call to timer interrupt handler 2011-08-19 20:57:37 +09:00
plat-spear Merge branch 'next/cross-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-26 17:12:10 -07:00
plat-tcc ARM: Consolidate the clkdev header files 2011-07-19 18:09:45 +02:00
plat-versatile
tools ARM: 7051/1: cpuimx* boards: fix mach-types errors 2011-08-22 15:57:22 +01:00
vfp Merge branch 'devel-stable' into for-next 2011-07-22 23:09:07 +01:00
Kconfig ARM: 7017/1: Use generic BUG() handler 2011-10-17 09:13:41 +01:00
Kconfig-nommu
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile Merge branch 'imx/dt' into next/dt 2011-07-28 15:25:46 +00:00