Rust XHCI Implementation.
This commit is contained in:
parent
8b022a6b24
commit
7bbbf79bd6
26 changed files with 1901 additions and 209 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use core::ffi::c_void;
|
||||
|
||||
use alloc::sync::Arc;
|
||||
use mammoth::{
|
||||
cap::Capability,
|
||||
|
|
@ -26,8 +28,11 @@ impl AhciController {
|
|||
pub fn new(pci_memory: Capability) -> Self {
|
||||
let pci_device = PciDevice::from_cap(pci_memory).unwrap();
|
||||
|
||||
let hba_vaddr =
|
||||
mem::map_direct_physical_and_leak(pci_device.header().bars[5] as u64, 0x1100);
|
||||
let hba_vaddr = mem::map_direct_physical_and_leak::<c_void>(
|
||||
pci_device.header().bars[5] as usize,
|
||||
0x1100,
|
||||
)
|
||||
.as_ptr() as u64;
|
||||
let hba = unsafe { (hba_vaddr as *mut AhciHba).as_mut().unwrap() };
|
||||
let mut controller = Self {
|
||||
pci_device: Mutex::new(pci_device),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue