From b65fe95a497a60c30c385e51d3e32cc4c3dc7f8a Mon Sep 17 00:00:00 2001 From: isiora Date: Sat, 5 Aug 2017 13:29:33 +0000 Subject: Changed interrupt macro in order to disallow the IRQs git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10353 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/ports/ARMCAx-TZ/chcore.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'os/common/ports/ARMCAx-TZ') diff --git a/os/common/ports/ARMCAx-TZ/chcore.h b/os/common/ports/ARMCAx-TZ/chcore.h index 7be2cdaca..c2c259581 100644 --- a/os/common/ports/ARMCAx-TZ/chcore.h +++ b/os/common/ports/ARMCAx-TZ/chcore.h @@ -298,7 +298,7 @@ struct port_context { * port implementation. */ #define PORT_IRQ_HANDLER(id) \ - __attribute__((interrupt("FIQ"))) void id(void) + __attribute__((interrupt("FIQ"))) bool id(void) /** * @brief Fast IRQ handler function declaration. @@ -306,7 +306,7 @@ struct port_context { * port implementation. */ #define PORT_FAST_IRQ_HANDLER(id) \ - __attribute__((interrupt("FIQ"))) void id(void) + __attribute__((interrupt("FIQ"))) bool id(void) /** * @brief Performs a context switch between two threads. @@ -434,20 +434,20 @@ static inline bool port_is_isr_context(void) { /** * @brief Kernel-lock action. * @details In this port it disables the FIQ sources and keeps IRQ sources - * enabled. + * disabled. */ static inline void port_lock(void) { - __asm volatile ("msr CPSR_c, #0x5F" : : : "memory"); + __asm volatile ("msr CPSR_c, #0xDF" : : : "memory"); } /** * @brief Kernel-unlock action. - * @details In this port it enables both the IRQ and FIQ sources. + * @details In this port it enables the FIQ sources. */ static inline void port_unlock(void) { - __asm volatile ("msr CPSR_c, #0x1F" : : : "memory"); + __asm volatile ("msr CPSR_c, #0x9F" : : : "memory"); } /** @@ -468,30 +468,31 @@ static inline void port_unlock_from_isr(void) { /** * @brief Disables all the interrupt sources. - * @details In this port it disables FIQ sources. + * @details In this port it disables FIQ sources and keeps IRQ sources + * disabled. */ static inline void port_disable(void) { - __asm volatile ("msr CPSR_c, #0x5F" : : : "memory"); + __asm volatile ("msr CPSR_c, #0xDF" : : : "memory"); } /** * @brief Disables the interrupt sources below kernel-level priority. * @note Interrupt sources above kernel level remains enabled. - * @note In this port it disables the FIQ sources. + * @note In this port it disables the FIQ and IRQ sources. */ static inline void port_suspend(void) { - __asm volatile ("msr CPSR_c, #0x5F" : : : "memory"); + __asm volatile ("msr CPSR_c, #0xDF" : : : "memory"); } /** * @brief Enables all the interrupt sources. - * @note In this port it enables both the IRQ and FIQ sources. + * @note In this port it enables the FIQ sources. */ static inline void port_enable(void) { - __asm volatile ("msr CPSR_c, #0x1F" : : : "memory"); + __asm volatile ("msr CPSR_c, #0x9F" : : : "memory"); } /** -- cgit v1.2.3