This commit inits dbs-pci lib for Dragonball to use. It contains several implementation now: 1. PCI configuration space 2. PCI bus More info of the design & behavior of those two features could be found in the README of dbs-pci. fixes: #8479 Signed-off-by: Gerry Liu <gerry@linux.alibaba.com> Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com> Signed-off-by: Shifang Feng <fengshifang@linux.alibaba.com> Signed-off-by: Yang Su <yang.su@linux.alibaba.com> Signed-off-by: Zha Bin <zhabin@linux.alibaba.com> Signed-off-by: Xin Lin <jingshan@linux.alibaba.com> Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
980 B
dbs-pci
Introduction
dbs-pci
is a crate for emulating PCI device.
There are several components in dbs-pci
crate building together to emulate PCI device behaviour :
-
device mod: mainly provide the trait for
PciDevice
, providing the ability to get id, write PCI configuration space, read PCI configuration space andas_any
to downcast the trait object to the actual device type. -
configuration mod: simulate PCI device configuration header and manage PCI Bar configuration. The PCI Specification defines the organization of the 256-byte Configuration Space registers and imposes a specific template for the space. The first 64 bytes of configuration space are standardised as configuration space header.
-
bus mod: simulate PCI buses, to simplify the implementation, PCI hierarchy is not supported. So all PCI devices are directly connected to the PCI root bus. PCI Bus has bus id, PCI devices attached and PCI bus I/O port, I/O mem resource use condition.