Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - QNX 7: replacement of pci_device_read_irq() by pci_config_read_irq(): (1 Item)
   
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;
}