secvar.h 765 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include <linux/types.h>
  11. #include <linux/errno.h>
  12. extern const struct secvar_operations *secvar_ops;
  13. struct secvar_operations {
  14. int (*get)(const char *key, uint64_t key_len, u8 *data,
  15. uint64_t *data_size);
  16. int (*get_next)(const char *key, uint64_t *key_len,
  17. uint64_t keybufsize);
  18. int (*set)(const char *key, uint64_t key_len, u8 *data,
  19. uint64_t data_size);
  20. };
  21. #ifdef CONFIG_PPC_SECURE_BOOT
  22. extern void set_secvar_ops(const struct secvar_operations *ops);
  23. #else
  24. static inline void set_secvar_ops(const struct secvar_operations *ops) { }
  25. #endif
  26. #endif