WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
crypto_common_macro.h 文件参考
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define crypto_cpu_to_be32(v)
 
#define crypto_max(a, b)   ((a) > (b)) ? (a) : (b)
 
#define crypto_min(a, b)   ((a) > (b)) ? (b) : (a)
 
#define crypto_unused(x)   (td_void)(x)
 
#define crypto_array_size(arr)   (sizeof(arr) / sizeof((arr)[0]))
 
#define crypto_reg_read(reg_addr)   (*(volatile td_u32 *)(uintptr_t)(reg_addr))
 
#define crypto_reg_write(reg_addr, value)   (*(volatile td_u32 *)(uintptr_t)(reg_addr) = (value))
 
#define crypto_reg_read_u16(reg_addr)   (*(volatile td_u16 *)(uintptr_t)(reg_addr))
 
#define crypto_set_bits(src, bit)   ((src) |= (1 << (bit)))
 
#define crypto_clear_bits(src, bit)   ((src) &= ~(1 << (bit)))
 
#define crypto_chk_print(cond, ...)
 
#define crypto_chk_return(cond, err_ret, ...)
 
#define crypto_chk_return_void(cond, ...)
 
#define crypto_chk_goto(cond, label, ...)
 
#define crypto_param_require(cond)
 
#define crypto_param_check(cond)
 
#define crypto_chk_goto_with_ret(ret, cond, label, err_ret, fmt, ...)
 
#define crypto_hal_func_enter()
 
#define crypto_hal_func_exit()
 
#define crypto_kapi_func_enter()
 
#define crypto_kapi_func_exit()
 
#define crypto_drv_func_enter()
 
#define crypto_drv_func_exit()
 
#define crypto_dispatch_func_enter()
 
#define crypto_dispatch_func_exit()
 
#define crypto_uapi_func_enter()
 
#define crypto_uapi_func_exit()
 
#define crypto_print_func_err(_func, _err_code)
 
#define crypto_chk_func_return(func, ret)
 
#define crypto_check_param(err_level, module, cond, err_code)
 
#define crypto_check_param_null(err_level, module, _val)
 

宏定义说明

◆ crypto_array_size

#define crypto_array_size (   arr)    (sizeof(arr) / sizeof((arr)[0]))

◆ crypto_check_param

#define crypto_check_param (   err_level,
  module,
  cond,
  err_code 
)
值:
do { \
if (cond) { \
crypto_log_err("pke invalid parameter: %s \r\n", #cond); \
return CRYPTO_COMPAT_ERRNO(CRYPTO_ERROR_ENV, err_level, module, err_code); \
} \
} while (0)
#define CRYPTO_COMPAT_ERRNO(env, layer, module, err_code)
Definition crypto_errno.h:113

◆ crypto_check_param_null

#define crypto_check_param_null (   err_level,
  module,
  _val 
)
值:
do { \
crypto_check_param(err_level, module, ((_val) == TD_NULL), ERROR_PARAM_IS_NULL); \
} while (0)
@ ERROR_PARAM_IS_NULL
Definition crypto_errno.h:50
#define TD_NULL
Definition td_type.h:30

◆ crypto_chk_func_return

#define crypto_chk_func_return (   func,
  ret 
)
值:
do { \
if ((ret) != TD_SUCCESS) { \
crypto_print_func_err(func, ret); \
return ret; \
} \
} while (0)
#define TD_SUCCESS
Definition crypto_type.h:14

◆ crypto_chk_goto

#define crypto_chk_goto (   cond,
  label,
  ... 
)
值:
do { \
if (cond) { \
crypto_log_err(__VA_ARGS__); \
goto label; \
} \
} while (0)

◆ crypto_chk_goto_with_ret

