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/config.h>
11 #include <linux/linkage.h>
12 #include <asm/assembler.h>
13 #include <asm/errno.h>
14 #include <asm/asm_offsets.h>
19 stmfd sp!, {r1 - r2, r4 - r9, fp, ip, lr, pc}
22 ldr r9, [r9, #TSK_ADDR_LIMIT]
26 .macro load_regs,flags
27 ldm\flags fp, {r1, r2, r4-r9, fp, sp, pc}^
32 9999: ldreqbt \reg1, [r0], #1
33 ldrneb \reg1, [r0], #1
34 .section __ex_table, "a"
40 .macro load2b, reg1, reg2
42 9999: ldreqbt \reg1, [r0], #1
43 ldrneb \reg1, [r0], #1
44 9998: ldreqbt \reg2, [r0], #1
45 ldrneb \reg2, [r0], #1
46 .section __ex_table, "a"
54 9999: ldreqt \reg1, [r0], #4
56 .section __ex_table, "a"
62 .macro load2l, reg1, reg2
64 ldmneia r0!, {\reg1, \reg2}
65 9999: ldreqt \reg1, [r0], #4
66 9998: ldreqt \reg2, [r0], #4
67 .section __ex_table, "a"
73 .macro load4l, reg1, reg2, reg3, reg4
75 ldmneia r0!, {\reg1, \reg2, \reg3, \reg4}
76 9999: ldreqt \reg1, [r0], #4
77 9998: ldreqt \reg2, [r0], #4
78 9997: ldreqt \reg3, [r0], #4
79 9996: ldreqt \reg4, [r0], #4
80 .section __ex_table, "a"
90 * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
91 * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
92 * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
95 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
97 #include "csumpartialcopygeneric.S"
100 * FIXME: minor buglet here
101 * We don't return the checksum for the data present in the buffer. To do
102 * so properly, we would have to add in whatever registers were loaded before
103 * the fault, which, with the current asm above is not predictable.
106 6001: mov r4, #-EFAULT
107 ldr r5, [fp, #4] @ *err_ptr
109 ldmia sp, {r1, r2} @ retrieve dst, len
111 mov r0, #0 @ zero the buffer