sec_param.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #ifndef __SEC_PARAM_H__
  2. #define __SEC_PARAM_H__
  3. /* TODO: currently, we use a different defenition for param index for each
  4. * SoCs.
  5. * This should be improved in future.
  6. */
  7. #include "qcom/sec_qc_param.h"
  8. typedef bool (*sec_param_read_t)(size_t, void *);
  9. typedef bool (*sec_param_write_t)(size_t, const void *);
  10. struct sec_param_operations {
  11. sec_param_read_t read;
  12. sec_param_write_t write;
  13. };
  14. #if IS_ENABLED(CONFIG_SEC_PARAM)
  15. extern bool sec_param_get(size_t index, void *value);
  16. extern bool sec_param_set(size_t index, const void *value);
  17. extern int sec_param_register_operations(struct sec_param_operations *ops);
  18. extern void sec_param_unregister_operations(struct sec_param_operations *ops);
  19. #else
  20. static inline bool sec_param_get(size_t index, void *value) { return false; }
  21. static inline bool sec_param_set(size_t index, const void *value) { return false; }
  22. static inline int sec_param_register_operations(struct sec_param_operations *ops) { return 0; }
  23. static inline void sec_param_unregister_operations(struct sec_param_operations *ops) {}
  24. #endif
  25. #endif /* __SEC_PARAM_H__ */