aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--test/hal/testbuild/pclint/waivers.lnt24
-rw-r--r--test/rt/testbuild/pclint/waivers.lnt8
6 files changed, 45 insertions, 23 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 */
diff --git a/test/hal/testbuild/pclint/waivers.lnt b/test/hal/testbuild/pclint/waivers.lnt
index 78b58e3c2..300ce66b9 100644
--- a/test/hal/testbuild/pclint/waivers.lnt
+++ b/test/hal/testbuild/pclint/waivers.lnt
@@ -6,6 +6,24 @@
+libh(core_cm4.h)
+libh(stm32f4xx.h)
+/* Reinforcing type checking for some critical types even if not required by
+ MISRA.*/
+-strong(AJX, systime_t)
+-strong(AJX, rtcnt_t)
+-strong(AJX, rttime_t)
+-strong(AJX, syssts_t)
+-strong(AJX, msg_t)
+-strong(AJX, tmode_t)
+-strong(AJX, tstate_t)
+-strong(AJX, trefs_t)
+-strong(AJX, tslices_t)
+-strong(AJX, tprio_t)
+-strong(AJX, cnt_t)
+-strong(AJX, ucnt_t)
+-strong(AJX, eventid_t)
+-strong(AJX, eventmask_t)
+-strong(AJX, eventflags_t)
+
/* Permitting anonymous unions.*/
+fan
@@ -50,7 +68,7 @@
header files, the guard is present, suppressing the noise.*/
-e451
-/* Waiver Rule 2.2, PCLint marks as pure functions that contain just arm
+/* Waiver Rule 2.2, PCLint marks as pure functions that contain just asm
code, this does not mean that those functions do nothing.*/
-e522
@@ -59,7 +77,7 @@
license URL and cannot be removed.*/
-e9059
-/* Waiver Rule 8.7, the static analyzer has no visibility of functions called
+/* Waiver Rule 8.7, the static analyser has no visibility of functions called
from asm modules.*/
-e765
@@ -69,7 +87,7 @@
/* Waiver Rule 11.3, casts among different types are required by system
design.*/
--e740 /* Wrongly marked as 1.3 in PCLint 9-0L.*/
+-e740 /* Wrongly marked as 1.3 in PCLint 9.00L.*/
-e9087
/* Waiver Rule 11.6, cast from integer to pointer is very commonly used
diff --git a/test/rt/testbuild/pclint/waivers.lnt b/test/rt/testbuild/pclint/waivers.lnt
index 03ccb7a09..ab2507c94 100644
--- a/test/rt/testbuild/pclint/waivers.lnt
+++ b/test/rt/testbuild/pclint/waivers.lnt
@@ -4,7 +4,7 @@
-elib(*) /* No checks on library files. */
+libclass(angle,ansi)
+libh(core_cm4.h)
-+libh(stm32f4xx.h)
++libh(stm32*.h)
+libh(*_lld.h)
/* Reinforcing type checking for some critical types even if not required by
@@ -69,7 +69,7 @@
header files, the guard is present, suppressing the noise.*/
-e451
-/* Waiver Rule 2.2, PCLint marks as pure functions that contain just arm
+/* Waiver Rule 2.2, PCLint marks as pure functions that contain just asm
code, this does not mean that those functions do nothing.*/
-e522
@@ -78,7 +78,7 @@
license URL and cannot be removed.*/
-e9059
-/* Waiver Rule 8.7, the static analyzer has no visibility of functions called
+/* Waiver Rule 8.7, the static analyser has no visibility of functions called
from asm modules.*/
-e765
@@ -88,7 +88,7 @@
/* Waiver Rule 11.3, casts among different types are required by system
design.*/
--e740 /* Wrongly marked as 1.3 in PCLint 9-0L.*/
+-e740 /* Wrongly marked as 1.3 in PCLint 9.00L.*/
-e9087
/* Waiver Rule 11.6, cast from integer to pointer is very commonly used