lzo: Allow for static inlining
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
0742542f87
commit
644800f593
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue