* copyright-checker: Add FreeRTOS Arm collab copyright FreeRTOS Arm collab files shall have both Amazon's and Arm's copyright headers. Hence, the copyright checker is modified to check for both copyrights. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> * armv8-m: Add support for IAR with TFM FREERTOS PORT As the case for ARMClang, and GCC toolchains, IAR with TFM FreeRTOS Port support is added. Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com> * armv8-m: Do not overwrite Control register value The current ARMv8-M FreeRTOS-Kernel Port code implementation is modified in a way that allows the CONTROL register's value to be retained rather than being overwritten. This is needed for adding PACBTI support as the special-purpose CONTROL register `PAC_EN`, `UPAC_EN`, `BTI_EN`, and `UBTI_EN` PACBTI enablement bits should be configured before calling `vRestoreContextOfFirstTask()` function which currently overwrite the value inside the CONTROL register. Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com> * armv8.1-m: Add PACBTI support to kernel non-secure implementation In this commit, Pointer Authentication, and Branch Target Identification Extension (PACBTI) support is added for Non-Secure and Non-TrustZone variants of Cortex-M85 FreeRTOS-Kernel Port. The PACBTI support is added for Arm Compiler For Embedded, and IAR toolchains only. The support in the kernel is not yet enabled for GNU toolchain due to known issues. Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com> * Fix CI check Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com> Co-authored-by: Ahmed Ismail <ahmism01@e133373.arm.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2.4 KiB
MISRA Compliance for FreeRTOS-Kernel
FreeRTOS-Kernel is MISRA C:2012 compliant. This directory contains a project to run Synopsys Coverity for checking MISRA compliance.
Note
Coverity version 2023.6.1 incorrectly infers the type of
pdTRUE
andpdFALSE
as boolean because of their names, resulting in multiple false positive warnings about type mismatch. We replacepdTRUE
withpdPASS
andpdFALSE
withpdFAIL
to avoid these false positive warnings. This workaround will not be needed after Coverity fixes the issue of incorrectly inferring the type ofpdTRUE
andpdFALSE
as boolean.
Deviations from the MISRA C:2012 guidelines are documented in MISRA.md and coverity_misra.config files.
Getting Started
Prerequisites
Coverity can be run on any platform mentioned here. The following are the prerequisites to generate coverity report:
- CMake version > 3.13.0 (You can check whether you have this by typing
cmake --version
). - GCC compiler.
- See download and installation instructions here.
- Clone the repo using the following command:
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git ./FreeRTOS-Kernel
Generating Report
Go to the root directory of the FreeRTOS-Kernel repo and run the following commands in a terminal:
- Update the compiler configuration in Coverity:
cov-configure --force --compiler cc --comptype gcc
- Create the build files using CMake in a
build
directory:
Singe core FreeRTOS:
cmake -B build -S examples/coverity
SMP FreeRTOS:
cmake -B build -S examples/coverity -DFREERTOS_SMP_EXAMPLE=1
- Build the (pseudo) application:
cd build/
cov-build --emit-complementary-info --dir cov-out make coverity
- Go to the Coverity output directory (
cov-out
) and begin Coverity static analysis:
cov-analyze --dir ./cov-out \
--coding-standard-config ../examples/coverity/coverity_misra.config \
--tu-pattern "file('[A-Za-z_]+\.c') && ( ! file('main.c') ) && ( ! file('port.c') )"
- Generate the HTML report:
cov-format-errors --dir ./cov-out --html-output html-output
HTML report should now be generated in a directory named html-output
.