Skip to contentSkip to conversation

Add LZO decompressor support

PATCH New Stefan Roese 1 participant 1 message Feb 26, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 Add LZO decompressor support

This patch adds LZO decompression support to U-Boot. It is needed for the upcoming UBIFS support, since UBIFS uses LZO as default compressor/ decompressor. Since we only support read-only in UBIFS only the decompressor is needed.

All this is copied with minor changes from the current Linux kernel version (2.6.28-rc8).

This patch only implements this LZO decompressor support for PPC. Other platforms using UBIFS will have to add the required "include/asm/unaligned.h" as well. It should be fairly easy to copy this from the Linux source tree as I have done it for PPC in this patch.

---
 Makefile                            |    1 +
 include/asm-ppc/unaligned.h         |   16 +++
 include/linux/lzo.h                 |   44 ++++++
 include/linux/unaligned/access_ok.h |   66 ++++++++++
 include/linux/unaligned/generic.h   |   71 ++++++++++
 lib_generic/lzo/Makefile            |   46 +++++++
 lib_generic/lzo/lzo1x_decompress.c  |  245 +++++++++++++++++++++++++++++++++++
 lib_generic/lzo/lzodefs.h           |   43 ++++++
 8 files changed, 532 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-ppc/unaligned.h
 create mode 100644 include/linux/lzo.h
 create mode 100644 include/linux/unaligned/access_ok.h
 create mode 100644 include/linux/unaligned/generic.h
 create mode 100644 lib_generic/lzo/Makefile
 create mode 100644 lib_generic/lzo/lzo1x_decompress.c
 create mode 100644 lib_generic/lzo/lzodefs.h
Makefile +1 -0
index e8b4c13..0f018d4 100644
@@ -210,6 +210,7 @@ OBJS := $(addprefix $(obj),$(OBJS))
 
 LIBS  = lib_generic/libgeneric.a
 LIBS += lib_generic/lzma/liblzma.a
+LIBS += lib_generic/lzo/liblzo.a
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
 	"board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
 LIBS += cpu/$(CPU)/lib$(CPU).a
include/asm-ppc/unaligned.h new file +16 -0
new file mode 100644
index 0000000..5f1b1e3
@@ -0,0 +1,16 @@
+#ifndef _ASM_POWERPC_UNALIGNED_H
+#define _ASM_POWERPC_UNALIGNED_H
+
+#ifdef __KERNEL__
+
+/*
+ * The PowerPC can do unaligned accesses itself in big endian mode.
+ */
+#include <linux/unaligned/access_ok.h>
+#include <linux/unaligned/generic.h>
+
+#define get_unaligned	__get_unaligned_be
+#define put_unaligned	__put_unaligned_be
+
+#endif	/* __KERNEL__ */
+#endif	/* _ASM_POWERPC_UNALIGNED_H */
include/linux/lzo.h new file +44 -0

44 lines not on this page · raw message

include/linux/unaligned/access_ok.h new file +66 -0

66 lines not on this page · raw message

include/linux/unaligned/generic.h new file +71 -0

71 lines not on this page · raw message

lib_generic/lzo/Makefile new file +46 -0

46 lines not on this page · raw message

lib_generic/lzo/lzo1x_decompress.c new file +245 -0

245 lines not on this page · raw message

lib_generic/lzo/lzodefs.h new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
1.6.1.3