/linux/arch/arm/lib/ |
H A D | csumpartialcopygeneric.S | 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 83 adcs sum, sum, r8, put_byte_0 @ update checksum 89 mov sum, #-1 [all …]
|
H A D | csumpartial.S | 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 105 movne sum, sum, ror #8 [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | test_tcp_custom_syncookie.h | 54 __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 D | iters_num.c | 16 __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 D | iters_testmod_seq.c | 28 __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 in testmod_seq_getter_after_bad() local 114 s64 sum = 0, *v; testmod_seq_getter_good() local [all...] |
/linux/arch/powerpc/include/asm/ |
H A D | checksum.h | 39 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument 41 u32 tmp = (__force u32)sum; 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() 89 __u8 proto, __wsum sum) in csum_tcpudp_magic() argument 91 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); in csum_tcpudp_magic() 116 static __always_inline __wsum csum_shift(__wsum sum, int offset) in csum_shift() argument [all …]
|
/linux/net/ipv6/ |
H A D | ip6_checksum.c | 16 __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/s390/include/asm/ |
H A D | checksum.h | 19 static inline __wsum cksm(const void *buff, int len, __wsum sum) in cksm() argument 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 96 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); in csum_tcpudp_magic() [all …]
|
/linux/arch/mips/include/asm/ |
H A D | checksum.h | 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() 142 sum += sum < tmp; in csum_tcpudp_nofold() [all …]
|
/linux/arch/m68k/include/asm/ |
H A D | checksum.h | 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() 78 return (__force __sum16)~sum; in csum_fold() [all …]
|
/linux/sound/pci/ctxfi/ |
H A D | ctamixer.c | 91 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/arch/loongarch/lib/ |
H A D | csum.c | 10 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/crypto/ |
H A D | tea.c | 59 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/arm/include/asm/ |
H A D | checksum.h | 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 104 if (__builtin_constant_p(sum) && sum == 0) { in csum_tcpudp_nofold() [all …]
|
/linux/arch/parisc/include/asm/ |
H A D | checksum.h | 29 unsigned int sum; in ip_fast_csum() local 53 : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (t0), "=r" (t1), "=r" (t2) in ip_fast_csum() 57 return (__force __sum16)sum; in ip_fast_csum() 65 u32 sum = (__force u32)csum; in csum_fold() local 70 sum += (sum << 16) + (sum >> 16); in csum_fold() 71 return (__force __sum16)(~sum >> 16); in csum_fold() 76 __wsum sum) in csum_tcpudp_nofold() argument 83 : "=r" (sum) in csum_tcpudp_nofold() 84 : "r" (daddr), "r"(saddr), "r"(proto+len), "0"(sum)); in csum_tcpudp_nofold() 85 return sum; in csum_tcpudp_nofold() [all …]
|
/linux/arch/x86/include/asm/ |
H A D | checksum_32.h | 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() 111 __wsum sum) in csum_tcpudp_nofold() argument [all …]
|
H A D | checksum_64.h | 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() 88 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument 94 : "=r" (sum) in csum_tcpudp_nofold() [all …]
|
/linux/arch/mips/lib/ |
H A D | csum_partial.S | 59 #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/x86/um/asm/ |
H A D | checksum.h | 21 extern __wsum csum_partial(const void *buff, int len, __wsum 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() 56 __u8 proto, __wsum sum) in csum_tcpudp_nofold() argument 62 : "=r" (sum) in csum_tcpudp_nofold() 63 : "g" (daddr), "g" (saddr), "g" ((len + proto) << 8), "0" (sum)); in csum_tcpudp_nofold() 64 return sum; in csum_tcpudp_nofold() [all …]
|
/linux/arch/sparc/include/asm/ |
H A D | checksum_32.h | 33 __wsum csum_partial(const void *buff, int len, __wsum sum); 83 __sum16 sum; in ip_fast_csum() local 111 : "=r" (sum), "=&r" (iph) in ip_fast_csum() 114 return sum; in ip_fast_csum() 118 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument 126 : "=&r" (sum), "=r" (tmp) in csum_fold() 127 : "0" (sum), "1" ((__force u32)sum<<16) in csum_fold() 129 return (__force __sum16)sum; in csum_fold() 134 __wsum sum) in csum_tcpudp_nofold() argument 140 : "=r" (sum), "=r" (saddr) in csum_tcpudp_nofold() [all …]
|
H A D | checksum_64.h | 33 __wsum csum_partial(const void * buff, int len, __wsum sum); 51 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument 60 : "=&r" (sum), "=r" (tmp) in csum_fold() 61 : "0" (sum), "1" ((__force u32)sum<<16) in csum_fold() 63 return (__force __sum16)sum; in csum_fold() 68 __wsum sum) in csum_tcpudp_nofold() argument 75 : "=r" (sum), "=r" (saddr) in csum_tcpudp_nofold() 76 : "r" (daddr), "r" (proto + len), "0" (sum), "1" (saddr) in csum_tcpudp_nofold() 78 return sum; in csum_tcpudp_nofold() 87 __wsum sum) in csum_tcpudp_magic() argument [all …]
|
/linux/arch/sh/include/asm/ |
H A D | checksum_32.h | 24 asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); 63 static inline __sum16 csum_fold(__wsum sum) in csum_fold() argument 73 : "=r" (sum), "=&r" (__dummy) in csum_fold() 74 : "0" (sum) in csum_fold() 76 return (__force __sum16)sum; in csum_fold() 88 __wsum sum; in ip_fast_csum() local 108 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1) in ip_fast_csum() 112 return csum_fold(sum); in ip_fast_csum() 117 __wsum sum) in csum_tcpudp_nofold() argument 130 : "=r" (sum), "=r" (len_proto) in csum_tcpudp_nofold() [all …]
|
/linux/arch/arm64/lib/ |
H A D | csum.c | 11 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/xtensa/include/asm/ |
H A D | checksum.h | 30 asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); 67 static __inline__ __sum16 csum_fold(__wsum sum) in csum_fold() argument 79 : "=r" (sum), "=&r" (__dummy) in csum_fold() 80 : "0" (sum)); in csum_fold() 81 return (__force __sum16)sum; in csum_fold() 90 unsigned int sum, tmp, endaddr; in ip_fast_csum() local 115 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), in ip_fast_csum() 120 return csum_fold(sum); in ip_fast_csum() 125 __wsum sum) in csum_tcpudp_nofold() argument 147 : "=r" (sum), "=r" (len_proto) in csum_tcpudp_nofold() [all …]
|
/linux/arch/arm64/include/asm/ |
H A D | checksum.h | 13 __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()
|