qtiseclib_cb_interface.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef QTISECLIB_CB_INTERFACE_H
  7. #define QTISECLIB_CB_INTERFACE_H
  8. #include <stdarg.h>
  9. #include <stdbool.h>
  10. #include <stddef.h>
  11. #include <stdint.h>
  12. #include <qtiseclib_defs.h>
  13. /* Standard Library API's */
  14. void *qtiseclib_cb_memcpy(void *dst, const void *src, size_t len);
  15. int qtiseclib_cb_strcmp(const char *s1, const char *s2);
  16. void *qtiseclib_cb_memset(void *s, int c, size_t n);
  17. void *qtiseclib_cb_memmove(void *dest, const void *src, size_t n);
  18. #define QTISECLIB_CB_ERROR(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_ERROR, __VA_ARGS__)
  19. #define QTISECLIB_CB_NOTICE(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_NOTICE, __VA_ARGS__)
  20. #define QTISECLIB_CB_WARN(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_WARNING, __VA_ARGS__)
  21. #define QTISECLIB_CB_INFO(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_INFO, __VA_ARGS__)
  22. void qtiseclib_cb_log(unsigned int loglvl, const char *fmt, ...);
  23. void qtiseclib_cb_spin_lock(qtiseclib_cb_spinlock_t *lock);
  24. void qtiseclib_cb_spin_unlock(qtiseclib_cb_spinlock_t *lock);
  25. unsigned int qtiseclib_cb_plat_my_core_pos(void);
  26. int qtiseclib_cb_plat_core_pos_by_mpidr(u_register_t mpidr);
  27. unsigned int qtiseclib_cb_plat_my_cluster_pos(void);
  28. /* GIC platform wrappers */
  29. void qtiseclib_cb_gic_pcpu_init(void);
  30. void qtiseclib_cb_ic_raise_sgi(int sgi_num, u_register_t target);
  31. void qtiseclib_cb_set_spi_routing(unsigned int id, unsigned int irm,
  32. u_register_t target);
  33. /* Crash reporting api's wrappers */
  34. void qtiseclib_cb_switch_console_to_crash_state(void);
  35. void qtiseclib_cb_udelay(uint32_t usec);
  36. void qtiseclib_cb_console_flush(void);
  37. #if QTI_SDI_BUILD
  38. int qtiseclib_cb_mmap_remove_dynamic_region(uintptr_t base_va, size_t size);
  39. int qtiseclib_cb_mmap_add_dynamic_region(unsigned long long base_pa,
  40. size_t size,
  41. qtiseclib_mmap_attr_t attr);
  42. void qtiseclib_cb_flush_dcache_all(void);
  43. void qtiseclib_cb_get_ns_ctx(qtiseclib_dbg_a64_ctxt_regs_type *ns_ctx);
  44. #endif
  45. #endif /* QTISECLIB_CB_INTERFACE_H */