ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / kernel / checksum.c
1 #include "asm/uaccess.h"
2 #include "linux/errno.h"
3 #include "linux/module.h"
4
5 extern unsigned int arch_csum_partial(const char *buff, int len, int sum);
6
7 extern unsigned int csum_partial(char *buff, int len, int sum)
8 {
9         return(arch_csum_partial(buff, len, sum));
10 }
11
12 EXPORT_SYMBOL(csum_partial);
13
14 unsigned int csum_partial_copy_to(const char *src, char *dst, int len, 
15                                   int sum, int *err_ptr)
16 {
17         if(copy_to_user(dst, src, len)){
18                 *err_ptr = -EFAULT;
19                 return(-1);
20         }
21
22         return(arch_csum_partial(src, len, sum));
23 }
24
25 unsigned int csum_partial_copy_from(const char *src, char *dst, int len, 
26                                     int sum, int *err_ptr)
27 {
28         if(copy_from_user(dst, src, len)){
29                 *err_ptr = -EFAULT;
30                 return(-1);
31         }
32
33         return(arch_csum_partial(dst, len, sum));
34 }
35
36 /*
37  * Overrides for Emacs so that we follow Linus's tabbing style.
38  * Emacs will notice this stuff at the end of the file and automatically
39  * adjust the settings for this buffer only.  This must remain at the end
40  * of the file.
41  * ---------------------------------------------------------------------------
42  * Local variables:
43  * c-file-style: "linux"
44  * End:
45  */