From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/9] lzo: Allow for static inlining
Date: Thu, 19 Jul 2012 10:12:54 +0200 [thread overview]
Message-ID: <1342685582-13244-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1342685582-13244-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
include/lzo.h | 8 ++++++--
lib/decompress_unlzo.c | 9 +++++++--
lib/lzo/lzo1x_decompress.c | 2 +-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/include/lzo.h b/include/lzo.h
index 0530a68..ceacfba 100644
--- a/include/lzo.h
+++ b/include/lzo.h
@@ -19,12 +19,16 @@
#define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3)
+#ifndef STATIC
+#define STATIC
+#endif
+
/* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */
int lzo1x_1_compress(const unsigned char *src, size_t src_len,
unsigned char *dst, size_t *dst_len, void *wrkmem);
/* safe decompression with overrun testing */
-int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
+STATIC int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
unsigned char *dst, size_t *dst_len);
/*
@@ -41,7 +45,7 @@ int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
#define LZO_E_INPUT_NOT_CONSUMED (-8)
#define LZO_E_NOT_YET_IMPLEMENTED (-9)
-int decompress_unlzo(u8 *input, int in_len,
+STATIC int decompress_unlzo(u8 *input, int in_len,
int (*fill) (void *, unsigned int),
int (*flush) (void *, unsigned int),
u8 *output, int *posp,
diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
index 000bd70..0e6a7ad 100644
--- a/lib/decompress_unlzo.c
+++ b/lib/decompress_unlzo.c
@@ -33,11 +33,16 @@
#include <common.h>
#include <malloc.h>
#include <linux/types.h>
-#include <lzo.h>
#include <errno.h>
#include <fs.h>
#include <xfuncs.h>
+#ifdef STATIC
+#include "lzo/lzo1x_decompress.c"
+#endif
+
+#include <lzo.h>
+
#include <linux/compiler.h>
#include <asm/unaligned.h>
@@ -106,7 +111,7 @@ static inline int parse_header(u8 *input, int *skip, int in_len)
return 1;
}
-int decompress_unlzo(u8 *input, int in_len,
+STATIC int decompress_unlzo(u8 *input, int in_len,
int (*fill) (void *, unsigned int),
int (*flush) (void *, unsigned int),
u8 *output, int *posp,
diff --git a/lib/lzo/lzo1x_decompress.c b/lib/lzo/lzo1x_decompress.c
index af94382..7f1451f 100644
--- a/lib/lzo/lzo1x_decompress.c
+++ b/lib/lzo/lzo1x_decompress.c
@@ -23,7 +23,7 @@
#define COPY4(dst, src) \
put_unaligned(get_unaligned((const u32 *)(src)), (u32 *)(dst))
-int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
+STATIC int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
unsigned char *out, size_t *out_len)
{
const unsigned char * const ip_end = in + in_len;
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-07-19 8:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 8:12 Compressed barebox image support Sascha Hauer
2012-07-19 8:12 ` Sascha Hauer [this message]
2012-07-19 8:12 ` [PATCH 2/9] ARM lds: remove unused got Sascha Hauer
2012-07-19 8:12 ` [PATCH 3/9] ARM: remove board linker script option Sascha Hauer
2012-07-19 8:12 ` [PATCH 4/9] ARM: remove exception vectors from boards Sascha Hauer
2012-07-19 8:12 ` [PATCH 5/9] ARM startup: calculate offset instead of runtime address Sascha Hauer
2012-07-19 8:12 ` [PATCH 6/9] ARM ep93xx: Get rid of special handling in linker file Sascha Hauer
2012-07-19 8:13 ` [PATCH 7/9] ARM boards: Use _text rather than TEXT_BASE Sascha Hauer
2012-07-19 8:13 ` [PATCH 8/9] ARM: Separate assembler functions into their own section Sascha Hauer
2012-07-19 10:38 ` Marc Kleine-Budde
2012-07-19 14:04 ` Jean-Christophe PLAGNIOL-VILLARD
2012-07-19 14:08 ` Sascha Hauer
2012-07-19 20:45 ` Sascha Hauer
2012-07-20 16:20 ` Johannes Stezenbach
2012-07-23 20:00 ` Sascha Hauer
2012-07-23 19:59 ` Sascha Hauer
2012-07-19 8:13 ` [PATCH 9/9] Add compressed image support Sascha Hauer
2012-07-19 14:10 ` Jean-Christophe PLAGNIOL-VILLARD
2012-07-19 17:08 ` Johannes Stezenbach
2012-07-19 17:41 ` Sascha Hauer
2012-07-19 18:32 ` Johannes Stezenbach
2012-07-19 20:42 ` Sascha Hauer
2012-07-20 15:01 ` Johannes Stezenbach
2012-07-20 15:24 ` Jean-Christophe PLAGNIOL-VILLARD
2012-07-19 15:08 ` Compressed barebox " Jean-Christophe PLAGNIOL-VILLARD
2012-07-19 16:05 ` Sascha Hauer
2012-07-19 20:11 ` Robert Jarzmik
2012-07-20 7:59 ` Sascha Hauer
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=1342685582-13244-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox