this is a posting regarding interrupt handling and makefile,
we r naive users of ***qnx4 and would be happy if any one can help in
the following matters,we r using pci card with plx 9052 chip.
we are able to access the card memory.and we are also getting the irq
line no,but …
the problem seems to be whenevr we get interrupt frm the board our
interrupt handler is not getting invoked we are using qnx_hint_attach
and also using the compilation options… -T1 -Wc,-s prg.c and
one more main point ****this program includes the code for all the
handling ,mem accessing and also our application lib functions,this we
are doing as we are not sure of the make file procedure…is it fine
or is it mandatory to compile the interrupt code …etc separately
using a make file…if so we would like to get some help on the
****makefile.
any help will be highly appreciated
thanking u in advance.
this is a posting regarding interrupt handling and makefile,
we r naive users of ***qnx4 and would be happy if any one can help in
the following matters,we r using pci card with plx 9052 chip.
we are able to access the card memory.and we are also getting the irq
line no,but …
the problem seems to be whenevr we get interrupt frm the board our
interrupt handler is not getting invoked we are using qnx_hint_attach
and also using the compilation options… -T1 -Wc,-s prg.c and
one more main point ****this program includes the code for all the
handling ,mem accessing and also our application lib functions,this we
are doing as we are not sure of the make file procedure…is it fine
or is it mandatory to compile the interrupt code …etc separately
using a make file…if so we would like to get some help on the
****makefile.
any help will be highly appreciated
thanking u in advance.
I would strongly suggest putting the irq handler code, and just the
irq handler code, in a seperate C source file.
Then compile:
cc -c -Wc,-s -zu interrupt.c
cc -c prg.c
cc -T1 prg.o interrupt.o -o prg
This may not be the cause/source of your problem with not getting
the interrupts, but is the proper way to build your program.
this is a posting regarding interrupt handling and makefile,
we r naive users of ***qnx4 and would be happy if any one can help in
the following matters,we r using pci card with plx 9052 chip.
we are able to access the card memory.and we are also getting the irq
line no,but …
the problem seems to be whenevr we get interrupt frm the board our
interrupt handler is not getting invoked we are using qnx_hint_attach
and also using the compilation options… -T1 -Wc,-s prg.c and
one more main point ****this program includes the code for all the
handling ,mem accessing and also our application lib functions,this we
are doing as we are not sure of the make file procedure…is it fine
or is it mandatory to compile the interrupt code …etc separately
using a make file…if so we would like to get some help on the
****makefile.
any help will be highly appreciated
thanking u in advance.
I would strongly suggest putting the irq handler code, and just the
irq handler code, in a seperate C source file.
Then compile:
cc -c -Wc,-s -zu interrupt.c
cc -c prg.c
cc -T1 prg.o interrupt.o -o prg
And also note that -T1 does nothing unless you run the process SUID=root
This may not be the cause/source of your problem with not getting
the interrupts, but is the proper way to build your program.
thanks for that compiling options,i need a small clarification, regarding
that in case i proceed as u said and compile these using the options
specified what do i get,do i get a exe file sort of thing that can be run.
i gues it will be a bit better if i describe it a bit more,
it is like we are coding a driver for our pci addon card wiith plx 9052
chip.we are proceeding in the following way…
we are using the MAKEFILE and on making it we expect a file to be generted
inthe specified directory and this we want to run at the back end and later
we want to test it by attaching some application programs. what is
currently happening is…
when we make file running the following command
make all interruptprg.c prg.c prg.o interruptprg.c
we get the file we expect in the expected location and on running it we
sucessfully find it in the sin.but when we try sin ir,we dont find it there
and i guess it means it is not attaching to the interrupt routines,actually
my doubt is ****what part of the code do i need to include in this interrupt
program …do i need to have all the interrupt related code in that
porogram…like the isr interrupt handling etc…
i gues it will be a bit better if i describe it a bit more,
it is like we are coding a driver for our pci addon card wiith plx 9052
chip.we are proceeding in the following way…
we are using the MAKEFILE and on making it we expect a file to be generted
inthe specified directory and this we want to run at the back end and later
we want to test it by attaching some application programs. what is
currently happening is…
when we make file running the following command
make all interruptprg.c prg.c prg.o interruptprg.c
we get the file we expect in the expected location and on running it we
sucessfully find it in the sin.but when we try sin ir,we dont find it there
and i guess it means it is not attaching to the interrupt routines,actually
my doubt is ****what part of the code do i need to include in this interrupt
program …do i need to have all the interrupt related code in that
porogram…like the isr interrupt handling etc…
If it appears in the “sin” output, but not the “sin irq” output,
then it has run but not hooked into the interrupt chain.
– did you check the return value from qnx_hint_attach()?
– did it succeed?
– if not, did you check errno to see why it failed?
yeah of course i checked and didnt find any error …the checking was like
i gave an if condition where if the qnx_hint_attach failed then it will
return -1 but it didnt happen.so how do i proceed from here…need a solution
soon.
thanks,
yeah of course i checked and didnt find any error …the checking was like
i gave an if condition where if the qnx_hint_attach failed then it will
return -1 but it didnt happen.so how do i proceed from here…need a solution
soon.
thanks,
What interrupt number are you passing? Can you post the snippet of
code that you’re using to do that attach?
Whenever interrupt is fired from our board,the handler should get invoked
and the p value should get incremented
But it never happens .Here is the snippet .
p=0; —global declaration
InitInterrupts(Intr)
{
*(BAR2+0x4c)=0x58; // BAR2 is memory mapped
*(BAR2+0x4d)=0x02; // 0x4c ,0x4d are the PLX 9052’s
ISR
outp(BAR3+0x100,Intr);
if( (irq_proxy=qnx_proxy_attach(0,0,0,-1)==-1))
{
printf(“unable to attach to proxy\n”);
return;
}
if ((irq_id=qnx_hint_attach(IntrLine,&Handler,FP_SG(&irq_proxy))==-1)
{
printf(“Unable to attach to interrupt\n”);
return;
}
yeah of course i checked and didnt find any error …the checking was
like
i gave an if condition where if the qnx_hint_attach failed then it will
return -1 but it didnt happen.so how do i proceed from here…need a
solution
soon.
thanks,
What interrupt number are you passing? Can you post the snippet of
code that you’re using to do that attach?
Whenever interrupt is fired from our board,the handler should get invoked
and the p value should get incremented
But it never happens .Here is the snippet .
p=0; —global declaration
InitInterrupts(Intr)
{
*(BAR2+0x4c)=0x58; // BAR2 is memory mapped
*(BAR2+0x4d)=0x02; // 0x4c ,0x4d are the PLX 9052’s
ISR
outp(BAR3+0x100,Intr);
if( (irq_proxy=qnx_proxy_attach(0,0,0,-1)==-1))
{
printf(“unable to attach to proxy\n”);
return;
}
if ((irq_id=qnx_hint_attach(IntrLine,&Handler,FP_SG(&irq_proxy))==-1)
{
IntrLine is assigned elsewhere?
Otherwise this looks pretty normal. As I said, I can’t see why
this would fail to work, or you would fail to see the interrupt
line attached in “sin irq”. You don’t even need hardware at a
particular irq point for an interrupt attach call to work – you
just need to make the call, and have your process still running.
I was wondering about IntrLine’s value, because if it was > 15, it
might still attach, but “sin irq” might only check the standar
0-15 interrupt range.