Init PCI compoment

This commit is contained in:
Yuke Peng 2025-07-25 15:25:38 +08:00 committed by Tate, Hongliang Tian
parent 391f11f1aa
commit f2d1cbdf57
6 changed files with 41 additions and 0 deletions

10
Cargo.lock generated
View File

@ -251,6 +251,16 @@ dependencies = [
"xmas-elf",
]
[[package]]
name = "aster-pci"
version = "0.1.0"
dependencies = [
"component",
"log",
"ostd",
"spin",
]
[[package]]
name = "aster-rights"
version = "0.1.0"

View File

@ -25,6 +25,7 @@ members = [
"kernel/comps/mlsdisk",
"kernel/comps/time",
"kernel/comps/virtio",
"kernel/comps/pci",
"kernel/libs/cpio-decoder",
"kernel/libs/int-to-c-enum",
"kernel/libs/int-to-c-enum/derive",

View File

@ -13,6 +13,7 @@ network = { name = "aster-network" }
mlsdisk = { name = "aster-mlsdisk" }
systree = { name = "aster-systree" }
keyboard = { name = "aster-keyboard" }
pci = { name = "aster-pci" }
[whitelist]
[whitelist.nix.main]

View File

@ -207,6 +207,7 @@ OSDK_CRATES := \
kernel/comps/mlsdisk \
kernel/comps/time \
kernel/comps/virtio \
kernel/comps/pci \
kernel/libs/aster-util \
kernel/libs/aster-bigtcp \
kernel/libs/xarray

View File

@ -0,0 +1,15 @@
[package]
name = "aster-pci"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ostd = { path = "../../../ostd" }
component = { path = "../../libs/comp-sys/component" }
log = "0.4"
spin = "0.9.4"
[lints]
workspace = true

View File

@ -0,0 +1,13 @@
// SPDX-License-Identifier: MPL-2.0
//! PCI bus in Asterinas
#![no_std]
#![deny(unsafe_code)]
use component::{init_component, ComponentInitError};
#[init_component]
fn pci_init() -> Result<(), ComponentInitError> {
init();
Ok(())
}