// SPDX-License-Identifier: GPL-2.0-only /* * Checksum functions for Hexagon * * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*/
/* This was derived from arch/alpha/lib/checksum.c */
/* Fold down to 32-bits so we don't lose in the typedef-less
network stack. */ /* 64 to 33 */
result = (result & 0xffffffffUL) + (result >> 32); /* 33 to 32 */
result = (result & 0xffffffffUL) + (result >> 32); return (__force __wsum)result;
}
EXPORT_SYMBOL(csum_tcpudp_nofold);
/* * Do a 64-bit checksum on an arbitrary memory area.. * * This isn't a great routine, but it's not _horrible_ either. The * inner loop could be unrolled a bit further, and there are better * ways to do the carry, but this is reasonable.
*/
/* optimized HEXAGON intrinsic version, with over read fixed */ unsignedint do_csum(constvoid *voidptr, int len)
{
u64 sum0, sum1, x0, x1, *ptr8_o, *ptr8_e, *ptr8; int i, start, mid, end, mask; constchar *ptr = voidptr; unsignedshort *ptr2; unsignedint *ptr4;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.