aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/lib')
-rw-r--r--arch/arm64/lib/Makefile2
-rw-r--r--arch/arm64/lib/memcpy.S4
-rw-r--r--arch/arm64/lib/tracememcpy.c12
3 files changed, 15 insertions, 3 deletions
diff --git a/arch/arm64/lib/Makefile b/arch/arm64/lib/Makefile
index d98d3e39879..46c1d40ce31 100644
--- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile
@@ -2,4 +2,4 @@ lib-y := bitops.o clear_user.o delay.o copy_from_user.o \
copy_to_user.o copy_in_user.o copy_page.o \
clear_page.o memchr.o memcpy.o memmove.o memset.o \
memcmp.o strcmp.o strncmp.o strlen.o strnlen.o \
- strchr.o strrchr.o
+ strchr.o strrchr.o tracememcpy.o
diff --git a/arch/arm64/lib/memcpy.S b/arch/arm64/lib/memcpy.S
index 8a9a96d3dda..0de0ee60776 100644
--- a/arch/arm64/lib/memcpy.S
+++ b/arch/arm64/lib/memcpy.S
@@ -56,7 +56,7 @@ C_h .req x12
D_l .req x13
D_h .req x14
-ENTRY(memcpy)
+ENTRY(memcpy_asm)
mov dst, dstin
cmp count, #16
/*When memory length is less than 16, the accessed are not aligned.*/
@@ -198,4 +198,4 @@ ENTRY(memcpy)
tst count, #0x3f
b.ne .Ltail63
ret
-ENDPROC(memcpy)
+ENDPROC(memcpy_asm)
diff --git a/arch/arm64/lib/tracememcpy.c b/arch/arm64/lib/tracememcpy.c
new file mode 100644
index 00000000000..0a951c4d9d9
--- /dev/null
+++ b/arch/arm64/lib/tracememcpy.c
@@ -0,0 +1,12 @@
+
+#define CREATE_TRACE_POINTS
+#include <asm/trace/events/string.h>
+
+extern void *memcpy_asm(void *dest, const void *src, size_t count);
+
+void *memcpy(void *dest, const void *src, size_t count)
+{
+ trace_memcpy(dest, src, count, __builtin_return_address(0));
+ return memcpy_asm(dest, src, count);
+}
+