1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//! ACPI table generation.

pub mod aml;
pub mod facs;
pub mod rsdp;
pub mod sdt;

pub use self::sdt::HEADER_LEN;

fn generate_checksum(data: &[u8]) -> u8 {
    (255 - data.iter().fold(0u8, |acc, x| acc.wrapping_add(*x))).wrapping_add(1)
}