18#if VSF_HAL_USE_RNG == ENABLED
23#define vsf_real_rng_t VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_t)
24#define vsf_real_rng_capability VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_capability)
26#ifndef VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY
27# define VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY DISABLED
30#ifdef VSF_RNG_CFG_IMP_REMAP_PREFIX
31# undef VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY
32# define VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY ENABLED
42#if VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
49 return rng_capability;
55#undef VSF_RNG_CFG_REIMPLEMENT_API_CAPABILITY
57#undef vsf_real_rng_capability
61#ifdef VSF_RNG_CFG_IMP_REMAP_PREFIX
63# define vsf_imp_rng_t VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_t)
64# define vsf_imp_rng_init VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_init)
65# define vsf_imp_rng_fini VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_fini)
66# define vsf_imp_rng_capability VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_capability)
67# define vsf_imp_rng_generate_request VSF_MCONNECT(VSF_RNG_CFG_IMP_PREFIX, _rng_generate_request)
69# define vsf_remap_rng_t VSF_MCONNECT(VSF_RNG_CFG_IMP_REMAP_PREFIX, _rng_t)
70# define vsf_remap_rng_init VSF_MCONNECT(VSF_RNG_CFG_IMP_REMAP_PREFIX, _rng_init)
71# define vsf_remap_rng_fini VSF_MCONNECT(VSF_RNG_CFG_IMP_REMAP_PREFIX, _rng_fini)
72# define vsf_remap_rng_capability VSF_MCONNECT(VSF_RNG_CFG_IMP_REMAP_PREFIX, _rng_capability)
73# define vsf_remap_rng_generate_request VSF_MCONNECT(VSF_RNG_CFG_IMP_REMAP_PREFIX, _rng_generate_request)
75# define VSF_RNG_CFG_IMP_REMAP_FUNCTIONS \
76 vsf_err_t vsf_imp_rng_init(vsf_imp_rng_t *rng_ptr) \
78 VSF_HAL_ASSERT(rng_ptr != NULL); \
79 return vsf_remap_rng_init(rng_ptr); \
81 void vsf_imp_rng_fini(vsf_imp_rng_t *rng_ptr) \
83 VSF_HAL_ASSERT(rng_ptr != NULL); \
84 vsf_remap_rng_fini(rng_ptr); \
86 vsf_err_t vsf_imp_rng_generate_request(vsf_imp_rng_t *rng_ptr, \
87 uint32_t *buffer, uint32_t num, void *param, \
88 vsf_imp_rng_on_ready_callback_t * on_ready_cb) \
90 VSF_HAL_ASSERT(rng_ptr != NULL); \
91 return vsf_remap_rng_generate_request(rng_ptr, buffer, num, param, on_ready_cb); \
93 vsf_rng_capability_t vsf_imp_rng_capability(vsf_imp_rng_t *rng_ptr) \
95 VSF_HAL_ASSERT(rng_ptr != NULL); \
96 return vsf_remap_rng_capability(rng_ptr); \
102#define VSF_HAL_TEMPLATE_IMP_NAME _rng
103#define VSF_HAL_TEMPLATE_IMP_UPCASE_NAME _RNG
105#ifndef VSF_RNG_CFG_IMP_PREFIX
106# error "Please define VSF_RNG_CFG_IMP_PREFIX in rng driver"
109#ifndef VSF_RNG_CFG_IMP_UPCASE_PREFIX
110# error "Please define VSF_RNG_CFG_IMP_UPCASE_PREFIX in rng driver"
113#ifndef VSF_RNG_CFG_IMP_COUNT_MASK_PREFIX
114# define VSF_RNG_CFG_IMP_COUNT_MASK_PREFIX VSF_RNG_CFG_IMP_UPCASE_PREFIX
117#ifdef VSF_RNG_CFG_IMP_REMAP_FUNCTIONS
118# define VSF_HAL_CFG_IMP_REMAP_FUNCTIONS VSF_RNG_CFG_IMP_REMAP_FUNCTIONS
123#undef VSF_RNG_CFG_IMP_PREFIX
124#undef VSF_RNG_CFG_IMP_COUNT_MASK_PREFIX
125#undef VSF_RNG_CFG_IMP_UPCASE_PREFIX
126#undef VSF_RNG_CFG_IMP_LV0
129#undef vsf_imp_rng_init
130#undef vsf_imp_rng_fini
131#undef vsf_imp_rng_capability
132#undef vsf_imp_rng_generate_request
134#undef vsf_remap_rng_t
135#undef vsf_remap_rng_init
136#undef vsf_remap_rng_fini
137#undef vsf_remap_rng_capability
138#undef vsf_remap_rng_generate_request
Definition vsf_template_rng.h:92