1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/csumpartialcopyuser.S
5 * Copyright (C) 1995-1998 Russell King
7 * 27/03/03 Ian Molton Clean up CONFIG_CPU
9 #include <linux/linkage.h>
10 #include <asm/assembler.h>
11 #include <asm/errno.h>
12 #include <asm/asm-offsets.h>
16 #if defined(CONFIG_CPU_SW_DOMAIN_PAN)
19 mrc p15, 0, ip, c3, c0, 0
20 stmfd sp!, {r1, r2, r4 - r8, ip, lr}
25 ldmfd sp!, {r1, r2, r4 - r8, ip, lr}
26 mcr p15, 0, ip, c3, c0, 0
30 #elif defined(CONFIG_CPU_TTBR0_PAN)
33 mrc p15, 0, ip, c2, c0, 2 @ read TTBCR
34 stmfd sp!, {r1, r2, r4 - r8, ip, lr}
39 ldmfd sp!, {r1, r2, r4 - r8, ip, lr}
40 mcr p15, 0, ip, c2, c0, 2 @ restore TTBCR
47 stmfd sp!, {r1, r2, r4 - r8, lr}
51 ldmfd sp!, {r1, r2, r4 - r8, pc}
60 .macro load2b, reg1, reg2
69 .macro load2l, reg1, reg2
74 .macro load4l, reg1, reg2, reg3, reg4
83 * csum_partial_copy_from_user(const char *src, char *dst, int len)
84 * r0 = src, r1 = dst, r2 = len
85 * Returns : r0 = checksum or 0
88 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
89 #define FN_EXIT ENDPROC(csum_partial_copy_from_user)
91 #include "csumpartialcopygeneric.S"
94 * We report fault by returning 0 csum - impossible in normal case, since
95 * we start with 0xffffffff for initial sum.
97 .pushsection .text.fixup,"ax"