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);
36 je .Lmemset_clear_rest
40 brct %r3,.Lmemset_clear_loop
42 ex %r4,.Lmemset_xc-.Lmemset_base(%r5)
57 brct %r3,.Lmemset_fill_loop
59 ex %r4,.Lmemset_mvc-.Lmemset_base(%r5)
67 * memcpy implementation
69 * void *memcpy(void *dest, const void *src, size_t n)
83 ex %r4,.Lmemcpy_mvc-.Lmemcpy_base(%r5)
89 brct %r0,.Lmemcpy_loop