Go to the source code of this file.
|
#define | __PLOOC_CLASS_USE_STRICT_TEMPLATE__ |
|
#define | VSF_POOL_CFG_STATISTIC_MODE ENABLED |
|
#define | VSF_POOL_CFG_FEED_ON_HEAP ENABLED |
|
#define | VSF_POOL_CFG_SUPPORT_USER_OBJECT ENABLED |
|
#define | __vsf_pool(__name) __name##_pool_t |
|
#define | __vsf_pool_item(__name) __name##_pool_item_t |
|
#define | __declare_vsf_pool(__name) |
|
#define | ____define_vsf_pool_tag(__name) |
|
#define | ____implement_vsf_pool_tag(__name) |
|
#define | __define_vsf_pool_tag(__name) ____define_vsf_pool_tag(__name) |
|
#define | __implement_vsf_pool_tag(__name) ____implement_vsf_pool_tag(__name) |
|
#define | __define_vsf_pool(__name, __type) |
|
#define | __implement_vsf_pool(__name, __type) |
|
|
#define | vsf_pool(__name) __vsf_pool(__name) |
|
#define | vsf_pool_item(__name) __vsf_pool_item(__name) |
|
#define | declare_vsf_pool(__name) |
|
#define | dcl_vsf_pool(__name) |
|
#define | define_vsf_pool(__name, __type) |
|
#define | def_vsf_pool(__name, __type) |
|
#define | end_def_pool(__name) |
|
#define | end_define_pool(__name) |
|
#define | implement_vsf_pool(__name, __type) |
|
#define | imp_vsf_pool(__name, __type) |
|
#define | VSF_POOL_INIT(__NAME, __VSF_POOL, __SIZE) |
|
#define | VSF_POOL_PREPARE(__NAME, __VSF_POOL) |
|
#define | END_VSF_POOL_PREPARE(__NAME) |
|
#define | VSF_POOL_INIT_EX( __NAME, __VSF_POOL, __SIZE, __ALIGN) |
|
#define | VSF_POOL_PREPARE_EX( __NAME, __VSF_POOL, __ALIGN) |
|
#define | VSF_POOL_ADD_BUFFER(__NAME, __VSF_POOL, __BUFFER, __SIZE) |
|
#define | VSF_POOL_ADD_BUFFER_EX(__NAME, __VSF_POOL, __BUFFER, __SIZE, __HANDLER) |
|
#define | VSF_POOL_FREE(__NAME, __VSF_POOL, __ITEM) |
|
#define | VSF_POOL_ALLOC(__NAME, __VSF_POOL) |
|
#define | VSF_POOL_ITEM_COUNT(__NAME, __VSF_POOL) |
|
#define | VSF_POOL_GET_REGION(__NAME, __VSF_POOL) |
|
#define | VSF_POOL_GET_TAG(__NAME, __VSF_POOL) |
|
#define | VSF_POOL_SET_TAG(__NAME, __VSF_POOL, __TARGET) |
|
|
| dcl_class (vsf_pool_t) typedef void vsf_pool_item_init_evt_handler_t(uintptr_t target_ptr |
|
void | vsf_pool_init (vsf_pool_t *obj_ptr, uint32_t item_size, uint_fast16_t align, vsf_pool_cfg_t *cfg_ptr) |
| initialise target pool !
|
|
bool | vsf_pool_add_buffer_ex (vsf_pool_t *obj_ptr, uintptr_t buffer_ptr, uint32_t buffer_size, uint32_t item_size, vsf_pool_item_init_evt_handler_t *item_init_fn) |
| add memory to pool !
|
|
bool | vsf_pool_add_buffer (vsf_pool_t *obj_ptr, uintptr_t buffer_ptr, uint32_t buffer_size, uint32_t item_size) |
| add memory to pool !
|
|
uintptr_t | vsf_pool_alloc (vsf_pool_t *obj_ptr) |
| try to fetch a memory block from the target pool !
|
|
void | vsf_pool_free (vsf_pool_t *obj_ptr, uintptr_t item_ptr) |
| return a memory block to the target pool !
|
|
uint_fast16_t | vsf_pool_get_count (vsf_pool_t *obj_ptr) |
| get the number of memory blocks available in the target pool !
|
|
uintptr_t | vsf_pool_get_tag (vsf_pool_t *obj_ptr) |
| get the address of the object which is attached to the pool !
|
|
uintptr_t | vsf_pool_set_tag (vsf_pool_t *obj_ptr, uintptr_t target_ptr) |
| set the address of the object which is attached to the pool !
|
|
vsf_protect_region_t * | vsf_pool_get_region (vsf_pool_t *obj_ptr) |
| get the address of the code region used by this pool !
|
|
◆ __PLOOC_CLASS_USE_STRICT_TEMPLATE__
#define __PLOOC_CLASS_USE_STRICT_TEMPLATE__ |
\NOTE: Make sure #include "utilities/ooc_class.h" is close to the class ! definition and there is NO ANY OTHER module-interface-header file ! included in this file
◆ VSF_POOL_CFG_STATISTIC_MODE
#define VSF_POOL_CFG_STATISTIC_MODE ENABLED |
- Note
- Enable statistic mode by default
◆ VSF_POOL_CFG_FEED_ON_HEAP
#define VSF_POOL_CFG_FEED_ON_HEAP ENABLED |
◆ VSF_POOL_CFG_SUPPORT_USER_OBJECT
#define VSF_POOL_CFG_SUPPORT_USER_OBJECT ENABLED |
◆ __vsf_pool
◆ __vsf_pool_item
◆ __declare_vsf_pool
#define __declare_vsf_pool |
( |
|
__name | ) |
|
Value:
#define __name
Definition hci_transport_aic8800.c:552
#define vsf_pool(__name)
Definition vsf_pool.h:258
#define vsf_pool_item(__name)
Definition vsf_pool.h:259
◆ ____define_vsf_pool_tag
#define ____define_vsf_pool_tag |
( |
|
__name | ) |
|
Value:
VSF_CAL_SECTION(
".text." #
__name "_pool_set_tag") \
#define VSF_CAL_SECTION(__SEC)
Definition __compiler.h:181
uint32_t uintptr_t
Definition stdint.h:38
◆ ____implement_vsf_pool_tag
#define ____implement_vsf_pool_tag |
( |
|
__name | ) |
|
Value: VSF_CAL_WEAK(
__name##_pool_get_tag) \
VSF_CAL_SECTION(
".text." #
__name "_pool_get_tag") \
{ \
} \
VSF_CAL_WEAK(
__name##_pool_set_tag) \
VSF_CAL_SECTION(
".text." #
__name "_pool_set_tag") \
{ \
}
uintptr_t vsf_pool_set_tag(vsf_pool_t *obj_ptr, uintptr_t target_ptr)
set the address of the object which is attached to the pool !
Definition vsf_pool.c:398
uintptr_t vsf_pool_get_tag(vsf_pool_t *obj_ptr)
get the address of the object which is attached to the pool !
Definition vsf_pool.c:385
◆ __define_vsf_pool_tag
◆ __implement_vsf_pool_tag
◆ __define_vsf_pool
Value: union vsf_pool_item(__name) { \
}; \
public_member( \
implement(vsf_pool_t) \
) \
) \
VSF_CAL_SECTION(
".text." #
__name "_pool_init_ex") \
extern void __name##_pool_init_ex( \
extern bool __name##_pool_add_buffer( \
VSF_CAL_SECTION(
".text." #
__name "_pool_add_buffer_ex") \
extern bool __name##_pool_add_buffer_ex( \
void *buffer_ptr, \
vsf_pool_item_init_evt_handler_t *handler_fn); \
VSF_CAL_SECTION(
".text." #
__name "_get_pool_item_count") \
VSF_CAL_SECTION(
".text." #
__name "_pool_get_region") \
#define __type
Definition hci_transport_aic8800.c:553
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned short uint_fast16_t
Definition stdint.h:25
Definition vsf_arch_abstraction.h:54
Definition vsf_list.h:872
vsf_pool_cfg_t
Definition vsf_pool.h:539
◆ __implement_vsf_pool
◆ vsf_pool
◆ vsf_pool_item
◆ declare_vsf_pool
#define declare_vsf_pool |
( |
|
__name | ) |
|
◆ dcl_vsf_pool
#define dcl_vsf_pool |
( |
|
__name | ) |
|
◆ define_vsf_pool
◆ def_vsf_pool
◆ end_def_pool
#define end_def_pool |
( |
|
__name | ) |
|
◆ end_define_pool
#define end_define_pool |
( |
|
__name | ) |
|
◆ implement_vsf_pool
◆ imp_vsf_pool
◆ VSF_POOL_INIT
#define VSF_POOL_INIT |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__SIZE |
|
) |
| |
Value: \
\
do { \
.pool_name_str = (
const uint8_t *)#__NAME, \
}; \
__NAME##_pool_init((__VSF_POOL), &cfg); \
vsf_pool_add_buffer((vsf_pool_t *)(__VSF_POOL), \
sizeof(__buffer), \
} while(0)
unsigned char uint8_t
Definition lvgl.h:40
◆ VSF_POOL_PREPARE
#define VSF_POOL_PREPARE |
( |
|
__NAME, |
|
|
|
__VSF_POOL |
|
) |
| |
Value: \
\
do { \
vsf_pool(
__name) *this_ptr = (__VSF_POOL); \
◆ END_VSF_POOL_PREPARE
#define END_VSF_POOL_PREPARE |
( |
|
__NAME | ) |
|
Value: }; \
__NAME##_pool_init((this_ptr), &cfg); \
} while(0);
◆ VSF_POOL_INIT_EX
#define VSF_POOL_INIT_EX |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__SIZE, |
|
|
|
__ALIGN |
|
) |
| |
Value: \
\
do { \
.pool_name_str = (
const uint8_t *)#__NAME, \
}; \
__NAME##_pool_init_ex((__VSF_POOL), (__ALIGN), &cfg); \
vsf_pool_add_buffer((vsf_pool_t *)(__VSF_POOL), \
__buffer, \
sizeof(__buffer), \
} while(0)
#define VSF_CAL_ALIGN(__N)
Definition __compiler.h:179
◆ VSF_POOL_PREPARE_EX
#define VSF_POOL_PREPARE_EX |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__ALIGN |
|
) |
| |
Value: \
\
do { \
.pool_name_str = (
const uint8_t *)#__NAME, \
}; \
__NAME##_pool_init_ex((__VSF_POOL), (__ALIGN), &cfg); \
} while(0)
◆ VSF_POOL_ADD_BUFFER
#define VSF_POOL_ADD_BUFFER |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__BUFFER, |
|
|
|
__SIZE |
|
) |
| |
Value: \
__NAME##_pool_add_buffer( (__VSF_POOL), \
(__SIZE))
◆ VSF_POOL_ADD_BUFFER_EX
#define VSF_POOL_ADD_BUFFER_EX |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__BUFFER, |
|
|
|
__SIZE, |
|
|
|
__HANDLER |
|
) |
| |
Value: \
__NAME##_pool_add_buffer_ex((__VSF_POOL), \
(__SIZE), \
(__HANDLER))
◆ VSF_POOL_FREE
#define VSF_POOL_FREE |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__ITEM |
|
) |
| |
Value: \
\
__NAME##_pool_free((__VSF_POOL), (__ITEM))
◆ VSF_POOL_ALLOC
#define VSF_POOL_ALLOC |
( |
|
__NAME, |
|
|
|
__VSF_POOL |
|
) |
| |
Value: \
__NAME##_pool_alloc((__VSF_POOL))
◆ VSF_POOL_ITEM_COUNT
#define VSF_POOL_ITEM_COUNT |
( |
|
__NAME, |
|
|
|
__VSF_POOL |
|
) |
| |
Value: \
__NAME##_get_pool_item_count((__VSF_POOL))
◆ VSF_POOL_GET_REGION
#define VSF_POOL_GET_REGION |
( |
|
__NAME, |
|
|
|
__VSF_POOL |
|
) |
| |
Value: \
__NAME##_pool_get_region((__VSF_POOL))
◆ VSF_POOL_GET_TAG
#define VSF_POOL_GET_TAG |
( |
|
__NAME, |
|
|
|
__VSF_POOL |
|
) |
| |
Value: \
__NAME##_pool_get_tag((__VSF_POOL))
◆ VSF_POOL_SET_TAG
#define VSF_POOL_SET_TAG |
( |
|
__NAME, |
|
|
|
__VSF_POOL, |
|
|
|
__TARGET |
|
) |
| |
Value: \
__NAME##_pool_set_tag((__VSF_POOL), (__TARGET))
◆ vsf_pool_info_t
◆ dcl_class()
◆ dcl_interface()
dcl_interface |
( |
i_pool_t |
| ) |
|
◆ vsf_pool_init()
initialise target pool !
- Parameters
-
obj_ptr | address of the target pool ! |
item_size | memory item size ! |
align | Item Alignment ! |
cfg_ptr | configurations ! |
- Returns
- none
- Parameters
-
this_ptr | address of the target pool ! |
cfg_ptr | configurations ! |
- Returns
- none
add pool to the pool list
◆ vsf_pool_add_buffer_ex()
bool vsf_pool_add_buffer_ex |
( |
vsf_pool_t * |
obj_ptr, |
|
|
uintptr_t |
buffer_ptr, |
|
|
uint32_t |
buffer_size, |
|
|
uint32_t |
item_size, |
|
|
vsf_pool_item_init_evt_handler_t * |
item_init_fn |
|
) |
| |
|
extern |
add memory to pool !
- Parameters
-
obj_ptr | address of the target pool ! |
buffer_ptr | address of the target memory ! |
buffer_size | the size of the target memory ! |
item_size | memory block size of the pool ! |
item_init_fn | block initialisation handler ! |
- Return values
-
false | the buffer size is too small or invalid parameters ! |
true | buffer is added |
- Parameters
-
this_ptr | address of the target pool ! |
buffer_ptr | address of the target memory ! |
buffer_size | the size of the target memory ! |
item_size | memory block size of the pool ! |
item_init_fn | block initialisation handler ! |
- Return values
-
false | the buffer size is too small or invalid parameters ! |
true | buffer is added |
◆ vsf_pool_add_buffer()
add memory to pool !
- Parameters
-
obj_ptr | address of the target pool ! |
buffer_ptr | address of the target memory ! |
buffer_size | the size of the target memory ! |
item_size | memory block size of the pool ! |
- Return values
-
false | the buffer size is too small or invalid parameters ! |
true | buffer is added |
- Parameters
-
this_ptr | address of the target pool ! |
buffer_ptr | address of the target memory ! |
buffer_size | the size of the target memory ! |
item_size | memory block size of the pool ! |
- Return values
-
false | the buffer size is too small or invalid parameters ! |
true | buffer is added |
◆ vsf_pool_alloc()
uintptr_t vsf_pool_alloc |
( |
vsf_pool_t * |
obj_ptr | ) |
|
|
extern |
try to fetch a memory block from the target pool !
- Parameters
-
obj_ptr | address of the target pool ! |
- Return values
-
NULL | the pool is empty ! |
!NULL | address of the allocated memory block |
- Parameters
-
this_ptr | address of the target pool ! |
- Return values
-
NULL | the pool is empty ! |
!NULL | address of the allocated memory block |
feed on heap
◆ vsf_pool_free()
void vsf_pool_free |
( |
vsf_pool_t * |
obj_ptr, |
|
|
uintptr_t |
pItem |
|
) |
| |
|
extern |
return a memory block to the target pool !
- Parameters
-
obj_ptr | address of the target pool ! |
item_ptr | target memory block ! |
- Returns
- none
- Parameters
-
this_ptr | address of the target pool ! |
pItem | target memory block ! |
- Returns
- none
◆ vsf_pool_get_count()
get the number of memory blocks available in the target pool !
- Parameters
-
obj_ptr | address of the target pool ! |
- Returns
- the number of memory blocks
- Parameters
-
this_ptr | address of the target pool ! |
- Returns
- the number of memory blocks
◆ vsf_pool_get_tag()
uintptr_t vsf_pool_get_tag |
( |
vsf_pool_t * |
obj_ptr | ) |
|
|
extern |
get the address of the object which is attached to the pool !
- Parameters
-
obj_ptr | address of the target pool ! |
- Returns
- the address of the object
- Parameters
-
this_ptr | address of the target pool ! |
- Returns
- the address of the object
◆ vsf_pool_set_tag()
set the address of the object which is attached to the pool !
- Parameters
-
obj_ptr | address of the target pool ! |
- Returns
- the address of the object
- Parameters
-
this_ptr | address of the target pool ! |
- Returns
- the address of the object
◆ vsf_pool_get_region()
get the address of the code region used by this pool !
- Parameters
-
obj_ptr | address of the target pool ! |
- Returns
- the address of the code region
- Parameters
-
this_ptr | address of the target pool ! |
- Returns
- the address of the code region
◆ item_ptr
◆ item_size
◆ vsf_pool_cfg_t
typedef struct vsf_pool_cfg_t |
◆ align
◆ cfg_ptr
◆ AddEx
◆ Add
◆ [struct]
◆ Allocate
uintptr_t(* Allocate) (vsf_pool_t *obj_ptr) |
( |
vsf_pool_t * |
obj_ptr | ) |
|
◆ Free
◆ Count
uint_fast16_t(* Count) (vsf_pool_t *obj_ptr) |
( |
vsf_pool_t * |
obj_ptr | ) |
|
◆ Get
uintptr_t(* Get) (vsf_pool_t *obj_ptr) |
( |
vsf_pool_t * |
obj_ptr | ) |
|
◆ Set
◆ [struct]