drm/rockchip: Don't change hdmi reference clock rate
[drm/drm-misc.git] / arch / arm / lib / csumpartialcopyuser.S
blobc289bde0474349c3158df92b57eacce9fd040407
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  *  linux/arch/arm/lib/csumpartialcopyuser.S
4  *
5  *  Copyright (C) 1995-1998 Russell King
6  *
7  * 27/03/03 Ian Molton Clean up CONFIG_CPU
8  */
9 #include <linux/linkage.h>
10 #include <asm/assembler.h>
11 #include <asm/errno.h>
12 #include <asm/asm-offsets.h>
14                 .text
16 #if defined(CONFIG_CPU_SW_DOMAIN_PAN)
18                 .macro  save_regs
19                 mrc     p15, 0, ip, c3, c0, 0
20                 stmfd   sp!, {r1, r2, r4 - r8, ip, lr}
21                 uaccess_enable ip
22                 .endm
24                 .macro  load_regs
25                 ldmfd   sp!, {r1, r2, r4 - r8, ip, lr}
26                 mcr     p15, 0, ip, c3, c0, 0
27                 ret     lr
28                 .endm
30 #elif defined(CONFIG_CPU_TTBR0_PAN)
32                 .macro  save_regs
33                 mrc     p15, 0, ip, c2, c0, 2           @ read TTBCR
34                 stmfd   sp!, {r1, r2, r4 - r8, ip, lr}
35                 uaccess_enable ip
36                 .endm
38                 .macro  load_regs
39                 ldmfd   sp!, {r1, r2, r4 - r8, ip, lr}
40                 mcr     p15, 0, ip, c2, c0, 2           @ restore TTBCR
41                 ret     lr
42                 .endm
44 #else
46                 .macro  save_regs
47                 stmfd   sp!, {r1, r2, r4 - r8, lr}
48                 .endm
50                 .macro  load_regs
51                 ldmfd   sp!, {r1, r2, r4 - r8, pc}
52                 .endm
54 #endif
56                 .macro  load1b, reg1
57                 ldrusr  \reg1, r0, 1
58                 .endm
60                 .macro  load2b, reg1, reg2
61                 ldrusr  \reg1, r0, 1
62                 ldrusr  \reg2, r0, 1
63                 .endm
65                 .macro  load1l, reg1
66                 ldrusr  \reg1, r0, 4
67                 .endm
69                 .macro  load2l, reg1, reg2
70                 ldrusr  \reg1, r0, 4
71                 ldrusr  \reg2, r0, 4
72                 .endm
74                 .macro  load4l, reg1, reg2, reg3, reg4
75                 ldrusr  \reg1, r0, 4
76                 ldrusr  \reg2, r0, 4
77                 ldrusr  \reg3, r0, 4
78                 ldrusr  \reg4, r0, 4
79                 .endm
82  * unsigned int
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
86  */
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.
96  */
97                 .pushsection .text.fixup,"ax"
98                 .align  4
99 9001:           mov     r0, #0
100                 load_regs
101                 .popsection