coreboot/payloads/libpayload/include
Julius Werner 97542110f0 libpayload: Rework exception hook interface
This patch makes some slight changes to the exception hook interface.
The old code provides a different handler hook for every exception
type... however, in practice all those hook functions often need to look
very similar, so this creates more boilerplate than it removes. The new
interface just allows for a single hook with the exception type passed
as an argument, and the consumer can signal whether the exception was
handled through the return value. (Right now this still only supports
one consumer, but it could easily be extended to walk through a list of
hooks if the need arises.)

Also move the excepton state from an argument to a global. This avoids a
lot of boilerplate since some consumers need to change the state from
many places, so they would have to pass the same pointer around many
times. It also removes the false suggestion that the exception state was
not global and you could have multiple copies of it (which the exception
core doesn't support for any architecture).

On the ARM side, the exception state is separated from the exception
stack for easier access. (This requires some assembly changes, and I
threw in a few comments and corrected the immediate sigils from '$' to
the official '#' while I'm there.) Since the exception state is now both
stored and loaded through an indirection pointer, this allows for some
very limited reentrance (you could point it to a different struct while
handling an exception, and while you still won't be able to return to
the outer-level exception from there, you could at least swap out the
pointer and return back to System Mode in one go).

BUG=chrome-os-partner:18390
TEST=Made sure normal exceptions still get dumped correctly on both
archs.

Change-Id: I5d9a934fab7c14ccb2c9d7ee4b3465c825521fa2
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202562
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2014-06-11 03:30:54 +00:00
..
arm/arch libpayload: Rework exception hook interface 2014-06-11 03:30:54 +00:00
arm64/arch libpayload: Add support for arm64 in libpayload 2014-06-07 01:28:57 +00:00
arpa
pci
storage libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00
sys
usb libpayload: Fix pointer related casts 2014-05-14 00:25:48 +00:00
x86/arch libpayload: Rework exception hook interface 2014-06-11 03:30:54 +00:00
assert.h
cbfs.h Provide selfboot() external declaration in a common file 2014-05-24 02:53:58 +00:00
cbfs_core.h libpayload: Add support for arm64 in libpayload 2014-06-07 01:28:57 +00:00
cbfs_ram.h libpayload: expose cbfs ram functions 2013-05-24 16:27:51 -07:00
coreboot_tables.h libpayload: Parse CBMEM ACPI GNVS pointer 2013-12-13 03:55:53 +00:00
ctype.h
die.h libpayload: Add a new "die" function to fatally signal programming errors. 2013-11-27 01:46:00 +00:00
endian.h libpayload: Fix the license in some files which were accidentally made GPL. 2014-01-11 01:36:57 +00:00
errno.h
exception.h libpayload: Rework exception hook interface 2014-06-11 03:30:54 +00:00
getopt.h
inttypes.h
ipchksum.h libpayload: Fix the license in some files which were accidentally made GPL. 2014-01-11 01:36:57 +00:00
kconfig.h libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig. 2013-08-14 17:05:33 -07:00
keycodes.h
lar.h
libpayload.h libpayload: Add ability to unregister output driver 2014-06-11 03:30:51 +00:00
limits.h
lzma.h LZMA: Add a version of ulzma which takes the input and output buffer sizes. 2013-08-14 17:05:34 -07:00
malloc.h
multiboot_tables.h
panel.h
pci.h
stdarg.h libpayload: Don't sneak in compiler includes 2013-04-09 13:45:42 -07:00
stddef.h ARM: API to Map Physical Address to Wipe Memory above 4GB 2014-03-07 04:54:49 +00:00
stdint.h libpayload: Fix type issues 2013-03-26 19:36:39 +01:00
stdio.h
stdlib.h ARM: API to Map Physical Address to Wipe Memory above 4GB 2014-03-07 04:54:49 +00:00
string.h
strings.h
sysinfo.h libpayload: Parse CBMEM ACPI GNVS pointer 2013-12-13 03:55:53 +00:00
term.h
unistd.h libpayload: Don't sneak in compiler includes 2013-04-09 13:45:42 -07:00
video_console.h