[U-Boot] [PATCH v1 1/1] cmd: adding malloc, math, and strcmp commands to u-boot

Tom Rini trini at konsulko.com
Tue Nov 19 20:37:33 UTC 2019


On Mon, Nov 18, 2019 at 04:26:30PM -0800, Vladimir Olovyannikov wrote:

> cmd: adding malloc, math, and strcmp u-boot commands.
> - malloc  supports allocation of heap memory and free allocated memory
>           via u-boot command line.

Can you expand on how this is used in a script?  I'm not sure I see that
exactly.  Also:

> +config CMD_MALLOC
> +	bool "malloc"
> +	default y
> +	help
> +	  Supports allocation of heap memory and free allocated memory commands.
> +	  These commands are used by u-boot scripts.
> +
> +config CMD_MATH
> +	bool "math"
> +	default y
> +	help
> +	  Provides math commands such as add, sub, mul, div, shift,
> +	  convert decimal to hex functionalities to be available in the script.

First, why do we need this, rather than using setexpr ?

> +
>  config CMD_SOURCE
>  	bool "source"
>  	default y
> @@ -1301,6 +1315,13 @@ config CMD_SETEXPR
>  	  Also supports loading the value at a memory location into a variable.
>  	  If CONFIG_REGEX is enabled, setexpr also supports a gsub function.
>  
> +config CMD_STRCMP
> +	bool "strcmp"
> +	default y
> +	help
> +	  Provides string compare command feature to u-boot scripts.

Second, new commands must not default to y, but they should be enabled
on sandbox and new test.py tests added for them.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/a7f5af39/attachment.sig>


More information about the U-Boot mailing list