diff mbox series

sandbox: enable support for the unlz4 command

Message ID 20240525081053.2818481-1-net147@gmail.com
State New
Delegated to: Simon Glass
Headers show
Series sandbox: enable support for the unlz4 command | expand

Commit Message

Jonathan Liu May 25, 2024, 8:10 a.m. UTC
This does not work with sandbox at present. Fix it up to use map_sysmem()
to convert an address to a pointer.

Signed-off-by: Jonathan Liu <net147@gmail.com>
---
 cmd/unlz4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass May 29, 2024, 4:29 p.m. UTC | #1
On Sat, 25 May 2024 at 02:11, Jonathan Liu <net147@gmail.com> wrote:
>
> This does not work with sandbox at present. Fix it up to use map_sysmem()
> to convert an address to a pointer.
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
> ---
>  cmd/unlz4.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/cmd/unlz4.c b/cmd/unlz4.c
index 5f20838e899..4b66794a72c 100644
--- a/cmd/unlz4.c
+++ b/cmd/unlz4.c
@@ -7,6 +7,7 @@ 
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <mapmem.h>
 #include <u-boot/lz4.h>
 
 static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc,
@@ -26,7 +27,7 @@  static int do_unlz4(struct cmd_tbl *cmdtp, int flag, int argc,
 		return CMD_RET_USAGE;
 	}
 
-	ret = ulz4fn((void *)src, src_len, (void *)dst, &dst_len);
+	ret = ulz4fn(map_sysmem(src, 0), src_len, map_sysmem(dst, dst_len), &dst_len);
 	if (ret) {
 		printf("Uncompressed err :%d\n", ret);
 		return 1;