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

TOMOYO Linux Cross Reference
Linux/lib/zstd/common/zstd_deps.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 ] ~

Diff markup

Differences between /lib/zstd/common/zstd_deps.h (Architecture alpha) and /lib/zstd/common/zstd_deps.h (Architecture ppc)


  1 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-      1 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
  2 /*                                                  2 /*
  3  * Copyright (c) Facebook, Inc.                     3  * Copyright (c) Facebook, Inc.
  4  * All rights reserved.                             4  * All rights reserved.
  5  *                                                  5  *
  6  * This source code is licensed under both the      6  * This source code is licensed under both the BSD-style license (found in the
  7  * LICENSE file in the root directory of this       7  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
  8  * in the COPYING file in the root directory o      8  * in the COPYING file in the root directory of this source tree).
  9  * You may select, at your option, one of the       9  * You may select, at your option, one of the above-listed licenses.
 10  */                                                10  */
 11                                                    11 
 12 /*                                                 12 /*
 13  * This file provides common libc dependencies     13  * This file provides common libc dependencies that zstd requires.
 14  * The purpose is to allow replacing this file     14  * The purpose is to allow replacing this file with a custom implementation
 15  * to compile zstd without libc support.           15  * to compile zstd without libc support.
 16  */                                                16  */
 17                                                    17 
 18 /* Need:                                           18 /* Need:
 19  * NULL                                            19  * NULL
 20  * INT_MAX                                         20  * INT_MAX
 21  * UINT_MAX                                        21  * UINT_MAX
 22  * ZSTD_memcpy()                                   22  * ZSTD_memcpy()
 23  * ZSTD_memset()                                   23  * ZSTD_memset()
 24  * ZSTD_memmove()                                  24  * ZSTD_memmove()
 25  */                                                25  */
 26 #ifndef ZSTD_DEPS_COMMON                           26 #ifndef ZSTD_DEPS_COMMON
 27 #define ZSTD_DEPS_COMMON                           27 #define ZSTD_DEPS_COMMON
 28                                                    28 
 29 #include <linux/limits.h>                          29 #include <linux/limits.h>
 30 #include <linux/stddef.h>                          30 #include <linux/stddef.h>
 31                                                    31 
 32 #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d     32 #define ZSTD_memcpy(d,s,n) __builtin_memcpy((d),(s),(n))
 33 #define ZSTD_memmove(d,s,n) __builtin_memmove(     33 #define ZSTD_memmove(d,s,n) __builtin_memmove((d),(s),(n))
 34 #define ZSTD_memset(d,s,n) __builtin_memset((d     34 #define ZSTD_memset(d,s,n) __builtin_memset((d),(s),(n))
 35                                                    35 
 36 #endif /* ZSTD_DEPS_COMMON */                      36 #endif /* ZSTD_DEPS_COMMON */
 37                                                    37 
 38 /*                                                 38 /*
 39  * Define malloc as always failing. That means     39  * Define malloc as always failing. That means the user must
 40  * either use ZSTD_customMem or statically all     40  * either use ZSTD_customMem or statically allocate memory.
 41  * Need:                                           41  * Need:
 42  * ZSTD_malloc()                                   42  * ZSTD_malloc()
 43  * ZSTD_free()                                     43  * ZSTD_free()
 44  * ZSTD_calloc()                                   44  * ZSTD_calloc()
 45  */                                                45  */
 46 #ifdef ZSTD_DEPS_NEED_MALLOC                       46 #ifdef ZSTD_DEPS_NEED_MALLOC
 47 #ifndef ZSTD_DEPS_MALLOC                           47 #ifndef ZSTD_DEPS_MALLOC
 48 #define ZSTD_DEPS_MALLOC                           48 #define ZSTD_DEPS_MALLOC
 49                                                    49 
 50 #define ZSTD_malloc(s) ({ (void)(s); NULL; })      50 #define ZSTD_malloc(s) ({ (void)(s); NULL; })
 51 #define ZSTD_free(p) ((void)(p))                   51 #define ZSTD_free(p) ((void)(p))
 52 #define ZSTD_calloc(n,s) ({ (void)(n); (void)(     52 #define ZSTD_calloc(n,s) ({ (void)(n); (void)(s); NULL; })
 53                                                    53 
 54 #endif /* ZSTD_DEPS_MALLOC */                      54 #endif /* ZSTD_DEPS_MALLOC */
 55 #endif /* ZSTD_DEPS_NEED_MALLOC */                 55 #endif /* ZSTD_DEPS_NEED_MALLOC */
 56                                                    56 
 57 /*                                                 57 /*
 58  * Provides 64-bit math support.                   58  * Provides 64-bit math support.
 59  * Need:                                           59  * Need:
 60  * U64 ZSTD_div64(U64 dividend, U32 divisor)       60  * U64 ZSTD_div64(U64 dividend, U32 divisor)
 61  */                                                61  */
 62 #ifdef ZSTD_DEPS_NEED_MATH64                       62 #ifdef ZSTD_DEPS_NEED_MATH64
 63 #ifndef ZSTD_DEPS_MATH64                           63 #ifndef ZSTD_DEPS_MATH64
 64 #define ZSTD_DEPS_MATH64                           64 #define ZSTD_DEPS_MATH64
 65                                                    65 
 66 #include <linux/math64.h>                          66 #include <linux/math64.h>
 67                                                    67 
 68 static uint64_t ZSTD_div64(uint64_t dividend,      68 static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) {
 69   return div_u64(dividend, divisor);               69   return div_u64(dividend, divisor);
 70 }                                                  70 }
 71                                                    71 
 72 #endif /* ZSTD_DEPS_MATH64 */                      72 #endif /* ZSTD_DEPS_MATH64 */
 73 #endif /* ZSTD_DEPS_NEED_MATH64 */                 73 #endif /* ZSTD_DEPS_NEED_MATH64 */
 74                                                    74 
 75 /*                                                 75 /*
 76  * This is only requested when DEBUGLEVEL >= 1     76  * This is only requested when DEBUGLEVEL >= 1, meaning
 77  * it is disabled in production.                   77  * it is disabled in production.
 78  * Need:                                           78  * Need:
 79  * assert()                                        79  * assert()
 80  */                                                80  */
 81 #ifdef ZSTD_DEPS_NEED_ASSERT                       81 #ifdef ZSTD_DEPS_NEED_ASSERT
 82 #ifndef ZSTD_DEPS_ASSERT                           82 #ifndef ZSTD_DEPS_ASSERT
 83 #define ZSTD_DEPS_ASSERT                           83 #define ZSTD_DEPS_ASSERT
 84                                                    84 
 85 #include <linux/kernel.h>                          85 #include <linux/kernel.h>
 86                                                    86 
 87 #define assert(x) WARN_ON(!(x))                    87 #define assert(x) WARN_ON(!(x))
 88                                                    88 
 89 #endif /* ZSTD_DEPS_ASSERT */                      89 #endif /* ZSTD_DEPS_ASSERT */
 90 #endif /* ZSTD_DEPS_NEED_ASSERT */                 90 #endif /* ZSTD_DEPS_NEED_ASSERT */
 91                                                    91 
 92 /*                                                 92 /*
 93  * This is only requested when DEBUGLEVEL >= 2     93  * This is only requested when DEBUGLEVEL >= 2, meaning
 94  * it is disabled in production.                   94  * it is disabled in production.
 95  * Need:                                           95  * Need:
 96  * ZSTD_DEBUG_PRINT()                              96  * ZSTD_DEBUG_PRINT()
 97  */                                                97  */
 98 #ifdef ZSTD_DEPS_NEED_IO                           98 #ifdef ZSTD_DEPS_NEED_IO
 99 #ifndef ZSTD_DEPS_IO                               99 #ifndef ZSTD_DEPS_IO
100 #define ZSTD_DEPS_IO                              100 #define ZSTD_DEPS_IO
101                                                   101 
102 #include <linux/printk.h>                         102 #include <linux/printk.h>
103                                                   103 
104 #define ZSTD_DEBUG_PRINT(...) pr_debug(__VA_AR    104 #define ZSTD_DEBUG_PRINT(...) pr_debug(__VA_ARGS__)
105                                                   105 
106 #endif /* ZSTD_DEPS_IO */                         106 #endif /* ZSTD_DEPS_IO */
107 #endif /* ZSTD_DEPS_NEED_IO */                    107 #endif /* ZSTD_DEPS_NEED_IO */
108                                                   108 

~ [ 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