Advertisement

在uboot中添加新命令

阅读量:

一、命令的具体定义

每一个指令的设定均依赖于U_BOOT_CMD宏,该宏用于构建一个对应的cmd_tbl_s结构体,其定义位于uboot/include/command.h文件中。

具体示例如下:

复制代码
    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)	*/
    #ifdef	CONFIG_SYS_LONGHELP
    	char		*help;		/* Help  message	(long)	*/
    #endif
    #ifdef CONFIG_AUTO_COMPLETE
    	/* do auto completion on the arguments */
    	int		(*c

全部评论 (0)

还没有任何评论哟~