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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/string.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 #ifndef _ASM_POWERPC_STRING_H
  3 #define _ASM_POWERPC_STRING_H
  4 
  5 #ifdef __KERNEL__
  6 
  7 #ifndef CONFIG_KASAN
  8 #define __HAVE_ARCH_STRNCPY
  9 #define __HAVE_ARCH_STRNCMP
 10 #define __HAVE_ARCH_MEMCHR
 11 #define __HAVE_ARCH_MEMCMP
 12 #define __HAVE_ARCH_MEMSET16
 13 #endif
 14 
 15 #define __HAVE_ARCH_MEMSET
 16 #define __HAVE_ARCH_MEMCPY
 17 #define __HAVE_ARCH_MEMMOVE
 18 #define __HAVE_ARCH_MEMCPY_FLUSHCACHE
 19 
 20 extern char * strcpy(char *,const char *);
 21 extern char * strncpy(char *,const char *, __kernel_size_t);
 22 extern __kernel_size_t strlen(const char *);
 23 extern int strcmp(const char *,const char *);
 24 extern int strncmp(const char *, const char *, __kernel_size_t);
 25 extern char * strcat(char *, const char *);
 26 extern void * memset(void *,int,__kernel_size_t);
 27 extern void * memcpy(void *,const void *,__kernel_size_t);
 28 extern void * memmove(void *,const void *,__kernel_size_t);
 29 extern int memcmp(const void *,const void *,__kernel_size_t);
 30 extern void * memchr(const void *,int,__kernel_size_t);
 31 void memcpy_flushcache(void *dest, const void *src, size_t size);
 32 
 33 #ifdef CONFIG_KASAN
 34 /* __mem variants are used by KASAN to implement instrumented meminstrinsics. */
 35 #ifdef CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX
 36 #define __memset memset
 37 #define __memcpy memcpy
 38 #define __memmove memmove
 39 #else /* CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
 40 void *__memset(void *s, int c, __kernel_size_t count);
 41 void *__memcpy(void *to, const void *from, __kernel_size_t n);
 42 void *__memmove(void *to, const void *from, __kernel_size_t n);
 43 #ifndef __SANITIZE_ADDRESS__
 44 /*
 45  * For files that are not instrumented (e.g. mm/slub.c) we
 46  * should use not instrumented version of mem* functions.
 47  */
 48 #define memcpy(dst, src, len) __memcpy(dst, src, len)
 49 #define memmove(dst, src, len) __memmove(dst, src, len)
 50 #define memset(s, c, n) __memset(s, c, n)
 51 
 52 #ifndef __NO_FORTIFY
 53 #define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
 54 #endif
 55 #endif /* !__SANITIZE_ADDRESS__ */
 56 #endif /* CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
 57 #endif /* CONFIG_KASAN */
 58 
 59 #ifdef CONFIG_PPC64
 60 #ifndef CONFIG_KASAN
 61 #define __HAVE_ARCH_MEMSET32
 62 #define __HAVE_ARCH_MEMSET64
 63 
 64 extern void *__memset16(uint16_t *, uint16_t v, __kernel_size_t);
 65 extern void *__memset32(uint32_t *, uint32_t v, __kernel_size_t);
 66 extern void *__memset64(uint64_t *, uint64_t v, __kernel_size_t);
 67 
 68 static inline void *memset16(uint16_t *p, uint16_t v, __kernel_size_t n)
 69 {
 70         return __memset16(p, v, n * 2);
 71 }
 72 
 73 static inline void *memset32(uint32_t *p, uint32_t v, __kernel_size_t n)
 74 {
 75         return __memset32(p, v, n * 4);
 76 }
 77 
 78 static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
 79 {
 80         return __memset64(p, v, n * 8);
 81 }
 82 #endif
 83 #else
 84 #ifndef CONFIG_KASAN
 85 #define __HAVE_ARCH_STRLEN
 86 #endif
 87 
 88 extern void *memset16(uint16_t *, uint16_t, __kernel_size_t);
 89 #endif
 90 #endif /* __KERNEL__ */
 91 
 92 #endif  /* _ASM_POWERPC_STRING_H */
 93 

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