coreboot-kgpe-d16/payloads/libpayload/arch/arm
Julius Werner 540a98001d printf: Automatically prefix %p with 0x
According to the POSIX standard, %p is supposed to print a pointer "as
if by %#x", meaning the "0x" prefix should automatically be prepended.
All other implementations out there (glibc, Linux, even libpayload) do
this, so we should make coreboot match. This patch changes vtxprintf()
accordingly and removes any explicit instances of "0x%p" from existing
format strings.

How to handle zero padding is less clear: the official POSIX definition
above technically says there should be no automatic zero padding, but in
practice most other implementations seem to do it and I assume most
programmers would prefer it. The way chosen here is to always zero-pad
to 32 bits, even on a 64-bit system. The rationale for this is that even
on 64-bit systems, coreboot always avoids using any memory above 4GB for
itself, so in practice all pointers should fit in that range and padding
everything to 64 bits would just hurt readability. Padding it this way
also helps pointers that do exceed 4GB (e.g. prints from MMU config on
some arm64 systems) stand out better from the others.

Change-Id: I0171b52f7288abb40e3fc3c8b874aee14b9bdcd6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37626
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: David Guckian
2019-12-11 11:38:59 +00:00
..
Kconfig libpayload: Rename Config.in -> Kconfig 2015-06-12 02:42:43 +02:00
Makefile.inc libpayload: Add remote GDB support 2015-01-09 07:06:51 +01:00
asmlib.h arm: Update mem* functions to newer versions 2014-09-22 18:47:42 +02:00
cache.c libpayload: sync arch/arm/cache.c with coreboot 2015-04-17 09:27:42 +02:00
coreboot.c libpayload: Consolidate coreboot table parsing 2015-03-20 15:31:59 +01:00
cpu.S arm: Fix minor mistake in cache maintenance assembly 2014-12-15 23:27:41 +01:00
dummy_media.c cbfs: define libpayload_init_default_cbfs_media weakly 2015-07-06 09:42:12 +02:00
eabi_compat.c libpayload: arm: Add EABI compatible utility functions. 2014-12-30 19:04:54 +01:00
exception.c arm: Dump additional fault registers in abort handlers 2015-04-08 09:28:37 +02:00
exception_asm.S Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
gdb.c libpayload: gdb: Factor out gdb_handle_reentrant_exception() from arm32 2018-10-12 20:17:40 +00:00
head.S libpayload: head.S: Avoid clearing BSS (and heap) again 2016-08-13 02:46:19 +02:00
libpayload.ldscript libpayload: Move base address, stack and heap size to Kconfig 2016-03-15 20:53:38 +01:00
main.c libpayload: Align main() data types 2019-04-05 22:37:19 +00:00
memcpy.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
memmove.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
memset.S arm: Put assembly functions into separate sections 2014-11-13 06:49:41 +01:00
selfboot.c libpayload: Introduce new Kconfig to explicitly allow GPL code 2015-01-09 07:06:27 +01:00
sysinfo.c ARM: Generalize armv7 as arm. 2014-09-08 18:59:23 +02:00
timer.c ARM: Generalize armv7 as arm. 2014-09-08 18:59:23 +02:00
util.S arm: Move libgcc assembly macros to arch/asm.h 2014-09-22 18:46:57 +02:00
virtual.c printf: Automatically prefix %p with 0x 2019-12-11 11:38:59 +00:00