QNX4 "_CA_PCI_Set_Hardware_Interrupt()" function

Hello

I’ve found the prototype for_CA_PCI_Set_Hardware_Interrupt() function in
/usr/include/sys/pci.h, but I can’t find the related help on the
“Watcom C Library reference”.

Does it mean I can change the IRQ # that BIOS has assigned to a PCI device?

Thanks

Davide Ancri <davidea@prisma-eng.it> wrote:
: Hello

: I’ve found the prototype for_CA_PCI_Set_Hardware_Interrupt() function in
: /usr/include/sys/pci.h, but I can’t find the related help on the
: “Watcom C Library reference”.

: Does it mean I can change the IRQ # that BIOS has assigned to a PCI device?

It’s been a long time since I worked on those docs, but I think that that
function isn’t supported. Someone else might know for sure.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Steve Reid <stever@qnx.com> wrote:

Davide Ancri <> davidea@prisma-eng.it> > wrote:
: Hello

: I’ve found the prototype for_CA_PCI_Set_Hardware_Interrupt() function in
: /usr/include/sys/pci.h, but I can’t find the related help on the
: “Watcom C Library reference”.

: Does it mean I can change the IRQ # that BIOS has assigned to a PCI device?

It’s been a long time since I worked on those docs, but I think that that
function isn’t supported. Someone else might know for sure.

Essentially yes. You may still get away with calling it – I think it
is in the library (well, macros, the _CA_PCI stuff is all macros that
jump into the PCI bios).

But, I’m not sure what the routine does – you might need to get the specs
for the _CA_PCI bios calls… I think it is a PCI spec 2.0 or 2.1 or
something like that.

There is also an IRQ_routing call in there… it might be related.

But, normally, you shouldn’t need to do this – why do you want to
change the IRQ assigned by the BIOS to your card?

-David

QNX Training Services
I do not answer technical questions by email.

David Gibbs wrote:

Steve Reid <> stever@qnx.com> > wrote:

Davide Ancri <> davidea@prisma-eng.it> > wrote:
: Hello


: I’ve found the prototype for_CA_PCI_Set_Hardware_Interrupt() function in
: /usr/include/sys/pci.h, but I can’t find the related help on the
: “Watcom C Library reference”.


: Does it mean I can change the IRQ # that BIOS has assigned to a PCI device?


It’s been a long time since I worked on those docs, but I think that that
function isn’t supported. Someone else might know for sure.


Essentially yes. You may still get away with calling it – I think it
is in the library (well, macros, the _CA_PCI stuff is all macros that
jump into the PCI bios).

But, I’m not sure what the routine does – you might need to get the specs
for the _CA_PCI bios calls… I think it is a PCI spec 2.0 or 2.1 or
something like that.

There is also an IRQ_routing call in there… it might be related.

But, normally, you shouldn’t need to do this – why do you want to
change the IRQ assigned by the BIOS to your card?

-David

It could be useful when my driver wants to handle more than one PCI card
(all the same Vendor/Device ID), so it can install only one interrupt
serviceing routine (after assigning all the handled cards to the same
IRQ, of course).
This is much more efficient than run one driver instance for each card
(too much context switches…)

Davide

Davide Ancri <davidea@prisma-eng.it> wrote:

David Gibbs wrote:



It could be useful when my driver wants to handle more than one PCI card
(all the same Vendor/Device ID), so it can install only one interrupt
serviceing routine (after assigning all the handled cards to the same
IRQ, of course).
This is much more efficient than run one driver instance for each card
(too much context switches…)

Still use only one driver. Have it attach to (potentially) multiple different
interrupts.

The more effecient way would be to have a seperate handler for each
possible IRQ line (e.g. handler_irq_5, handler_irq_7, handler_irq_11)
and as you detect the appropriate cards, attach only the irq handlers
for which you have interrupts.

Then, when you get an irq on interrupt 5, you actually can be more
efficient – you only have to query the card or cards attached to
irq 5 to see if they generated the interrupt. If you have all your
cards attached to the same irq, you have to query every card on every
interrupt.

Yes, there is a mild code overhead for what I’ve just proposed. But ISR
should be short anyway, so shouldn’t be too much.

-David

QNX Training Services
I do not answer technical questions by email.