[En-Nut-Discussion] Cortex ix_xxx_interuptY code duplication
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Wed Jul 25 11:07:25 CEST 2012
>>>>> "Ulrich" == Ulrich Prinz <ulrich.prinz at googlemail.com> writes:
...
Ulrich> I used to add the IRQ number as a parameter to the IRQ control
Ulrich> function in the IRQ struct already somewhere in the Cortex
Ulrich> port. Sort of a sub-peripheral address if you like. Should be no
Ulrich> problem to extend this to all peripherals. But isn't it then
Ulrich> better to pass the struct itself to the IRQ setup und IRQ handle
Ulrich> function addressed from the struct? It creates less CPU overhead
Ulrich> and stack operations. So you have all information at one address
Ulrich> and ARM/Cortex can address relative without speed loss.
Show (pseudo) code and/or proposed header definitions ;-)
>> I think there wouldn't be any further redirection needed as long as
>> we pass the IRQ_HANDLER instead of a user argument, as the user
>> argument is stored in the IRQ_HANDLER struct, isn't it?
>>
>>> Perhaps even one file for all IRQ_HANDLERs.
>> Yes, I fully agree. We could stay with one file for all
>> interrupts. The only thing shich would have to be defined is the
>> IRQ_HANDLER struct instance.
Ulrich> Same idea like mine :)
>>
>>> NUT_IRQCTL_GETMODE/NUT_IRQCTL_SETMODE might need a special
>>> consideration, as Ulrich marked some interrupt handlers as
>>> NUT_IRQMODE_LEVEL versus the default NUT_IRQMODE_EDGE everywhere in
>>> nxp and mostly in stm32.
>> AFAIK the CM3 does not even support NUT_IRQMODE_LEVEL as the AT91
>> does.
>>
Ulrich> I am not sure if there is an option to have only one file for
Ulrich> all Cortex SOCs.
I meant one IRQ file for each architecture like NXP17/STM32, but that will
be sprackled with #if for all those slight differences in the subfamilies.
Uwe
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the En-Nut-Discussion
mailing list