patch-2.2.18 linux/include/asm-s390/checksum.h
Next file: linux/include/asm-s390/dasd.h
Previous file: linux/include/asm-s390/ccwcache.h
Back to the patch index
Back to the overall index
- Lines: 40
- Date:
Wed Nov 8 23:09:58 2000
- Orig file:
v2.2.17/include/asm-s390/checksum.h
- Orig date:
Fri Apr 21 12:46:49 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/include/asm-s390/checksum.h linux/include/asm-s390/checksum.h
@@ -92,7 +92,7 @@
* Fold a partial checksum without adding pseudo headers
*/
#if 1
-unsigned short csum_fold(unsigned int sum);
+extern unsigned short csum_fold(unsigned int sum);
#else
extern inline unsigned short
csum_fold(unsigned int sum)
@@ -141,20 +141,19 @@
unsigned int sum)
{
__asm__ __volatile__ (
- " sll %3,16\n"
- " or %3,%4\n" /* newproto=proto<<16 in hiword, len in lowword */
- " alr %1,%2\n" /* saddr+=daddr */
- " brc 12,0f\n"
- " ahi %1,1\n" /* add carry */
- "0: alr %1,%3\n" /* add saddr+=newproto */
- " brc 12,1f\n"
- " ahi %1,1\n" /* add carry again */
- "1: alr %0,%1\n" /* sum+=saddr */
+ " alr %0,%1\n" /* sum += saddr */
+ " brc 12,0f\n"
+ " ahi %0,1\n" /* add carry */
+ "0: alr %0,%2\n" /* sum += daddr */
+ " brc 12,1f\n"
+ " ahi %0,1\n" /* add carry */
+ "1: alr %0,%3\n" /* sum += (len<<16) + (proto<<8) */
" brc 12,2f\n"
- " ahi %0,1\n" /* add carry again */
+ " ahi %0,1\n" /* add carry */
"2:"
: "+&d" (sum)
- : "d" (saddr), "d" (daddr), "d" (proto), "d" (len)
+ : "d" (saddr), "d" (daddr),
+ "d" (((unsigned int) len<<16) + (unsigned int) proto)
: "cc" );
return sum;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)