drivers/pci/pci-bridge-emul.c
Source file repositories/reference/linux-study-clean/drivers/pci/pci-bridge-emul.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/pci-bridge-emul.c- Extension
.c- Size
- 18384 bytes
- Lines
- 622
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hpci-bridge-emul.h
Detected Declarations
struct pci_bridge_reg_behaviorfunction pci_bridge_emul_read_ssidfunction pci_bridge_emul_initfunction pci_bridge_emul_initfunction pci_bridge_emul_conf_readfunction pci_bridge_emul_conf_writeexport pci_bridge_emul_initexport pci_bridge_emul_cleanupexport pci_bridge_emul_conf_readexport pci_bridge_emul_conf_write
Annotated Snippet
struct pci_bridge_reg_behavior {
/* Read-only bits */
u32 ro;
/* Read-write bits */
u32 rw;
/* Write-1-to-clear bits */
u32 w1c;
};
static const
struct pci_bridge_reg_behavior pci_regs_behavior[PCI_STD_HEADER_SIZEOF / 4] = {
[PCI_VENDOR_ID / 4] = { .ro = ~0 },
[PCI_COMMAND / 4] = {
.rw = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER | PCI_COMMAND_PARITY |
PCI_COMMAND_SERR),
.ro = ((PCI_COMMAND_SPECIAL | PCI_COMMAND_INVALIDATE |
PCI_COMMAND_VGA_PALETTE | PCI_COMMAND_WAIT |
PCI_COMMAND_FAST_BACK) |
(PCI_STATUS_CAP_LIST | PCI_STATUS_66MHZ |
PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MASK) << 16),
.w1c = PCI_STATUS_ERROR_BITS << 16,
},
[PCI_CLASS_REVISION / 4] = { .ro = ~0 },
/*
* Cache Line Size register: implement as read-only, we do not
* pretend implementing "Memory Write and Invalidate"
* transactions"
*
* Latency Timer Register: implemented as read-only, as "A
* bridge that is not capable of a burst transfer of more than
* two data phases on its primary interface is permitted to
* hardwire the Latency Timer to a value of 16 or less"
*
* Header Type: always read-only
*
* BIST register: implemented as read-only, as "A bridge that
* does not support BIST must implement this register as a
* read-only register that returns 0 when read"
*/
[PCI_CACHE_LINE_SIZE / 4] = { .ro = ~0 },
/*
* Base Address registers not used must be implemented as
* read-only registers that return 0 when read.
*/
[PCI_BASE_ADDRESS_0 / 4] = { .ro = ~0 },
[PCI_BASE_ADDRESS_1 / 4] = { .ro = ~0 },
[PCI_PRIMARY_BUS / 4] = {
/* Primary, secondary and subordinate bus are RW */
.rw = GENMASK(24, 0),
/* Secondary latency is read-only */
.ro = GENMASK(31, 24),
},
[PCI_IO_BASE / 4] = {
/* The high four bits of I/O base/limit are RW */
.rw = (GENMASK(15, 12) | GENMASK(7, 4)),
/* The low four bits of I/O base/limit are RO */
.ro = (((PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK |
PCI_STATUS_DEVSEL_MASK) << 16) |
GENMASK(11, 8) | GENMASK(3, 0)),
.w1c = PCI_STATUS_ERROR_BITS << 16,
},
[PCI_MEMORY_BASE / 4] = {
/* The high 12-bits of mem base/limit are RW */
.rw = GENMASK(31, 20) | GENMASK(15, 4),
/* The low four bits of mem base/limit are RO */
.ro = GENMASK(19, 16) | GENMASK(3, 0),
},
[PCI_PREF_MEMORY_BASE / 4] = {
/* The high 12-bits of pref mem base/limit are RW */
.rw = GENMASK(31, 20) | GENMASK(15, 4),
/* The low four bits of pref mem base/limit are RO */
.ro = GENMASK(19, 16) | GENMASK(3, 0),
},
[PCI_PREF_BASE_UPPER32 / 4] = {
.rw = ~0,
},
Annotation
- Immediate include surface: `linux/pci.h`, `pci-bridge-emul.h`.
- Detected declarations: `struct pci_bridge_reg_behavior`, `function pci_bridge_emul_read_ssid`, `function pci_bridge_emul_init`, `function pci_bridge_emul_init`, `function pci_bridge_emul_conf_read`, `function pci_bridge_emul_conf_write`, `export pci_bridge_emul_init`, `export pci_bridge_emul_cleanup`, `export pci_bridge_emul_conf_read`, `export pci_bridge_emul_conf_write`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.