mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
sparc: csum_add for Sparc
versions. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4405b4d635
commit
20fce54fa7
2 changed files with 24 additions and 0 deletions
|
@ -238,4 +238,16 @@ static inline __sum16 ip_compute_csum(const void *buff, int len)
|
|||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define HAVE_ARCH_CSUM_ADD
|
||||
static inline __wsum csum_add(__wsum csum, __wsum addend)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"addcc %0, %1, %0\n"
|
||||
"addx %0, %%g0, %0"
|
||||
: "=r" (csum)
|
||||
: "r" (addend), "0" (csum));
|
||||
|
||||
return csum;
|
||||
}
|
||||
|
||||
#endif /* !(__SPARC_CHECKSUM_H) */
|
||||
|
|
|
@ -164,4 +164,16 @@ static inline __sum16 ip_compute_csum(const void *buff, int len)
|
|||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define HAVE_ARCH_CSUM_ADD
|
||||
static inline __wsum csum_add(__wsum csum, __wsum addend)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"addcc %0, %1, %0\n"
|
||||
"addx %0, %%g0, %0"
|
||||
: "=r" (csum)
|
||||
: "r" (addend), "0" (csum));
|
||||
|
||||
return csum;
|
||||
}
|
||||
|
||||
#endif /* !(__SPARC64_CHECKSUM_H) */
|
||||
|
|
Loading…
Add table
Reference in a new issue