summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.h
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-17 23:44:14 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-18 00:09:55 +0000
commit6def381e3c9d98b16361d49a9949505e62b9cc13 (patch)
tree71c6c743182003a5e22eb8732ca8a46bf98f7278 /util/nvmutil/nvmutil.h
parentec96cb46fc3511a0a81288a4685a55e10e90c306 (diff)
nvmutil: make commands check themselves
check yourself before you execute yourself Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.h')
-rw-r--r--util/nvmutil/nvmutil.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.h b/util/nvmutil/nvmutil.h
index c278481e..d02d2d7f 100644
--- a/util/nvmutil/nvmutil.h
+++ b/util/nvmutil/nvmutil.h
@@ -4,6 +4,11 @@
* Copyright (c) 2022-2026 Leah Rowe <leah@libreboot.org>
*/
+/* Use this shorthand in cmd helpers. e.g.
+ in cmd_setmac function:
+ check_cmd(cmd_helper_cat);
+*/
+
#ifndef NVMUTIL_H
#define NVMUTIL_H
@@ -290,6 +295,10 @@ struct xstate {
/* store size of a struct here.
(can be used to copy old state) */
unsigned long xsize;
+
+ /* Cat commands set this.
+ the cat cmd helpers check it */
+ int cat;
};
@@ -374,8 +383,13 @@ void cmd_helper_copy(void);
* cat, cat16 and cat128
*/
void cmd_helper_cat(void);
+void cmd_helper_cat16(void);
+void cmd_helper_cat128(void);
+void cat(unsigned long nff);
void cat_buf(unsigned char *b);
+void check_cmd(void (*fn)(void), const char *name);
+
/*
* After command processing, write
* the modified GbE file back.