To meet test CI conditions

This commit is contained in:
Luoyuan Xiao 2022-05-27 14:21:33 +08:00
parent 0f1ea71bfb
commit 6ab43eb9d8
3 changed files with 17 additions and 10 deletions

View File

@ -1,5 +1,6 @@
#![allow(unused)]
#[cfg(any(target_arch = "x86_64", target_arch = "riscv64"))]
pub mod pci;
pub fn phys_to_virt(paddr: PhysAddr) -> VirtAddr {

View File

@ -1,9 +1,7 @@
use alloc::boxed::Box;
use alloc::format;
use alloc::sync::Arc;
use zcore_drivers::builder::{DevicetreeDriverBuilder, IoMapper};
use zcore_drivers::bus::pci;
use zcore_drivers::irq::riscv::ScauseIntCode;
use zcore_drivers::uart::BufferedUart;
use zcore_drivers::{Device, DeviceResult};
@ -64,9 +62,14 @@ pub(super) fn init() -> DeviceResult {
}
}
let pci_devs = pci::init(Some(Arc::new(IoMapperImpl)))?;
for d in pci_devs.into_iter() {
drivers::add_device(d);
#[cfg(not(feature = "loopback"))]
{
use alloc::sync::Arc;
use zcore_drivers::bus::pci;
let pci_devs = pci::init(Some(Arc::new(IoMapperImpl)))?;
for d in pci_devs.into_iter() {
drivers::add_device(d);
}
}
intc_init()?;

View File

@ -1,6 +1,5 @@
use alloc::{boxed::Box, sync::Arc};
use zcore_drivers::bus::pci;
use zcore_drivers::irq::x86::Apic;
use zcore_drivers::scheme::IrqScheme;
use zcore_drivers::uart::{BufferedUart, Uart16550Pmio};
@ -48,10 +47,14 @@ pub(super) fn init() -> DeviceResult {
drivers::add_device(Device::Irq(irq));
// PCI scan
let pci_devs = pci::init(None)?;
for d in pci_devs.into_iter() {
drivers::add_device(d);
#[cfg(not(feature = "loopback"))]
{
// PCI scan
use zcore_drivers::bus::pci;
let pci_devs = pci::init(None)?;
for d in pci_devs.into_iter() {
drivers::add_device(d);
}
}
#[cfg(feature = "graphic")]