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, u64 key_len, u8 *data, u64 *data_size); 18 int (*get_next)(const char *key, u64 *key_len, u64 keybufsize); 19 int (*set)(const char *key, u64 key_len, u8 *data, u64 data_size); 20 ssize_t (*format)(char *buf, size_t bufsize); 21 }; 22 23 #ifdef CONFIG_PPC_SECURE_BOOT 24 25 int set_secvar_ops(const struct secvar_operations *ops); 26 27 #else 28 29 static inline int set_secvar_ops(const struct secvar_operations *ops) { return 0; } 30 31 #endif 32 33 #endif 34