INtime SDK Help
PciGetExtendedAddressSpace
INtime SDK v6 > About INtime > Other system libraries > PCI Library > PciGetExtendedAddressSpace

Obtains and decodes extended BAR address space information from a PCI device.

The PCIDEV structure should be fully initialized, as returned from a call to PciFindDevicePciFindClass or PciReadHeader.

BOOLEAN PciGetExtendedAddressSpace(
    PCIDEV *pPciDevice, 
    PCISPACE *space, 
    LPDWORD pdwCount);

Parameters

pPciDevice
A pointer to a PCIDEV structure, initialized as described above.
pSpace
A pointer to an array of PCISPACE structures which will be filled with the extended BAR information for the device.
pdwCount
A pointer to the count of the elements referenced by pSpace. After a successful call returns the number of extended address spaces found.

Example

Use this call before calling PciReadHeader, as follows:

PciGetExtendedAddressSpace sample
Copy Code

PCIDEV pci;
PCISPACE sp[3];
DWORD count, i;
LPDWORD regs;

// read the header info for device @ PCI 2:0.0

pci.wBusNum = 2;
pci.wDeviceNum = 0;
pci.wFunction = 0;

// Read the device header information

PciReadHeader(&pci);
count = 3;
if (PciGetExtendedAddressSpace(&pci, sp, &count) && count > 0) {
    // map the 64-bit physical address of the first extended BAR range
    regs = MapRtPhysicalAddress64(sp[0].start, sp[0].size, 0);
}

Return Values

TRUE, if the device exists. Otherwise FALSE.

Requirements

Versions Defined in Include Link to
INtime 6.3 intime/rt/include/pcibus.h pcibus.h pcibus.lib
   
See Also