diff options
Diffstat (limited to 'lib/lzo/lzodefs.h')
-rw-r--r-- | lib/lzo/lzodefs.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/lib/lzo/lzodefs.h b/lib/lzo/lzodefs.h index b6d482c492ef..6710b83ce72e 100644 --- a/lib/lzo/lzodefs.h +++ b/lib/lzo/lzodefs.h | |||
@@ -1,19 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * lzodefs.h -- architecture, OS and compiler specific defines | 2 | * lzodefs.h -- architecture, OS and compiler specific defines |
3 | * | 3 | * |
4 | * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com> | 4 | * Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com> |
5 | * | 5 | * |
6 | * The full LZO package can be found at: | 6 | * The full LZO package can be found at: |
7 | * http://www.oberhumer.com/opensource/lzo/ | 7 | * http://www.oberhumer.com/opensource/lzo/ |
8 | * | 8 | * |
9 | * Changed for kernel use by: | 9 | * Changed for Linux kernel use by: |
10 | * Nitin Gupta <nitingupta910@gmail.com> | 10 | * Nitin Gupta <nitingupta910@gmail.com> |
11 | * Richard Purdie <rpurdie@openedhand.com> | 11 | * Richard Purdie <rpurdie@openedhand.com> |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define LZO_VERSION 0x2020 | 14 | |
15 | #define LZO_VERSION_STRING "2.02" | 15 | #define COPY4(dst, src) \ |
16 | #define LZO_VERSION_DATE "Oct 17 2005" | 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)) | ||
20 | #else | ||
21 | #define COPY8(dst, src) \ | ||
22 | COPY4(dst, src); COPY4((dst) + 4, (src) + 4) | ||
23 | #endif | ||
24 | |||
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 | ||
34 | #endif | ||
17 | 35 | ||
18 | #define M1_MAX_OFFSET 0x0400 | 36 | #define M1_MAX_OFFSET 0x0400 |
19 | #define M2_MAX_OFFSET 0x0800 | 37 | #define M2_MAX_OFFSET 0x0800 |
@@ -34,10 +52,8 @@ | |||
34 | #define M3_MARKER 32 | 52 | #define M3_MARKER 32 |
35 | #define M4_MARKER 16 | 53 | #define M4_MARKER 16 |
36 | 54 | ||
37 | #define D_BITS 14 | 55 | #define lzo_dict_t unsigned short |
38 | #define D_MASK ((1u << D_BITS) - 1) | 56 | #define D_BITS 13 |
57 | #define D_SIZE (1u << D_BITS) | ||
58 | #define D_MASK (D_SIZE - 1) | ||
39 | #define D_HIGH ((D_MASK >> 1) + 1) | 59 | #define D_HIGH ((D_MASK >> 1) + 1) |
40 | |||
41 | #define DX2(p, s1, s2) (((((size_t)((p)[2]) << (s2)) ^ (p)[1]) \ | ||
42 | << (s1)) ^ (p)[0]) | ||
43 | #define DX3(p, s1, s2, s3) ((DX2((p)+1, s2, s3) << (s1)) ^ (p)[0]) | ||