mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-12 12:21:37 -10:00
It will be used outside of the kernel. While at it clean the function up a bit to make it a little more readable.
24 lines
425 B
C++
24 lines
425 B
C++
/*
|
|
* Copyright (c) 2026, Undefine <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "Table.h"
|
|
#include <AK/BitCast.h>
|
|
|
|
namespace ACPI {
|
|
|
|
bool validate_table(::ACPI::Structures::SDTHeader const& header)
|
|
{
|
|
auto const* sdt = reinterpret_cast<u8 const*>(&header);
|
|
|
|
u8 checksum = 0;
|
|
for (size_t i = 0; i < header.length; i++)
|
|
checksum += sdt[i];
|
|
|
|
return checksum == 0;
|
|
}
|
|
|
|
}
|