From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9594 invoked by alias); 22 Aug 2007 09:23:59 -0000 Received: (qmail 9574 invoked by uid 22791); 22 Aug 2007 09:23:58 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME X-Spam-Check-By: sourceware.org Received: from quina.moeckel.org (HELO quina.moeckel.org) (217.160.223.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Aug 2007 09:23:55 +0000 Received: from bluebird.headcrashers.bnfh (bluebird.headcrashers.org [IPv6:2001:8d8:81:a11:204:acff:fe97:190]) (authenticated bits=0) by quina.moeckel.org (8.13.8/8.13.8/Debian-3) with ESMTP id l7M9NlqE004787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 22 Aug 2007 11:23:47 +0200 Received: from executor.headcrashers.bnfh (IDENT:root@executor.headcrashers.bnfh [IPv6:2001:8d8:81:a11:209:6bff:fee0:8244]) by bluebird.headcrashers.bnfh (8.13.8/8.13.8) with ESMTP id l7M9Nk2U023814; Wed, 22 Aug 2007 11:23:46 +0200 Received: from executor.headcrashers.bnfh (IDENT:woodstoc@localhost [127.0.0.1]) by executor.headcrashers.bnfh (8.13.8/8.13.8) with ESMTP id l7M9N8C6002409; Wed, 22 Aug 2007 11:23:08 +0200 (CEST) Received: (from woodstoc@localhost) by executor.headcrashers.bnfh (8.13.8/8.13.8/Submit) id l7M9N7qE003198; Wed, 22 Aug 2007 11:23:07 +0200 (CEST) Date: Wed, 22 Aug 2007 09:23:00 -0000 From: Hans Rosenfeld To: ecos-patches@sourceware.org Cc: andrew@lunn.ch, uwe.kindler@cetoni.de Subject: Re: LPC2xxx patch for support of vectored interrupt controller Message-ID: <20070822092307.GC2126@grumpf.hope-2000.org> References: <46CA81F3.60109@cetoni.de> <20070822084244.GG31057@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070822084244.GG31057@lunn.ch> User-Agent: Mutt/1.4.2.2i X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on quina.moeckel.org X-IsSubscribed: yes Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2007-08/txt/msg00042.txt.bz2 On Wed, Aug 22, 2007 at 10:42:44AM +0200, Andrew Lunn wrote: > On Tue, Aug 21, 2007 at 08:10:59AM +0200, cetoni GmbH - Uwe Kindler wrote: > > Btw. the assertion I put into the code is wrong: > > > > CYG_ASSERT(vector <= CYGNUM_HAL_INTERRUPT_EINT3 && > > vector >= CYGNUM_HAL_INTERRUPT_EINT0 , "Invalid vector"); > > > > should be: > > > > CYG_ASSERT(vector <= CYGNUM_HAL_INTERRUPT_EINT3 || > > vector >= CYGNUM_HAL_INTERRUPT_EINT0 , "Invalid vector"); > > Please could you submit a patch. May I suggest that you think about this again? The only configurable interrupts are EINT0 to EINT3. So this assertion makes sure that the vector passed to hal_interrupt configure is less or equal to EINT3 _and_ greater or equal to EINT0. And if this is not true the assertion fails. If you change the assertion the way suggested you could also just remove it, since _all_ vectors are either less or equal to EINT3, or greater or equal to EINT0, or both. > Should there also be another check like: > > CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX && > vector >= CYGNUM_HAL_ISR_MIN , "Invalid vector"); > > If you pass it an invalid vector, such as 33, you end up shifting 1 by > 33 which i guess results in 0. The code will then set/reset the level > on every single interrupt! This assertion cannot fail if the previous assertion did not fail, and if the previous assertion failed it is never reached. Any vector less or equal to EINT3 is also less than ISR_MAX, and any vector greater or equal to EINT0 is also greater than ISR_MIN. > If the hardware is not capable of setting priority and level for these > vectors, we should check for this. I suggest we make the test case a > little bit more intelligent so that it only tries to do things which > the hardware is capable of doing. In some respect, the test failing is > correct! This could probably be done by introducing something like CYGNUM_HAL_ISR_CONF_MAX and _MIN to the HALs. -- %SYSTEM-F-ANARCHISM, The operating system has been overthrown