forked from FreeRTOS/FreeRTOS-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
Update coverity violation for SMP #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
chinglee-iot
merged 134 commits into
smp-dev-complete-merge-candidate-history
from
merge-main-misra-SMP-rebase20221130
May 16, 2023
Merged
Changes from 116 commits
Commits
Show all changes
134 commits
Select commit
Hold shift + click to select a range
c011734
Fix compile warnings and MISRA 2012 C Rule 1.1.
ActoryOu abc85d3
Fix MISRA C 2012 Directive 4.6.
ActoryOu 3b05aba
Fix MISRA C 2012 Rule 1.1.
ActoryOu cb17335
Fix MISRA C 2012 Rule 17.3.
ActoryOu 516fc6f
Fix MISRA C 2012 Rule 8.3.
ActoryOu 3466371
Fix MISRA C 2012 Rule 8.4.
ActoryOu 80785f9
Fix CHECKED_RETURN.
ActoryOu 65fa1bb
Fix MISRA C 2012 Rule 10.1.
ActoryOu a9cbaa1
Fix MISRA C 2012 Rule 10.2.
ActoryOu 1e14c65
Fix MISRA C 2012 Rule 10.3.
ActoryOu 7857976
Fix MISRA C 2012 Rule 10.4.
ActoryOu e9d6e22
Fix MISRA C 2012 Rule 10.7.
ActoryOu d656d1d
Fix MISRA C 2012 Rule 10.8.
ActoryOu 32295e7
Fix MISRA C 2012 Rule 11.3.
ActoryOu ee9a882
Fix MISRA C 2012 Rule 11.5.
ActoryOu e1a1db9
Fix MISRA C 2012 Rule 12.1.
ActoryOu 7036d9d
Fix MISRA C 2012 Rule 13.3.
ActoryOu bc39734
Fix MISRA C 2012 Rule 14.3.
ActoryOu 213e8f9
Fix MISRA C 2012 Rule 17.7.
ActoryOu b55b074
Fix MISRA C 2012 Rule 18.1.
ActoryOu 178f9b9
Fix MISRA C 2012 Rule 8.13.
ActoryOu 66665d2
Fix MISRA C 2012 Rule 8.5.
ActoryOu 611cff6
Fix MISRA C 2012 Rule 8.6.
ActoryOu 70903a3
Fix MISRA C 2012 Rule 8.9.
ActoryOu 257c3e0
Fix MISRA C 2012 Rule 8.4.
ActoryOu f1ece17
Fix MISRA C 2012 Rule 8.5.
ActoryOu b73bf11
Fix MISRA C 2012 Rule 8.6.
ActoryOu 59cf3f6
Revert unnecessary suppression.
ActoryOu 5c6d77b
Add more description in MISRA.md
ActoryOu b278341
Fix formatting.
ActoryOu ef65fda
Fix MISRA.md
ActoryOu b998572
Fix comments.
ActoryOu 646698d
Update MISRA.md for rule 8.9.
ActoryOu d29d3e2
Update MISRA.md for rule 8.5/8.6.
ActoryOu a244764
Wrap xYieldCount with configRUN_MULTIPLE_PRIORITIES. Fix comments.
ActoryOu 99d3d54
Fix array-bounds compiler warning on gcc11+ in list.h (#580)
archigup 6d65558
move the prototype for vApplicationIdleHook to task.h. (#600)
tcpluess aab4812
Update MISRA.md.
ActoryOu 953f32e
Remove Dir 4.6 in MISRA.md.
ActoryOu bb6071e
Update equal priority task preemption (#603)
chinglee-iot 8592fd2
Update FreeRTOS/FreeRTOS build checks (#613)
aggarg 78319fd
Add ulTaskGetRunTimeCounter and ulTaskGetRunTimePercent (#611)
chrisnc 260a37c
Fix some CMake documentation typos (#616)
davefiddes 88674cb
Update the uxSchedulerSuspended after prvCheckForRunStateChange
chinglee-iot 91c20f5
Added support of 64bit events. (#597)
Hadatko 050cf0d
Introduce portMEMORY_BARRIER for Microblaze port. (#621)
bbain 8252ede
Do not call exit() on MSVC Port when calling vPortEndScheduler (#624)
ba1deb5
Update PR template to include checkbox for Unit Test related changes…
AniruddhaKanhere 5d05601
Fix build failure introduced in PR #597 (#629)
aggarg 8cd5451
Feature/fixing clang gnu compiler warnings (#620)
phelter cd87681
POSIX port fixes (#626)
jacky309 5fdbb7f
Cortex-M35P: Add Cortex-M35P port (#631)
urutva 0a70ecb
Introduced Github Status Badge for Unit Tests (#634)
amazonKamath e6514fb
Remove C99 requirement from CMake file (#633)
aggarg c3e1df0
Add Thread Local Storage (TLS) support using Picolibc functions (#343)
keith-packard a9e1f66
Interrupt priority assert improvements for CM3/4/7 (#602)
chrisnc 97acc2e
Introduced code coverage status badge (#635)
amazonKamath ddd50d9
added portPOINTER_SIZE_TYPE and SIZE_MAX definition to PIC24/dsPIC po…
n9wxu 563c57e
Fix TLS and stack alignment when using picolibc (#637)
keith-packard 7b26ea6
Enable building the GCC Cortex-R5 port without an FPU (#586)
paulbartell 309a18a
Fix freertos_kernel cmake property, Posix Port (#640)
kstribrnAmzn 55658e1
Add missing FreeRTOS+ defines
d4d5e43
Run kernel demos and unit tests for PR changes (#645)
aggarg 4600c94
Merge branch 'smp-dev-complete-merge-candidate-history' into misra-SM…
chinglee-iot 9488ba2
Add functions to get the buffers of statically created objects (#641)
Dazza0 99797e1
Cortex-M Assert when NVIC implements 8 PRIO bits (#639)
kar-rahul-aws 97e58da
Remove C90 requirement from CMakeLists (#649)
aggarg 68f1053
Only add alignment padding when needed (#650)
aggarg 1b8a424
add a missing comma (#651)
nbrunner aa987a3
fix conversion warning (#658)
votrungchi 6cbb783
Merge branch 'smp-dev-complete-merge-candidate-history' into update-i…
chinglee-iot 029ce2a
Merge branch 'smp-dev-complete-merge-candidate-history' into misra-SM…
chinglee-iot 435c44a
Merge pull request #1 from chinglee-iot/misra-SMP-rebase20221130
ActoryOu 686b6e6
ARMv7M: Adjust implemented priority bit assertions (#665)
paulbartell d8d2454
Update get idle tasks stats
chinglee-iot 3101a1a
Define portBASE_TYPE in XMOS AICORE porting
chinglee-iot 5c094b5
Update enter critical from ISR API
chinglee-iot 714e543
Format portmacro.h in arm CM0 ports
paulbartell 5f19e34
portable/ARM_CM0: Add xPortIsInsideInterrupt
paulbartell 452b893
Merge branch 'smp-dev-update-xmos-aicore-conflict' into smp-dev-candi…
chinglee-iot bef099f
Merge branch 'update-increase-uxSchedulerSuspended-after' into smp-de…
chinglee-iot c4be682
Merge branch 'smp-dev-complete-merge-candidate-history' into merge-ma…
chinglee-iot 1871ef5
Merge branch 'merge-main-misra-SMP-rebase20221130' into smp-dev-candi…
chinglee-iot 7b9edd4
Merge pull request #2 from chinglee-iot/merge-main-misra-SMP-rebase20…
ActoryOu a5f1094
Fix get task stats
chinglee-iot 8bfec72
Merge branch 'smp-dev-fix-idle-task-stats' into smp-dev-candidate-202…
chinglee-iot 39b3bea
Fix missing configNUM_CORES
chinglee-iot c35632e
Merge branch 'smp-dev-fix-idle-task-stats' into smp-dev-candidate-202…
chinglee-iot 9d21b07
Merge branch 'main' into smp-dev-compelete-merge-main-20230424
chinglee-iot 91ff650
Merge branch 'smp-dev-complete-merge-candidate-history' into smp-dev-…
chinglee-iot 3cc732a
Merge branch 'smp-dev-complete-merge-candidate-history' into smp-dev-…
chinglee-iot 5b0bda3
Merge branch 'smp-dev-compelete-merge-main-20230424' into smp-dev-can…
chinglee-iot f6ec3c7
Fix uncrustify
chinglee-iot 8037d3b
Update lexicon
chinglee-iot 4e2c58d
Remove tailing space
chinglee-iot c659463
Fix ulTotalRunTime and ulTaskSwitchedInTime
chinglee-iot 8748c6e
Ignore XMOS AICORE header check
chinglee-iot c30474a
Merge branch 'smp-dev-complete-fix-demos' into smp-dev-candidate-2023…
chinglee-iot a4f5274
Merge branch 'smp-dev-complete-fix-uncrustify' into smp-dev-candidate…
chinglee-iot 6d2b442
Fix MSVC build init array
chinglee-iot c3fefa6
Fix MSVC building.
ActoryOu 42b59b5
Merge branch 'misra-SMP-rebase20221130' into smp-dev-candidate-20230424
chinglee-iot 4af4493
Merge branch 'smp-dev-complete-merge-candidate-history' into smp-dev-…
chinglee-iot 9b9a9c7
Merge branch 'smp-dev-complete-merge-candidate-history' into merge-ma…
chinglee-iot 791e0c9
Fix for c90 compiler
chinglee-iot a108e90
Merge main to misra smp rebase20221130 (#3)
chinglee-iot bcb60fc
Merge branch 'misra-SMP-rebase20221130' into smp-dev-candidate-20230424
chinglee-iot 0fb7154
Merge branch 'smp-dev-complete-merge-candidate-history' into misra-SM…
chinglee-iot 4c7a8da
Fix MISRA violation in get idle run time counter
chinglee-iot 239051f
Merge remote-tracking branch 'actory/misra-SMP-rebase20221130' into m…
chinglee-iot b9470a3
Fix CI check error
chinglee-iot 7b03893
Merge branch 'merge-main-misra-SMP-rebase20221130' into smp-dev-candi…
chinglee-iot 86f37cb
Merge branch 'merge-main-misra-SMP-rebase20221130' into smp-dev-candi…
chinglee-iot 56a9c7e
Fix single MISRA violation
chinglee-iot ea595d9
Update for std C90
chinglee-iot a1eab5a
Fix uncrustify
chinglee-iot e590e34
Remove unnecessary MISRA suppression
chinglee-iot 84b19fe
Remove unreferenced MISRA suppression in MISRA.md
chinglee-iot 17e5526
Remove 11.3 supression
chinglee-iot 58da3ff
Remove 11.3 in MISRA.md
chinglee-iot b3514bd
Add back the suppression for pxCurrentTCBs
chinglee-iot 28fa919
Fix typo
chinglee-iot b8b6d95
Fix more coverity errors
chinglee-iot cf0d10f
Fix error
chinglee-iot 16f7d73
Return pdTRUE or pdFALSE with macros
chinglee-iot d4d167a
Fix possible overrun in prvSelectHighestPriority task
chinglee-iot c515f6b
Remove const due to list operation
chinglee-iot f02ef03
Uncrustify tasks
chinglee-iot 5c41147
Code review suggestions
aggarg dc01863
Code review suggestions - 2
aggarg 4de5931
Update for misra rule 2.5
chinglee-iot 7352171
Fix format
chinglee-iot 12a0252
Add rule 8.7 and 11.5 in misra.config
chinglee-iot 12d08d6
Fix uncrustify
chinglee-iot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,6 +317,7 @@ coproc | |
coprocessor | ||
coprocessors | ||
coreid | ||
coverity | ||
covfs | ||
cp | ||
cpacr | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# MISRA Compliance (for configNUMBER_OF_CORES > 1) | ||
|
||
For now, FreeRTOS-Kernel only conforms [MISRA C:2012](https://www.misra.org.uk/misra-c) guidelines in SMP part (configNUMBER_OF_CORES > 1), | ||
with the deviations listed below. Compliance is checked with Coverity static analysis. Refer to [configuration](#misra-configuration) to build an application for the tool to analyze. | ||
|
||
### Suppressed with Coverity Comments | ||
To find the violation references in the source files run grep on the source code | ||
with ( Assuming rule 4.6 violation; with justification in point 1 ): | ||
``` | ||
grep 'MISRA Ref 8.4.1' . -rI | ||
``` | ||
|
||
#### Rule 8.4 | ||
|
||
_Ref 8.4.1_ | ||
|
||
- MISRA C:2012 Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined. | ||
vTaskEnterCriticalFromISR()/vTaskExitCriticalFromISR are used at some ports. | ||
|
||
#### Rule 8.5 | ||
|
||
_Ref 8.5.1_ | ||
|
||
- MISRA C:2012 Rule 8.5: An external object or function shall be declared once in one and only one file. | ||
Function is declared in header file correctly. But the function name in task.h/tasks.c is different if portUSING_MPU_WRAPPERS enabled. | ||
|
||
#### Rule 8.6 | ||
|
||
_Ref 8.6.1_ | ||
|
||
- MISRA C:2012 Rule 8.6: An identifier with external linkage shall have exactly one external definition. | ||
Function is declared in header file correctly. But the function name in task.h/tasks.c is different if portUSING_MPU_WRAPPERS enabled. | ||
|
||
#### Rule 8.9 | ||
|
||
_Ref 8.9.1_ | ||
|
||
- MISRA C:2012 Rule 8.9: An object should be defined at block scope if its identifier only appears in a single function. | ||
False alarm. This variable is actually used by several different functions. | ||
|
||
#### Rule 11.3 | ||
|
||
_Ref 11.3.1_ | ||
|
||
- MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to object type and a pointer to a different object type. | ||
Unusual cast is ok as the structures are designed to have the same alignment, this is checked by an assert. | ||
|
||
_Ref 11.3.2_ | ||
chinglee-iot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to object type and a pointer to a different object type. | ||
The mini list structure is used as the list end to save RAM. This is checked and valid. | ||
|
||
#### Rule 11.5 | ||
|
||
_Ref 11.5.1_ | ||
chinglee-iot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- MISRA C:2012 Rule 11.5: A conversion should not be performed from pointer to void into pointer to object. | ||
void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. | ||
|
||
#### Rule 18.1 | ||
chinglee-iot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
_Ref 18.1.1_ | ||
|
||
- MISRA C:2012 Rule 18.1: A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand. | ||
Loop breaks before index overrun. | ||
|
||
### MISRA configuration | ||
|
||
Copy below content as misra.conf to run coverity on FreeRTOS-Kernel. | ||
|
||
``` | ||
// MISRA C-2012 Rules | ||
{ | ||
version : "2.0", | ||
standard : "c2012", | ||
title: "Coverity MISRA Configuration", | ||
deviations : [ | ||
// Disable the following rules. | ||
{ | ||
deviation: "Directive 4.8", | ||
reason: "We include lots of header files from other sources such as the kernel which defines structures that violate that Dir" | ||
}, | ||
{ | ||
deviation: "Directive 4.9", | ||
reason: "It is important the FreeRTOS-Kernel is optimised to work on small micro-controllers. To achieve that, macros are being used." | ||
}, | ||
{ | ||
deviation: "Rule 1.2", | ||
reason: "Allow FreeRTOS-Kernel to use attributes." | ||
}, | ||
{ | ||
deviation: "Rule 2.3", | ||
reason: "The way we declare structures are conformant with the FreeRTOS libraries, which leaves somes types unused." | ||
}, | ||
{ | ||
deviation: "Rule 2.4", | ||
reason: "Structures are always declared with both a struct tag and typedef alias. Some of these structs are always referred to by their typedef alias and thus the corresponding tags are unused." | ||
}, | ||
{ | ||
deviation: "Rule 2.5", | ||
reason: "We use unused macros for backward compatibility in addition to macros comming from FreeRTOS" | ||
}, | ||
{ | ||
deviation: "Rule 3.1", | ||
reason: "We post links which contain // inside comments blocks" | ||
}, | ||
{ | ||
deviation: "Rule 21.2", | ||
reason: "Allow use of all names." | ||
} | ||
] | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.