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