U-Boot DM(一):CMDLINE宏

一:U_BOOT_CMD

U_BOOT_CMD(
	demo,   4,      1,      do_demo,
	"Driver model (dm) demo operations",
	"list                     List available demo devices\n"
	"demo hello  []     Say hello\n"
	"demo light []            Set or get the lights\n"
	"demo status              Get demo device status\n"
	"demo list                     List available demo devices"
);

U_BOOT_CMD宏展开过程中的一些定义:

#define U_BOOT_CMD(_name, _maxargs, _rep, _cmd, _usage, _help)		\
	U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, NULL)

#define U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, _comp) \
	ll_entry_declare(cmd_tbl_t, _name, cmd) =			\
		U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd,	\
						_usage, _help, _comp);

#define

你可能感兴趣的:(U-Boot,Linux,Device,Drivers,linux)