coreboot-kgpe-d16/payloads/libpayload/libc
Patrick Georgi 006eb9d8c8 libpayload: refactor fetching cbmem pointers
There's a recurring pattern of reading cbtable entries that point into
cbmem entries. Move that pattern into its own function.

Coccinelle patch used for this:
  @@
  identifier T, T2;
  expression TARGET;
  @@
  -struct cb_cbmem_tab *const T2 = (struct cb_cbmem_tab *)T;
  -TARGET = phys_to_virt(T2->cbmem_tab);
  +TARGET = get_cbmem_ptr(T);

Change-Id: I7bd4a7ad8baeeaebf0fa7d4b4de6dbc719bc781f
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35756
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2019-10-03 15:27:30 +00:00
..
64bit_div.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
Makefile.inc libpayload: Add support for handling fmaps 2015-07-14 18:12:06 +02:00
args.c
console.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
coreboot.c libpayload: refactor fetching cbmem pointers 2019-10-03 15:27:30 +00:00
ctype.c Remove empty lines at end of file 2015-06-08 00:55:07 +02:00
die.c libpayload: Add a new "die" function to fatally signal programming errors. 2014-09-15 17:37:13 +02:00
exec.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
fmap.c libpayload: Add support for handling fmaps 2015-07-14 18:12:06 +02:00
getopt_long.c
hexdump.c libpayload: hexdump: Use `p` as conversion specifier for pointers 2014-12-19 21:15:05 +01:00
ipchecksum.c
lib.c Add buffer_to/from_fifo32(_prefix) helpers 2019-08-22 10:36:22 +00:00
libgcc.c lib: Unify log2() and related functions 2015-06-05 13:18:55 +02:00
malloc.c libpayload: Fix CONFIG_LP_DEBUG_MALLOC for 64-bit archs 2019-04-10 10:42:45 +00:00
memory.c libpayload: add memchr to libc 2019-02-11 23:17:37 +00:00
printf.c libpayload: Enable -Wimplicit-fallthrough 2019-07-21 17:17:42 +00:00
qsort.c
rand.c
readline.c Catch various cases in libpayload where malloc() or memalign() return NULL 2009-07-31 11:39:55 +00:00
string.c libpayload/libc: Use size_t for lengths and indices 2019-07-23 09:10:22 +00:00
strlcpy.c
sysinfo.c
time.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00