[rtems commit] score: Add RTEMS_ALIGNED()

Sebastian Huber sebh at rtems.org
Tue Jan 26 08:11:41 UTC 2016


Module:    rtems
Branch:    master
Commit:    cd9ef18564af6cdbd2ab65bb16e184e17aa43702
Changeset: http://git.rtems.org/rtems/commit/?id=cd9ef18564af6cdbd2ab65bb16e184e17aa43702

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Jan 25 10:20:14 2016 +0100

score: Add RTEMS_ALIGNED()

---

 cpukit/score/include/rtems/score/basedefs.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 7e282c1..25f5058 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -235,6 +235,15 @@
   #define RTEMS_PACKED
 #endif
 
+/**
+ * @brief Instructs the compiler to enforce the specified alignment.
+ */
+#if defined(__GNUC__)
+  #define RTEMS_ALIGNED( _alignment ) __attribute__((__aligned__(_alignment)))
+#else
+  #define RTEMS_ALIGNED( _alignment )
+#endif
+
 /* Provided for backward compatibility */
 #define RTEMS_COMPILER_PACKED_ATTRIBUTE RTEMS_PACKED
 



More information about the vc mailing list