2 * linux/arch/arm/lib/csumpartialcopyuser.S
4 * Copyright (C) 1995-1998 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * 27/03/03 Ian Molton Clean up CONFIG_CPU
13 #include <linux/linkage.h>
14 #include <asm/assembler.h>
15 #include <asm/errno.h>
16 #include <asm/asm-offsets.h>
20 #ifdef CONFIG_CPU_SW_DOMAIN_PAN
22 mrc p15, 0, ip, c3, c0, 0
23 stmfd sp!, {r1, r2, r4 - r8, ip, lr}
28 ldmfd sp!, {r1, r2, r4 - r8, ip, lr}
29 mcr p15, 0, ip, c3, c0, 0
34 stmfd sp!, {r1, r2, r4 - r8, lr}
38 ldmfd sp!, {r1, r2, r4 - r8, pc}
46 .macro load2b, reg1, reg2
55 .macro load2l, reg1, reg2
60 .macro load4l, reg1, reg2, reg3, reg4
69 * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
70 * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
71 * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
74 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
75 #define FN_EXIT ENDPROC(csum_partial_copy_from_user)
77 #include "csumpartialcopygeneric.S"
80 * FIXME: minor buglet here
81 * We don't return the checksum for the data present in the buffer. To do
82 * so properly, we would have to add in whatever registers were loaded before
83 * the fault, which, with the current asm above is not predictable.
85 .pushsection .text.fixup,"ax"
87 9001: mov r4, #-EFAULT
88 #ifdef CONFIG_CPU_SW_DOMAIN_PAN
89 ldr r5, [sp, #9*4] @ *err_ptr
91 ldr r5, [sp, #8*4] @ *err_ptr
94 ldmia sp, {r1, r2} @ retrieve dst, len
96 mov r0, #0 @ zero the buffer