]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: enable support for the unlz4 command
authorJonathan Liu <net147@gmail.com>
Sat, 25 May 2024 08:10:53 +0000 (18:10 +1000)
committerSimon Glass <sjg@chromium.org>
Wed, 3 Jul 2024 06:36:32 +0000 (07:36 +0100)
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Fix conflict and reformat to 80cols:
Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/unlz4.c

index fc5200117adc0261b4723c59598c33e9bacf6a09..2eadc753e6c40ab788cf6445c1513360058ba881 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <command.h>
 #include <env.h>
+#include <mapmem.h>
 #include <vsprintf.h>
 #include <u-boot/lz4.h>
 
@@ -26,7 +27,8 @@ 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;