linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* installing an ISR from user code
@ 2000-10-30 17:23 Brett Smith
  2000-10-30 19:06 ` rread
  2000-10-30 19:35 ` Anton Altaparmakov
  0 siblings, 2 replies; 5+ messages in thread
From: Brett Smith @ 2000-10-30 17:23 UTC (permalink / raw)
  To: linux kernel


We have written a char driver for our proprietary h/w.  This driver
handles a
multitude of interrupts from the h/w in the following fashion:  The ISR
reads/saves the status register (indication of which int was hit) in
global, and the marks the BH to run.  The BH uses the global to call one
of 32 "ISRs" (an array of func ptrs).  I would like to be able to
install an "ISR" dynamically from user code (the module has already been
installed).  Is this possible?

If it is possible, how does the build/link work?

thanks,
brett.smith@bktech.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing an ISR from user code
  2000-10-30 17:23 installing an ISR from user code Brett Smith
@ 2000-10-30 19:06 ` rread
  2000-10-30 19:12   ` Tim Waugh
  2000-10-30 19:35 ` Anton Altaparmakov
  1 sibling, 1 reply; 5+ messages in thread
From: rread @ 2000-10-30 19:06 UTC (permalink / raw)
  To: Brett Smith; +Cc: linux kernel

I'm new at this myself, but how about creating a minor number for each
ISR?  When the BH runs, it wakes up the processing waiting on the
device for that ISR.  The user code opens as whatever devices it's
interested in and waits for interrupts using select.


robert

* Brett Smith (brett.smith@bktech.com) [001030 09:25]:
> 
> We have written a char driver for our proprietary h/w.  This driver
> handles a
> multitude of interrupts from the h/w in the following fashion:  The ISR
> reads/saves the status register (indication of which int was hit) in
> global, and the marks the BH to run.  The BH uses the global to call one
> of 32 "ISRs" (an array of func ptrs).  I would like to be able to
> install an "ISR" dynamically from user code (the module has already been
> installed).  Is this possible?
> 
> If it is possible, how does the build/link work?
> 
> thanks,
> brett.smith@bktech.com
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing an ISR from user code
  2000-10-30 19:06 ` rread
@ 2000-10-30 19:12   ` Tim Waugh
  2000-10-30 20:03     ` Richard B. Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Waugh @ 2000-10-30 19:12 UTC (permalink / raw)
  To: rread; +Cc: Brett Smith, linux kernel

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

On Mon, Oct 30, 2000 at 11:06:59AM -0800, rread@datarithm.net wrote:

> I'm new at this myself, but how about creating a minor number for each
> ISR?  When the BH runs, it wakes up the processing waiting on the
> device for that ISR.

... which won't get run until after the interrupt is processed, but
the interrupt won't get processed until it's run.  Nope.

Tim.
*/

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing an ISR from user code
  2000-10-30 17:23 installing an ISR from user code Brett Smith
  2000-10-30 19:06 ` rread
@ 2000-10-30 19:35 ` Anton Altaparmakov
  1 sibling, 0 replies; 5+ messages in thread
From: Anton Altaparmakov @ 2000-10-30 19:35 UTC (permalink / raw)
  To: Brett Smith; +Cc: linux kernel

At 17:23 30/10/2000, Brett Smith wrote:
>We have written a char driver for our proprietary h/w.  This driver
>handles a multitude of interrupts from the h/w in the following 
>fashion:  The ISR reads/saves the status register (indication of which int 
>was hit) in
>global, and the marks the BH to run.  The BH uses the global to call one
>of 32 "ISRs" (an array of func ptrs).  I would like to be able to
>install an "ISR" dynamically from user code (the module has already been
>installed).  Is this possible?
>
>If it is possible, how does the build/link work?

Of course it is possible. - There are drivers out there doing similar 
things. - Unfortunately while the one I actually know is open source the 
program attaching to this driver is not open source so you can only see the 
kernel side of the solution. )-:

Download: ftp://ftp.sigmadesigns.com/NetStr_2000/NetStream2000-0.1.033.0.tar.gz

Gunzip/Untar the archive and look in the Barbados/kernelmode directory in 
the file quasar.c. - In that file you will find the implementation of some 
IOCTLs and the one you will find most interesting is IOCTL_SEND_PID which 
is used for the purpose of registering a user space ISR with the kernel 
mode driver.

This concept can easily be extended by another passed in argument 
containing which ISR to register with this call or you could do them all at 
once whatever suits you.

Hope this helps.

Regards,

         Anton

>thanks,
>brett.smith@bktech.com
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>Please read the FAQ at http://www.tux.org/lkml/

-- 
      "Education is what remains after one has forgotten everything he 
learned in school." - Albert Einstein
-- 
Anton Altaparmakov  Voice: +44-(0)1223-333541(lab) / +44-(0)7712-632205(mobile)
Christ's College    eMail: AntonA@bigfoot.com / aia21@cam.ac.uk
Cambridge CB2 3BU    ICQ: 8561279
United Kingdom       WWW: http://www-stu.christs.cam.ac.uk/~aia21/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: installing an ISR from user code
  2000-10-30 19:12   ` Tim Waugh
@ 2000-10-30 20:03     ` Richard B. Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard B. Johnson @ 2000-10-30 20:03 UTC (permalink / raw)
  To: Tim Waugh; +Cc: rread, Brett Smith, linux kernel

On Mon, 30 Oct 2000, Tim Waugh wrote:

> On Mon, Oct 30, 2000 at 11:06:59AM -0800, rread@datarithm.net wrote:
> 
> > I'm new at this myself, but how about creating a minor number for each
> > ISR?  When the BH runs, it wakes up the processing waiting on the
> > device for that ISR.
> 
> ... which won't get run until after the interrupt is processed, but
> the interrupt won't get processed until it's run.  Nope.
> 
> Tim.
> */
> 

An interrupt will occur at any time. The user-pages may not be in
memory at that time.

I suggest you do your ISR in the driver (or module) where it really
should be done. The ISR pages are always present.

Cheers,
Dick Johnson

Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-30 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-30 17:23 installing an ISR from user code Brett Smith
2000-10-30 19:06 ` rread
2000-10-30 19:12   ` Tim Waugh
2000-10-30 20:03     ` Richard B. Johnson
2000-10-30 19:35 ` Anton Altaparmakov

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).