~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/lib/lzo/lzodefs.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  *  lzodefs.h -- architecture, OS and compiler specific defines
  4  *
  5  *  Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <markus@oberhumer.com>
  6  *
  7  *  The full LZO package can be found at:
  8  *  http://www.oberhumer.com/opensource/lzo/
  9  *
 10  *  Changed for Linux kernel use by:
 11  *  Nitin Gupta <nitingupta910@gmail.com>
 12  *  Richard Purdie <rpurdie@openedhand.com>
 13  */
 14 
 15 
 16 /* Version
 17  * 0: original lzo version
 18  * 1: lzo with support for RLE
 19  */
 20 #define LZO_VERSION 1
 21 
 22 #define COPY4(dst, src) \
 23                 put_unaligned(get_unaligned((const u32 *)(src)), (u32 *)(dst))
 24 #if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
 25 #define COPY8(dst, src) \
 26                 put_unaligned(get_unaligned((const u64 *)(src)), (u64 *)(dst))
 27 #else
 28 #define COPY8(dst, src) \
 29                 COPY4(dst, src); COPY4((dst) + 4, (src) + 4)
 30 #endif
 31 
 32 #if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
 33 #error "conflicting endian definitions"
 34 #elif defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
 35 #define LZO_USE_CTZ64   1
 36 #define LZO_USE_CTZ32   1
 37 #define LZO_FAST_64BIT_MEMORY_ACCESS
 38 #elif defined(CONFIG_X86) || defined(CONFIG_PPC)
 39 #define LZO_USE_CTZ32   1
 40 #elif defined(CONFIG_ARM) && (__LINUX_ARM_ARCH__ >= 5)
 41 #define LZO_USE_CTZ32   1
 42 #endif
 43 
 44 #define M1_MAX_OFFSET   0x0400
 45 #define M2_MAX_OFFSET   0x0800
 46 #define M3_MAX_OFFSET   0x4000
 47 #define M4_MAX_OFFSET_V0        0xbfff
 48 #define M4_MAX_OFFSET_V1        0xbffe
 49 
 50 #define M1_MIN_LEN      2
 51 #define M1_MAX_LEN      2
 52 #define M2_MIN_LEN      3
 53 #define M2_MAX_LEN      8
 54 #define M3_MIN_LEN      3
 55 #define M3_MAX_LEN      33
 56 #define M4_MIN_LEN      3
 57 #define M4_MAX_LEN      9
 58 
 59 #define M1_MARKER       0
 60 #define M2_MARKER       64
 61 #define M3_MARKER       32
 62 #define M4_MARKER       16
 63 
 64 #define MIN_ZERO_RUN_LENGTH     4
 65 #define MAX_ZERO_RUN_LENGTH     (2047 + MIN_ZERO_RUN_LENGTH)
 66 
 67 #define lzo_dict_t      unsigned short
 68 #define D_BITS          13
 69 #define D_SIZE          (1u << D_BITS)
 70 #define D_MASK          (D_SIZE - 1)
 71 #define D_HIGH          ((D_MASK >> 1) + 1)
 72 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php