U-BOOT源码分析及移植
int repeatable; /* autorepeat allowed? */
/* Implementation function 命令执行函数*/
int (*cmd)(struct cmd_tbl_s *, int, int, char *[]);
char *usage; /* Usage message (short) */
#ifdef CFG_LONGHELP
char *help; /* Help message (long) */
#endif
#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;
//定义section属性的结构体。编译的时候会单独生成一个名为.u_boot_cmd的section段。
#define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
//这个宏定义一个命令结构体变量。并用name,maxargs,rep,cmd,usage,help初始化各个域。
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \

