Need Help Accessing PCI devices under QNX 4 with Watcom 10.6

Hi All;
I am current getting a SIGSEGV everytime I try to run the program below.
This happens even when I comment out the block of code referring to
_CA_PCI_Find_Device. To compile the program I type the following:
cc -o find find.c

It seems to compile and link OK. I know that there is a thread privity issue
under QNX RTP that is taken care of by calling:
ThreadCtl(_NTO_TCTL_IO,0);

What should I do to accomplish the same thing under QNX 4? Any help/insights
would be greatly appreciated.

#include <stdio.h>
#include <stdlib.h>
#include <sys/pci.h>

void main()
{
unsigned busnum, devfuncnum,index=0;
unsigned lastbus, version, hardware;
unsigned DEVICE_ID, VENDOR_ID;
DEVICE_ID = 0x11B0;
VENDOR_ID = 0x4750;

if (_CA_PCI_BIOS_Present (&lastbus, &version, &hardware) !=PCI_SUCCESS)
{
printf(“Error no PCI Bios found!!!\n”);
exit (0);
}

if (_CA_PCI_Find_Device(DEVICE_ID,VENDOR_ID,index,&busnum,
&devfuncnum)!=PCI_SUCCESS){
printf (“SCRAMNet card not found!!\n”);
exit (0);
}
else
{
printf(“Found card!!\n”);
printf (“card is at index 0x%\n”, index);
printf (“card is located at bus 0x%x\n”,busnum);
printf (“card is devfunction type 0x%x\n”, devfuncnum);
}
}

Chris Fought <cfought@systran.com> wrote:

Hi All;
I am current getting a SIGSEGV everytime I try to run the program below.
This happens even when I comment out the block of code referring to
_CA_PCI_Find_Device. To compile the program I type the following:
cc -o find find.c

It seems to compile and link OK. I know that there is a thread privity issue
under QNX RTP that is taken care of by calling:
ThreadCtl(_NTO_TCTL_IO,0);

What should I do to accomplish the same thing under QNX 4? Any help/insights
would be greatly appreciated.

cc -T1 at link time.

-David

QNX Training Services
dagibbs@qnx.com