]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - lib/lzo/lzodefs.h
2 * lzodefs.h -- architecture, OS and compiler specific defines
4 * Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com>
6 * The full LZO package can be found at:
7 * http://www.oberhumer.com/opensource/lzo/
9 * Changed for Linux kernel use by:
10 * Nitin Gupta <nitingupta910@gmail.com>
11 * Richard Purdie <rpurdie@openedhand.com>
15 #define COPY4(dst, src) \
16 put_unaligned(get_unaligned((const u32 *)(src)), (u32 *)(dst))
17 #if defined(__x86_64__)
18 #define COPY8(dst, src) \
19 put_unaligned(get_unaligned((const u64 *)(src)), (u64 *)(dst))
21 #define COPY8(dst, src) \
22 COPY4(dst, src); COPY4((dst) + 4, (src) + 4)
25 #if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
26 #error "conflicting endian definitions"
27 #elif defined(__x86_64__)
28 #define LZO_USE_CTZ64 1
29 #define LZO_USE_CTZ32 1
30 #elif defined(__i386__) || defined(__powerpc__)
31 #define LZO_USE_CTZ32 1
32 #elif defined(__arm__) && (__LINUX_ARM_ARCH__ >= 5)
33 #define LZO_USE_CTZ32 1
36 #define M1_MAX_OFFSET 0x0400
37 #define M2_MAX_OFFSET 0x0800
38 #define M3_MAX_OFFSET 0x4000
39 #define M4_MAX_OFFSET 0xbfff
55 #define lzo_dict_t unsigned short
57 #define D_SIZE (1u << D_BITS)
58 #define D_MASK (D_SIZE - 1)
59 #define D_HIGH ((D_MASK >> 1) + 1)