Offline SMMSTORE variable modification tool. Can be used to pre-configure ROM image or debug EFI state stored in a dump. Change-Id: I6c1c06f1d0c39c13b5be76a3070f09b715aca6e0 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79080 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
30 lines
578 B
C
30 lines
578 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#ifndef SMMSTORETOOL__UTILS_H__
|
|
#define SMMSTORETOOL__UTILS_H__
|
|
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "udk2017.h"
|
|
|
|
struct mem_range_t {
|
|
uint8_t *start;
|
|
size_t length;
|
|
};
|
|
|
|
void *xmalloc(size_t size);
|
|
|
|
char *to_chars(const CHAR16 uchars[], size_t size);
|
|
|
|
CHAR16 *to_uchars(const char chars[], size_t *size);
|
|
|
|
bool str_eq(const char lhs[], const char rhs[]);
|
|
|
|
struct mem_range_t map_file(const char path[], bool rw);
|
|
|
|
void unmap_file(struct mem_range_t store);
|
|
|
|
#endif // SMMSTORETOOL__UTILS_H__
|