typedef long (*syscall_func)();
#include <stdarg.h>
#define SECTION(x) __attribute__((section(x)))
struct finsh_syscall
{
const char* name;
const char* desc;
syscall_func func;
};
#define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \
const char __fsym_##cmd##_name[] SECTION(".rodata.name") = #cmd; \
const char __fsym_##cmd##_desc[] SECTION(".rodata.name") = #desc; \
const struct finsh_syscall __fsym_##cmd SECTION("FSymTab")= \
{ \
__fsym_##cmd##_name, \
__fsym_##cmd##_desc, \
(syscall_func)&name \
};
#define FINSH_FUNCTION_EXPORT(name, desc) \
FINSH_FUNCTION_EXPORT_CMD(name, name, desc)
static void enc28j60(void)
{
}
FINSH_FUNCTION_EXPORT(enc28j60, dump enc28j60 registers);
extern const int FSymTab$$Base;
extern const int FSymTab$$Limit;
struct finsh_syscall *_syscall_table_begin = NULL;
struct finsh_syscall *_syscall_table_end = NULL;
void finsh_system_function_init(const void *begin, const void *end)
{
_syscall_table_begin = (struct finsh_syscall *) begin;
_syscall_table_end = (struct finsh_syscall *) end;
__fsym_enc28j60.func();
}
const struct finsh_syscall *P;
int finsh_system_init(void)
{
finsh_system_function_init(&FSymTab$$Base, &FSymTab$$Limit);
P = &__fsym_enc28j60;
}