1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) Paul Mackerras 1997.
5 * NOTE: this code runs in 32 bit mode and is packaged as ELF32.
31 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
105 rlwinm r0,r5,32-2,2,31
127 rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */
130 beq 3f /* if less than 8 bytes to do */
131 andi. r0,r6,3 /* get dest word aligned */
134 andi. r0,r4,3 /* check src word aligned too */
159 andi. r7,r7,3 /* will source be word-aligned too? */
161 bne 3b /* do byte-by-byte if not */
169 rlwinm. r7,r5,32-3,3,31
174 .globl backwards_memcpy
176 rlwinm. r7,r5,32-3,3,31 /* r7 = r5 >> 3 */
213 rlwinm. r7,r5,32-3,3,31
248 * Flush the dcache and invalidate the icache for a range of addresses.
250 * flush_cache(addr, len)
254 addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */