use core::{alloc::Layout, ptr::NonNull};

use yggdrasil_abi::error::Error;

#[derive(Debug)]
pub struct DmaAllocation {
    pub host_virtual: NonNull<()>,
    pub host_physical: u64,
    pub bus_address: u64,
    pub page_count: usize,
}

pub trait DmaAllocator: Send + Sync {
    fn allocate(&self, layout: Layout) -> Result<DmaAllocation, Error>;
}
