mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 16:13:27 +00:00
23 lines
510 B
Rust
23 lines
510 B
Rust
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
pub mod capability;
|
|
pub mod common_cfg;
|
|
pub mod device;
|
|
pub mod driver;
|
|
pub(super) mod msix;
|
|
|
|
use alloc::sync::Arc;
|
|
|
|
use aster_frame::bus::pci::PCI_BUS;
|
|
use spin::Once;
|
|
|
|
use self::driver::VirtioPciDriver;
|
|
|
|
pub static VIRTIO_PCI_DRIVER: Once<Arc<VirtioPciDriver>> = Once::new();
|
|
pub fn virtio_pci_init() {
|
|
VIRTIO_PCI_DRIVER.call_once(|| Arc::new(VirtioPciDriver::new()));
|
|
PCI_BUS
|
|
.lock()
|
|
.register_driver(VIRTIO_PCI_DRIVER.get().unwrap().clone());
|
|
}
|