From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31062 invoked by alias); 1 Nov 2013 17:46:57 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 31051 invoked by uid 89); 1 Nov 2013 17:46:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mail.carallon.com Received: from mail.carallon.com (HELO mail.carallon.com) (95.177.28.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Nov 2013 17:46:56 +0000 X-MDAV-Result: clean X-MDAV-Processed: mail.carallon.com, Fri, 01 Nov 2013 17:46:54 +0000 Received: from [172.20.1.41] by mail.carallon.com (Cipher TLSv1:-SHA:128) (MDaemon PRO v13.6.0) with ESMTP id md50001443500.msg for ; Fri, 01 Nov 2013 17:46:54 +0000 X-Spam-Processed: mail.carallon.com, Fri, 01 Nov 2013 17:46:54 +0000 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 172.20.1.41 X-Return-Path: andrewp@carallon.com X-Envelope-From: andrewp@carallon.com X-MDaemon-Deliver-To: ecos-discuss@ecos.sourceware.org Message-ID: <5273E90C.2010807@carallon.com> Date: Fri, 01 Nov 2013 17:46:00 -0000 From: Andrew Parlane User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Nick Garnett , ecos-discuss@ecos.sourceware.org References: <52729021.3080205@carallon.com> <5273DFAE.1080000@calivar.com> <5273E2EE.3010908@carallon.com> <5273E7FC.7010907@calivar.com> In-Reply-To: <5273E7FC.7010907@calivar.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] Spurious interrupt on ARM. X-SW-Source: 2013-11/txt/msg00008.txt.bz2 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