U_BOOT_CMD命令的实现
2014-02-26 11:40
323 查看
宏定义,用于定义一个U_BOOT命令
Struct cmd_tbl_s:
例如:
U_BOOT_CMD(
bootm, CONFIG_SYS_MAXARGS, 1, do_bootm,
"boot application image from memory", bootm_help_text
);展开后:
cmd_tbl_t __u_boot_cmd_##namebootm Struct_Section__attribute__ ((unused,section (".u_boot_cmd"))) =
{#name"bootm", maxargs16, rep1, cmddo_bootm, usage"boot application image from memory"}
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage) / cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage}
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))//设置属性,存在.u_boot_cmd段中
Struct cmd_tbl_s:
struct cmd_tbl_s { char *name; /* Command Name */ int maxargs; /* maximum number of arguments */ int repeatable; /* autorepeat allowed? */ /* Implementation function */ int (*cmd)(struct cmd_tbl_s *, int, int, char *[]); char *usage; /* Usage message (short) */ char *help; /* Help message (long) */ #ifdef CONFIG_AUTO_COMPLETE /* do auto completion on the arguments */ int (*complete)(int argc, char *argv[], char last_char, int maxv, char *cmdv[]); #endif }; typedef struct cmd_tbl_s cmd_tbl_t;
例如:
U_BOOT_CMD(
bootm, CONFIG_SYS_MAXARGS, 1, do_bootm,
"boot application image from memory", bootm_help_text
);展开后:
cmd_tbl_t __u_boot_cmd_##namebootm Struct_Section__attribute__ ((unused,section (".u_boot_cmd"))) =
{#name"bootm", maxargs16, rep1, cmddo_bootm, usage"boot application image from memory"}
相关文章推荐
- U_BOOT_CMD命令的实现
- U_BOOT_CMD 命令实现分析
- U_BOOT_CMD命令的实现
- U_BOOT_CMD命令的实现
- U_BOOT_CMD命令的实现
- U_BOOT_CMD命令的实现
- cmd环境下实现:为命令设置别名、启动cmd时自动执行bat
- u-boot命令-cmd编译过程
- 用面向对象实现支付功能、用线程实现龟兔赛跑、Java调用CMD运行adb命令并保存结果及归档
- U-boot 添加命令 U_BOOT_CMD
- #写一个脚本实现如下功能: 输入一个数字,然后运行对应的>一个命令。显示命令如下:*cmd meau** 1—date 2–ls 3–who 4–pwd #当输入1时,会运行date, 输入2
- SQL利用CMD及RAR命令实现将某一压缩文件解压到指定的路径
- 利用ajax持续发送请求,实现web版的cmd命令执行效果
- u-boot分析(三)---boot命令实现以及内核的启动
- SQL利用CMD以及IIS命令APPCMD 实现一些IIS操作
- u-boot传递给内核的参数bootargs和命令bootcmd(上)
- u-boot分析 七 (添加u-boot命令,学习u-boot命令实现原理)
- u-boot分析之u-boot命令实现
- uboot 的命令定义注意点,u-boot, cfg_cmd,cmd_confdefs.h
- 在U-Boot中添加自定义命令以实现自动下载程序【转】