Browse Source

Addition of standard APIs in qtiseclib interface

Follwing APIs wrappers are exposed to qtiseclib
* strcmp
* memset
* memmove

Change-Id: I79d50f358239cfda607d5f1a53314aa3b8f430cb
Signed-off-by: Saurabh Gorecha <sgorecha@codeaurora.org>
pull/1979/head
Saurabh Gorecha 4 years ago
parent
commit
9ac093b651
  1. 5
      plat/qti/qtiseclib/inc/qtiseclib_cb_interface.h
  2. 20
      plat/qti/qtiseclib/src/qtiseclib_cb_interface.c

5
plat/qti/qtiseclib/inc/qtiseclib_cb_interface.h

@ -16,6 +16,9 @@
/* Standard Library API's */
void *qtiseclib_cb_memcpy(void *dst, const void *src, size_t len);
int qtiseclib_cb_strcmp(const char *s1, const char *s2);
void *qtiseclib_cb_memset(void *s, int c, size_t n);
void *qtiseclib_cb_memmove(void *dest, const void *src, size_t n);
#define QTISECLIB_CB_ERROR(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_ERROR, __VA_ARGS__)
#define QTISECLIB_CB_NOTICE(...) qtiseclib_cb_log(QTISECLIB_LOG_LEVEL_NOTICE, __VA_ARGS__)
@ -41,6 +44,8 @@ void qtiseclib_cb_switch_console_to_crash_state(void);
void qtiseclib_cb_udelay(uint32_t usec);
int qtiseclib_cb_console_flush(void);
#if QTI_SDI_BUILD
int qtiseclib_cb_mmap_remove_dynamic_region(uintptr_t base_va, size_t size);
int qtiseclib_cb_mmap_add_dynamic_region(unsigned long long base_pa,

20
plat/qti/qtiseclib/src/qtiseclib_cb_interface.c

@ -29,6 +29,21 @@ void *qtiseclib_cb_memcpy(void *dst, const void *src, size_t len)
return memcpy(dst, src, len);
}
int qtiseclib_cb_strcmp(const char *s1, const char *s2)
{
return strcmp(s1, s2);
}
void *qtiseclib_cb_memset(void *s, int c, size_t n)
{
return memset(s, c, n);
}
void *qtiseclib_cb_memmove(void *dest, const void *src, size_t n)
{
return memmove(dest, src, n);
}
/* Printing logs below or equal LOG_LEVEL from QTISECLIB. */
void qtiseclib_cb_log(unsigned int loglvl, const char *fmt, ...)
{
@ -106,6 +121,11 @@ void qtiseclib_cb_udelay(uint32_t usec)
udelay(usec);
}
int qtiseclib_cb_console_flush(void)
{
return console_flush();
}
#if QTI_SDI_BUILD
void qtiseclib_cb_get_ns_ctx(qtiseclib_dbg_a64_ctxt_regs_type *qti_ns_ctx)
{

Loading…
Cancel
Save