XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_init_section.c
浏览该文件的文档.
1
12/* ==================== [Includes] ========================================== */
13
14#include "xf_init_section.h"
15#include "xf_utils.h"
16
17#if XF_INIT_IMPL_METHOD == XF_INIT_IMPL_BY_SECTION
18
19/* ==================== [Defines] =========================================== */
20
21#define TAG "section"
22
23/* ==================== [Typedefs] ========================================== */
24
25/* ==================== [Static Prototypes] ================================= */
26
27static int start(void);
29static int end(void);
31
32/* ==================== [Static Variables] ================================== */
33
34/* ==================== [Macros] ============================================ */
35
36/* ==================== [Global Functions] ================================== */
37
38void xf_init_from_section(void)
39{
40 int result = 0;
41 UNUSED(result);
42 const xf_init_section_desc_t *desc = &__xf_init_start;
43 for (desc++; desc < &__xf_init_end; desc++) {
44 if (NULL == desc->func) {
45 continue;
46 }
47 result = desc->func();
48 XF_LOGD(TAG, "initialize [ret: %d] %s done.", result, desc->func_name);
49 }
50}
51
52/* ==================== [Static Functions] ================================== */
53
54static int start(void)
55{
56 return 0;
57}
58
59static int end(void)
60{
61 return 0;
62}
63
64#endif
#define TAG
Definition xf_main.c:24
初始化函数详情结构体.
const xf_init_fn_t func
static block_link_t start
闲内存块链表的起点和终点。 用户在注册的时候末尾 next_free_block 为 (void*) 0,block_size 为 0
Definition xf_alloc.c:54
static block_link_t * end
Definition xf_alloc.c:54
使用段属性实现自动初始化。
#define XF_INIT_EXPORT_SECTION(function, level)
导出初始化函数到段.
void xf_init_from_section(void)
section 注册的函数将会被统一在这个函数里面调用。
#define XF_LOGD(tag, format,...)
#define UNUSED(_x)