Skip to main content

acpi_spec/
slit.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use super::Table;
5use crate::packed_nums::*;
6use zerocopy::FromBytes;
7use zerocopy::Immutable;
8use zerocopy::IntoBytes;
9use zerocopy::KnownLayout;
10use zerocopy::Unaligned;
11
12/// SLIT table header (after the standard ACPI header).
13///
14/// The SLIT body is an N×N matrix of `u8` distances appended after this header.
15#[repr(C)]
16#[derive(Copy, Clone, Debug, IntoBytes, Immutable, KnownLayout, FromBytes, Unaligned)]
17pub struct SlitHeader {
18    pub number_of_system_localities: u64_ne,
19}
20
21impl SlitHeader {
22    pub fn new(num_localities: u64) -> Self {
23        Self {
24            number_of_system_localities: num_localities.into(),
25        }
26    }
27}
28
29impl Table for SlitHeader {
30    const SIGNATURE: [u8; 4] = *b"SLIT";
31}
32
33pub const SLIT_REVISION: u8 = 1;