From 4d34c53e0691888632a64c89ce2024a7d4134a12 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 20 Sep 2025 15:36:43 -0400 Subject: kern: pci: Handle base address registers (BARs) This commit handles base address registers by storing them in a bar array within the PCI device structure. We also introduced a helper header to perform operations with BARs such as getting the length of their underlying region Signed-off-by: Ian Moffett --- src/sys/include/io/pci/pci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sys/include/io/pci/pci.h') diff --git a/src/sys/include/io/pci/pci.h b/src/sys/include/io/pci/pci.h index 9184c00..fedb0d5 100644 --- a/src/sys/include/io/pci/pci.h +++ b/src/sys/include/io/pci/pci.h @@ -62,6 +62,7 @@ typedef uint32_t pcival_t; * @func: Function number of device * @vendor: Vendor ID * @device: Device ID + * @bar: Base address registers */ struct pci_device { uint16_t bus; @@ -71,6 +72,7 @@ struct pci_device { uint8_t subclass; uint16_t vendor; uint16_t device; + uint32_t bar[6]; TAILQ_ENTRY(pci_device) link; }; -- cgit v1.2.3