From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32516 invoked by alias); 20 Aug 2007 15:14:19 -0000 Received: (qmail 32271 invoked by uid 22791); 20 Aug 2007 15:14:18 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,TW_LV 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; Mon, 20 Aug 2007 15:14:09 +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 l7KFDwMc009707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Aug 2007 17:14:00 +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 l7KFDwFa024894 for ; Mon, 20 Aug 2007 17:13:58 +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 l7KFDbvg019942 for ; Mon, 20 Aug 2007 17:13:37 +0200 (CEST) Received: (from woodstoc@localhost) by executor.headcrashers.bnfh (8.13.8/8.13.8/Submit) id l7KFDbMa000625 for ecos-patches@sourceware.org; Mon, 20 Aug 2007 17:13:37 +0200 (CEST) Date: Mon, 20 Aug 2007 15:14:00 -0000 From: Hans Rosenfeld To: ecos-patches@sourceware.org Subject: Re: LPC2xxx patch for support of vectored interrupt controller Message-ID: <20070820151336.GA1125@grumpf.hope-2000.org> References: <21907044.603801184047861289.JavaMail.servlet@kundenserver> <20070817140209.GA26081@grumpf.hope-2000.org> <20070817171322.GB26081@grumpf.hope-2000.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ibTvN161/egqYuK8" Content-Disposition: inline In-Reply-To: <20070817171322.GB26081@grumpf.hope-2000.org> User-Agent: Mutt/1.4.2.2i X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on quina.moeckel.org X-Virus-Checked: Checked by ClamAV on sourceware.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/msg00034.txt.bz2 --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 902 On Fri, Aug 17, 2007 at 07:13:23PM +0200, Hans Rosenfeld wrote: > On Fri, Aug 17, 2007 at 04:02:09PM +0200, Hans Rosenfeld wrote: > > A less simple solution would be to fix the drivers and the kintr0 test > > to use configurable priorities. If it wouldn't involve kintr0 I would > > just do that. I did some minor changes intr0 and kintr0 to use a configurable interrupt priority, which should be set to 16 for LPC2xxx systems. There is another change required to the LPC2xxx HAL. The above tests use hal_interrupt_configure() on some random interrupt vector, but this function contains a assertion to make sure that only external interrupts are configures. I think it would be better to change this assertion into a simple test, so that calling hal_interrupt_configure() with an un-configurable interrupt vector just does nothing. -- %SYSTEM-F-ANARCHISM, The operating system has been overthrown --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="priorities-kernel.diff" Content-length: 4969 Index: ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v retrieving revision 1.143 diff -u -r1.143 ChangeLog --- ChangeLog 2 Jul 2007 11:49:09 -0000 1.143 +++ ChangeLog 20 Aug 2007 14:54:14 -0000 @@ -1,3 +1,8 @@ +2007-08-20 Hans Rosenfeld + + * cdl/kernel.cdl, tests/intr0.cxx, tests/kintr0.cxx: Added option + to set the interrupt priority used by the intr0 and kintr0 tests. + 2007-07-02 Gary Thomas * src/debug/dbg_gdb.cxx: Index: cdl/kernel.cdl =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/cdl/kernel.cdl,v retrieving revision 1.21 diff -u -r1.21 kernel.cdl --- cdl/kernel.cdl 8 Jan 2007 16:20:13 -0000 1.21 +++ cdl/kernel.cdl 20 Aug 2007 14:54:15 -0000 @@ -317,7 +317,7 @@ the set of global flags if present." } - cdl_option CYGPKG_KERNEL_TESTS { + cdl_component CYGPKG_KERNEL_TESTS { display "Kernel tests" flavor data no_define @@ -330,6 +330,16 @@ } description " This option specifies the set of tests for the eCos kernel." + + cdl_option CYGNUM_KERNEL_INTR_TEST_PRIO { + display "interrupt priority used by intr0/kintr0 test" + flavor booldata + default_value 0 + legal_values 0 to 16 + description "The intr0 and kintr0 tests create several interrupts. + This option selects the interrupt priority to be used + for these interrupts." + } } } } Index: tests/intr0.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/intr0.cxx,v retrieving revision 1.13 diff -u -r1.13 intr0.cxx --- tests/intr0.cxx 11 Aug 2006 09:29:31 -0000 1.13 +++ tests/intr0.cxx 20 Aug 2007 14:54:15 -0000 @@ -60,6 +60,14 @@ #include "testaux.hxx" +#ifdef CYGNUM_KERNEL_INTR_TEST_PRIO +#define PRIO_0 CYGNUM_KERNEL_INTR_TEST_PRIO +#define PRIO_1 CYGNUM_KERNEL_INTR_TEST_PRIO +#else +#define PRIO_0 0 +#define PRIO_1 1 +#endif + static cyg_ISR isr0, isr1; static cyg_DSR dsr0, dsr1; @@ -97,7 +105,7 @@ static bool flash( void ) { - Cyg_Interrupt intr0 = Cyg_Interrupt(CYGNUM_HAL_ISR_MIN, 0, (CYG_ADDRWORD)333, isr0, dsr0 ); + Cyg_Interrupt intr0 = Cyg_Interrupt(CYGNUM_HAL_ISR_MIN, PRIO_0, (CYG_ADDRWORD)333, isr0, dsr0 ); return true; } @@ -134,13 +142,13 @@ HAL_INTERRUPT_IN_USE( lvl1, in_use ); Cyg_Interrupt* intr0 = NULL; if (!in_use) - intr0 = new((void *)&intr0_obj[0]) Cyg_Interrupt( lvl1, 1, (CYG_ADDRWORD)777, isr0, dsr0 ); + intr0 = new((void *)&intr0_obj[0]) Cyg_Interrupt( lvl1, PRIO_1, (CYG_ADDRWORD)777, isr0, dsr0 ); cyg_vector lvl2 = CYGNUM_HAL_ISR_MIN + ( 15 % CYGNUM_HAL_ISR_COUNT); HAL_INTERRUPT_IN_USE( lvl2, in_use ); Cyg_Interrupt* intr1 = NULL; if (!in_use && lvl1 != lvl2) - intr1 = new((void *)&intr1_obj[0]) Cyg_Interrupt( lvl2, 1, 888, isr1, dsr1 ); + intr1 = new((void *)&intr1_obj[0]) Cyg_Interrupt( lvl2, PRIO_1, 888, isr1, dsr1 ); // Check these functions at least exist Cyg_Interrupt::disable_interrupts(); Index: tests/kintr0.c =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/kintr0.c,v retrieving revision 1.12 diff -u -r1.12 kintr0.c --- tests/kintr0.c 11 Aug 2006 09:29:31 -0000 1.12 +++ tests/kintr0.c 20 Aug 2007 14:54:15 -0000 @@ -61,6 +61,14 @@ #include "testaux.h" +#ifdef CYGNUM_KERNEL_INTR_TEST_PRIO +#define PRIO_0 CYGNUM_KERNEL_INTR_TEST_PRIO +#define PRIO_1 CYGNUM_KERNEL_INTR_TEST_PRIO +#else +#define PRIO_0 0 +#define PRIO_1 1 +#endif + static cyg_interrupt intr_obj[2]; static cyg_handle_t intr0, intr1; @@ -103,7 +111,7 @@ cyg_handle_t handle; cyg_interrupt intr; - cyg_interrupt_create(CYGNUM_HAL_ISR_MIN, 0, (cyg_addrword_t)333, + cyg_interrupt_create(CYGNUM_HAL_ISR_MIN, PRIO_0, (cyg_addrword_t)333, isr0, dsr0, &handle, &intr ); cyg_interrupt_delete(handle); @@ -156,13 +164,13 @@ HAL_INTERRUPT_IN_USE( lvl1, in_use ); intr0 = 0; if (!in_use) - cyg_interrupt_create(lvl1, 1, (cyg_addrword_t)777, isr0, dsr0, + cyg_interrupt_create(lvl1, PRIO_1, (cyg_addrword_t)777, isr0, dsr0, &intr0, &intr_obj[0]); HAL_INTERRUPT_IN_USE( lvl2, in_use ); intr1 = 0; if (!in_use && lvl1 != lvl2) - cyg_interrupt_create(lvl2, 1, 888, isr1, dsr1, &intr1, &intr_obj[1]); + cyg_interrupt_create(lvl2, PRIO_1, 888, isr1, dsr1, &intr1, &intr_obj[1]); // Check these functions at least exist --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hal_interrupt_configure.diff" Content-length: 787 Index: lpc2xxx_misc.c =================================================================== RCS file: /cvs/ecos/ecos/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c,v retrieving revision 1.5 diff -u -r1.5 lpc2xxx_misc.c --- lpc2xxx_misc.c 30 Jul 2007 18:09:47 -0000 1.5 +++ lpc2xxx_misc.c 20 Aug 2007 14:46:32 -0000 @@ -355,8 +355,9 @@ cyg_uint32 regval, saved_vpbdiv; // Only external interrupts are configurable - CYG_ASSERT(vector <= CYGNUM_HAL_INTERRUPT_EINT3 && - vector >= CYGNUM_HAL_INTERRUPT_EINT0 , "Invalid vector"); + if(vector < CYGNUM_HAL_INTERRUPT_EINT0 || + vector > CYGNUM_HAL_INTERRUPT_EINT3) + return; // Map int vector to corresponding bit (0..3) vector = 1 << (vector - CYGNUM_HAL_INTERRUPT_EINT0); --ibTvN161/egqYuK8--