30 lines
494 B
C
30 lines
494 B
C
|
|
||
|
#ifndef sys_api_h__
|
||
|
#define sys_api_h__
|
||
|
|
||
|
#include "stdint.h"
|
||
|
#include "stdlib.h"
|
||
|
#include "stddef.h"
|
||
|
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
void *fun;
|
||
|
int index;
|
||
|
}api_item_struct;
|
||
|
|
||
|
|
||
|
|
||
|
//#define api_table(name_,size_)\
|
||
|
// __attribute__((used)) static const void *name_[size_] __attribute__((section("sys_api")))
|
||
|
|
||
|
|
||
|
#define api_item(fun_,index_) \
|
||
|
__attribute__((used)) static const api_item_struct api_##index_ __attribute__((section("sys_api")))=\
|
||
|
{.fun=fun_,.index=index_}
|
||
|
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|