// Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: MIT

// TODO: Implement per-arch memory handlers for ACPI memory map regions

use lazy_static::lazy_static;
use limine::{request::RsdpRequest, response::RsdpResponse};

use crate::{format, log::*, log_info, log_warning};

#[used]
#[unsafe(link_section = ".requests")]
pub static RSDP_REQUEST: RsdpRequest = limine::request::RsdpRequest::new();

lazy_static! {
    pub static ref RSDP: Option<&'static RsdpResponse> = match RSDP_REQUEST.get_response() {
        Some(resp) => {
            log_info!("Device: Got RSDP pointer");
            Some(resp)
        }
        None => {
            log_warning!("Device: Did not get RSDP pointer, ACPI unavailable");
            None
        }
    };
}
