#[repr(u32)]
#[derive(Copy, Clone, Debug)]
pub enum HeaderTagISA {
I386 = 0,
MIPS32 = 4,
}
#[repr(u16)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum HeaderTagType {
End = 0,
InformationRequest = 1,
Address = 2,
EntryAddress = 3,
ConsoleFlags = 4,
Framebuffer = 5,
ModuleAlign = 6,
EfiBS = 7,
EntryAddressEFI32 = 8,
EntryAddressEFI64 = 9,
Relocatable = 10,
}
impl HeaderTagType {
pub const fn count() -> u32 {
11
}
}
#[repr(u16)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum HeaderTagFlag {
Required = 0,
Optional = 1,
}
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct HeaderTag {
typ: HeaderTagType,
flags: HeaderTagFlag,
size: u32,
}
impl HeaderTag {
pub const fn typ(&self) -> HeaderTagType {
self.typ
}
pub const fn flags(&self) -> HeaderTagFlag {
self.flags
}
pub const fn size(&self) -> u32 {
self.size
}
}
#[cfg(test)]
mod tests {
use crate::HeaderTag;
#[test]
fn test_assert_size() {
assert_eq!(core::mem::size_of::<HeaderTag>(), 2 + 2 + 4);
}
}