hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/powerpc/lib/mem_64.S
....@@ -1,18 +1,16 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * String handling functions for PowerPC.
34 *
45 * Copyright (C) 1996 Paul Mackerras.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117 #include <asm/processor.h>
128 #include <asm/errno.h>
139 #include <asm/ppc_asm.h>
1410 #include <asm/export.h>
11
+#include <asm/kasan.h>
1512
13
+#ifndef CONFIG_KASAN
1614 _GLOBAL(__memset16)
1715 rlwimi r4,r4,16,0,15
1816 /* fall through */
....@@ -29,8 +27,9 @@
2927 EXPORT_SYMBOL(__memset16)
3028 EXPORT_SYMBOL(__memset32)
3129 EXPORT_SYMBOL(__memset64)
30
+#endif
3231
33
-_GLOBAL(memset)
32
+_GLOBAL_KASAN(memset)
3433 neg r0,r3
3534 rlwimi r4,r4,8,16,23
3635 andi. r0,r0,7 /* # bytes to be 8-byte aligned */
....@@ -40,7 +39,7 @@
4039 .Lms: PPC_MTOCRF(1,r0)
4140 mr r6,r3
4241 blt cr1,8f
43
- beq+ 3f /* if already 8-byte aligned */
42
+ beq 3f /* if already 8-byte aligned */
4443 subf r5,r0,r5
4544 bf 31,1f
4645 stb r4,0(r6)
....@@ -85,7 +84,7 @@
8584 addi r6,r6,8
8685 8: cmpwi r5,0
8786 PPC_MTOCRF(1,r5)
88
- beqlr+
87
+ beqlr
8988 bf 29,9f
9089 stw r4,0(r6)
9190 addi r6,r6,4
....@@ -96,8 +95,9 @@
9695 stb r4,0(r6)
9796 blr
9897 EXPORT_SYMBOL(memset)
98
+EXPORT_SYMBOL_KASAN(memset)
9999
100
-_GLOBAL_TOC(memmove)
100
+_GLOBAL_TOC_KASAN(memmove)
101101 cmplw 0,r3,r4
102102 bgt backwards_memcpy
103103 b memcpy
....@@ -139,3 +139,4 @@
139139 mtctr r7
140140 b 1b
141141 EXPORT_SYMBOL(memmove)
142
+EXPORT_SYMBOL_KASAN(memmove)