imx: nandbcb: refactor update function
[oweals/u-boot.git] / arch / arm / lib / memcpy.S
index 7d9fc0f9be400e5f934b9cf9c252aedc602515ed..f7fb77235cd642b734fdb17c60f0a4e1b2c9cd64 100644 (file)
@@ -1,24 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  *  linux/arch/arm/lib/memcpy.S
  *
  *  Author:    Nicolas Pitre
  *  Created:   Sep 28, 2005
  *  Copyright: MontaVista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
  */
 
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 
-#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
-#define W(instr)       instr.w
-#else
-#define W(instr)       instr
-#endif
-
 #define LDR1W_SHIFT    0
 #define STR1W_SHIFT    0
 
 
 /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
        .syntax unified
-#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
        .thumb
        .thumb_func
 #endif
 ENTRY(memcpy)
                cmp     r0, r1
-               moveq   pc, lr
+               bxeq    lr
 
                enter   r4, lr
 
@@ -156,7 +147,8 @@ ENTRY(memcpy)
                str1b   r0, r4, cs, abort=21f
                str1b   r0, ip, cs, abort=21f
 
-               exit    r4, pc
+               exit    r4, lr
+               bx      lr
 
 9:             rsb     ip, ip, #4
                cmp     ip, #2
@@ -265,7 +257,8 @@ ENTRY(memcpy)
        .endm
 
        .macro  copy_abort_end
-       ldmfd   sp!, {r4, pc}
+       ldmfd   sp!, {r4, lr}
+       bx      lr
        .endm
 
 ENDPROC(memcpy)