smci_appcontroller.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef __SMCI_APPCONTROLLER_H
  6. #define __SMCI_APPCONTROLLER_H
  7. #include "smci_object.h"
  8. #include "IAppController.h"
  9. #define SMCI_APPCONTROLLER_CBO_INTERFACE_WAIT UINT32_C(1)
  10. #define SMCI_APPCONTROLLER_ERROR_APP_SUSPENDED INT32_C(10)
  11. #define SMCI_APPCONTROLLER_ERROR_APP_BLOCKED_ON_LISTENER INT32_C(11)
  12. #define SMCI_APPCONTROLLER_ERROR_APP_UNLOADED INT32_C(12)
  13. #define SMCI_APPCONTROLLER_ERROR_APP_IN_USE INT32_C(13)
  14. #define SMCI_APPCONTROLLER_ERROR_NOT_SUPPORTED INT32_C(14)
  15. #define SMCI_APPCONTROLLER_ERROR_CBO_UNKNOWN INT32_C(15)
  16. #define SMCI_APPCONTROLLER_ERROR_APP_UNLOAD_NOT_ALLOWED INT32_C(16)
  17. #define SMCI_APPCONTROLLER_ERROR_APP_DISCONNECTED INT32_C(17)
  18. #define SMCI_APPCONTROLLER_ERROR_USER_DISCONNECT_REJECTED INT32_C(18)
  19. #define SMCI_APPCONTROLLER_ERROR_STILL_RUNNING INT32_C(19)
  20. #define SMCI_APPCONTROLLER_OP_OPENSESSION 0
  21. #define SMCI_APPCONTROLLER_OP_UNLOAD 1
  22. #define SMCI_APPCONTROLLER_OP_GETAPPOBJECT 2
  23. #define SMCI_APPCONTROLLER_OP_INSTALLCBO 3
  24. #define SMCI_APPCONTROLLER_OP_DISCONNECT 4
  25. #define SMCI_APPCONTROLLER_OP_RESTART 5
  26. static inline int32_t
  27. smci_appcontroller_release(struct smci_object self)
  28. {
  29. return IAppController_release(self);
  30. }
  31. static inline int32_t
  32. smci_appcontroller_retain(struct smci_object self)
  33. {
  34. return IAppController_retain(self);
  35. }
  36. static inline int32_t
  37. smci_appcontroller_opensession(struct smci_object self, uint32_t cancel_code_val,
  38. uint32_t connection_method_val, uint32_t connection_data_val, uint32_t param_types_val,
  39. uint32_t ex_param_types_val, const void *i1_ptr, size_t i1_len, const void *i2_ptr,
  40. size_t i2_len, const void *i3_ptr, size_t i3_len, const void *i4_ptr, size_t i4_len,
  41. void *o1_ptr, size_t o1_len, size_t *o1_lenout, void *o2_ptr, size_t o2_len,
  42. size_t *o2_lenout, void *o3_ptr, size_t o3_len, size_t *o3_lenout, void *o4_ptr,
  43. size_t o4_len, size_t *o4_lenout, struct smci_object imem1_val,
  44. struct smci_object imem2_val, struct smci_object imem3_val, struct smci_object imem4_val,
  45. uint32_t *memref_out_sz1_ptr, uint32_t *memref_out_sz2_ptr, uint32_t *memref_out_sz3_ptr,
  46. uint32_t *memref_out_sz4_ptr, struct smci_object *session_ptr, uint32_t *ret_value_ptr,
  47. uint32_t *ret_origin_ptr)
  48. {
  49. return IAppController_openSession(self, cancel_code_val,
  50. connection_method_val, connection_data_val, param_types_val,
  51. ex_param_types_val, i1_ptr, i1_len, i2_ptr,
  52. i2_len, i3_ptr, i3_len, i4_ptr, i4_len,
  53. o1_ptr, o1_len, o1_lenout, o2_ptr, o2_len,
  54. o2_lenout, o3_ptr, o3_len, o3_lenout, o4_ptr,
  55. o4_len, o4_lenout, imem1_val,
  56. imem2_val, imem3_val, imem4_val,
  57. memref_out_sz1_ptr, memref_out_sz2_ptr, memref_out_sz3_ptr,
  58. memref_out_sz4_ptr, session_ptr, ret_value_ptr,
  59. ret_origin_ptr);
  60. }
  61. static inline int32_t
  62. smci_appcontroller_unload(struct smci_object self)
  63. {
  64. return IAppController_unload(self);
  65. }
  66. static inline int32_t
  67. smci_appcontroller_getappobject(struct smci_object self, struct smci_object *obj_ptr)
  68. {
  69. return IAppController_getAppObject(self, obj_ptr);
  70. }
  71. static inline int32_t
  72. smci_appcontroller_installcbo(struct smci_object self, uint32_t uid_val, struct smci_object obj_val)
  73. {
  74. return IAppController_installCBO(self, uid_val, obj_val);
  75. }
  76. static inline int32_t
  77. smci_appcontroller_disconnect(struct smci_object self)
  78. {
  79. return IAppController_disconnect(self);
  80. }
  81. static inline int32_t
  82. smci_appcontroller_restart(struct smci_object self)
  83. {
  84. return IAppController_restart(self);
  85. }
  86. #endif /* __SMCI_APPCONTROLLER_H */