2 #ifndef _ASM_M32R_CHECKSUM_H
3 #define _ASM_M32R_CHECKSUM_H
20 #include <linux/in6.h>
61 " sll3 %1, %0, #16 \n"
67 " xor3 %0, %0, #0x0000ffff \n"
68 :
"=r" (sum),
"=&r" (tmpreg)
81 unsigned long tmpreg0, tmpreg1;
109 :
"=&r" (sum),
"=r" (iph),
"=r" (ihl),
"=&r" (tmpreg0),
"=&r" (tmpreg1)
110 :
"1" (iph),
"2" (ihl)
113 return csum_fold(sum);
118 unsigned short proto,
121 #if defined(__LITTLE_ENDIAN)
122 unsigned long len_proto = (proto + len) << 8;
124 unsigned long len_proto = proto + len;
126 unsigned long tmpreg;
135 :
"=r" (sum),
"=&r" (tmpreg)
136 :
"r" (daddr),
"r" (saddr),
"r" (len_proto),
"0" (sum)
149 unsigned short proto,
165 #define _HAVE_ARCH_IPV6_CSUM
168 __u32 len,
unsigned short proto,
171 unsigned long tmpreg0, tmpreg1, tmpreg2, tmpreg3;
176 " ld %4, @(12,%5) \n"
184 " ld %4, @(12,%6) \n"
193 :
"=&r" (sum),
"=&r" (tmpreg0),
"=&r" (tmpreg1),
194 "=&r" (tmpreg2),
"=&r" (tmpreg3)
195 :
"r" (saddr),
"r" (daddr),
196 "r" (
htonl(len)),
"r" (
htonl(proto)),
"0" (sum)
200 return csum_fold(sum);