patch-2.1.25 linux/include/asm-i386/checksum.h

Next file: linux/include/asm-i386/smp_lock.h
Previous file: linux/fs/smbfs/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.24/linux/include/asm-i386/checksum.h linux/include/asm-i386/checksum.h
@@ -17,20 +17,39 @@
 
 /*
  * the same as csum_partial, but copies from src while it
- * checksums
+ * checksums, and handles user-space pointer exceptions correctly, when needed.
  *
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
  */
 
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
+unsigned int csum_partial_copy_from_user( int * err, const char *src, 
+						char *dst, int len, int sum);
+
+/*
+ * I hope GCC will optimize 'dummy' away ...
+ */
+
+unsigned int csum_partial_copy_nocheck_generic( int * err, const char *src, char *dst,
+						 int len, int sum);
 
+extern __inline__ unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
+                                                        int len, int sum)
+{
+        int dummy;
+
+        return csum_partial_copy_nocheck_generic ( &dummy, src, dst, len, sum);
+}
 
 /*
- * the same as csum_partial, but copies from user space (but on the x86
- * we have just one address space, so this is identical to the above)
+ * These are the 'old' way of doing checksums, a warning message will be
+ * printed if they are used and an exeption occurs.
+ *
+ * these functions should go away after some time.
  */
+
 #define csum_partial_copy_fromuser csum_partial_copy
+unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
 
 /*
  *	This is a version of ip_compute_csum() optimized for IP headers,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov