summaryrefslogtreecommitdiffstats
path: root/src/include/smmstore.h
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-03-14 21:11:21 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-10-08 09:46:30 +0000
commit9360feaf5121fb0b4b2d63e3168effe066650071 (patch)
treedae8bcba4a33a3920e1b57e5f2d9033fa763b32d /src/include/smmstore.h
parent88607a4b1002ed6acc7f316f274feea2fd861095 (diff)
downloadcoreboot-9360feaf5121fb0b4b2d63e3168effe066650071.tar.gz
coreboot-9360feaf5121fb0b4b2d63e3168effe066650071.tar.bz2
coreboot-9360feaf5121fb0b4b2d63e3168effe066650071.zip
smmstore: Add a key/val store facility in flash, mediated through SMM
It exposes an interface that is as generic as possible, so payloads and/or kernels can use it for their data. Change-Id: I9553922f9dfa60b9d4b3576973ad4b84d3fe2fb5 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/25182 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/smmstore.h')
-rw-r--r--src/include/smmstore.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/include/smmstore.h b/src/include/smmstore.h
new file mode 100644
index 000000000000..685a425dab3e
--- /dev/null
+++ b/src/include/smmstore.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 The Chromium OS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _SMMSTORE_H_
+#define _SMMSTORE_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define SMMSTORE_APM_CNT 0xed
+
+#define SMMSTORE_RET_SUCCESS 0
+#define SMMSTORE_RET_FAILURE 1
+#define SMMSTORE_RET_UNSUPPORTED 2
+
+#define SMMSTORE_CMD_CLEAR 1
+#define SMMSTORE_CMD_READ 2
+#define SMMSTORE_CMD_APPEND 3
+
+struct smmstore_params_read {
+ void *buf;
+ ssize_t bufsize;
+};
+
+struct smmstore_params_append {
+ void *key;
+ size_t keysize;
+ void *val;
+ size_t valsize;
+};
+
+/* SMM responder */
+uint32_t smmstore_exec(uint8_t command, void *param);
+
+/* implementation */
+int smmstore_read_region(void *buf, ssize_t *bufsize);
+int smmstore_append_data(void *key, uint32_t key_sz,
+ void *value, uint32_t value_sz);
+int smmstore_clear_region(void);
+#endif