kernel_acpi/lib.rs
1//! # System ACPI Support
2
3#![cfg_attr(not(test), no_std)]
4#![allow(unsafe_code)]
5
6pub mod rsdp;
7
8/// Map a physical region and return a *read-only* byte slice for its contents.
9/// You provide the implementation (identity map, kmap, etc.).
10pub trait PhysMapRo {
11 /// # Safety
12 /// The implementor must ensure the returned slice is valid for `len` bytes.
13 unsafe fn map_ro<'a>(&self, paddr: u64, len: usize) -> &'a [u8];
14}
15
16fn sum(bytes: &[u8]) -> u8 {
17 bytes.iter().fold(0, |a, &b| a.wrapping_add(b))
18}