PCI / shared library conflicts

Hi,

here’s a problem we’re having with QNX 4.25:
One of our applications uses the _CA_PCI_xxx() functions, especially
_CA_PCI_BIOS_Present().
This application used to work fine until we decided to put some functions of
this app into a shared library.
From that moment on, the PCI function always returned -1 (error).

I did some testing and now am rather sure that PCI functions and shared libs
won’t go together. They don’t
even work with the photon shlibs.

Also, the online help for the PCI functions mentions that the stack size
shouldn’t exceed 64k - I found that
the limit is more like 60k… the reason for this seems to be the ‘offset’
determined at link time… as soon as
it becomes greater than 64k, PCI funcs stop working.

Why is this?
And does it have to be?
Can this be fixed or worked around?
If so, how?

Regards,
Thomas

JE <L.fehr@je-gmbh.de> wrote:

Hi,

here’s a problem we’re having with QNX 4.25:
One of our applications uses the _CA_PCI_xxx() functions, especially
_CA_PCI_BIOS_Present().
This application used to work fine until we decided to put some functions of
this app into a shared library.
From that moment on, the PCI function always returned -1 (error).



Also, the online help for the PCI functions mentions that the stack size
shouldn’t exceed 64k - I found that
the limit is more like 60k… the reason for this seems to be the ‘offset’
determined at link time… as soon as
it becomes greater than 64k, PCI funcs stop working.

Yup.

It is a limitation of the fact that we make a direct call into the
PCI BIOS – it can not be executed with a stack size/address above
64K.

Why is this?
And does it have to be?
Can this be fixed or worked around?
If so, how?

Setup a server that makes the pci calls, build a message passing API
that turns the local calls into message passes to a server that does
the work. (e.g. write a driver in a seperate process to access the
PCI hardware).

I wrote and posted an implementation of this at:

ftp.qnx.com:/usr/free/qnx4/os/samples/misc/ca_pci_msg.tgz

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.