Home
last modified time | relevance | path

Searched full:sum (Results 1 – 25 of 1040) sorted by relevance

12345678910>>...42

/linux/arch/arm/lib/
H A Dcsumpartialcopygeneric.S11 * csum_partial_copy_xxx(const char *src, char *dst, int len, int sum, )
12 * r0 = src, r1 = dst, r2 = len, r3 = sum
21 sum .req r3 label
23 .Lzero: mov r0, sum
38 adcs sum, sum, ip, put_byte_1 @ update checksum
45 adcs sum, sum, r8, put_byte_0
47 adcs sum, sum, ip, put_byte_1
65 adcs sum, sum, ip, put_byte_1 @ update checksum
72 adcs sum, sum, r8, put_byte_0
74 adcs sum, sum, ip, put_byte_1
[all …]
H A Dcsumpartial.S13 * Function: __u32 csum_partial(const char *src, int len, __u32 sum)
20 sum .req r2 label
26 .Lzero: mov r0, sum
39 movne sum, sum, ror #8
42 adcsne sum, sum, td0, put_byte_1
63 adcs sum, sum, td0
69 adcsne sum, sum, td0, put_byte_0 @ update checksum
71 .Ldone: adc r0, sum, #0 @ collect up the last carry
80 adcsne sum, sum, td0, put_byte_1 @ update checksum
96 adcsne sum, sum, td0 @ update checksum
[all …]
/linux/tools/testing/selftests/bpf/progs/
H A Dtest_tcp_custom_syncookie.h54 __u32 len, __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument
56 unsigned long long s = (__force u32)sum; in csum_tcpudp_nofold()
71 u32 sum = (__force u32)csum; in csum_fold() local
73 sum = (sum & 0xffff) + (sum >> 16); in csum_fold()
74 sum = (sum & 0xffff) + (sum >> 16); in csum_fold()
75 return (__force __sum16)~sum; in csum_fold()
79 __u8 proto, __wsum sum) in csum_tcpudp_magic() argument
81 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); in csum_tcpudp_magic()
92 __u32 sum = (__force u32)csum; in csum_ipv6_magic() local
94 sum += (__force u32)saddr->in6_u.u6_addr32[0]; in csum_ipv6_magic()
[all …]
H A Diters_num.c16 __s64 sum = 0, i; in num_empty_zero() local
18 bpf_for(i, 0, 0) sum += i; in num_empty_zero()
19 res_empty_zero = 1 + sum; in num_empty_zero()
30 __s64 sum = 0, i; in num_empty_int_min() local
32 bpf_for(i, INT_MIN, INT_MIN) sum += i; in num_empty_int_min()
33 res_empty_int_min = 2 + sum; in num_empty_int_min()
44 __s64 sum = 0, i; in num_empty_int_max() local
46 bpf_for(i, INT_MAX, INT_MAX) sum += i; in num_empty_int_max()
47 res_empty_int_max = 3 + sum; in num_empty_int_max()
58 __s64 sum = 0, i; in num_empty_minus_one() local
[all …]
H A Diters_testmod_seq.c28 __s64 sum = 0, *i; in testmod_seq_empty() local
30 bpf_for_each(testmod_seq, i, 1000, 0) sum += *i; in testmod_seq_empty()
31 res_empty = 1 + sum; in testmod_seq_empty()
46 __s64 sum = 0, *i; in testmod_seq_full() local
48 bpf_for_each(testmod_seq, i, 1000, 1000) sum += *i; in testmod_seq_full()
49 res_full = sum; in testmod_seq_full()
66 __s64 sum = 0, *i; in testmod_seq_truncated() local
70 sum += *i; in testmod_seq_truncated()
75 res_truncated = sum; in testmod_seq_truncated()
96 s64 sum = 0, *v; in testmod_seq_getter_after_bad() local
[all …]
/linux/arch/powerpc/include/asm/
H A Dchecksum.h13 * and adds in "sum" (32-bit), while copying the block to dst.
39 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
41 u32 tmp = (__force u32)sum; in csum_fold()
44 * swap the two 16-bit halves of sum in csum_fold()
47 * giving us the correct sum in the upper half. in csum_fold()
58 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument
61 u64 s = (__force u32)sum; in csum_tcpudp_nofold()
78 : "=r" (sum) in csum_tcpudp_nofold()
79 : "r" (daddr), "r"(saddr), "r"(proto + len), "0"(sum)); in csum_tcpudp_nofold()
80 return sum; in csum_tcpudp_nofold()
[all …]
/linux/sound/pci/ctxfi/
H A Dctamixer.c91 static int amixer_set_sum(struct amixer *amixer, struct sum *sum) in amixer_set_sum() argument
96 amixer->sum = sum; in amixer_set_sum()
97 if (!sum) { in amixer_set_sum()
102 sum->rsc.ops->index(&sum->rsc)); in amixer_set_sum()
114 struct sum *sum; in amixer_commit_write() local
118 sum = amixer->sum; in amixer_commit_write()
125 if (sum) in amixer_commit_write()
126 sum->rsc.ops->master(&sum->rsc); in amixer_commit_write()
135 if (sum) { in amixer_commit_write()
137 sum->rsc.ops->index(&sum->rsc)); in amixer_commit_write()
[all …]
/linux/net/ipv6/
H A Dip6_checksum.c16 __u32 sum = (__force u32)csum; in csum_ipv6_magic() local
18 sum += (__force u32)saddr->s6_addr32[0]; in csum_ipv6_magic()
19 carry = (sum < (__force u32)saddr->s6_addr32[0]); in csum_ipv6_magic()
20 sum += carry; in csum_ipv6_magic()
22 sum += (__force u32)saddr->s6_addr32[1]; in csum_ipv6_magic()
23 carry = (sum < (__force u32)saddr->s6_addr32[1]); in csum_ipv6_magic()
24 sum += carry; in csum_ipv6_magic()
26 sum += (__force u32)saddr->s6_addr32[2]; in csum_ipv6_magic()
27 carry = (sum < (__force u32)saddr->s6_addr32[2]); in csum_ipv6_magic()
28 sum += carry; in csum_ipv6_magic()
[all …]
/linux/arch/mips/lib/
H A Dcsum_partial.S59 #define ADDC(sum,reg) \ argument
62 ADD sum, reg; \
63 sltu v1, sum, reg; \
64 ADD sum, v1; \
67 #define ADDC32(sum,reg) \ argument
70 addu sum, reg; \
71 sltu v1, sum, reg; \
72 addu sum, v1; \
75 #define CSUM_BIGCHUNK1(src, offset, sum, _t0, _t1, _t2, _t3) \ argument
82 ADDC(sum, _t0); \
[all …]
/linux/arch/s390/include/asm/
H A Dchecksum.h19 static inline __wsum cksm(const void *buff, int len, __wsum sum) in cksm() argument
29 "0: cksm %[sum],%[rp]\n" in cksm()
31 : [sum] "+&d" (sum), [rp] "+&d" (rp.pair) : : "cc", "memory"); in cksm()
32 return sum; in cksm()
35 __wsum csum_partial(const void *buff, int len, __wsum sum);
43 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
45 u32 csum = (__force u32) sum; in csum_fold()
77 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument
79 __u64 csum = (__force __u64)sum; in csum_tcpudp_nofold()
94 __u8 proto, __wsum sum) in csum_tcpudp_magic() argument
[all …]
/linux/crypto/
H A Dtea.c59 u32 y, z, n, sum = 0; in tea_encrypt() local
76 sum += TEA_DELTA; in tea_encrypt()
77 y += ((z << 4) + k0) ^ (z + sum) ^ ((z >> 5) + k1); in tea_encrypt()
78 z += ((y << 4) + k2) ^ (y + sum) ^ ((y >> 5) + k3); in tea_encrypt()
87 u32 y, z, n, sum; in tea_decrypt() local
101 sum = TEA_DELTA << 5; in tea_decrypt()
106 z -= ((y << 4) + k2) ^ (y + sum) ^ ((y >> 5) + k3); in tea_decrypt()
107 y -= ((z << 4) + k0) ^ (z + sum) ^ ((z >> 5) + k1); in tea_decrypt()
108 sum -= TEA_DELTA; in tea_decrypt()
132 u32 y, z, sum = 0; in xtea_encrypt() local
[all …]
/linux/arch/sparc/lib/
H A Dchecksum_32.S20 #define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \ argument
23 addxcc t0, sum, sum; \
24 addxcc t1, sum, sum; \
26 addxcc t2, sum, sum; \
27 addxcc t3, sum, sum; \
29 addxcc t4, sum, sum; \
30 addxcc t5, sum, sum; \
31 addxcc t0, sum, sum; \
32 addxcc t1, sum, sum;
34 #define CSUM_LASTCHUNK(buf, offset, sum, t0, t1, t2, t3) \ argument
[all …]
/linux/arch/x86/include/asm/
H A Dchecksum_64.h16 * sum: 32bit unfolded sum
22 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
26 : "=r" (sum) in csum_fold()
27 : "r" ((__force u32)sum << 16), in csum_fold()
28 "0" ((__force u32)sum & 0xffff0000)); in csum_fold()
29 return (__force __sum16)(~(__force u32)sum >> 16); in csum_fold()
47 unsigned int sum; in ip_fast_csum() local
69 : "=r" (sum), "=r" (iph), "=r" (ihl) in ip_fast_csum()
72 return (__force __sum16)sum; in ip_fast_csum()
81 * @sum: initial sum to be added in (32bit unfolded)
[all …]
H A Dchecksum_32.h10 * and adds in "sum" (32-bit)
20 asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
67 unsigned int sum; in ip_fast_csum() local
89 : "=r" (sum), "=r" (iph), "=r" (ihl) in ip_fast_csum()
92 return (__force __sum16)sum; in ip_fast_csum()
99 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
103 : "=r" (sum) in csum_fold()
104 : "r" ((__force u32)sum << 16), in csum_fold()
105 "0" ((__force u32)sum & 0xffff0000)); in csum_fold()
106 return (__force __sum16)(~(__force u32)sum >> 16); in csum_fold()
[all …]
/linux/arch/x86/um/asm/
H A Dchecksum.h11 * and adds in "sum" (32-bit)
21 extern __wsum csum_partial(const void *buff, int len, __wsum sum);
25 * sum: 32bit unfolded sum
31 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
36 : "=r" (sum) in csum_fold()
37 : "r" ((__force u32)sum << 16), in csum_fold()
38 "0" ((__force u32)sum & 0xffff0000) in csum_fold()
40 return (__force __sum16)(~(__force u32)sum >> 16); in csum_fold()
49 * @sum: initial sum to be added in (32bit unfolded)
56 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument
[all …]
/linux/arch/mips/include/asm/
H A Dchecksum.h25 * and adds in "sum" (32-bit)
35 __wsum csum_partial(const void *buff, int len, __wsum sum);
79 u32 sum = (__force u32)csum; in csum_fold() local
81 sum += (sum << 16); in csum_fold()
82 csum = (__force __wsum)(sum < (__force u32)csum); in csum_fold()
83 sum >>= 16; in csum_fold()
84 sum += (__force u32)csum; in csum_fold()
86 return (__force __sum16)~sum; in csum_fold()
134 unsigned long sum = (__force unsigned long)daddr; in csum_tcpudp_nofold() local
139 sum += tmp; in csum_tcpudp_nofold()
[all …]
/linux/arch/loongarch/lib/
H A Dcsum.c10 static u64 accumulate(u64 sum, u64 data) in accumulate() argument
12 sum += data; in accumulate()
13 if (sum < data) in accumulate()
14 sum += 1; in accumulate()
15 return sum; in accumulate()
24 unsigned int offset, shift, sum; in do_csum() local
112 sum = sum64 >> 32; in do_csum()
113 sum += (sum >> 16) | (sum << 16); in do_csum()
115 return (u16)swab32(sum); in do_csum()
117 return sum >> 16; in do_csum()
[all …]
/linux/arch/m68k/include/asm/
H A Dchecksum.h13 * and adds in "sum" (32-bit)
23 __wsum csum_partial(const void *buff, int len, __wsum sum);
48 unsigned int sum = 0; in ip_fast_csum() local
61 : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp) in ip_fast_csum()
62 : "0" (sum), "1" (iph), "2" (ihl) in ip_fast_csum()
64 return (__force __sum16)~sum; in ip_fast_csum()
67 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
69 unsigned int tmp = (__force u32)sum; in csum_fold()
75 : "=&d" (sum), "=&d" (tmp) in csum_fold()
76 : "0" (sum), "1" (tmp)); in csum_fold()
[all …]
/linux/include/net/
H A Dchecksum.h41 __wsum sum = csum_partial(src, len, ~0U); in csum_and_copy_to_user() local
44 return sum; in csum_and_copy_to_user()
86 static __always_inline __wsum csum_shift(__wsum sum, int offset) in csum_shift() argument
88 /* rotate sum to align it with a 16b boundary */ in csum_shift()
90 return (__force __wsum)ror32((__force u32)sum, 8); in csum_shift()
91 return sum; in csum_shift()
119 __wsum csum_partial_ext(const void *buff, int len, __wsum sum) in csum_partial_ext() argument
121 return csum_partial(buff, len, sum); in csum_partial_ext()
126 static __always_inline void csum_replace_by_diff(__sum16 *sum, __wsum diff) in csum_replace_by_diff() argument
128 *sum = csum_fold(csum_add(diff, ~csum_unfold(*sum))); in csum_replace_by_diff()
[all …]
/linux/arch/arm64/include/asm/
H A Dchecksum.h13 __u32 len, __u8 proto, __wsum sum);
17 u32 sum = (__force u32)csum; in csum_fold() local
18 sum += (sum >> 16) | (sum << 16); in csum_fold()
19 return ~(__force __sum16)(sum >> 16); in csum_fold()
26 u64 sum; in ip_fast_csum() local
33 sum = tmp >> 64; in ip_fast_csum()
35 sum += *(const u32 *)iph; in ip_fast_csum()
39 sum += ((sum >> 32) | (sum << 32)); in ip_fast_csum()
40 return csum_fold((__force __wsum)(sum >> 32)); in ip_fast_csum()
/linux/arch/arm/include/asm/
H A Dchecksum.h18 * and adds in "sum" (32-bit)
28 __wsum csum_partial(const void *buff, int len, __wsum sum);
58 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument
62 : "=r" (sum) in csum_fold()
63 : "r" (sum) in csum_fold()
65 return (__force __sum16)(~(__force u32)sum >> 16); in csum_fold()
76 __wsum sum; in ip_fast_csum() local
93 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) in ip_fast_csum()
96 return csum_fold(sum); in ip_fast_csum()
101 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument
[all …]
/linux/arch/x86/lib/
H A Dcsum-wrappers_64.c24 __wsum sum; in csum_and_copy_from_user() local
29 sum = csum_partial_copy_generic((__force const void *)src, dst, len); in csum_and_copy_from_user()
31 return sum; in csum_and_copy_from_user()
46 __wsum sum; in csum_and_copy_to_user() local
51 sum = csum_partial_copy_generic(src, (void __force *)dst, len); in csum_and_copy_to_user()
53 return sum; in csum_and_copy_to_user()
73 __u32 len, __u8 proto, __wsum sum) in csum_ipv6_magic() argument
78 (__force __u64)sum; in csum_ipv6_magic()
80 asm(" addq (%[saddr]),%[sum]\n" in csum_ipv6_magic()
81 " adcq 8(%[saddr]),%[sum]\n" in csum_ipv6_magic()
[all …]
/linux/arch/arm64/lib/
H A Dcsum.c11 static u64 accumulate(u64 sum, u64 data) in accumulate() argument
13 __uint128_t tmp = (__uint128_t)sum + data; in accumulate()
23 unsigned int offset, shift, sum; in do_csum() local
124 sum = sum64 >> 32; in do_csum()
125 sum += (sum >> 16) | (sum << 16); in do_csum()
127 return (u16)swab32(sum); in do_csum()
129 return sum >> 16; in do_csum()
137 u64 sum = (__force u64)csum; in csum_ipv6_magic() local
142 sum += (__force u32)htonl(len); in csum_ipv6_magic()
144 sum += (u32)proto << 24; in csum_ipv6_magic()
[all …]
/linux/arch/alpha/include/asm/
H A Dchecksum.h18 __u32 len, __u8 proto, __wsum sum);
21 __u32 len, __u8 proto, __wsum sum);
25 * and adds in "sum" (32-bit)
35 extern __wsum csum_partial(const void *buff, int len, __wsum sum);
64 u32 sum = (__force u32)csum; in csum_fold() local
65 sum = (sum & 0xffff) + (sum >> 16); in csum_fold()
66 sum = (sum & 0xffff) + (sum >> 16); in csum_fold()
67 return (__force __sum16)~sum; in csum_fold()
73 __u32 len, __u8 proto, __wsum sum);
/linux/arch/riscv/lib/
H A Dcsum.c25 unsigned long sum = (__force unsigned long)csum; in csum_ipv6_magic() local
27 sum += (__force unsigned long)saddr->s6_addr32[0]; in csum_ipv6_magic()
28 sum += (__force unsigned long)saddr->s6_addr32[1]; in csum_ipv6_magic()
29 sum += (__force unsigned long)saddr->s6_addr32[2]; in csum_ipv6_magic()
30 sum += (__force unsigned long)saddr->s6_addr32[3]; in csum_ipv6_magic()
32 sum += (__force unsigned long)daddr->s6_addr32[0]; in csum_ipv6_magic()
33 sum += (__force unsigned long)daddr->s6_addr32[1]; in csum_ipv6_magic()
34 sum += (__force unsigned long)daddr->s6_addr32[2]; in csum_ipv6_magic()
35 sum += (__force unsigned long)daddr->s6_addr32[3]; in csum_ipv6_magic()
38 sum += ulen; in csum_ipv6_magic()
[all …]

12345678910>>...42