]> begriffs open source - freertos/commit
Armv8-M (except Cortex-M23) interrupt priority checking (#673)
authorDevaraj Ranganna <devaraj.ranganna@arm.com>
Thu, 11 May 2023 16:41:00 +0000 (17:41 +0100)
committerGitHub <noreply@github.com>
Thu, 11 May 2023 16:41:00 +0000 (09:41 -0700)
commita07f649bd50798cf7bd20325f12491c599a8bd39
tree32bdc8b37abf9a4f11a1f9692dbaa469fb9244e0
parent9149af9a6f647851bafecec75d27e39056b115f9
Armv8-M (except Cortex-M23) interrupt priority checking (#673)

* Armv8-M: Formatting changes

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
* Armv8-M: Add support for interrupt priority check

FreeRTOS provides `FromISR` system calls which can be called directly
from interrupt service routines. It is crucial that the priority of
these ISRs is set to same or lower value (numerically higher) than that
of `configMAX_SYSCALL_INTERRUPT_PRIORITY`. For more information refer
to https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html.

Add a check to trigger an assert when an ISR with priority higher
(numerically lower) than `configMAX_SYSCALL_INTERRUPT_PRIORITY` calls
`FromISR` system calls if `configASSERT` macro is defined.

In addition, add a config option
`configQEMU_DISABLE_INTERRUPT_PRIO_BITS_CHECK` to disable interrupt
priority check while running on QEMU. Based on the discussion
https://gitlab.com/qemu-project/qemu/-/issues/1122, The interrupt
priority bits in QEMU do not match the real hardware. Therefore the
assert that checks the number of implemented bits and __NVIC_PRIO_BITS
will always fail. The config option
 `configQEMU_DISABLE_INTERRUPT_PRIO_BITS_CHECK` should be defined in the
`FreeRTOSConfig.h` for QEMU targets.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
* Use SHPR2 for calculating interrupt priority bits

This removes the dependency on the secure software to mark the interrupt
as non-secure.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
---------

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
76 files changed:
portable/ARMv8M/non_secure/port.c
portable/ARMv8M/non_secure/portable/GCC/ARM_CM23/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM23_NTZ/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM33/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM33_NTZ/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM35P/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM55/portmacro.h
portable/ARMv8M/non_secure/portable/GCC/ARM_CM85/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM23/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM23_NTZ/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM33/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM33_NTZ/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM35P/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM55/portmacro.h
portable/ARMv8M/non_secure/portable/IAR/ARM_CM85/portmacro.h
portable/ARMv8M/non_secure/portmacrocommon.h
portable/GCC/ARM_CM23/non_secure/port.c
portable/GCC/ARM_CM23/non_secure/portmacro.h
portable/GCC/ARM_CM23/non_secure/portmacrocommon.h
portable/GCC/ARM_CM23_NTZ/non_secure/port.c
portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h
portable/GCC/ARM_CM23_NTZ/non_secure/portmacrocommon.h
portable/GCC/ARM_CM33/non_secure/port.c
portable/GCC/ARM_CM33/non_secure/portmacro.h
portable/GCC/ARM_CM33/non_secure/portmacrocommon.h
portable/GCC/ARM_CM33_NTZ/non_secure/port.c
portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h
portable/GCC/ARM_CM33_NTZ/non_secure/portmacrocommon.h
portable/GCC/ARM_CM35P/non_secure/port.c
portable/GCC/ARM_CM35P/non_secure/portmacro.h
portable/GCC/ARM_CM35P/non_secure/portmacrocommon.h
portable/GCC/ARM_CM35P_NTZ/non_secure/port.c
portable/GCC/ARM_CM35P_NTZ/non_secure/portmacro.h
portable/GCC/ARM_CM35P_NTZ/non_secure/portmacrocommon.h
portable/GCC/ARM_CM55/non_secure/port.c
portable/GCC/ARM_CM55/non_secure/portmacro.h
portable/GCC/ARM_CM55/non_secure/portmacrocommon.h
portable/GCC/ARM_CM55_NTZ/non_secure/port.c
portable/GCC/ARM_CM55_NTZ/non_secure/portmacro.h
portable/GCC/ARM_CM55_NTZ/non_secure/portmacrocommon.h
portable/GCC/ARM_CM85/non_secure/port.c
portable/GCC/ARM_CM85/non_secure/portmacro.h
portable/GCC/ARM_CM85/non_secure/portmacrocommon.h
portable/GCC/ARM_CM85_NTZ/non_secure/port.c
portable/GCC/ARM_CM85_NTZ/non_secure/portmacro.h
portable/GCC/ARM_CM85_NTZ/non_secure/portmacrocommon.h
portable/IAR/ARM_CM23/non_secure/port.c
portable/IAR/ARM_CM23/non_secure/portmacro.h
portable/IAR/ARM_CM23/non_secure/portmacrocommon.h
portable/IAR/ARM_CM23_NTZ/non_secure/port.c
portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h
portable/IAR/ARM_CM23_NTZ/non_secure/portmacrocommon.h
portable/IAR/ARM_CM33/non_secure/port.c
portable/IAR/ARM_CM33/non_secure/portmacro.h
portable/IAR/ARM_CM33/non_secure/portmacrocommon.h
portable/IAR/ARM_CM33_NTZ/non_secure/port.c
portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h
portable/IAR/ARM_CM33_NTZ/non_secure/portmacrocommon.h
portable/IAR/ARM_CM35P/non_secure/port.c
portable/IAR/ARM_CM35P/non_secure/portmacro.h
portable/IAR/ARM_CM35P/non_secure/portmacrocommon.h
portable/IAR/ARM_CM35P_NTZ/non_secure/port.c
portable/IAR/ARM_CM35P_NTZ/non_secure/portmacro.h
portable/IAR/ARM_CM35P_NTZ/non_secure/portmacrocommon.h
portable/IAR/ARM_CM55/non_secure/port.c
portable/IAR/ARM_CM55/non_secure/portmacro.h
portable/IAR/ARM_CM55/non_secure/portmacrocommon.h
portable/IAR/ARM_CM55_NTZ/non_secure/port.c
portable/IAR/ARM_CM55_NTZ/non_secure/portmacro.h
portable/IAR/ARM_CM55_NTZ/non_secure/portmacrocommon.h
portable/IAR/ARM_CM85/non_secure/port.c
portable/IAR/ARM_CM85/non_secure/portmacro.h
portable/IAR/ARM_CM85/non_secure/portmacrocommon.h
portable/IAR/ARM_CM85_NTZ/non_secure/port.c
portable/IAR/ARM_CM85_NTZ/non_secure/portmacro.h
portable/IAR/ARM_CM85_NTZ/non_secure/portmacrocommon.h