aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/ports/MSP430X
diff options
context:
space:
mode:
Diffstat (limited to 'os/common/ports/MSP430X')
-rw-r--r--os/common/ports/MSP430X/chcore.c4
-rw-r--r--os/common/ports/MSP430X/compilers/GCC/chtypes.h14
2 files changed, 15 insertions, 3 deletions
diff --git a/os/common/ports/MSP430X/chcore.c b/os/common/ports/MSP430X/chcore.c
index 4e09b8f..7a8d7f2 100644
--- a/os/common/ports/MSP430X/chcore.c
+++ b/os/common/ports/MSP430X/chcore.c
@@ -58,11 +58,11 @@
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
-#if !defined(__DOXYGEN__) && defined(__OPTIMIZE__)
+#if !(__GNUC__ < 6 && __GNUC_MINOR__ < 4) || defined(__OPTIMIZE__)
__attribute__((naked))
#endif
void _port_switch(thread_t *ntp, thread_t *otp) {
-#if !defined(__OPTIMIZE__)
+#if (__GNUC__ < 6 && __GNUC_MINOR__ < 4) && !defined(__OPTIMIZE__)
asm volatile ("add #4, r1");
#endif
(void)(ntp);
diff --git a/os/common/ports/MSP430X/compilers/GCC/chtypes.h b/os/common/ports/MSP430X/compilers/GCC/chtypes.h
index 11cc980..46a074c 100644
--- a/os/common/ports/MSP430X/compilers/GCC/chtypes.h
+++ b/os/common/ports/MSP430X/compilers/GCC/chtypes.h
@@ -94,6 +94,18 @@ typedef uint16_t ucnt_t; /**< Generic unsigned counter. */
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
-#endif /* _NILTYPES_H_ */
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
+
+#endif /* CHTYPES_H */
/** @} */