From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1168 invoked by alias); 23 Nov 2008 22:20:06 -0000 Received: (qmail 1127 invoked by uid 22791); 23 Nov 2008 22:20:03 -0000 X-Spam-Level: * X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 23 Nov 2008 22:18:56 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id E571E2F8008; Sun, 23 Nov 2008 22:18:45 +0000 (GMT) X-Virus-Scanned: amavisd-new at ecoscentric.com Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9zHmxZieXwaW; Sun, 23 Nov 2008 22:18:40 +0000 (GMT) Received: from delenn.bartv.net (hagrid.vpn.ecoscentric.com [192.168.145.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 6A89C3B4006F; Sun, 23 Nov 2008 22:18:40 +0000 (GMT) Date: Sun, 23 Nov 2008 22:20:00 -0000 Message-Id: From: Bart Veer To: Andrew Lunn CC: martin.laabs@mailbox.tu-dresden.de, ecos-devel@ecos.sourceware.org In-reply-to: <20081122191149.GO17925@lunn.ch> (message from Andrew Lunn on Sat, 22 Nov 2008 20:11:49 +0100) Subject: Re: Patch for CYGPKG_IO_SERIAL_ARM_LPC2XXX References: <20081122191149.GO17925@lunn.ch> Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2008-11/txt/msg00063.txt.bz2 >>>>> "Andrew" == Andrew Lunn writes: >> PS: Is it possible to avoid assignment of equal priorities to >> different IRQs at same time in configtool/cdl. Andrew> You can use an implies statement in one of the options. eg Andrew> in CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO0 have Andrew> requires { is_active(CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO1) Andrew> implies { CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO0 != Andrew> CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO1 } Andrew> } That works for the specific case of preventing the two serial devices from sharing the same interrupt priority, but does not prevent a serial device from being given the same priority as some other device (which I assume is the limitation within the LPC VIC). I have run into similar problems on some ColdFire processors. Unfortunately right now there is no good way of imposing the constraint in CDL. The syntax for that would look something like: cdl_option CYGDAT_HAL_ARM_LPC2XXX_INTPRIO(0 to 31) { flavor data default_value "user" } cdl_option CYGNUM_IO_SERIAL_ARM_LPC2XXX_SERIAL0_INTPRIO { legal_values 0 to 31 requires { CYGDAT_HAL_ARM_LPC2XXX_INTPRIO($self) == "uart0" } } As long as all relevant device drivers, and anything else that installed an interrupt handler, had a config option like that per interrupt source the "requires" constraints would prevent two devices being given the same interrupt priority. Also, the application developer could see which interrupt priorities were still available, and could reserve certain ones by setting user values. Unfortunately there are no plans at present to extend the CDL language with facilities like that. What I have done in the past is to add a testcase to the processor HAL which walks through the interrupt vectors, reports the priority associated with each one, and checks for any conflicts. You can then run that testcase in your configuration. However that won't catch clashes between priorities used by device drivers and ones used by application code. Another approach is to have a debug version of the interrupt SET_LEVEL() macro which does a run-time check. Bart -- Bart Veer eCos Configuration Architect eCosCentric Limited The eCos experts http://www.ecoscentric.com/ Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071.