comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tero.koskinen@iki.fi>
Subject: Re: Protected Objects and Interrupt Handlers
Date: Thu, 25 Feb 2016 19:40:54 +0200
Date: 2016-02-25T19:40:54+02:00	[thread overview]
Message-ID: <nanead$d28$1@loke.gir.dk> (raw)
In-Reply-To: <lysi0glqwu.fsf@pushface.org>

Hi,

25.2.2016, 18.02, Simon Wright wrote:
> Maciej Sobczak <see.my.homepage@gmail.com> writes:
>
>> Last but no least - Simon has pointed you towards an article (a
>> book chapter, in fact) where the interrupts are handled by regular
>> procedures instead - as an author of that text I feel responsible
>> for clarifying why - the reason is that the book consistently
>> assumes a zero-runtime execution platform, where the necessary
>> scaffolding for protected objects (namely: actual synchronization)
>> simply does not exist.
>
> A minor point: a common cited advantage of the Cortex series is that
> ISRs can be written in ordinary code, without compiler magic. This
> seems to imply that other MCUs _do_ need compiler magic!

Yes, ARM Cortex-Mx family processors can have normal C functions as
interrupt handlers because when the interrupt occurs the hardware pushes
a set of registers to stack automatically (and also restores
the registers when returning from the interrupt).

On the other hand, 8-bit AVRs do not have this feature, so for them you
need to mark the interrupt handler somehow so that the compiler can
generate different code for them.

In general, ARM Cortex-Mx processors are "C-friendly". For example
in the normal case, you can have all the startup code in C (or
in Ada, which is then exported to C) and there is no need for
assembler.

Yours,
  Tero


  reply	other threads:[~2016-02-25 17:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 22:25 Protected Objects and Interrupt Handlers Jere
2016-02-23 23:09 ` Simon Wright
2016-02-24 14:38   ` Jere
2016-02-24 18:29     ` Simon Wright
2016-02-24 21:37       ` Jere
2016-02-25 15:14 ` Maciej Sobczak
2016-02-25 15:59   ` Simon Wright
2016-02-26  3:20     ` Dennis Lee Bieber
2016-02-26  8:12       ` Simon Wright
2016-02-27 18:06     ` Maciej Sobczak
2016-02-25 16:02   ` Simon Wright
2016-02-25 17:40     ` Tero Koskinen [this message]
2016-02-25 19:49       ` Simon Wright
2016-03-13  8:10         ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox