LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 11-07-2008, 05:56 AM   #1
nesta
Member
 
Registered: Aug 2006
Posts: 100

Rep: Reputation: 15
How to register an interrupt under linux?


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:

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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how does one un-register from linux questions genix LQ Suggestions & Feedback 1 11-13-2007 06:53 PM
How to register my interrupt service routine with kernel john_crichton Programming 1 04-09-2007 01:39 PM
control is not going to interrupt handler when interrupt comes in serial driver sateeshalla Linux - Kernel 1 05-04-2006 09:43 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration