From b6cceb40835d6b200aaf8731ba9dac5c3bb62180 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 17 Dec 2024 21:40:34 -0500 Subject: kernel/amd64: pci: Allow mapping of 64 bit BARs Signed-off-by: Ian Moffett --- sys/include/dev/pci/pciregs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/include/dev/pci') 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_ */ -- cgit v1.2.3