blob: a535c5ba358a30204dd90c4d30144bf77a328e0b [file] [log] [blame]
Patrick Georgi9360fea2018-03-14 21:11:21 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2018 The Chromium OS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _SMMSTORE_H_
17#define _SMMSTORE_H_
18
19#include <stddef.h>
20#include <stdint.h>
21
Patrick Georgi9360fea2018-03-14 21:11:21 +010022#define SMMSTORE_RET_SUCCESS 0
23#define SMMSTORE_RET_FAILURE 1
24#define SMMSTORE_RET_UNSUPPORTED 2
25
26#define SMMSTORE_CMD_CLEAR 1
27#define SMMSTORE_CMD_READ 2
28#define SMMSTORE_CMD_APPEND 3
29
30struct smmstore_params_read {
31 void *buf;
32 ssize_t bufsize;
33};
34
35struct smmstore_params_append {
36 void *key;
37 size_t keysize;
38 void *val;
39 size_t valsize;
40};
41
42/* SMM responder */
43uint32_t smmstore_exec(uint8_t command, void *param);
44
45/* implementation */
46int smmstore_read_region(void *buf, ssize_t *bufsize);
47int smmstore_append_data(void *key, uint32_t key_sz,
48 void *value, uint32_t value_sz);
49int smmstore_clear_region(void);
50#endif