treewide: Move device_tree to commonlib
[coreboot2.git] / util / cbfstool / cse_helpers.h
blob58ba1287511d1b7f13e3cc751bd446f37514f5a3
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stddef.h>
5 #include "common.h"
7 #define READ_MEMBER(_buff, _x) read_member(_buff, &(_x), sizeof(_x))
8 #define WRITE_MEMBER(_buff, _x) write_member(_buff, &(_x), sizeof(_x))
10 /* Write data from `src` of length `size` to buffer in little-endian format and seek the buffer
11 forward by `size` bytes. */
12 void write_member(struct buffer *buff, void *src, size_t size);
14 /* Read data from buffer in little-endian format of length `size` to `dst` and seek the buffer
15 forward by `size` bytes. */
16 void read_member(struct buffer *buff, void *dst, size_t size);