public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Parlane <andrewp@carallon.com>
To: Nick Garnett <nickg@calivar.com>, ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Spurious interrupt on ARM.
Date: Fri, 01 Nov 2013 17:46:00 -0000	[thread overview]
Message-ID: <5273E90C.2010807@carallon.com> (raw)
In-Reply-To: <5273E7FC.7010907@calivar.com>

Excellent thanks. I guess we're a bit out of date.

Thanks again,
Andrew

On 01/11/2013 17:42, Nick Garnett wrote:
>
> On 01/11/13 17:20, Andrew Parlane wrote:
>> Sorry, I should have been a bit more clear.
>> First we skip the ISR by jumping to the spurious_IRQ label, and then we
>> switch stacks if necessary, then we have (line numbers may vary):
>>
>> 941        // The return value from the handler (in r0) will indicate
>> whether a
>> 942        // DSR is to be posted. Pass this together with a pointer to the
>> 943        // interrupt object we have just used to the interrupt tidy
>> up routine.
>> 944
>> 945                              // don't run this for spurious interrupts!
>> 946        cmp     v1,#CYGNUM_HAL_INTERRUPT_NONE
>> 947        beq     17f
>> 948        ldr     r1,.hal_interrupt_objects
>> 949        ldr     r1,[r1,v1,lsl #2]
>> 950        mov     r2,v6           // register frame
>> 951
>> 952        THUMB_MODE(r3,10)
>> 953
>> 954        bl      interrupt_end   // post any bottom layer handler
>> 955                                // threads and call scheduler
>> 956        ARM_MODE(r1,10)
>> 957 17:
>>
>> So it compares the result of hal_IRQ_handler (stored in v1) with
>> CYGNUM_HAL_INTERRUPT_NONE, and jumps forwards to label 17: which is
>> after interrupt_end. if it was a spurious IRQ.
>
> Hmm. You're right. That is clearly wrong. Our own sources have the
> following code, which is slightly different:
>
>          // The return value from the handler (in r0) will indicate
> whether a
>          // DSR is to be posted. Pass this together with a pointer to the
>          // interrupt object we have just used to the interrupt tidy up
> routine.
>
>          // For a spurious interrupt, pass a NULL object. interrupt_end()
> will
>          // handle that and still unlock the scheduler.
>          cmp     v1,#CYGNUM_HAL_INTERRUPT_NONE
>          moveq   r1,#0
>          beq     17f
>          ldr     r1,.hal_interrupt_objects
>          ldr     r1,[r1,v1,lsl #2]
> 17:
>          mov     r2,v6           // register frame
>
>
> So interrupt_end does get called, but with a NULL interrupt object pointer.
>
>



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2013-11-01 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 17:15 Andrew Parlane
2013-11-01 17:06 ` Nick Garnett
2013-11-01 17:20   ` Andrew Parlane
2013-11-01 17:42     ` Nick Garnett
2013-11-01 17:46       ` Andrew Parlane [this message]
2013-11-01 17:50         ` Nick Garnett
2013-11-01 17:54           ` Andrew Parlane

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=5273E90C.2010807@carallon.com \
    --to=andrewp@carallon.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=nickg@calivar.com \
    /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 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 read-only IMAP folder(s) and NNTP newsgroup(s).