aboutsummaryrefslogtreecommitdiff
path: root/sys/include/dev/pci/pciregs.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-12-17 21:40:34 -0500
committerIan Moffett <ian@osmora.org>2024-12-17 21:44:10 -0500
commitb6cceb40835d6b200aaf8731ba9dac5c3bb62180 (patch)
tree200542caa9d0d0361b389da606f16c1787e605e1 /sys/include/dev/pci/pciregs.h
parentf763a3d69cbddab734c51100310504d8113d7ac4 (diff)
kernel/amd64: pci: Allow mapping of 64 bit BARs
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/dev/pci/pciregs.h')
-rw-r--r--sys/include/dev/pci/pciregs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/include/dev/pci/pciregs.h b/sys/include/dev/pci/pciregs.h
index 763fade..f0ed4d2 100644
--- a/sys/include/dev/pci/pciregs.h
+++ b/sys/include/dev/pci/pciregs.h
@@ -69,4 +69,9 @@
#define PCI_CAP_MSI 0x05
#define PCI_CAP_MSIX 0x11
+/* PCI BAR defines */
+#define PCI_BAR_TYPE(BAR) ((BAR >> 1) & 3)
+#define PCI_BAR_32(BAR) (PCI_BAR_TYPE(BAR) == 0x0)
+#define PCI_BAR_64(BAR) (PCI_BAR_TYPE(BAR) == 0x2)
+
#endif /* _PCI_PCIREGS_H_ */