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
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
die.c
exec.c payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-07 17:15:30 +00:00
fmap.c
getopt_long.c
hexdump.c
ipchecksum.c
lib.c Add buffer_to/from_fifo32(_prefix) helpers 2019-08-22 10:36:22 +00:00
libgcc.c
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
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