2 * String handling functions.
4 * Copyright IBM Corp. 2012
7 #include <linux/linkage.h>
8 #include <asm/export.h>
11 * void *memmove(void *dest, const void *src, size_t n)
31 brctg %r0,.Lmemmove_loop
33 larl %r5,.Lmemmove_mvc
38 .Lmemmove_reverse_loop:
41 brctg %r4,.Lmemmove_reverse_loop
47 EXPORT_SYMBOL(memmove)
50 * memset implementation
52 * This code corresponds to the C construct below. We do distinguish
53 * between clearing (c == 0) and setting a memory array (c != 0) simply
54 * because nearly all memset invocations in the kernel clear memory and
55 * the xc instruction is preferred in such cases.
57 * void *memset(void *s, int c, size_t n)
60 * return __builtin_memset(s, 0, n);
61 * return __builtin_memset(s, c, n);
73 jz .Lmemset_clear_rest
77 brctg %r3,.Lmemset_clear_loop
94 brctg %r3,.Lmemset_fill_loop
103 EXPORT_SYMBOL(memset)
106 * memcpy implementation
108 * void *memcpy(void *dest, const void *src, size_t n)
119 larl %r5,.Lmemcpy_mvc
123 mvc 0(256,%r1),0(%r3)
126 brctg %r5,.Lmemcpy_loop
130 EXPORT_SYMBOL(memcpy)