From 880d6916b3fb25b3972ed78b380db630524623e7 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 3 Mar 2015 15:08:54 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7713 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chschd.h | 2 +- os/rt/include/chvt.h | 8 ++++---- os/rt/ports/ARM/chcore.h | 2 +- os/rt/ports/ARMCMx/chcore_v6m.h | 2 +- os/rt/ports/ARMCMx/chcore_v7m.h | 2 +- os/rt/ports/SIMIA32/chcore.h | 4 ++-- os/rt/ports/e200/chcore.h | 2 +- os/rt/templates/chcore.h | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) (limited to 'os/rt') 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. -- cgit v1.2.3