diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2023-11-17 19:31:20 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2024-03-09 23:22:55 +0000 |
commit | 04bd9651435843ce4b03c9717f2965fe344fe5cc (patch) | |
tree | 0193502b26818c738206a60862c689485d533a50 /util/smmstoretool/utils.h | |
parent | 7a51acfbe91c7f9d01837103341526abb6ea46f4 (diff) |
util: add smmstoretool for editing SMMSTORE
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>
Diffstat (limited to 'util/smmstoretool/utils.h')
-rw-r--r-- | util/smmstoretool/utils.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/util/smmstoretool/utils.h b/util/smmstoretool/utils.h new file mode 100644 index 0000000000..a1cefc1748 --- /dev/null +++ b/util/smmstoretool/utils.h @@ -0,0 +1,29 @@ +/* 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__ |