// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: utcksum - Support generating table checksums * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acutils.h" /* This module used for application-level code only */ #define _COMPONENT … ACPI_MODULE_NAME("utcksum") /******************************************************************************* * * FUNCTION: acpi_ut_verify_checksum * * PARAMETERS: table - ACPI table to verify * length - Length of entire table * * RETURN: Status * * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns * exception on bad checksum. * Note: We don't have to check for a CDAT here, since CDAT is * not in the RSDT/XSDT, and the CDAT table is never installed * via ACPICA. * ******************************************************************************/ acpi_status acpi_ut_verify_checksum(struct acpi_table_header *table, u32 length) { … } /******************************************************************************* * * FUNCTION: acpi_ut_verify_cdat_checksum * * PARAMETERS: table - CDAT ACPI table to verify * length - Length of entire table * * RETURN: Status * * DESCRIPTION: Verifies that the CDAT table checksums to zero. Optionally * returns an exception on bad checksum. * ******************************************************************************/ acpi_status acpi_ut_verify_cdat_checksum(struct acpi_table_cdat *cdat_table, u32 length) { … } /******************************************************************************* * * FUNCTION: acpi_ut_generate_checksum * * PARAMETERS: table - Pointer to table to be checksummed * length - Length of the table * original_checksum - Value of the checksum field * * RETURN: 8 bit checksum of buffer * * DESCRIPTION: Computes an 8 bit checksum of the table. * ******************************************************************************/ u8 acpi_ut_generate_checksum(void *table, u32 length, u8 original_checksum) { … } /******************************************************************************* * * FUNCTION: acpi_ut_checksum * * PARAMETERS: buffer - Pointer to memory region to be checked * length - Length of this memory region * * RETURN: Checksum (u8) * * DESCRIPTION: Calculates circular checksum of memory region. * ******************************************************************************/ u8 acpi_ut_checksum(u8 *buffer, u32 length) { … }