summaryrefslogtreecommitdiff
path: root/src/sys/include/io/pci/pci.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-20 15:36:43 -0400
committerIan Moffett <ian@osmora.org>2025-09-20 15:36:43 -0400
commit4d34c53e0691888632a64c89ce2024a7d4134a12 (patch)
treefd73029163b3fb99ae6e6e26b8dfa56ed874d548 /src/sys/include/io/pci/pci.h
parent1a6c982dc7aebbd14b7966170c3847c1792991db (diff)
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 <ian@osmora.org>
Diffstat (limited to 'src/sys/include/io/pci/pci.h')
-rw-r--r--src/sys/include/io/pci/pci.h2
1 files changed, 2 insertions, 0 deletions
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;
};