Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Patrick Georgi | 9360fea | 2018-03-14 21:11:21 +0100 | [diff] [blame] | 3 | |
| 4 | #ifndef _SMMSTORE_H_ |
| 5 | #define _SMMSTORE_H_ |
| 6 | |
| 7 | #include <stddef.h> |
| 8 | #include <stdint.h> |
| 9 | |
Patrick Georgi | 9360fea | 2018-03-14 21:11:21 +0100 | [diff] [blame] | 10 | #define SMMSTORE_RET_SUCCESS 0 |
| 11 | #define SMMSTORE_RET_FAILURE 1 |
| 12 | #define SMMSTORE_RET_UNSUPPORTED 2 |
| 13 | |
| 14 | #define SMMSTORE_CMD_CLEAR 1 |
| 15 | #define SMMSTORE_CMD_READ 2 |
| 16 | #define SMMSTORE_CMD_APPEND 3 |
| 17 | |
| 18 | struct smmstore_params_read { |
| 19 | void *buf; |
| 20 | ssize_t bufsize; |
| 21 | }; |
| 22 | |
| 23 | struct smmstore_params_append { |
| 24 | void *key; |
| 25 | size_t keysize; |
| 26 | void *val; |
| 27 | size_t valsize; |
| 28 | }; |
| 29 | |
| 30 | /* SMM responder */ |
| 31 | uint32_t smmstore_exec(uint8_t command, void *param); |
| 32 | |
| 33 | /* implementation */ |
| 34 | int smmstore_read_region(void *buf, ssize_t *bufsize); |
| 35 | int smmstore_append_data(void *key, uint32_t key_sz, |
| 36 | void *value, uint32_t value_sz); |
| 37 | int smmstore_clear_region(void); |
| 38 | #endif |