RT-Thead SHELL 命令段定义实现方法
来源:互联网 发布:翻墙 mac 免费 2017 编辑:程序博客网 时间:2024/06/05 20:20
typedef long (*syscall_func)();#include <stdarg.h>//段定义#define SECTION(x) __attribute__((section(x)))/* system call table */struct finsh_syscall{ const char* name; /* the name of system call */ const char* desc; /* description of system call */ syscall_func func; /* the function address of system call */};#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; }
0 0
- RT-Thead SHELL 命令段定义实现方法
- 5.6 实现Runable接口定义线程和直接继承Thead类定义线程的区别
- thead.join方法 原理
- 在C语言中调用shell命令的实现方法
- shell编程:定义简单标准命令集
- 【Shell】shell中执行字符串定义的命令
- 执行Shell命令的方法。
- shell实现ftp命令示例
- shell实现ftp命令示例
- shell实现ftp命令示例
- Hadoop Shell命令实现原理
- shell实现ftp命令示例
- shell实现ftp命令示例
- shell中的clear命令实现
- 头部固定悬浮table表头(thead)的方法
- Robotium学习(七)- 实现用shell命令执行一些操作的方法
- 解析如何在C语言中调用shell命令的实现方法
- rt-thread中用消息队列实现广播功能的一种方法
- java
- SIMD——MMX指令的溢出处理
- Spring-bean的生命周期
- 子类父类 构造函数析构函数
- LeetCode 题解(Week6):300. Longest Increasing Subsequence
- RT-Thead SHELL 命令段定义实现方法
- amr格式解析
- c++ 字符串切割
- 通过观测到的公交车线路估计城市共有多少路公交车
- 数据库触发器
- iOS app版本迭代(iOS中app在iTunes中更新版本流程)
- VS中MFC连接MySQL由于系统不同位(32/64)引起的错误:无法解析的外部符号 _mysql_init@4、_mysql_query
- 读《统计自然语言处理》——词汇获取
- 代码混淆之道(一)