Re: two interrupt handlers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

Hi,

 

It is possible to have two interrupt handlers for same piece of hardware.

What we can do is, we can have the concept of chaining the ISRs (Interrupt Service Routines or Interrupt Handlers). If you want to learn more about Chaining of Interrupt Handlers, go to following link:

 

http://webster.cs.ucr.edu/AoA/DOS/ch17/CH17-4.html#HEADING4-1

 

This article explains in context to DOS, but this is also possible in Linux, as Linux also maintains the interrupt table, which contains the pointer to chain of interrupt handlers.

 

The concept says:

Let's say we have an interrupt handlers 'A' for keyboard and we have written our own interrupt handler 'B' for the same. We can place our interrupt handler 'B' in front of 'A' and save the pointer to 'A' in our local variable, so that we don?t loose the actual interrupt handler. Now we can test our interrupt handler as not in place of 'A', 'B' will always be invoked whenever an interrupt occurs.

 

Once we are done with the testing of our interrupt, we can undo the things as we have the pointer to actual interrupt handler. So just placing back that pointer in interrupt table, we can direct the control to actual interrupt handler 'A' and can release our own interrupt handler from memory.

 

Thanks & Regards,

Gaurav Dhiman



James Stevenson <james@stev.org> wrote:

> i 'm reading linux device drivers book by A. Rubini, chapter 9
> Interrupt Handling. i would like write a experimental module to
> handle keyboard interrupts. this handler will be shared. so my
> simple question is:
> can i use two interrupt handlers for keyboard in kernel (one
> original and one mine) ?
>

Hi,

it is probably unlikly that you would be able todo this.

The support for multiple irq handlers is for sharing an irq between
2 devices.

When dealing with the same hardware the irq handle that runs first
should have already completed the task that the irq was raised for.

James


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/


Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux