* How to register an interrupt under linux?
@ 2008-11-07 8:52 wael showair
2008-11-07 17:31 ` Scott Wood
0 siblings, 1 reply; 2+ messages in thread
From: wael showair @ 2008-11-07 8:52 UTC (permalink / raw)
To: linuxppc-embedded
Dear all,
First here is the setup i've:
1. The board is SPTWIMAX-CC1E board
2. The processor is MPC8555 i found it in the powerpc family NOT ppc family.
Also the board contains DSP core.
3. Linux Kernel 2.6.19-rc5 running on the MPC8555 processor side.
I aim to let the DSP processor interrupts the MPC8555 processor so i think
the first step is to register an interrupt handler for an interrupt number.
i found this in the linux API request_irq. so
i make a simple module & write in it
request_irq(4,my_handler,SA_INTERRUPT,"DSP",NULL); but unfortunately it
returns -ENOSYS. i have tracked the error & i found this is because the
irq_chip structure was not set.
so i added the API of set_irq_chip as follows:
irqChip.enable = NULL;
irqChip.disable = NULL;
irqChip.startup = NULL;
irqChip.shutdown = NULL;
so that all of these functions will be set to the default APIs
(default_enable,default_disable,default_startup & default_shutdown)
then i passed this struct to the set_irq_chip as follows:
set_irq_chip(4,&irqChip);
& at last i call request_irq.
***********************************************************
My code:
irqChip.enable = NULL;
irqChip.disable = NULL;
irqChip.startup = NULL;
irqChip.shutdown = NULL;
set_irq_chip(4,&irqChip);
request_irq(4,my_handler,SA_INTERRUPT,"DSP",NULL);
********************************************************
but unfortunately when i tried to insert my module i got a segmentation
fault. i have tracked it & i found this is because of the unmask function of
my interrupt irq_chip was not set.
so do i have to implement it & if so, should i write a code that enables my
irq_number for the MPC8555 processor or what?
At last i want you to tell me if this is the right way to register my
interrupt_handler for a certain interrupt_number under linux? this is my
aim.
thanks in advance for your help
--
View this message in context: http://www.nabble.com/How-to-register-an-interrupt-under-linux--tp20376306p20376306.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to register an interrupt under linux?
2008-11-07 8:52 How to register an interrupt under linux? wael showair
@ 2008-11-07 17:31 ` Scott Wood
0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2008-11-07 17:31 UTC (permalink / raw)
To: wael showair; +Cc: linuxppc-embedded
wael showair wrote:
> Dear all,
> First here is the setup i've:
> 1. The board is SPTWIMAX-CC1E board
> 2. The processor is MPC8555 i found it in the powerpc family NOT ppc family.
> Also the board contains DSP core.
> 3. Linux Kernel 2.6.19-rc5 running on the MPC8555 processor side.
That's rather old...
> I aim to let the DSP processor interrupts the MPC8555 processor so i think
> the first step is to register an interrupt handler for an interrupt number.
> i found this in the linux API request_irq. so
>
> i make a simple module & write in it
> request_irq(4,my_handler,SA_INTERRUPT,"DSP",NULL); but unfortunately it
> returns -ENOSYS.
If we had a FAQ, this would be entry #1. request_irq() takes virtual
IRQ numbers, not hardware numbers of some specific PIC. You need to
create a mapping, typically via the device tree. Google should be able
to provide more details.
> i have tracked the error & i found this is because the
> irq_chip structure was not set.
>
> so i added the API of set_irq_chip as follows:
>
> irqChip.enable = NULL;
> irqChip.disable = NULL;
> irqChip.startup = NULL;
> irqChip.shutdown = NULL;
That's kind of like commenting out every line with an error until the
code builds. :-P
> but unfortunately when i tried to insert my module i got a segmentation
> fault.
That tends to happen if you tell the kernel to call a NULL pointer.
i have tracked it & i found this is because of the unmask function of
> my interrupt irq_chip was not set.
> so do i have to implement it
No, it's already implemented in the MPIC driver.
-Scott
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-07 17:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 8:52 How to register an interrupt under linux? wael showair
2008-11-07 17:31 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).