From: Philippe Gerum <rpm@xenomai.org>
To: Wolfgang Grandegger <wg@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Missing IRQ end function on PowerPC
Date: Thu, 02 Feb 2006 13:52:04 +0100 [thread overview]
Message-ID: <43E20074.2040306@domain.hid> (raw)
In-Reply-To: <43D5FF83.7050305@domain.hid>
Wolfgang Grandegger wrote:
> Gilles Chanteperdrix wrote:
>
>> Wolfgang Grandegger wrote:
>> > Therefore we need a dedicated function to re-enable interrupts in
>> the > ISR. We could name it *_end_irq, but maybe *_enable_isr_irq is
>> more > obvious. On non-PPC archs it would translate to *_irq_enable.
>> I > realized, that *_irq_enable is used in various place/skins and
>> therefore > I have not yet provided a patch.
>>
>> The function xnarch_irq_enable seems to be called in only two functions,
>> xintr_enable and xnintr_irq_handler when the flag XN_ISR_ENABLE is set.
>>
>> In any case, since I am not sure if this has to be done at the Adeos
>> level or in Xenomai, we will wait for Philippe to come back and decide.
>
>
> Attached is a temporary Xenomai patch fixing the IRQ end problem for the
> PowerPC arch. I had a closer look to the various IRQ end functions on
> PowerPC:
Applied and generalized for all archs, thanks.
>
> ic_end(unsigned int irq)
> {
> ic_ack(irq);
> if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
> ic_enable(irq);
> }
> }
>
> In most cases the end functions do the same than the begin functions but
> there are exceptions where the end functions do an additional ic_ack()
> as shown above.
>
> Wolfgang.
>
>
>
> ------------------------------------------------------------------------
>
> + diff -u xenomai/include/asm-generic/hal.h.IRQEND xenomai/include/asm-generic/hal.h
> --- xenomai/include/asm-generic/hal.h.IRQEND 2006-01-11 18:03:34.000000000 +0100
> +++ xenomai/include/asm-generic/hal.h 2006-01-19 20:52:40.000000000 +0100
> @@ -357,6 +357,8 @@
>
> int rthal_irq_disable(unsigned irq);
>
> +int rthal_irq_end(unsigned irq);
> +
> int rthal_irq_host_request(unsigned irq,
> irqreturn_t (*handler)(int irq,
> void *dev_id,
> + diff -u xenomai/include/asm-generic/system.h.IRQEND xenomai/include/asm-generic/system.h
> --- xenomai/include/asm-generic/system.h.IRQEND 2006-01-11 18:03:34.000000000 +0100
> +++ xenomai/include/asm-generic/system.h 2006-01-19 20:50:17.000000000 +0100
> @@ -496,6 +496,12 @@
> return rthal_irq_disable(irq);
> }
>
> +static inline int xnarch_end_irq (unsigned irq)
> +
> +{
> + return rthal_irq_end(irq);
> +}
> +
> static inline void xnarch_chain_irq (unsigned irq)
>
> {
> + diff -u xenomai/include/asm-uvm/system.h.IRQEND xenomai/include/asm-uvm/system.h
> --- xenomai/include/asm-uvm/system.h.IRQEND 2006-01-11 18:03:34.000000000 +0100
> +++ xenomai/include/asm-uvm/system.h 2006-01-19 20:51:36.000000000 +0100
> @@ -296,6 +296,13 @@
> return -ENOSYS;
> }
>
> +static inline int xnarch_end_irq (unsigned irq)
> +
> +{
> + return -ENOSYS;
> +}
> +
> +
> static inline void xnarch_chain_irq (unsigned irq)
>
> { /* Nop */ }
> + diff -u xenomai/ksrc/arch/generic/hal.c.IRQEND xenomai/ksrc/arch/generic/hal.c
> --- xenomai/ksrc/arch/generic/hal.c.IRQEND 2006-01-11 18:03:42.000000000 +0100
> +++ xenomai/ksrc/arch/generic/hal.c 2006-01-19 20:54:06.000000000 +0100
> @@ -1156,6 +1156,7 @@
> EXPORT_SYMBOL(rthal_irq_release);
> EXPORT_SYMBOL(rthal_irq_enable);
> EXPORT_SYMBOL(rthal_irq_disable);
> +EXPORT_SYMBOL(rthal_irq_end);
> EXPORT_SYMBOL(rthal_irq_host_request);
> EXPORT_SYMBOL(rthal_irq_host_release);
> EXPORT_SYMBOL(rthal_irq_host_pend);
> + diff -u xenomai/ksrc/arch/powerpc/hal.c.IRQEND xenomai/ksrc/arch/powerpc/hal.c
> --- xenomai/ksrc/arch/powerpc/hal.c.IRQEND 2006-01-11 18:03:41.000000000 +0100
> +++ xenomai/ksrc/arch/powerpc/hal.c 2006-01-19 21:56:19.000000000 +0100
> @@ -356,6 +356,27 @@
> return 0;
> }
>
> +int rthal_irq_end (unsigned irq)
> +
> +{
> + if (irq >= IPIPE_NR_XIRQS)
> + return -EINVAL;
> +
> + if (rthal_irq_descp(irq)->handler != NULL)
> + {
> + if (rthal_irq_descp(irq)->handler->end != NULL)
> + rthal_irq_descp(irq)->handler->end(irq);
> + else if (rthal_irq_descp(irq)->handler->enable != NULL)
> + rthal_irq_descp(irq)->handler->enable(irq);
> + else
> + return -ENODEV;
> + }
> + else
> + return -ENODEV;
> +
> + return 0;
> +}
> +
> static inline int do_exception_event (unsigned event, unsigned domid, void *data)
>
> {
> + diff -u xenomai/ksrc/nucleus/intr.c.IRQEND xenomai/ksrc/nucleus/intr.c
> --- xenomai/ksrc/nucleus/intr.c.IRQEND 2006-01-11 18:03:42.000000000 +0100
> +++ xenomai/ksrc/nucleus/intr.c 2006-01-19 20:42:53.000000000 +0100
> @@ -363,7 +363,7 @@
> ++intr->hits;
>
> if (s & XN_ISR_ENABLE)
> - xnarch_enable_irq(irq);
> + xnarch_end_irq(irq);
>
> if (s & XN_ISR_CHAINED)
> xnarch_chain_irq(irq);
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
next prev parent reply other threads:[~2006-02-02 12:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-18 10:44 [Xenomai-core] Missing IRQ end function on PowerPC Wolfgang Grandegger
2006-01-19 12:29 ` Gilles Chanteperdrix
2006-01-19 13:06 ` Wolfgang Grandegger
2006-01-19 13:27 ` Gilles Chanteperdrix
2006-01-19 13:40 ` Wolfgang Grandegger
2006-01-24 10:20 ` Wolfgang Grandegger
2006-02-02 12:52 ` Philippe Gerum [this message]
2006-01-29 22:56 ` Philippe Gerum
2006-01-30 8:16 ` Jan Kiszka
2006-01-30 10:00 ` Philippe Gerum
-- strict thread matches above, loose matches on Subject: below --
2006-01-30 8:33 Wolfgang Grandegger
2006-01-30 9:20 ` Jan Kiszka
2006-01-30 9:58 ` Philippe Gerum
2006-01-30 10:12 ` Jan Kiszka
2006-01-30 11:13 ` Philippe Gerum
2006-01-30 11:09 Wolfgang Grandegger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43E20074.2040306@domain.hid \
--to=rpm@xenomai.org \
--cc=wg@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.