coreboot-kgpe-d16/util/cbfstool/cse_helpers.h
Furquan Shaikh 555f040772 util/cse*: Add cse_helpers.{c,h}
This change moves `read_member` and `write_member` helper functions
out of cse_fpt.c and cse_serger.c into cse_helpers.c to avoid
duplication.

BUG=b:189177186,b:189167923

Change-Id: I7b646b29c9058d892bb0fc9824ef1b4340d2510c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58201
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-10-19 16:08:45 +00:00

16 lines
611 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <stddef.h>
#include "common.h"
#define READ_MEMBER(_buff, _x) read_member(_buff, &(_x), sizeof(_x))
#define WRITE_MEMBER(_buff, _x) write_member(_buff, &(_x), sizeof(_x))
/* Write data from `src` of length `size` to buffer in little-endian format and seek the buffer
forward by `size` bytes. */
void write_member(struct buffer *buff, void *src, size_t size);
/* Read data from buffer in little-endian format of length `size` to `dst` and seek the buffer
forward by `size` bytes. */
void read_member(struct buffer *buff, void *dst, size_t size);