coreboot/payloads/libpayload/arch/arm
Julius Werner 4a914d36bb arm: Fix stored PC value when handling exceptions
ARM processors save the PC value in the Link Register when they handle
and exception, but they store it with an added offset (depending on the
exception type). In order to make crashes easier to read and correctly
support more complicated handlers in libpayload, this patch adjusts the
saved PC value on exception entry to correct for that offset.

(Note: The value that we now store is what ARM calls the "preferred
return address". For most exceptions this is the faulting instruction,
but for software interrupts (SWI) it is the instruction after that. This
is the way most programs like GDB expect the stored PC address to work,
so let's leave it at that.)

Numbers taken from the Architecture Reference Manual at the end of
section B1.8.3.

BRANCH=none
BUG=chrome-os-partner:18390
TEST=Provoked a data abort and an undefined instruction in both coreboot
and depthcharge, confirmed that the PC address was spot on.

Change-Id: Ia958a7edfcd4aa5e04c20148140a6148586935ba
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199844
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-05-15 05:28:15 +00:00
..
asmlib.h arm: Update mem* functions to newer versions 2014-01-14 03:29:44 +00:00
cache.c arm: Redesign, clarify and clean up cache related code 2014-01-29 21:33:35 +00:00
Config.in libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
coreboot.c libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
cpu.S arm: Fix minor mistake in cache maintenance assembly 2014-04-05 01:42:16 +00:00
dummy_media.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
eabi_compat.c libpayload: arm: Add EABI compatible utility functions. 2014-05-15 05:23:17 +00:00
exception.c libpayload: ARM: Keep track of the CPSR when exceptions happen. 2014-02-13 04:21:44 +00:00
exception_asm.S arm: Fix stored PC value when handling exceptions 2014-05-15 05:28:15 +00:00
head.S libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
libpayload.ldscript ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
main.c libpayload: Make it possible to install callbacks for particular exceptions. 2014-02-13 04:15:59 +00:00
Makefile.inc libpayload: Provide selfboot function. 2014-05-15 05:26:29 +00:00
memcpy.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
memmove.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
memset.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
selfboot.c libpayload: Provide selfboot function. 2014-05-15 05:26:29 +00:00
sysinfo.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
timer.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
util.S arm: Move libgcc assembly macros to arch/asm.h 2014-01-14 03:29:41 +00:00
virtual.c ARM: API to Map Physical Address to Wipe Memory above 4GB 2014-03-07 04:54:49 +00:00