FreeBSD kernel CXGBE device code
fastlz.c File Reference
#include <sys/cdefs.h>
#include "osdep.h"
#include "fastlz.h"
#include "fastlz.c"
Include dependency graph for fastlz.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FASTLZ_SAFE
 
#define FASTLZ_EXPECT_CONDITIONAL(c)   (c)
 
#define FASTLZ_UNEXPECT_CONDITIONAL(c)   (c)
 
#define FASTLZ_INLINE
 
#define FASTLZ_STRICT_ALIGN
 
#define MAX_COPY   32
 
#define MAX_LEN   264 /* 256 + 8 */
 
#define MAX_DISTANCE   8192
 
#define FASTLZ_READU16(p)   ((p)[0] | (p)[1]<<8)
 
#define HASH_LOG   13
 
#define HASH_SIZE   (1 << HASH_LOG)
 
#define HASH_MASK   (HASH_SIZE - 1)
 
#define HASH_FUNCTION(v, p)
 
#define FASTLZ_LEVEL   1
 
#define FASTLZ_COMPRESSOR   fastlz1_compress
 
#define FASTLZ_DECOMPRESSOR   fastlz1_decompress
 
#define FASTLZ_LEVEL   2
 
#define MAX_DISTANCE   8191
 
#define MAX_FARDISTANCE   (65535 + MAX_DISTANCE - 1)
 
#define FASTLZ_COMPRESSOR   fastlz2_compress
 
#define FASTLZ_DECOMPRESSOR   fastlz2_decompress
 

Functions

 __FBSDID ("$FreeBSD$")
 
static FASTLZ_INLINE int FASTLZ_COMPRESSOR (const void *input, int length, void *output)
 
static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR (const void *input, int length, void *output, int maxout)
 
int fastlz_compress (const void *input, int length, void *output)
 
int fastlz_decompress (const void *input, int length, void *output, int maxout)
 
int fastlz_compress_level (int level, const void *input, int length, void *output)
 

Macro Definition Documentation

◆ FASTLZ_COMPRESSOR [1/2]

#define FASTLZ_COMPRESSOR   fastlz1_compress

Definition at line 137 of file fastlz.c.

◆ FASTLZ_COMPRESSOR [2/2]

#define FASTLZ_COMPRESSOR   fastlz2_compress

Definition at line 137 of file fastlz.c.

◆ FASTLZ_DECOMPRESSOR [1/2]

#define FASTLZ_DECOMPRESSOR   fastlz1_decompress

Definition at line 138 of file fastlz.c.

◆ FASTLZ_DECOMPRESSOR [2/2]

#define FASTLZ_DECOMPRESSOR   fastlz2_decompress

Definition at line 138 of file fastlz.c.

◆ FASTLZ_EXPECT_CONDITIONAL

#define FASTLZ_EXPECT_CONDITIONAL (   c)    (c)

Definition at line 55 of file fastlz.c.

◆ FASTLZ_INLINE

#define FASTLZ_INLINE

Definition at line 68 of file fastlz.c.

◆ FASTLZ_LEVEL [1/2]

#define FASTLZ_LEVEL   1

Definition at line 129 of file fastlz.c.

◆ FASTLZ_LEVEL [2/2]

#define FASTLZ_LEVEL   2

Definition at line 129 of file fastlz.c.

◆ FASTLZ_READU16

#define FASTLZ_READU16 (   p)    ((p)[0] | (p)[1]<<8)

Definition at line 102 of file fastlz.c.

◆ FASTLZ_SAFE

#define FASTLZ_SAFE

Definition at line 38 of file fastlz.c.

◆ FASTLZ_STRICT_ALIGN

#define FASTLZ_STRICT_ALIGN

Definition at line 75 of file fastlz.c.

◆ FASTLZ_UNEXPECT_CONDITIONAL

#define FASTLZ_UNEXPECT_CONDITIONAL (   c)    (c)

Definition at line 56 of file fastlz.c.

◆ HASH_FUNCTION

#define HASH_FUNCTION (   v,
 
)
Value:
{\
v = FASTLZ_READU16(p);\
v ^= FASTLZ_READU16(p + 1)^\
(v>>(16 - HASH_LOG));\
v &= HASH_MASK;\
}
#define HASH_MASK
Definition: fastlz.c:107
#define HASH_LOG
Definition: fastlz.c:105
#define FASTLZ_READU16(p)
Definition: fastlz.c:102

Definition at line 108 of file fastlz.c.

◆ HASH_LOG

#define HASH_LOG   13

Definition at line 105 of file fastlz.c.

◆ HASH_MASK

#define HASH_MASK   (HASH_SIZE - 1)

Definition at line 107 of file fastlz.c.

◆ HASH_SIZE

#define HASH_SIZE   (1 << HASH_LOG)

Definition at line 106 of file fastlz.c.

◆ MAX_COPY

#define MAX_COPY   32

Definition at line 95 of file fastlz.c.

◆ MAX_DISTANCE [1/2]

#define MAX_DISTANCE   8192

Definition at line 132 of file fastlz.c.

◆ MAX_DISTANCE [2/2]

#define MAX_DISTANCE   8191

Definition at line 132 of file fastlz.c.

◆ MAX_FARDISTANCE

#define MAX_FARDISTANCE   (65535 + MAX_DISTANCE - 1)

Definition at line 133 of file fastlz.c.

◆ MAX_LEN

#define MAX_LEN   264 /* 256 + 8 */

Definition at line 96 of file fastlz.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ fastlz_compress()

int fastlz_compress ( const void *  input,
int  length,
void *  output 
)

Definition at line 145 of file fastlz.c.

◆ fastlz_compress_level()

int fastlz_compress_level ( int  level,
const void *  input,
int  length,
void *  output 
)

Definition at line 169 of file fastlz.c.

Referenced by compress_buff().

Here is the caller graph for this function:

◆ FASTLZ_COMPRESSOR()

static FASTLZ_INLINE int FASTLZ_COMPRESSOR ( const void *  input,
int  length,
void *  output 
)
static

◆ fastlz_decompress()

int fastlz_decompress ( const void *  input,
int  length,
void *  output,
int  maxout 
)

Definition at line 155 of file fastlz.c.

Referenced by decompress_buffer().

Here is the caller graph for this function:

◆ FASTLZ_DECOMPRESSOR()

static FASTLZ_INLINE int FASTLZ_DECOMPRESSOR ( const void *  input,
int  length,
void *  output,
int  maxout 
)
static