pci_util.bas

PCI Utility Functions

Author

Marcel Sondaar

License

Public Domain

Summary
pci_util.basPCI Utility Functions
Functions
PCI_bar_readaddressReturns the address contained in a specific Base Address Register
PCI_bar_readmaskReturns the size mask for the selected Base Address Register

Functions

PCI_bar_readaddress

Function PCI_bar_readaddress(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Bar As Unsigned Integer
) As Unsigned Integer

Returns the address contained in a specific Base Address Register

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
BarThe base address register to read

Out

ReturnThe offset for the current BAR

PCI_bar_readmask

Function PCI_bar_readmask(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Bar As Unsigned Integer
) As Unsigned Integer

Returns the size mask for the selected Base Address Register

In

BusThe PCI Bus index
DeviceThe Device index of the bus
FuncThe subfunction of the device
BarThe base address register to read

Out

ReturnThe offset for the current BAR
Function PCI_bar_readaddress(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Bar As Unsigned Integer
) As Unsigned Integer
Returns the address contained in a specific Base Address Register
Function PCI_bar_readmask(
   ByVal Bus As Unsigned Integer,
   ByVal Device As Unsigned Integer,
   ByVal Func As Unsigned Integer,
   ByVal Bar As Unsigned Integer
) As Unsigned Integer
Returns the size mask for the selected Base Address Register