* [U-Boot-Users] [PATCH] Adds a bunzip2 command in common/cmd_bzip2.c
@ 2007-07-03 16:30 eran.liberty at gmail.com
2007-07-03 17:26 ` Grant Likely
0 siblings, 1 reply; 2+ messages in thread
From: eran.liberty at gmail.com @ 2007-07-03 16:30 UTC (permalink / raw)
To: u-boot
Adds a bunzip2 <src addr> <dst addr> <size>
to uncompress buffer in memory
Signed-off-by: Eran Liberty <eran.liberty@gmail.com>
Index: common/cmd_bzip2.c
===================================================================
--- common/cmd_bzip2.c (.../tags/trunk/20070620_2_merge_to_exsw6000) (revision 0)
+++ common/cmd_bzip2.c (.../branches/exsw6000) (revision 69)
@@ -0,0 +1,66 @@
+/*
+ * (C) Copyright 2007
+ * Liberty Eran, Extricom, eran.liberty at gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <command.h>
+#include <bzlib.h>
+
+#if defined(CONFIG_BZIP2)
+int do_bunzip2 (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+ ulong addr, dest, count;
+ unsigned int destSize;
+ int rc;
+
+ if (argc != 4) {
+ printf ("Usage:\n%s\n", cmdtp->usage);
+ return 1;
+ }
+
+ /* Check for size specification.
+ */
+ addr = simple_strtoul (argv[1], NULL, 16);
+ dest = simple_strtoul (argv[2], NULL, 16);
+ count = simple_strtoul (argv[3], NULL, 16);
+
+ if (count == 0) {
+ puts ("BUNZIP2 ERROR: Zero length ???\n");
+ return 1;
+ }
+
+ if ((rc =
+ BZ2_bzBuffToBuffDecompress ((char *)dest, &destSize, (char *)addr,
+ count, 1, 0)) != BZ_OK) {
+ printf ("BUNZIP2 ERROR: %d\n", rc);
+ return 1;
+ }
+ printf
+ ("BUNZIP2: decompressed image address & size: 0x%08x 0x%x (%d)\n",
+ dest, destSize, destSize);
+ return 0;
+
+}
+
+U_BOOT_CMD (bunzip2, 4, 4, do_bunzip2,
+ "bunzip2 - decompress bz2 buffers\n", "src dest size_of_src\n");
+#endif
Index: common/Makefile
===================================================================
--- common/Makefile (.../tags/trunk/20070620_2_merge_to_exsw6000) (revision 69)
+++ common/Makefile (.../branches/exsw6000) (revision 69)
@@ -39,7 +40,7 @@
cmd_nand.o cmd_net.o cmd_nvedit.o \
cmd_pci.o cmd_pcmcia.o cmd_portio.o \
cmd_reginfo.o cmd_reiser.o cmd_scsi.o cmd_spi.o cmd_universe.o \
- cmd_usb.o cmd_vfd.o \
+ cmd_usb.o cmd_vfd.o cmd_bzip2.o \
command.o console.o cyclon2.o devices.o dlmalloc.o docecc.o \
environment.o env_common.o \
env_nand.o env_dataflash.o env_flash.o env_eeprom.o \
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot-Users] [PATCH] Adds a bunzip2 command in common/cmd_bzip2.c
2007-07-03 16:30 [U-Boot-Users] [PATCH] Adds a bunzip2 command in common/cmd_bzip2.c eran.liberty at gmail.com
@ 2007-07-03 17:26 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2007-07-03 17:26 UTC (permalink / raw)
To: u-boot
On 7/3/07, eran.liberty at gmail.com <eran.liberty@gmail.com> wrote:
> Adds a bunzip2 <src addr> <dst addr> <size>
> to uncompress buffer in memory
>
> Signed-off-by: Eran Liberty <eran.liberty@gmail.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-03 17:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 16:30 [U-Boot-Users] [PATCH] Adds a bunzip2 command in common/cmd_bzip2.c eran.liberty at gmail.com
2007-07-03 17:26 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox