summaryrefslogtreecommitdiffstats
path: root/include/asm-sh/checksum.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/checksum.h')
-rw-r--r--include/asm-sh/checksum.h96
1 files changed, 39 insertions, 57 deletions
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index ae0272e9b..846e64509 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -55,24 +55,6 @@ unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL);
}
-#if 0
-
-/* Not used at the moment. It is difficult to imagine for what purpose
- it can be used :-) Please, do not forget to verify_area before it --ANK
- */
-
-/*
- * This combination is currently not used, but possible:
- */
-
-extern __inline__
-unsigned int csum_partial_copy_to_user ( const char *src, char *dst,
- int len, int sum, int *err_ptr)
-{
- return csum_partial_copy_generic ( src, dst, len, sum, NULL, err_ptr);
-}
-#endif
-
/*
* These are the old (and unsafe) way of doing checksums, a warning message will be
* printed if they are used and an exeption occurs.
@@ -91,12 +73,12 @@ static __inline__ unsigned int csum_fold(unsigned int sum)
{
unsigned int __dummy;
__asm__("clrt\n\t"
- "mov %0,%1\n\t"
+ "mov %0, %1\n\t"
"shll16 %0\n\t"
- "addc %0,%1\n\t"
+ "addc %0, %1\n\t"
"movt %0\n\t"
"shlr16 %1\n\t"
- "add %1,%0"
+ "add %1, %0"
: "=r" (sum), "=&r" (__dummy)
: "0" (sum));
return ~sum;
@@ -114,24 +96,24 @@ static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int
unsigned int sum, __dummy;
__asm__ __volatile__(
- "mov.l @%1+,%0\n\t"
- "add #-4,%2\n\t"
+ "mov.l @%1+, %0\n\t"
+ "add #-4, %2\n\t"
"clrt\n\t"
- "mov.l @%1+,%3\n\t"
- "addc %3,%0\n\t"
- "mov.l @%1+,%3\n\t"
- "addc %3,%0\n\t"
- "mov.l @%1+,%3\n\t"
- "addc %3,%0\n"
+ "mov.l @%1+, %3\n\t"
+ "addc %3, %0\n\t"
+ "mov.l @%1+, %3\n\t"
+ "addc %3, %0\n\t"
+ "mov.l @%1+, %3\n\t"
+ "addc %3, %0\n"
"1:\t"
- "mov.l @%1+,%3\n\t"
- "addc %3,%0\n\t"
+ "mov.l @%1+, %3\n\t"
+ "addc %3, %0\n\t"
"movt %3\n\t"
"dt %2\n\t"
"bf/s 1b\n\t"
- " cmp/eq #1,%3\n\t"
- "mov #0,%3\n\t"
- "addc %3,%0\n\t"
+ " cmp/eq #1, %3\n\t"
+ "mov #0, %3\n\t"
+ "addc %3, %0\n\t"
/* Since the input registers which are loaded with iph and ihl
are modified, we must also specify them as outputs, or gcc
will assume they contain their original values. */
@@ -153,11 +135,11 @@ static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr,
unsigned long len_proto = (proto<<16)+len;
#endif
__asm__("clrt\n\t"
- "addc %0,%1\n\t"
- "addc %2,%1\n\t"
- "addc %3,%1\n\t"
+ "addc %0, %1\n\t"
+ "addc %2, %1\n\t"
+ "addc %3, %1\n\t"
"movt %0\n\t"
- "add %1,%0"
+ "add %1, %0"
: "=r" (sum), "=r" (len_proto)
: "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum));
return sum;
@@ -195,26 +177,26 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
{
unsigned int __dummy;
__asm__("clrt\n\t"
- "mov.l @(0,%2),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(4,%2),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(8,%2),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(12,%2),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(0,%3),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(4,%3),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(8,%3),%1\n\t"
- "addc %1,%0\n\t"
- "mov.l @(12,%3),%1\n\t"
- "addc %1,%0\n\t"
- "addc %4,%0\n\t"
- "addc %5,%0\n\t"
+ "mov.l @(0,%2), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(4,%2), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(8,%2), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(12,%2), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(0,%3), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(4,%3), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(8,%3), %1\n\t"
+ "addc %1, %0\n\t"
+ "mov.l @(12,%3), %1\n\t"
+ "addc %1, %0\n\t"
+ "addc %4, %0\n\t"
+ "addc %5, %0\n\t"
"movt %1\n\t"
- "add %1,%0\n"
+ "add %1, %0\n"
: "=r" (sum), "=&r" (__dummy)
: "r" (saddr), "r" (daddr),
"r" (htonl(len)), "r" (htonl(proto)), "0" (sum));