aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt')
-rw-r--r--os/rt/include/chschd.h2
-rw-r--r--os/rt/include/chvt.h8
-rw-r--r--os/rt/ports/ARM/chcore.h2
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.h2
-rw-r--r--os/rt/ports/ARMCMx/chcore_v7m.h2
-rw-r--r--os/rt/ports/SIMIA32/chcore.h4
-rw-r--r--os/rt/ports/e200/chcore.h2
-rw-r--r--os/rt/templates/chcore.h2
8 files changed, 12 insertions, 12 deletions
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index 0679cadd5..12a6762fa 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -116,7 +116,7 @@
* @api
*/
#define THD_ALIGN_STACK_SIZE(n) \
- ((((n) - 1) | (sizeof(stkalign_t) - 1)) + 1)
+ (((((size_t)(n)) - 1U) | (sizeof(stkalign_t) - 1U)) + 1U)
/**
* @brief Calculates the total Working Area size.
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index 0a4b3a94c..f0a8f00d6 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -118,8 +118,8 @@
* @api
*/
#define MS2ST(msec) \
- ((systime_t)(((((uint32_t)(msec)) * \
- ((uint32_t)CH_CFG_ST_FREQUENCY) - 1UL) / 1000UL) + 1UL))
+ ((systime_t)((((((uint32_t)(msec)) * \
+ ((uint32_t)CH_CFG_ST_FREQUENCY)) - 1UL) / 1000UL) + 1UL))
/**
* @brief Microseconds to system ticks.
@@ -132,8 +132,8 @@
* @api
*/
#define US2ST(usec) \
- ((systime_t)(((((uint32_t)(usec)) * \
- ((uint32_t)CH_CFG_ST_FREQUENCY) - 1UL) / 1000000UL) + 1UL))
+ ((systime_t)((((((uint32_t)(usec)) * \
+ ((uint32_t)CH_CFG_ST_FREQUENCY)) - 1UL) / 1000000UL) + 1UL))
/**
* @brief System ticks to seconds.
diff --git a/os/rt/ports/ARM/chcore.h b/os/rt/ports/ARM/chcore.h
index 980a45a8e..2d672d7ac 100644
--- a/os/rt/ports/ARM/chcore.h
+++ b/os/rt/ports/ARM/chcore.h
@@ -251,7 +251,7 @@ struct context {
*/
#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
+ ((size_t)(n)) + ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h
index 7bb1b3d8f..3ded54449 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.h
+++ b/os/rt/ports/ARMCMx/chcore_v6m.h
@@ -197,7 +197,7 @@ struct port_intctx {
*/
#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
+ ((size_t)(n)) + ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h
index 47a5cf9a8..80faaefc9 100644
--- a/os/rt/ports/ARMCMx/chcore_v7m.h
+++ b/os/rt/ports/ARMCMx/chcore_v7m.h
@@ -296,7 +296,7 @@ struct port_intctx {
*/
#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
+ ((size_t)(n)) + ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.
diff --git a/os/rt/ports/SIMIA32/chcore.h b/os/rt/ports/SIMIA32/chcore.h
index 5f7f3ff14..06d9f9329 100644
--- a/os/rt/ports/SIMIA32/chcore.h
+++ b/os/rt/ports/SIMIA32/chcore.h
@@ -191,8 +191,8 @@ struct context {
#define PORT_WA_SIZE(n) (sizeof(void *) * 4 + \
sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + \
- PORT_INT_REQUIRED_STACK)
+ ((size_t)(n)) + \
+ ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.
diff --git a/os/rt/ports/e200/chcore.h b/os/rt/ports/e200/chcore.h
index 116f269f0..f1485b81a 100644
--- a/os/rt/ports/e200/chcore.h
+++ b/os/rt/ports/e200/chcore.h
@@ -300,7 +300,7 @@ struct context {
*/
#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
+ ((size_t)(n)) + ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.
diff --git a/os/rt/templates/chcore.h b/os/rt/templates/chcore.h
index af09b2efd..39d173608 100644
--- a/os/rt/templates/chcore.h
+++ b/os/rt/templates/chcore.h
@@ -177,7 +177,7 @@ struct context {
*/
#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
+ ((size_t)(n)) + ((size_t)(PORT_INT_REQUIRED_STACK)))
/**
* @brief IRQ prologue code.