2 * linux/arch/arm26/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 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/errno.h>
13 #include <asm/asm-offsets.h>
18 stmfd sp!, {r1 - r2, r4 - r9, fp, ip, lr, pc}
21 ldr r9, [r9, #TSK_ADDR_LIMIT]
25 .macro load_regs,flags
26 ldm\flags fp, {r1, r2, r4-r9, fp, sp, pc}^
31 9999: ldreqbt \reg1, [r0], #1
32 ldrneb \reg1, [r0], #1
33 .section __ex_table, "a"
39 .macro load2b, reg1, reg2
41 9999: ldreqbt \reg1, [r0], #1
42 ldrneb \reg1, [r0], #1
43 9998: ldreqbt \reg2, [r0], #1
44 ldrneb \reg2, [r0], #1
45 .section __ex_table, "a"
53 9999: ldreqt \reg1, [r0], #4
55 .section __ex_table, "a"
61 .macro load2l, reg1, reg2
63 ldmneia r0!, {\reg1, \reg2}
64 9999: ldreqt \reg1, [r0], #4
65 9998: ldreqt \reg2, [r0], #4
66 .section __ex_table, "a"
72 .macro load4l, reg1, reg2, reg3, reg4
74 ldmneia r0!, {\reg1, \reg2, \reg3, \reg4}
75 9999: ldreqt \reg1, [r0], #4
76 9998: ldreqt \reg2, [r0], #4
77 9997: ldreqt \reg3, [r0], #4
78 9996: ldreqt \reg4, [r0], #4
79 .section __ex_table, "a"
89 * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
90 * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
91 * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
94 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
96 #include "csumpartialcopygeneric.S"
99 * FIXME: minor buglet here
100 * We don't return the checksum for the data present in the buffer. To do
101 * so properly, we would have to add in whatever registers were loaded before
102 * the fault, which, with the current asm above is not predictable.
105 6001: mov r4, #-EFAULT
106 ldr r5, [fp, #4] @ *err_ptr
108 ldmia sp, {r1, r2} @ retrieve dst, len
110 mov r0, #0 @ zero the buffer