aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-10 10:40:37 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-10 10:40:37 +0000
commit2fd2d1efb9a720b7e601123e5504730685e98557 (patch)
tree3c95963e975c7d0af5c13d92d97a25290bcefaaa /os
parent014976ee109e90dec11591118a4ab0d88c00118f (diff)
downloadChibiOS-2fd2d1efb9a720b7e601123e5504730685e98557.tar.gz
ChibiOS-2fd2d1efb9a720b7e601123e5504730685e98557.tar.bz2
ChibiOS-2fd2d1efb9a720b7e601123e5504730685e98557.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7747 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.c10
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.h12
-rw-r--r--os/rt/ports/ARMCMx/chcore_v7m.h10
-rw-r--r--os/rt/src/chtm.c4
4 files changed, 20 insertions, 16 deletions
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.c b/os/rt/ports/ARMCMx/chcore_v6m.c
index e7514cbe4..b799a8724 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.c
+++ b/os/rt/ports/ARMCMx/chcore_v6m.c
@@ -51,13 +51,15 @@
/* Module interrupt handlers. */
/*===========================================================================*/
-#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#if (CORTEX_ALTERNATE_SWITCH == FALSE) || defined(__DOXYGEN__)
/**
* @brief NMI vector.
* @details The NMI vector is used for exception mode re-entering after a
* context switch.
*/
+/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
void NMI_Handler(void) {
+/*lint -restore*/
/* The port_extctx structure is pointed by the PSP register.*/
struct port_extctx *ctxp = (struct port_extctx *)__get_PSP();
@@ -74,13 +76,15 @@ void NMI_Handler(void) {
}
#endif /* !CORTEX_ALTERNATE_SWITCH */
-#if CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#if (CORTEX_ALTERNATE_SWITCH == TRUE) || defined(__DOXYGEN__)
/**
* @brief PendSV vector.
* @details The PendSV vector is used for exception mode re-entering after a
* context switch.
*/
+/*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
void PendSV_Handler(void) {
+/*lint -restore*/
/* The port_extctx structure is pointed by the PSP register.*/
struct port_extctx *ctxp = (struct port_extctx *)__get_PSP();
@@ -105,7 +109,7 @@ void PendSV_Handler(void) {
*/
void _port_irq_epilogue(regarm_t lr) {
- if (lr != (regarm_t)0xFFFFFFF1) {
+ if (lr != (regarm_t)0xFFFFFFF1U) {
struct port_extctx *ctxp;
port_lock_from_isr();
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h
index 3c28c0f54..3ac78b926 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.h
+++ b/os/rt/ports/ARMCMx/chcore_v6m.h
@@ -124,7 +124,7 @@
/**
* @brief Port-specific information string.
*/
-#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#if (CORTEX_ALTERNATE_SWITCH == FALSE) || defined(__DOXYGEN__)
#define PORT_INFO "Preemption through NMI"
#else
#define PORT_INFO "Preemption through PendSV"
@@ -134,7 +134,7 @@
/**
* @brief Maximum usable priority for normal ISRs.
*/
-#if CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#if (CORTEX_ALTERNATE_SWITCH == TRUE) || defined(__DOXYGEN__)
#define CORTEX_MAX_KERNEL_PRIORITY 1
#else
#define CORTEX_MAX_KERNEL_PRIORITY 0
@@ -246,7 +246,7 @@ struct port_intctx {
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
-#if !CH_DBG_ENABLE_STACK_CHECK || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_STACK_CHECK == FALSE) || defined(__DOXYGEN__)
#define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
@@ -306,7 +306,7 @@ static inline syssts_t port_get_irq_status(void) {
*/
static inline bool port_irq_enabled(syssts_t sts) {
- return (sts & 1) == 0;
+ return (sts & (syssts_t)1) == (syssts_t)0;
}
/**
@@ -318,7 +318,7 @@ static inline bool port_irq_enabled(syssts_t sts) {
*/
static inline bool port_is_isr_context(void) {
- return (bool)((__get_IPSR() & 0x1FF) != 0);
+ return (bool)((__get_IPSR() & 0x1FFU) != 0U);
}
/**
@@ -393,7 +393,7 @@ static inline void port_enable(void) {
*/
static inline void port_wait_for_interrupt(void) {
-#if CORTEX_ENABLE_WFI_IDLE
+#if CORTEX_ENABLE_WFI_IDLE == TRUE
__WFI();
#endif
}
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h
index f3c59a296..d6befaf72 100644
--- a/os/rt/ports/ARMCMx/chcore_v7m.h
+++ b/os/rt/ports/ARMCMx/chcore_v7m.h
@@ -397,12 +397,12 @@ static inline void port_init(void) {
* @return The interrupts status.
*/
static inline syssts_t port_get_irq_status(void) {
- uint32_t sts;
+ syssts_t sts;
#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
- sts = __get_BASEPRI();
+ sts = (syssts_t)__get_BASEPRI();
#else /* CORTEX_SIMPLIFIED_PRIORITY */
- sts = __get_PRIMASK();
+ sts = (syssts_t)__get_PRIMASK();
#endif /* CORTEX_SIMPLIFIED_PRIORITY */
return sts;
}
@@ -419,9 +419,9 @@ static inline syssts_t port_get_irq_status(void) {
static inline bool port_irq_enabled(syssts_t sts) {
#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
- return sts == CORTEX_BASEPRI_DISABLED;
+ return sts == (syssts_t)CORTEX_BASEPRI_DISABLED;
#else /* CORTEX_SIMPLIFIED_PRIORITY */
- return (sts & 1) == 0;
+ return (sts & (syssts_t)1) == (syssts_t)0;
#endif /* CORTEX_SIMPLIFIED_PRIORITY */
}
diff --git a/os/rt/src/chtm.c b/os/rt/src/chtm.c
index 07f365114..a0001cb62 100644
--- a/os/rt/src/chtm.c
+++ b/os/rt/src/chtm.c
@@ -82,7 +82,7 @@ void _tm_init(void) {
/* Time Measurement subsystem calibration, it does a null measurement
and calculates the call overhead which is subtracted to real
measurements.*/
- ch.tm.offset = 0;
+ ch.tm.offset = (rtcnt_t)0;
chTMObjectInit(&tm);
chTMStartMeasurementX(&tm);
chTMStopMeasurementX(&tm);
@@ -150,7 +150,7 @@ NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1,
tmp2->last = chSysGetRealtimeCounterX();
/* Stops previous measurement using the same time stamp.*/
- tm_stop(tmp1, tmp2->last, 0);
+ tm_stop(tmp1, tmp2->last, (rtcnt_t)0);
}
#endif /* CH_CFG_USE_TM == TRUE */