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>
21 stmfd sp!, {r1 - r2, r4 - r8, fp, ip, lr, pc}
24 .macro load_regs,flags
25 ldm\flags fp, {r1, r2, r4-r8, fp, sp, pc}
29 9999: ldrbt \reg1, [r0], $1
30 .section __ex_table, "a"
36 .macro load2b, reg1, reg2
37 9999: ldrbt \reg1, [r0], $1
38 9998: ldrbt \reg2, [r0], $1
39 .section __ex_table, "a"
46 9999: ldrt \reg1, [r0], $4
47 .section __ex_table, "a"
53 .macro load2l, reg1, reg2
54 9999: ldrt \reg1, [r0], $4
55 9998: ldrt \reg2, [r0], $4
56 .section __ex_table, "a"
62 .macro load4l, reg1, reg2, reg3, reg4
63 9999: ldrt \reg1, [r0], $4
64 9998: ldrt \reg2, [r0], $4
65 9997: ldrt \reg3, [r0], $4
66 9996: ldrt \reg4, [r0], $4
67 .section __ex_table, "a"
77 * csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr)
78 * r0 = src, r1 = dst, r2 = len, r3 = sum, [sp] = *err_ptr
79 * Returns : r0 = checksum, [[sp, #0], #0] = 0 or -EFAULT
82 #define FN_ENTRY ENTRY(csum_partial_copy_from_user)
84 #include "csumpartialcopygeneric.S"
87 * FIXME: minor buglet here
88 * We don't return the checksum for the data present in the buffer. To do
89 * so properly, we would have to add in whatever registers were loaded before
90 * the fault, which, with the current asm above is not predictable.
94 6001: mov r4, #-EFAULT
95 ldr r5, [fp, #4] @ *err_ptr
97 ldmia sp, {r1, r2} @ retrieve dst, len
99 mov r0, #0 @ zero the buffer