]> git.baikalelectronics.ru Git - uboot.git/commit
setexpr: Add explicit support for 32- and 64-bit ints
authorSimon Glass <sjg@chromium.org>
Sun, 1 Nov 2020 21:15:37 +0000 (14:15 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 1 Dec 2020 15:33:38 +0000 (10:33 -0500)
commitba4602389bf979e5775a7c00898bf6551d122e81
tree491181cd84bae451bafd6215014cbf722745e28f
parent230b834c6c12f66aabcaf3cda5bf1b73ce7f1cfe
setexpr: Add explicit support for 32- and 64-bit ints

At present this function assumes that a size of 4 refers to a ulong. This
is true on 32-bit machines but not commonly on 64-bit machines.

This means that the 'l' specify does not work correctly with setexpr.

Add an explicit case for 32-bit values so that 64-bit machines can still
use the 'l' specifier. On 32-bit machines, 64-bit is still not supported.

This corrects the operation of the default size (which is 4 for setexpr),
so update the tests accordingly.

The original code for reading from memory was included in 47ab5ad1457
("cmd_setexpr: allow memory addresses in expressions") but I am not adding
a Fixes: tag since that code was not written with 64-bit machines in mind.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/setexpr.c
test/cmd/setexpr.c