/* SPDX-License-Identifier: GPL-2.0-only */1/*2* linux/arch/arm/lib/copypage.S3*4* Copyright (C) 1995-1999 Russell King5*6* ASM optimised string functions7*/8#include <linux/linkage.h>9#include <asm/assembler.h>10#include <asm/asm-offsets.h>11#include <asm/cache.h>1213#define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 ))1415.text16.align 517/*18* StrongARM optimised copy_page routine19* now 1.78bytes/cycle, was 1.60 bytes/cycle (50MHz bus -> 89MB/s)20* Note that we probably achieve closer to the 100MB/s target with21* the core clock switching.22*/23ENTRY(copy_page)24stmfd sp!, {r4, lr} @ 225PLD( pld [r1, #0] )26PLD( pld [r1, #L1_CACHE_BYTES] )27mov r2, #COPY_COUNT @ 128ldmia r1!, {r3, r4, ip, lr} @ 4+1291: PLD( pld [r1, #2 * L1_CACHE_BYTES])30PLD( pld [r1, #3 * L1_CACHE_BYTES])312:32.rept (2 * L1_CACHE_BYTES / 16 - 1)33stmia r0!, {r3, r4, ip, lr} @ 434ldmia r1!, {r3, r4, ip, lr} @ 435.endr36subs r2, r2, #1 @ 137stmia r0!, {r3, r4, ip, lr} @ 438ldmiagt r1!, {r3, r4, ip, lr} @ 439bgt 1b @ 140PLD( ldmiaeq r1!, {r3, r4, ip, lr} )41PLD( beq 2b )42ldmfd sp!, {r4, pc} @ 343ENDPROC(copy_page)444546