/usr/src/linux-headers-5.15.0-181/arch/sh/include/asm
NameSizeModeActions
adc.h2110644editdlrm
addrspace.h18960644editdlrm
alignment.h6540644editdlrm
asm-offsets.h740644editdlrm
atomic-grb.h26770644editdlrm
atomic-irq.h16870644editdlrm
atomic-llsc.h21860644editdlrm
atomic.h8400644editdlrm
barrier.h15030644editdlrm
bitops-cas.h17700644editdlrm
bitops-grb.h63640644editdlrm
bitops-llsc.h28580644editdlrm
bitops-op32.h38420644editdlrm
bitops.h16530644editdlrm
bl_bit.h660644editdlrm
bl_bit_32.h6390644editdlrm
bug.h28350644editdlrm
cache.h11710644editdlrm
cacheflush.h37350644editdlrm
cache_insns.h710644editdlrm
cache_insns_32.h6420644editdlrm
checksum.h680644editdlrm
checksum_32.h50090644editdlrm
clock.h4360644editdlrm
cmpxchg-cas.h5490644editdlrm
cmpxchg-grb.h28690644editdlrm
cmpxchg-irq.h10650644editdlrm
cmpxchg-llsc.h10850644editdlrm
cmpxchg-xchg.h12740644editdlrm
cmpxchg.h18220644editdlrm
device.h4420644editdlrm
dma-register.h17080644editdlrm
dma.h36520644editdlrm
dmabrg.h5360644editdlrm
dwarf.h98960644editdlrm
elf.h60090644editdlrm
entry-macros.S18970644editdlrm
extable.h1350644editdlrm
fb.h4140644editdlrm
fixmap.h25430644editdlrm
flat.h8630644editdlrm
fpu.h16350644editdlrm
freq.h2120644editdlrm
ftrace.h11380644editdlrm
futex-cas.h7280644editdlrm
futex-irq.h4820644editdlrm
futex-llsc.h8700644editdlrm
futex.h13810644editdlrm
gpio.h8510644editdlrm
hardirq.h2670644editdlrm
hd64461.h120680644editdlrm
heartbeat.h3830644editdlrm
hugetlb.h9150644editdlrm
hw_breakpoint.h19700644editdlrm
hw_irq.h9150644editdlrm
i2c-sh7760.h4060644editdlrm
io.h86990644editdlrm
io_generic.h6610644editdlrm
io_noioport.h15020644editdlrm
io_trapped.h14740644editdlrm
irq.h16420644editdlrm
irqflags.h2260644editdlrm
Kbuild1410644editdlrm
kdebug.h4330644editdlrm
kexec.h26720644editdlrm
kgdb.h8510644editdlrm
kprobes.h14070644editdlrm
linkage.h1540644editdlrm
machvec.h8500644editdlrm
mmiowb.h2460644editdlrm
mmu.h22310644editdlrm
mmu_context.h41670644editdlrm
mmu_context_32.h11360644editdlrm
mmzone.h10520644editdlrm
module.h2760644editdlrm
page.h54190644editdlrm
pci.h30070644editdlrm
perf_event.h7970644editdlrm
pgalloc.h11070644editdlrm
pgtable-2level.h5670644editdlrm
pgtable-3level.h14640644editdlrm
pgtable.h43050644editdlrm
pgtable_32.h158990644editdlrm
platform_early.h18500644editdlrm
posix_types.h710644editdlrm
processor.h43420644editdlrm
processor_32.h46140644editdlrm
ptrace.h38340644editdlrm
ptrace_32.h3070644editdlrm
push-switch.h7550644editdlrm
reboot.h4720644editdlrm
romimage-macros.h11260644editdlrm
rtc.h2490644editdlrm
seccomp.h5460644editdlrm
sections.h3110644editdlrm
segment.h8600644editdlrm
setup.h7250644editdlrm
sfp-machine.h27670644editdlrm
sh7760fb.h57400644editdlrm
shmparam.h4890644editdlrm
sh_bios.h7430644editdlrm
siu.h3850644editdlrm
smc37c93x.h56980644editdlrm
smp-ops.h10120644editdlrm
smp.h18470644editdlrm
sparsemem.h3190644editdlrm
spi.h2650644editdlrm
spinlock-cas.h20010644editdlrm
spinlock-llsc.h41490644editdlrm
spinlock.h4380644editdlrm
spinlock_types.h4630644editdlrm
sram.h6700644editdlrm
stackprotector.h7110644editdlrm
stacktrace.h5280644editdlrm
string.h660644editdlrm
string_32.h22080644editdlrm
suspend.h25760644editdlrm
switch_to.h1900644editdlrm
switch_to_32.h36310644editdlrm
syscall.h2010644editdlrm
syscalls.h4540644editdlrm
syscalls_32.h9790644editdlrm
syscall_32.h19170644editdlrm
thread_info.h53420644editdlrm
timex.h6370644editdlrm
tlb.h6250644editdlrm
tlbflush.h18090644editdlrm
topology.h6450644editdlrm
traps.h4240644editdlrm
traps_32.h13380644editdlrm
types.h3260644editdlrm
uaccess.h48110644editdlrm
uaccess_32.h50070644editdlrm
uncached.h13720644editdlrm
unistd.h9190644editdlrm
unwinder.h8560644editdlrm
user.h24400644editdlrm
vermagic.h7090644editdlrm
vga.h1370644editdlrm
vmalloc.h840644editdlrm
vmlinux.lds.h4160644editdlrm
watchdog.h39810644editdlrm
word-at-a-time.h13210644editdlrm
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 /* * 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 , 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 */