----- Original Message -----
From: <[EMAIL PROTECTED]>

> On Fri, Sep 15, 2000 at 11:22:54AM +0900, Mukaila olundegun wrote:
> >
> > Actually, I have 4 devices on same board. Of course they all have
thesame
> > devname but have different deviceId with shared interrupt. The only way
to
> > identify which device generate interrupt is the deviceID. That means it
will
> > be very hard for "low_level_handler_installed_by_request_irq" to provide
> > this requirement.
>
> Something has to discover which  device generated the interrupt. Generally
> you would want the low level handler to do
>
> handler:
>           look at board status registers to discover correct device
>           call dev_handler(device_name);

Yes thanks. This will serve as temporary solution.
Then my question is if I don't register this irq_number as  a shared irq,
will it be still possible to try share operation on un-registered shared
irq? Will the system not complain?

Also I think (not actually copying Linux) that if  a function like Linux

      request_irq(irq_number, ISR_funtion_name, irq_flags, device_name,
device_Id)

is available in RTLinux for shared interrupt number will simplify this
operation. So that when the interrupt service routine is called,  IRQ_number
and device_Id will be passed in addition to the register states. (Though, it
required additional work!!)

Also when you are about to free the requested IRQ_num, you only release the
device_Id associated with that irq but not just the irq_number as used in
the current RTLinux rtl_free_irq(irq_number).

> Linux does not figure this out for you: it calls every handler that shares
the
> interrupt and makes them figure it out. Here's the code in
i386/kernel/irq.c
>  do {
>                 status |= action->flags;
>                 action->handler(irq, action->dev_id, regs);
>                 action = action->next;
>         } while (action);
>
>
> >
> > Your further assistant will be helpful.
> >
> > Regards,
> > Mukaila
> > ----- Original Message -----
> > From: Tomasz Motylewski <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Cc: Mukaila olundegun <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Friday, September 15, 2000 12:57 AM
> > Subject: Re: [rtl] Linux request_irq() vs RTLinux rtl_request_irq()
> >
> >
> > > On Thu, 14 Sep 2000 [EMAIL PROTECTED] wrote:
> > >
> > > > > service several interrupts. Quite common case when using some kind
of
> > > > > wrappers, etc. Having "device id" is a requirement. It was not
present
> > in
> > > > > Linux initially, but soon people understood its usefulness.
> > > >
> > > >
> > > > low_level_handler_installed_by_request_irq:
> > > >           general_handler(devname);
> > > >           return;
> > > >
> > > > Is that a problem?
> > >
> > > Yes. In low_level_handler_installed_by_request_irq I have no way to
get
> > > devname. We are talking about fully dynamic situations. Like I have
two
> > > identical cards, I want to use the same driver. At compile time I do
not
> > know
> > > if I will install 1 or 5 interrupt handlers and for which devices. I
also
> > do
> > > not know the names at compile time.
> > >
> > > Or should I use:
> > >
> > > switch(irq) {
> > > case 5:
> > > install low_level_handler_5;
> > > break;
> > > case 7:
> > > install low_level_handler_7;
> > > etc...
> > > } ?
> > >
> > > Solution I would use now is to reproduce Linux 1.2 with an array of 16
> > "irq
> > > structures". I get IRQ number from some register as you have
suggested,
> > and
> > > get all other data from my table indexed by IRQ.
> > >
> > > Best regards,
> > > --
> > > Tomek
> > >
> > >
>
> --
> ---------------------------------------------------------
> Victor Yodaiken
> Finite State Machine Labs: The RTLinux Company.
>  www.fsmlabs.com  www.rtlinux.com
>
>

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to