ia64/linux-2.6.18-xen.hg

view arch/cris/arch-v10/lib/csumcpfruser.S @ 673:3161879fdf22

[IA64] xencomm: support XENMEM_add_to_physmap and XENMEM_remove_from_phsymap

support XENMEM_add_to_physmap and XENMEM_remove_from_phsymap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Tue Sep 16 21:26:15 2008 +0900 (2008-09-16)
parents 831230e53067
children
line source
1 /*
2 * Add-on to transform csum_partial_copy_nocheck in checksumcopy.S into
3 * csum_partial_copy_from_user by adding exception records.
4 *
5 * Copyright (C) 2001 Axis Communications AB.
6 *
7 * Author: Hans-Peter Nilsson.
8 */
10 #include <asm/errno.h>
12 /* Same function body, but a different name. If we just added exception
13 records to _csum_partial_copy_nocheck and made it generic, we wouldn't
14 know a user fault from a kernel fault and we would have overhead in
15 each kernel caller for the error-pointer argument.
17 unsigned int csum_partial_copy_from_user
18 (const char *src, char *dst, int len, unsigned int sum, int *errptr);
20 Note that the errptr argument is only set if we encounter an error.
21 It is conveniently located on the stack, so the normal function body
22 does not have to handle it. */
24 #define csum_partial_copy_nocheck csum_partial_copy_from_user
26 /* There are local labels numbered 1, 2 and 3 present to mark the
27 different from-user accesses. */
28 #include "checksumcopy.S"
30 .section .fixup,"ax"
32 ;; Here from the movem loop; restore stack.
33 4:
34 movem [$sp+],$r8
35 ;; r12 is already decremented. Add back chunk_size-2.
36 addq 40-2,$r12
38 ;; Here from the word loop; r12 is off by 2; add it back.
39 5:
40 addq 2,$r12
42 ;; Here from a failing single byte.
43 6:
45 ;; Signal in *errptr that we had a failing access.
46 moveq -EFAULT,$r9
47 move.d $r9,[[$sp]]
49 ;; Clear the rest of the destination area using memset. Preserve the
50 ;; checksum for the readable bytes.
51 push $srp
52 push $r13
53 move.d $r11,$r10
54 clear.d $r11
55 jsr memset
56 pop $r10
57 jump [$sp+]
59 .previous
60 .section __ex_table,"a"
61 .dword 1b,4b
62 .dword 2b,5b
63 .dword 3b,6b
64 .previous