添加bsp_init,sys_api段
This commit is contained in:
@@ -16,8 +16,8 @@ typedef struct{
|
||||
|
||||
// ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʼ<EFBFBD><CABC>
|
||||
#define extern_init(name_,init_)\
|
||||
const char __init_##name_[] __attribute__((section("name"))) = #name_;\
|
||||
__attribute__((used)) const init_call_fun __bsp_init_##name_ __attribute__((section("bsp_init")))=\
|
||||
const char __init_##name_[] __attribute__((section(".name"))) = #name_;\
|
||||
__attribute__((used,section(".bsp_init"))) const init_call_fun __bsp_init_##name_ =\
|
||||
{\
|
||||
.name=__init_##name_,\
|
||||
.init=init_,\
|
||||
|
@@ -38,11 +38,11 @@ api_table_struct g_api_table;
|
||||
|
||||
static int api_table_init(void)
|
||||
{
|
||||
extern const unsigned int Load$$sys_api$$Base;
|
||||
extern const unsigned int Load$$sys_api$$Limit;
|
||||
extern const unsigned int sys_api_start;
|
||||
extern const unsigned int sys_api_end;
|
||||
|
||||
api_item_struct *start=(api_item_struct *)&Load$$sys_api$$Base;
|
||||
api_item_struct *end=(api_item_struct *)&Load$$sys_api$$Limit;
|
||||
api_item_struct *start=(api_item_struct *)&sys_api_start;
|
||||
api_item_struct *end=(api_item_struct *)&sys_api_end;
|
||||
|
||||
if(g_api_table.fun_table==0)
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@ typedef struct
|
||||
|
||||
|
||||
#define api_item(fun_,index_) \
|
||||
__attribute__((used)) static const api_item_struct api_##index_ __attribute__((section("sys_api")))=\
|
||||
__attribute__((used,section(".sys_api"))) static const api_item_struct api_##index_ =\
|
||||
{.fun=fun_,.index=index_}
|
||||
|
||||
|
||||
|
@@ -126,7 +126,7 @@ SECTIONS
|
||||
.sys_api :{
|
||||
. = ALIGN(4);
|
||||
sys_api_start = .;
|
||||
*(.sys_api)
|
||||
KEEP(*(.sys_api))
|
||||
sys_api_end = .;
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
@@ -134,7 +134,7 @@ SECTIONS
|
||||
.bsp_init :{
|
||||
. = ALIGN(4);
|
||||
bsp_init_start = .;
|
||||
*(bsp_init)
|
||||
KEEP(*(.bsp_init))
|
||||
bsp_init_end = .;
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
Reference in New Issue
Block a user