On Tue, 2005-02-15 at 09:29, [EMAIL PROTECTED] wrote:
> On Mon, 14 Feb 2005, Michael Neuhauser wrote:
>
> > On Mon, 2005-02-14 at 18:11, [EMAIL PROTECTED] wrote:
> > > RTAI Linux
> > > ^ | ^ |
> > > Hardware -> ADEOS _| |____| |__ ...
> > >
> > > which I thought was the case.
> >
> > This is more correct than the one above.
>
> Good! Then my initial understanding was right. What confused me was the
> fact that the trampoline handler was one for all, so, I concluded that it
> was called directly from asm entry functions, not having read the code...
>
> I can for-see a couple of points that would need some careful thinking:
>
> 1. pending (to Linux). How is it done - a) for each new irq it is added to
> a queue and then they are delivered exactly in this order, or b) each new
> irq is marked pending (e.g. in a bit-mask) and then they are delivered in
> arbitrary order? If a), then 1 per irq or possibly multiple entries per
> irq?
It is b), kind of:
typedef struct adomain {
...
struct adcpudata {
volatile unsigned long status;
volatile unsigned long irq_pending_hi;
volatile unsigned long irq_pending_lo[IPIPE_IRQ_IWORDS];
volatile unsigned irq_hits[IPIPE_NR_IRQS];
} cpudata[ADEOS_NR_CPUS];
...
} adomain_t;
For each real and virtual interrupt there is one bit (irq_pending_lo)
and a counter (irq_hits). irq_pending_hi allows to quickly check if any
interrupt is pending (any bit of irq_pending_lo word is != 0 => the
corresponding bit in irq_pending_hi is != 0).
The decision what interrupt to deliver next is done
by__adeos_sync_stage() (with no relation to the order they happened):
the function flnz() favours the high numbered irqs (and has the
advantage of being only one assembler statement ("clz") for >= ARMv5.
> 2. mask-/ack-ing. Is only RTAI using real hardware irq-operations for all
> irqs, or only for real-time irqs and further domains are allowed to mask
> / ack themselves?
When pipelining is enabled, Adeos replaces the mask, unmaks & mask_ack
slots in the linux irq_desc[] with its own
__adeos_override_irq_mask/unmas/mask_ack functions. These functions
disable interrupts hard to protect the PIC and call the original Linux
functions.
__adeos_handle_irq() calls the irq acknowledge function (which actually
does mask-ack) before calling any domain's irq-handler. Unmasking the
irq (or doing irq-source specific clearing) is left to the irq handler.
Mike
--
Dr. Michael Neuhauser phone: +43 1 789 08 49 - 30
Firmix Software GmbH fax: +43 1 789 08 49 - 55
Vienna/Austria/Europe email: [EMAIL PROTECTED]
Embedded Linux Development and Services http://www.firmix.at/