[ell-i-developers] Re: About type correctness

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Tue, 18 Feb 2014 09:12:14 +0200

> The ARMv6-M architecture guarantees that all exceptions are entered with 
> 8-byte stack alignment. However, because exceptions can occur on any 
> instruction boundary, it is possible that the current stack pointer is not 
> 8-byte aligned when an exception activates. [...]

Good catch!

> The only point it attracted my attention is that ChibiOS generated 8 byte 
> aligned contexts. The point is that they generated false contexts for their 
> application. In that sense, it would be necessary to align the contexts, but 
> if our application does not need to do it, then it is not necessary, or is it?

Yes, we need to make sure that our exception context data structures (stacks) 
are properly aligned.  I'm not sure if my code does that, most probably not.  I 
think __attribute__((align(8)) or something with proper documentation and 
reference to the section B1.5.7 is the way to go.


Other related posts: