1234567891011121314151617181920212223242526272829303132333435 |
- use core::{ops::Deref, ptr::NonNull};
- pub struct PhysicalMapping<T> {
- pub physical_start: usize,
- pub virtual_start: NonNull<T>,
- pub region_length: usize,
- pub mapped_length: usize,
- }
- impl<T> Deref for PhysicalMapping<T> {
- type Target = T;
- fn deref(&self) -> &T {
- unsafe { self.virtual_start.as_ref() }
- }
- }
- pub trait AcpiHandler {
-
-
-
-
-
- unsafe fn map_physical_region<T>(&mut self, physical_address: usize, size: usize) -> PhysicalMapping<T>;
-
-
- fn unmap_physical_region<T>(&mut self, region: PhysicalMapping<T>);
- }
|