#[repr(C)]
pub struct TableSignatures;

#[repr(C)]
pub struct RuntimeServicesTable {
    efi_table_header: TableHeader,
}

#[repr(C)]
pub struct ACPIConfigurationTable {}

#[repr(C)]
pub struct SMBIOSConfigurationTable {}

#[repr(C)]
pub struct SALSystemTable {}

#[repr(C)]
pub struct ConfigurationTable {}

#[repr(C)]
pub struct SimpleTextInputProtocol {}

#[repr(C)]
pub struct TableHeader {
    signature: u64,
    revision: u32,
    header_size: u32,
    crc32: u32,
    reserved: u32,
}

#[repr(u64)]
pub enum Status {
    Success = 0,
    LoadError = 1,
    InvalidParameter = 2,
    Unsupported = 3,
    BadBufferSize = 4,
    BufferTooSmall = 5,
    NotReady = 6,
    DeviceError = 7,
    WriteProtected = 8,
    OutOfResources = 9,
    VolumeCorrupted = 10,
    VolumeFull = 11,
    NoMedia = 12,
    MediaChanged = 13,
    NotFound = 14,
    AccessDenied = 15,
    NoResponse = 16,
    NoMapping = 17,
    Timeout = 18,
    NotStarted = 19,
    AlreadyStarted = 20,
    Aborted = 21,
    IcmpError = 22,
    TftpError = 23,
    ProtocolError = 24,
    IncompatibleVersion = 25,
    SecurityViolation = 26,
    CrcError = 27,
    EndOfMedia = 28,
    EndOfFile = 31,
    InvalidLanguage = 32,
    CompromisedData = 33,
    IpAddressConflict = 34,
    HttpError = 35,
}

impl From<u64> for Status {
    fn from(value: u64) -> Self {
        match value {
            0 => Status::Success,
            1 => Status::LoadError,
            2 => Status::InvalidParameter,
            3 => Status::Unsupported,
            4 => Status::BadBufferSize,
            5 => Status::BufferTooSmall,
            6 => Status::NotReady,
            7 => Status::DeviceError,
            8 => Status::WriteProtected,
            9 => Status::OutOfResources,
            10 => Status::VolumeCorrupted,
            11 => Status::VolumeFull,
            12 => Status::NoMedia,
            13 => Status::MediaChanged,
            14 => Status::NotFound,
            15 => Status::AccessDenied,
            16 => Status::NoResponse,
            17 => Status::NoMapping,
            18 => Status::Timeout,
            19 => Status::NotStarted,
            20 => Status::AlreadyStarted,
            21 => Status::Aborted,
            22 => Status::IcmpError,
            23 => Status::TftpError,
            24 => Status::ProtocolError,
            25 => Status::IncompatibleVersion,
            26 => Status::SecurityViolation,
            27 => Status::CrcError,
            28 => Status::EndOfMedia,
            31 => Status::EndOfFile,
            32 => Status::InvalidLanguage,
            33 => Status::CompromisedData,
            34 => Status::IpAddressConflict,
            35 => Status::HttpError,
            _ => Status::Unsupported, // Default case
        }
    }
}

impl From<Status> for u64 {
    fn from(status: Status) -> Self {
        status as u64
    }
}

impl From<Status> for usize {
    fn from(status: Status) -> Self {
        status as usize
    }
}

#[repr(C)]
pub struct GUID {
    pub data1: u32,
    pub data2: u16,
    pub data3: u16,
    pub data4: [u8; 8],
}
