aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/include/secvar.h
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/include/secvar.h
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/include/secvar.h')
-rw-r--r--roms/skiboot/include/secvar.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/roms/skiboot/include/secvar.h b/roms/skiboot/include/secvar.h
new file mode 100644
index 000000000..413d7997e
--- /dev/null
+++ b/roms/skiboot/include/secvar.h
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+/* Copyright 2019 IBM Corp. */
+
+#ifndef _SECVAR_DRIVER_
+#define _SECVAR_DRIVER_
+
+#include <stdint.h>
+
+struct secvar;
+
+struct secvar_storage_driver {
+ int (*load_bank)(struct list_head *bank, int section);
+ int (*write_bank)(struct list_head *bank, int section);
+ int (*store_init)(void);
+ void (*lockdown)(void);
+ uint64_t max_var_size;
+};
+
+struct secvar_backend_driver {
+ /* Perform any pre-processing stuff (e.g. determine secure boot state) */
+ int (*pre_process)(struct list_head *variable_bank,
+ struct list_head *update_bank);
+
+ /* Process all updates */
+ int (*process)(struct list_head *variable_bank,
+ struct list_head *update_bank);
+
+ /* Perform any post-processing stuff (e.g. derive/update variables)*/
+ int (*post_process)(struct list_head *variable_bank,
+ struct list_head *update_bank);
+
+ /* Validate a single variable, return boolean */
+ int (*validate)(struct secvar *var);
+
+ /* String to use for compatible in secvar node */
+ const char *compatible;
+};
+
+extern struct secvar_storage_driver secboot_tpm_driver;
+extern struct secvar_backend_driver edk2_compatible_v1;
+
+int secvar_main(struct secvar_storage_driver, struct secvar_backend_driver);
+
+#endif