#define crypto_chk_goto_with_ret (   ret,
  cond,
  label,
  err_ret,
  fmt,
  ... 
)
值:
do { \
if (cond) { \
crypto_log_err(fmt, ##__VA_ARGS__); \
ret = err_ret; \
goto label; \
} \
} while (0)

◆ crypto_chk_print

#define crypto_chk_print (   cond,
  ... 
)
值:
do { \
if (cond) { \
crypto_log_err(__VA_ARGS__); \
} \
} while (0)

◆ crypto_chk_return

#define crypto_chk_return (   cond,
  err_ret,
  ... 
)
值:
do { \
if (cond) { \
crypto_log_err(__VA_ARGS__); \
return err_ret; \
} \
} while (0)

◆ crypto_chk_return_void

#define crypto_chk_return_void (   cond,
  ... 
)
值:
do { \
if (cond) { \
crypto_log_err(__VA_ARGS__); \
return; \
} \
} while (0)

◆ crypto_clear_bits

#define crypto_clear_bits (   src,
  bit 
)    ((src) &= ~(1 << (bit)))

◆ crypto_cpu_to_be32

#define crypto_cpu_to_be32 (   v)
值:
((((td_u32)(v)) >> 24) | ((((td_u32)(v)) >> 8) & 0xff00) \
| ((((td_u32)(v)) << 8) & 0xff0000) | (((td_u32)(v)) << 24))
unsigned int td_u32
Definition td_type.h:38

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.

Description: crypto common macro header.
History:
2023-03-22, Create file.

◆ crypto_dispatch_func_enter

#define crypto_dispatch_func_enter ( )

◆ crypto_dispatch_func_exit

#define crypto_dispatch_func_exit ( )

◆ crypto_drv_func_enter

#define crypto_drv_func_enter ( )

◆ crypto_drv_func_exit

#define crypto_drv_func_exit ( )

◆ crypto_hal_func_enter

#define crypto_hal_func_enter ( )

◆ crypto_hal_func_exit

#define crypto_hal_func_exit ( )

◆ crypto_kapi_func_enter

#define crypto_kapi_func_enter ( )

◆ crypto_kapi_func_exit

#define crypto_kapi_func_exit ( )

◆ crypto_max

#define crypto_max (   a,
 
)    ((a) > (b)) ? (a) : (b)

◆ crypto_min

#define crypto_min (   a,
 
)    ((a) > (b)) ? (b) : (a)

◆ crypto_param_check

#define crypto_param_check (   cond)
值:
do { \
if (cond) { \
crypto_log_err("Param Check %s failed\n", #cond); \
return CRYPTO_FAILURE; \
} \
} while (0)
@ CRYPTO_FAILURE
Definition crypto_errno.h:134

◆ crypto_param_require

#define crypto_param_require (   cond)
值:
do { \
if (!(cond)) { \
crypto_log_err("Param Check %s failed\n", #cond); \
return CRYPTO_FAILURE; \
} \
} while (0)

◆ crypto_print_func_err

#define crypto_print_func_err (   _func,
  _err_code 
)
值:
do { \
crypto_log_err("%s failed! error code: 0x%x \r\n", #_func, _err_code); \
} while (0)

◆ crypto_reg_read

#define crypto_reg_read (   reg_addr)    (*(volatile td_u32 *)(uintptr_t)(reg_addr))

◆ crypto_reg_read_u16

#define crypto_reg_read_u16 (   reg_addr)    (*(volatile td_u16 *)(uintptr_t)(reg_addr))

◆ crypto_reg_write

#define crypto_reg_write (   reg_addr,
  value 
)    (*(volatile td_u32 *)(uintptr_t)(reg_addr) = (value))

◆ crypto_set_bits

#define crypto_set_bits (   src,
  bit 
)    ((src) |= (1 << (bit)))

◆ crypto_uapi_func_enter

#define crypto_uapi_func_enter ( )

◆ crypto_uapi_func_exit

#define crypto_uapi_func_exit ( )

◆ crypto_unused

#define crypto_unused (   x)    (td_void)(x)