All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Liu <net147@gmail.com>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Jonathan Liu <net147@gmail.com>
Subject: [PATCH] sandbox: enable support for the unlz4 command
Date: Sat, 25 May 2024 18:10:53 +1000	[thread overview]
Message-ID: <20240525081053.2818481-1-net147@gmail.com> (raw)

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(-)

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;
-- 
2.44.0


             reply	other threads:[~2024-05-25  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-25  8:10 Jonathan Liu [this message]
2024-05-29 16:29 ` [PATCH] sandbox: enable support for the unlz4 command Simon Glass
2024-07-15 13:31   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240525081053.2818481-1-net147@gmail.com \
    --to=net147@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.