This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LPC2xxx patch for support of vectored interrupt controller


On Wed, Aug 22, 2007 at 10:40:26AM +0200, Hans Rosenfeld wrote:
> On Wed, Aug 22, 2007 at 10:24:51AM +0200, Andrew Lunn wrote:
> > > +#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
> > 
> > I've not spent time to really understand this change. But a first
> > glance suggests this is wrong. Shouldn't it be
> > 
> > #define PRIO_1 (CYGNUM_KERNEL_INTR_TEST_PRIO + 1)
> > 
> > in order to maintain the old behaviour. 
> 
> On the LPC2xxx there is only one interrupt priority (16) that can be
> used more than once. The reason for making this configurable is to make
> this test use only this priority, even if this is different from the old
> behaviour. I don't think this is a problem since the interrupts are never
> triggered in those tests.

I think much better way to do this is:

            cdl_option CYGNUM_KERNEL_INTR_TEST_PRIO_A {
                display       "interrupt priority used by intr0/kintr0 test"
                flavor        data
                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."
            }

            cdl_option CYGNUM_KERNEL_INTR_TEST_PRIO_B {
                display       "interrupt priority used by intr0/kintr0 test"
                flavor        data
                default_value 1
                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."
            }

and then in the LPC2XXX hal statements like

    requires { is_active(CYGNUM_KERNEL_INTR_TEST_PRIO_A) 
               implies { CYGNUM_KERNEL_INTR_TEST_PRIO_A == 16 } }

    requires { is_active(CYGNUM_KERNEL_INTR_TEST_PRIO_B) 
               implies { CYGNUM_KERNEL_INTR_TEST_PRIO_B == 16 } }

It makes the test more flexible. You can how for example use vectors 5
and 15 which was not possible before.

    Andrew

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]