/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
sh
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/sh/include/asm
mkdir
upload
Name
Size
Mode
Actions
adc.h
211
0644
edit
dl
rm
addrspace.h
1896
0644
edit
dl
rm
alignment.h
654
0644
edit
dl
rm
asm-offsets.h
74
0644
edit
dl
rm
atomic-grb.h
2677
0644
edit
dl
rm
atomic-irq.h
1687
0644
edit
dl
rm
atomic-llsc.h
2186
0644
edit
dl
rm
atomic.h
840
0644
edit
dl
rm
barrier.h
1503
0644
edit
dl
rm
bitops-cas.h
1770
0644
edit
dl
rm
bitops-grb.h
6364
0644
edit
dl
rm
bitops-llsc.h
2858
0644
edit
dl
rm
bitops-op32.h
3842
0644
edit
dl
rm
bitops.h
1653
0644
edit
dl
rm
bl_bit.h
66
0644
edit
dl
rm
bl_bit_32.h
639
0644
edit
dl
rm
bug.h
2835
0644
edit
dl
rm
cache.h
1171
0644
edit
dl
rm
cacheflush.h
3735
0644
edit
dl
rm
cache_insns.h
71
0644
edit
dl
rm
cache_insns_32.h
642
0644
edit
dl
rm
checksum.h
68
0644
edit
dl
rm
checksum_32.h
5009
0644
edit
dl
rm
clock.h
436
0644
edit
dl
rm
cmpxchg-cas.h
549
0644
edit
dl
rm
cmpxchg-grb.h
2869
0644
edit
dl
rm
cmpxchg-irq.h
1065
0644
edit
dl
rm
cmpxchg-llsc.h
1085
0644
edit
dl
rm
cmpxchg-xchg.h
1274
0644
edit
dl
rm
cmpxchg.h
1822
0644
edit
dl
rm
device.h
442
0644
edit
dl
rm
dma-register.h
1708
0644
edit
dl
rm
dma.h
3652
0644
edit
dl
rm
dmabrg.h
536
0644
edit
dl
rm
dwarf.h
9896
0644
edit
dl
rm
elf.h
6009
0644
edit
dl
rm
entry-macros.S
1897
0644
edit
dl
rm
extable.h
135
0644
edit
dl
rm
fb.h
414
0644
edit
dl
rm
fixmap.h
2543
0644
edit
dl
rm
flat.h
863
0644
edit
dl
rm
fpu.h
1635
0644
edit
dl
rm
freq.h
212
0644
edit
dl
rm
ftrace.h
1138
0644
edit
dl
rm
futex-cas.h
728
0644
edit
dl
rm
futex-irq.h
482
0644
edit
dl
rm
futex-llsc.h
870
0644
edit
dl
rm
futex.h
1381
0644
edit
dl
rm
gpio.h
851
0644
edit
dl
rm
hardirq.h
267
0644
edit
dl
rm
hd64461.h
12068
0644
edit
dl
rm
heartbeat.h
383
0644
edit
dl
rm
hugetlb.h
915
0644
edit
dl
rm
hw_breakpoint.h
1970
0644
edit
dl
rm
hw_irq.h
915
0644
edit
dl
rm
i2c-sh7760.h
406
0644
edit
dl
rm
io.h
8699
0644
edit
dl
rm
io_generic.h
661
0644
edit
dl
rm
io_noioport.h
1502
0644
edit
dl
rm
io_trapped.h
1474
0644
edit
dl
rm
irq.h
1642
0644
edit
dl
rm
irqflags.h
226
0644
edit
dl
rm
Kbuild
141
0644
edit
dl
rm
kdebug.h
433
0644
edit
dl
rm
kexec.h
2672
0644
edit
dl
rm
kgdb.h
851
0644
edit
dl
rm
kprobes.h
1407
0644
edit
dl
rm
linkage.h
154
0644
edit
dl
rm
machvec.h
850
0644
edit
dl
rm
mmiowb.h
246
0644
edit
dl
rm
mmu.h
2231
0644
edit
dl
rm
mmu_context.h
4167
0644
edit
dl
rm
mmu_context_32.h
1136
0644
edit
dl
rm
mmzone.h
1052
0644
edit
dl
rm
module.h
276
0644
edit
dl
rm
page.h
5419
0644
edit
dl
rm
pci.h
3007
0644
edit
dl
rm
perf_event.h
797
0644
edit
dl
rm
pgalloc.h
1107
0644
edit
dl
rm
pgtable-2level.h
567
0644
edit
dl
rm
pgtable-3level.h
1464
0644
edit
dl
rm
pgtable.h
4305
0644
edit
dl
rm
pgtable_32.h
15899
0644
edit
dl
rm
platform_early.h
1850
0644
edit
dl
rm
posix_types.h
71
0644
edit
dl
rm
processor.h
4342
0644
edit
dl
rm
processor_32.h
4614
0644
edit
dl
rm
ptrace.h
3834
0644
edit
dl
rm
ptrace_32.h
307
0644
edit
dl
rm
push-switch.h
755
0644
edit
dl
rm
reboot.h
472
0644
edit
dl
rm
romimage-macros.h
1126
0644
edit
dl
rm
rtc.h
249
0644
edit
dl
rm
seccomp.h
546
0644
edit
dl
rm
sections.h
311
0644
edit
dl
rm
segment.h
860
0644
edit
dl
rm
setup.h
725
0644
edit
dl
rm
sfp-machine.h
2767
0644
edit
dl
rm
sh7760fb.h
5740
0644
edit
dl
rm
shmparam.h
489
0644
edit
dl
rm
sh_bios.h
743
0644
edit
dl
rm
siu.h
385
0644
edit
dl
rm
smc37c93x.h
5698
0644
edit
dl
rm
smp-ops.h
1012
0644
edit
dl
rm
smp.h
1847
0644
edit
dl
rm
sparsemem.h
319
0644
edit
dl
rm
spi.h
265
0644
edit
dl
rm
spinlock-cas.h
2001
0644
edit
dl
rm
spinlock-llsc.h
4149
0644
edit
dl
rm
spinlock.h
438
0644
edit
dl
rm
spinlock_types.h
463
0644
edit
dl
rm
sram.h
670
0644
edit
dl
rm
stackprotector.h
711
0644
edit
dl
rm
stacktrace.h
528
0644
edit
dl
rm
string.h
66
0644
edit
dl
rm
string_32.h
2208
0644
edit
dl
rm
suspend.h
2576
0644
edit
dl
rm
switch_to.h
190
0644
edit
dl
rm
switch_to_32.h
3631
0644
edit
dl
rm
syscall.h
201
0644
edit
dl
rm
syscalls.h
454
0644
edit
dl
rm
syscalls_32.h
979
0644
edit
dl
rm
syscall_32.h
1917
0644
edit
dl
rm
thread_info.h
5342
0644
edit
dl
rm
timex.h
637
0644
edit
dl
rm
tlb.h
625
0644
edit
dl
rm
tlbflush.h
1809
0644
edit
dl
rm
topology.h
645
0644
edit
dl
rm
traps.h
424
0644
edit
dl
rm
traps_32.h
1338
0644
edit
dl
rm
types.h
326
0644
edit
dl
rm
uaccess.h
4811
0644
edit
dl
rm
uaccess_32.h
5007
0644
edit
dl
rm
uncached.h
1372
0644
edit
dl
rm
unistd.h
919
0644
edit
dl
rm
unwinder.h
856
0644
edit
dl
rm
user.h
2440
0644
edit
dl
rm
vermagic.h
709
0644
edit
dl
rm
vga.h
137
0644
edit
dl
rm
vmalloc.h
84
0644
edit
dl
rm
vmlinux.lds.h
416
0644
edit
dl
rm
watchdog.h
3981
0644
edit
dl
rm
word-at-a-time.h
1321
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/sh/include/asm/checksum_32.h
(5009B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ASM_SH_CHECKSUM_H #define __ASM_SH_CHECKSUM_H /* * Copyright (C) 1999 by Kaz Kojima & Niibe Yutaka */ #include <linux/in6.h> /* * computes the checksum of a memory block at buff, length len, * and adds in "sum" (32-bit) * * returns a 32-bit number suitable for feeding into itself * or csum_tcpudp_magic * * this function must be called with even lengths, except * for the last fragment, which may be odd * * it's best to have buff aligned on a 32-bit boundary */ asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); /* * the same as csum_partial, but copies from src while it * checksums, and handles user-space pointer exceptions correctly, when needed. * * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary */ asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, int len); #define _HAVE_ARCH_CSUM_AND_COPY /* * Note: when you get a NULL pointer exception here this means someone * passed in an incorrect kernel address to one of these functions. * * If you use these functions directly please don't forget the * access_ok(). */ static inline __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len) { return csum_partial_copy_generic(src, dst, len); } #define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER static inline __wsum csum_and_copy_from_user(const void __user *src, void *dst, int len) { if (!access_ok(src, len)) return 0; return csum_partial_copy_generic((__force const void *)src, dst, len); } /* * Fold a partial checksum */ static inline __sum16 csum_fold(__wsum sum) { unsigned int __dummy; __asm__("swap.w %0, %1\n\t" "extu.w %0, %0\n\t" "extu.w %1, %1\n\t" "add %1, %0\n\t" "swap.w %0, %1\n\t" "add %1, %0\n\t" "not %0, %0\n\t" : "=r" (sum), "=&r" (__dummy) : "0" (sum) : "t"); return (__force __sum16)sum; } /* * This is a version of ip_compute_csum() optimized for IP headers, * which always checksum on 4 octet boundaries. * * i386 version by Jorge Cwik <jorge@laser.satlink.net>, adapted * for linux by * Arnt Gulbrandsen. */ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) { unsigned int sum, __dummy0, __dummy1; __asm__ __volatile__( "mov.l @%1+, %0\n\t" "mov.l @%1+, %3\n\t" "add #-2, %2\n\t" "clrt\n\t" "1:\t" "addc %3, %0\n\t" "movt %4\n\t" "mov.l @%1+, %3\n\t" "dt %2\n\t" "bf/s 1b\n\t" " cmp/eq #1, %4\n\t" "addc %3, %0\n\t" "addc %2, %0" /* Here %2 is 0, add carry-bit */ /* Since the input registers which are loaded with iph and ihl are modified, we must also specify them as outputs, or gcc will assume they contain their original values. */ : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (__dummy0), "=&z" (__dummy1) : "1" (iph), "2" (ihl) : "t", "memory"); return csum_fold(sum); } static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len, __u8 proto, __wsum sum) { #ifdef __LITTLE_ENDIAN__ unsigned long len_proto = (proto + len) << 8; #else unsigned long len_proto = proto + len; #endif __asm__("clrt\n\t" "addc %0, %1\n\t" "addc %2, %1\n\t" "addc %3, %1\n\t" "movt %0\n\t" "add %1, %0" : "=r" (sum), "=r" (len_proto) : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum) : "t"); return sum; } /* * computes the checksum of the TCP/UDP pseudo-header * returns a 16-bit checksum, already complemented */ static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, __u32 len, __u8 proto, __wsum sum) { return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); } /* * this routine is used for miscellaneous IP-like checksums, mainly * in icmp.c */ static inline __sum16 ip_compute_csum(const void *buff, int len) { return csum_fold(csum_partial(buff, len, 0)); } #define _HAVE_ARCH_IPV6_CSUM static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len, __u8 proto, __wsum sum) { unsigned int __dummy; __asm__("clrt\n\t" "mov.l @(0,%2), %1\n\t" "addc %1, %0\n\t" "mov.l @(4,%2), %1\n\t" "addc %1, %0\n\t" "mov.l @(8,%2), %1\n\t" "addc %1, %0\n\t" "mov.l @(12,%2), %1\n\t" "addc %1, %0\n\t" "mov.l @(0,%3), %1\n\t" "addc %1, %0\n\t" "mov.l @(4,%3), %1\n\t" "addc %1, %0\n\t" "mov.l @(8,%3), %1\n\t" "addc %1, %0\n\t" "mov.l @(12,%3), %1\n\t" "addc %1, %0\n\t" "addc %4, %0\n\t" "addc %5, %0\n\t" "movt %1\n\t" "add %1, %0\n" : "=r" (sum), "=&r" (__dummy) : "r" (saddr), "r" (daddr), "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) : "t"); return csum_fold(sum); } /* * Copy and checksum to user */ #define HAVE_CSUM_COPY_USER static inline __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len) { if (!access_ok(dst, len)) return 0; return csum_partial_copy_generic((__force const void *)src, dst, len); } #endif /* __ASM_SH_CHECKSUM_H */
Save
cmd:
run