2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
#ifndef sys_api_h__
|
|
|
|
|
#define sys_api_h__
|
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
#include "stddef.h"
|
2025-06-27 00:32:57 +08:00
|
|
|
#include "stdint.h"
|
|
|
|
|
#include "stdlib.h"
|
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
typedef struct {
|
|
|
|
|
void *fun;
|
|
|
|
|
int index;
|
|
|
|
|
} api_item_struct;
|
2025-07-06 02:53:08 +08:00
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
#define api_item(fun_, index_) \
|
|
|
|
|
__attribute__((used, section(".sys_api"))) static const api_item_struct \
|
|
|
|
|
api_##index_ = {.fun = fun_, .index = index_}
|
2025-07-06 02:53:08 +08:00
|
|
|
|
2025-06-27 00:32:57 +08:00
|
|
|
#endif
|