linux/lib/decompress_unlzo.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * LZO decompressor for the Linux kernel. Code borrowed from the lzo
 * implementation by Markus Franz Xaver Johannes Oberhumer.
 *
 * Linux kernel adaptation:
 * Copyright (C) 2009
 * Albin Tonnerre, Free Electrons <[email protected]>
 *
 * Original code:
 * Copyright (C) 1996-2005 Markus Franz Xaver Johannes Oberhumer
 * All Rights Reserved.
 *
 * Markus F.X.J. Oberhumer
 * <[email protected]>
 * http://www.oberhumer.com/opensource/lzop/
 */

#ifdef STATIC
#define PREBOOT
#include "lzo/lzo1x_decompress_safe.c"
#else
#include <linux/decompress/unlzo.h>
#endif

#include <linux/types.h>
#include <linux/lzo.h>
#include <linux/decompress/mm.h>

#include <linux/compiler.h>
#include <asm/unaligned.h>

static const unsigned char lzop_magic[] =;

#define LZO_BLOCK_SIZE
#define HEADER_HAS_FILTER
#define HEADER_SIZE_MIN
#define HEADER_SIZE_MAX

STATIC inline long INIT parse_header(u8 *input, long *skip, long in_len)
{}

STATIC int INIT unlzo(u8 *input, long in_len,
				long (*fill)(void *, unsigned long),
				long (*flush)(void *, unsigned long),
				u8 *output, long *posp,
				void (*error) (char *x))
{}

#ifdef PREBOOT
STATIC int INIT __decompress(unsigned char *buf, long len,
			   long (*fill)(void*, unsigned long),
			   long (*flush)(void*, unsigned long),
			   unsigned char *out_buf, long olen,
			   long *pos,
			   void (*error)(char *x))
{
	return unlzo(buf, len, fill, flush, out_buf, pos, error);
}
#endif