I'm reading pci_mapreg_type(9) and I'm wondering about the returns of
this function. The documentation says it can return either
PCI_MAPREG_TYPE_IO or PCI_MAPREG_TYPE_MEM. But I also see at least one
driver checking the type for PCI_MAPREG_MEM_TYPE_64BIT
Looking at the definitions of these in sys/dev/pci/pcireg.h I see the
two defines listed above but also some others that seem specific to
memory mapped registers.
#define PCI_MAPREG_TYPE(mr) \
((mr) & PCI_MAPREG_TYPE_MASK)
#define PCI_MAPREG_TYPE_MASK 0x00000001
#define PCI_MAPREG_TYPE_MEM 0x00000000
#define PCI_MAPREG_TYPE_IO 0x00000001
#define PCI_MAPREG_MEM_TYPE(mr) \
((mr) & PCI_MAPREG_MEM_TYPE_MASK)
#define PCI_MAPREG_MEM_TYPE_MASK 0x00000006
#define PCI_MAPREG_MEM_TYPE_32BIT 0x00000000
#define PCI_MAPREG_MEM_TYPE_32BIT_1M 0x00000002
#define PCI_MAPREG_MEM_TYPE_64BIT 0x00000004
So, I am curious about the correct way to be using these,
pci_mapreg_type(9) doesn't seem to light the way very far here. Please
send help I'm in a maze of twisty little passages, all alike.
--
Ted Bullock <[email protected]>