Epiphany - Alignment question (double word)

Hesham Moustafa heshamelmatary at gmail.com
Tue Nov 25 19:06:02 UTC 2014


Hi all,

I came across an issue with alignment when I am porting RTEMS to Epiphany
now. The reference manual says that stores should be aligned according to
the store instruction type (half word, word, double word). For example strd
instruction should get an address aligned to 8 bytes. Although I set
CPU_ALIGNMENT and Stack aliment macros to 8 in cpu.h, I still get some
automatic variables not aligned to 8 bytes, which causes an exception when
executing relevant (double) store/load instructions.

I had to apply a brute-force solution to get over this problem. For example
I add alignment's attribute to "CORE_mutex_Attributes attr __attribute__
((aligned (8)));" and I set "#define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC
TRUE" instead of using CPU_TIMESTAMP_USE_INT64

Is there any other good solution for such a problem?

Regards,
Hesham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20141125/b1a071bc/attachment.html>


More information about the devel mailing list