1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2008 Mark Nelson, IBM Corp.
5 #include <linux/export.h>
7 #include <asm/processor.h>
8 #include <asm/ppc_asm.h>
9 #include <asm/asm-offsets.h>
10 #include <asm/feature-fixups.h>
12 _GLOBAL_TOC(copy_page)
16 #ifdef CONFIG_PPC_BOOK3S_64
19 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
21 #ifdef CONFIG_PPC_KERNEL_PCREL
23 * Hack for toolchain - prefixed instructions cause label difference to
24 * be non-constant even if 8 byte alignment is known, so they can not
25 * be put in FTR sections.
27 LOAD_REG_ADDR(r10, ppc64_caches)
31 LOAD_REG_ADDR(r10, ppc64_caches)
33 lwz r11,DCACHEL1LOGBLOCKSIZE(r10) /* log2 of cache block size */
34 lwz r12,DCACHEL1BLOCKSIZE(r10) /* get cache block size */
44 END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
46 srdi r8,r5,7 /* page is copied in 128 byte strides */
47 addi r8,r8,-1 /* one stride copied outside loop */
118 EXPORT_SYMBOL(copy_page)