PCI interrupts

Hey guys,
does anyone have any sample source code for PCI interrupts in QNX. I’ve
tried everything and nothing has functioned properly as of yet. Anything
that could be sent would be much obliged.

Thanks

bstocking@NXTenergy.com

There’s basically only one difference between a PCI interrupt and
an ISA in software which is that if you don’t reset a PCI interrupt in
the handler, your cpu will appear to hang as the interrupt continually
fires.

What problems are you having? Maybe post your source code.


Previously, Brad Stocking wrote in qdn.public.qnx4.photon:

Hey guys,
does anyone have any sample source code for PCI interrupts in QNX. I’ve
tried everything and nothing has functioned properly as of yet. Anything
that could be sent would be much obliged.

Thanks

bstocking@NXTenergy.com

\


Mitchell Schoenbrun --------- maschoen@pobox.com

Many PCI IO cards require that interrupts be enabled in their PCI interface
controllers. This requires outputting a special value to the controller.
Vendor specific.

“Brad Stocking” <bstocking@NXTenergy.com> wrote in message
news:9cv03g$8gc$1@inn.qnx.com

Hey guys,
does anyone have any sample source code for PCI interrupts in QNX.
I’ve
tried everything and nothing has functioned properly as of yet. Anything
that could be sent would be much obliged.

Thanks

bstocking@NXTenergy.com

Actually I’ve pinpointed the problem. Within the handler I use two commands
that acknowledge the interrupts on the card. The commands are:

{
*win_address = addr;
*win_data = data;
return(proxy);
}

The pointers above point to the address I mapped for the appropriate
register I want to access. The variables are all - volatile unsigned short
int - and the “win_” variables are pointers. The problem is that the
pointer values are not changing. If I do the same assignments outside of
the interrupt handler the values do change. I have no idea why they don’t
change within the handler. If anyone can tell me why it doesn’t work and
how I can fix it, that would be great.

Brad Stocking

I’ve pinpointed the problem. I use - volatile unsigned short int * -
variables that do not change when I assign them a value within the handler.
If I assign the same variables values outside the handler the variables do
change. I don’t know why they don’t change within the handler. If anyone
can tell me why they don’t that would be great.

Thanks
Brad

How did you define the irq handler? Did you add some compiling options?

Maybe you have not tried the following yet.

int far irq_handler() {
…// you function here
}

cc -zu -Wc -s -o file.o file.c

Brad Stocking <bstocking@NXTenergy.com> wrote in message
news:9d7aq7$8jv$1@inn.qnx.com

Actually I’ve pinpointed the problem. Within the handler I use two
commands
that acknowledge the interrupts on the card. The commands are:

{
*win_address = addr;
*win_data = data;
return(proxy);
}

The pointers above point to the address I mapped for the appropriate
register I want to access. The variables are all - volatile unsigned
short
int - and the “win_” variables are pointers. The problem is that the
pointer values are not changing. If I do the same assignments outside of
the interrupt handler the values do change. I have no idea why they don’t
change within the handler. If anyone can tell me why it doesn’t work and
how I can fix it, that would be great.

Brad Stocking