xref: /openbmc/linux/arch/powerpc/include/asm/secvar.h (revision dc6a81c3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2019 IBM Corporation
4  * Author: Nayna Jain
5  *
6  * PowerPC secure variable operations.
7  */
8 #ifndef SECVAR_OPS_H
9 #define SECVAR_OPS_H
10 
11 #include <linux/types.h>
12 #include <linux/errno.h>
13 
14 extern const struct secvar_operations *secvar_ops;
15 
16 struct secvar_operations {
17 	int (*get)(const char *key, uint64_t key_len, u8 *data,
18 		   uint64_t *data_size);
19 	int (*get_next)(const char *key, uint64_t *key_len,
20 			uint64_t keybufsize);
21 	int (*set)(const char *key, uint64_t key_len, u8 *data,
22 		   uint64_t data_size);
23 };
24 
25 #ifdef CONFIG_PPC_SECURE_BOOT
26 
27 extern void set_secvar_ops(const struct secvar_operations *ops);
28 
29 #else
30 
31 static inline void set_secvar_ops(const struct secvar_operations *ops) { }
32 
33 #endif
34 
35 #endif
36