2 * String handling functions.
4 * Copyright IBM Corp. 2012
7 #include <linux/linkage.h>
10 * memset implementation
12 * This code corresponds to the C construct below. We do distinguish
13 * between clearing (c == 0) and setting a memory array (c != 0) simply
14 * because nearly all memset invocations in the kernel clear memory and
15 * the xc instruction is preferred in such cases.
17 * void *memset(void *s, int c, size_t n)
20 * return __builtin_memset(s, 0, n);
21 * return __builtin_memset(s, c, n);
33 jz .Lmemset_clear_rest
37 brctg %r3,.Lmemset_clear_loop
54 brctg %r3,.Lmemset_fill_loop
65 * memcpy implementation
67 * void *memcpy(void *dest, const void *src, size_t n)
85 brctg %r5,.Lmemcpy_loop