coreboot/tests
Julius Werner de37109767 lib: Move IP checksum to commonlib
This patch moves the IP checksum algorithm into commonlib to prepare for
it being shared with libpayload. The current implementation is ancient
and pretty hard to read (and does some unnecessary questionable things
like the type-punning stuff which leads to suboptimal code generation),
so this reimplements it from scratch (that also helps with the
licensing).

This algorithm is prepared to take in a pre-calculated "wide" checksum
in a machine-register-sized data type which is then narrowed down to 16
bits (see RFC 1071 for why that's valid). This isn't used yet (and the
code will get optimized out), but will be used later in this patch
series for architecture-specific optimization.

Change-Id: Ic04c714c00439a17fc04a8a6e730cc2aa19b8e68
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80251
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
2024-02-02 22:48:27 +00:00
..
acpi tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
commonlib lib: Move IP checksum to commonlib 2024-02-02 22:48:27 +00:00
console tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
data/lib/lzma-test tests: Add lib/lzma-test test case 2021-10-14 13:13:07 +00:00
device tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
drivers tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
include tests/include: Move EMPTY_WRAP() macro to tests/include/test.h 2022-02-10 21:16:49 +00:00
lib lib: Move IP checksum to commonlib 2024-02-02 22:48:27 +00:00
mock tests: Fix tests code and comments style 2022-01-14 14:29:29 +00:00
stubs tests/stubs/console: Allow enabling printk to print to stdout 2021-09-13 14:00:57 +00:00
Makefile.common tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00
Makefile.mk tests: Rename Makefiles from .inc to .mk 2024-01-26 12:43:08 +00:00