patch-2.4.23 linux-2.4.23/include/asm-sparc/checksum.h
Next file: linux-2.4.23/include/asm-sparc/ioctl.h
Previous file: linux-2.4.23/include/asm-sparc/bitops.h
Back to the patch index
Back to the overall index
- Lines: 133
- Date:
2003-11-28 10:26:21.000000000 -0800
- Orig file:
linux-2.4.22/include/asm-sparc/checksum.h
- Orig date:
2002-08-02 17:39:45.000000000 -0700
diff -urN linux-2.4.22/include/asm-sparc/checksum.h linux-2.4.23/include/asm-sparc/checksum.h
@@ -48,23 +48,26 @@
extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *);
-extern __inline__ unsigned int
+static inline unsigned int
csum_partial_copy_nocheck (const char *src, char *dst, int len,
unsigned int sum)
{
register unsigned int ret asm("o0") = (unsigned int)src;
register char *d asm("o1") = dst;
register int l asm("g1") = len;
-
+
__asm__ __volatile__ (
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
- " mov %4, %%g7\n"
- : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) :
- "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+ " mov %6, %%g7\n"
+ : "=&r" (ret), "=&r" (d), "=&r" (l)
+ : "0" (ret), "1" (d), "2" (l), "r" (sum)
+ : "o2", "o3", "o4", "o5", "o7",
+ "g2", "g3", "g4", "g5", "g7",
+ "memory", "cc");
return ret;
}
-extern __inline__ unsigned int
+static inline unsigned int
csum_partial_copy_from_user(const char *src, char *dst, int len,
unsigned int sum, int *err)
{
@@ -85,14 +88,16 @@
".previous\n"
"1:\n\t"
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
- " st %5, [%%sp + 64]\n"
- : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
- "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+ " st %8, [%%sp + 64]\n"
+ : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
+ : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
+ : "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5",
+ "cc", "memory");
return ret;
}
}
-extern __inline__ unsigned int
+static inline unsigned int
csum_partial_copy_to_user(const char *src, char *dst, int len,
unsigned int sum, int *err)
{
@@ -112,9 +117,12 @@
".previous\n"
"1:\n\t"
"call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t"
- " st %5, [%%sp + 64]\n"
- : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) :
- "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7");
+ " st %8, [%%sp + 64]\n"
+ : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s)
+ : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err)
+ : "o2", "o3", "o4", "o5", "o7",
+ "g2", "g3", "g4", "g5",
+ "cc", "memory");
return ret;
}
}
@@ -125,8 +133,8 @@
/* ihl is always 5 or greater, almost always is 5, and iph is word aligned
* the majority of the time.
*/
-extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph,
- unsigned int ihl)
+static inline unsigned short ip_fast_csum(const unsigned char *iph,
+ unsigned int ihl)
{
unsigned short sum;
@@ -163,7 +171,7 @@
}
/* Fold a partial checksum without adding pseudo headers. */
-extern __inline__ unsigned int csum_fold(unsigned int sum)
+static inline unsigned int csum_fold(unsigned int sum)
{
unsigned int tmp;
@@ -177,11 +185,11 @@
return sum;
}
-extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr,
- unsigned long daddr,
- unsigned int len,
- unsigned short proto,
- unsigned int sum)
+static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
+ unsigned long daddr,
+ unsigned int len,
+ unsigned short proto,
+ unsigned int sum)
{
__asm__ __volatile__("addcc\t%1, %0, %0\n\t"
"addxcc\t%2, %0, %0\n\t"
@@ -209,11 +217,11 @@
#define _HAVE_ARCH_IPV6_CSUM
-static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
- struct in6_addr *daddr,
- __u32 len,
- unsigned short proto,
- unsigned int sum)
+static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
+ struct in6_addr *daddr,
+ __u32 len,
+ unsigned short proto,
+ unsigned int sum)
{
__asm__ __volatile__ (
"addcc %3, %4, %%g4\n\t"
@@ -244,7 +252,7 @@
}
/* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */
-extern __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len)
+static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
{
return csum_fold(csum_partial(buff, len, 0));
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)