|
QNX 7: replacement of pci_device_read_irq() by pci_config_read_irq()
|
09/27/2020 5:38 AM
post120957
|
QNX 7: replacement of pci_device_read_irq() by pci_config_read_irq()
Just for supporting paralllel bus adaptesr under QNX 7!!
#include <hw/inout.h>
/* replacement of pci_device_read_irq() by pci_config_read_irq() */
/* Use these macros for getting bus & dev:
PCI_DEV(_bdf_)
PCI_BUS(_bdf_)
from a pci_bdf_t var */
/* permissions for in / out must be set*/
#define PCI_CONFIG_DATA 0x0CFC
#define PCI_CONFIG_ADDRESS 0x0CF8
#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
/**
* Liest ein Dword aus einem PCI-Konfigurations-Register
* @param bus Bus
* @param dev Gerät
* @param func Funktion
* @return Register content
*/
int pci_config_read_irq(int bus,int dev) {
int val;
int address = 0x80000000|(bus<<16)|(dev<<11)|(func<<8)|(PCI_INTERRUPT_PIN&0xFC);
out32(PCI_CONFIG_ADDRESS,address);
val = in32(PCI_CONFIG_DATA);
return val;
}
|
|
|