use crate::{GenericAddressStructure, SDTHeader};
use core::ffi::CStr;
#[derive(Copy, Clone)]
#[repr(C, packed)]
pub struct EmbeddedControllerBootResourcesTable {
pub header: SDTHeader,
pub ec_control: GenericAddressStructure,
pub ec_data: GenericAddressStructure,
pub uid: u32,
pub gpe_bit: u8,
pub ec_id: [u8; 0],
}
impl EmbeddedControllerBootResourcesTable {
pub const fn ec_id(&self) -> &CStr {
unsafe {
CStr::from_bytes_with_nul_unchecked(core::slice::from_raw_parts(
(self as *const _ as *const u8).add(0x41),
self.header.length as usize - 0x41,
))
}
}
}