Commit Graph

34104 Commits

Author SHA1 Message Date
Sebastian Huber
490e6e8809 score: Define _Assert() for static analysis runs
The goal is to reduce false positive NULL_RETURNS,
PW.NORETURN_FUNCTION_DOES_RETURN, PW.SET_BUT_NOT_USED,
UNUSED_VALUE, etc. issues produced by Coverity.

Define RTEMS_STATIC_ANALYSIS if a static analysis run by Coverity is
performed.
2021-02-01 14:19:28 +01:00
Sebastian Huber
8f7baef4a6 libtest: Remove double definition 2021-02-01 14:19:28 +01:00
Sebastian Huber
56494ed8d1 score: Clarify thread life state documentation 2021-02-01 12:48:10 +01:00
Sebastian Huber
05da65c297 score: Document Thread_Life_state 2021-02-01 10:15:57 +01:00
Sebastian Huber
51e59d59b7 nios2: Allow ISR nesting in dispatch variant
Rename _Nios2_ISR_Dispatch_with_shadow_non_preemptive() in
_Nios2_ISR_Dispatch_with_shadow_register_set().  Remove
_Nios2_ISR_Dispatch_with_shadow_preemptive().
2021-02-01 06:26:18 +01:00
Sebastian Huber
19acb3bc17 nios2: Optimize ISR dispatch variant
Use _Thread_Do_dispatch() in
_Nios2_ISR_Dispatch_with_shadow_non_preemptive().
2021-02-01 06:26:18 +01:00
Sebastian Huber
9165349d39 nios2: Use Per_CPU_Control::isr_dispatch_disable 2021-02-01 06:26:18 +01:00
Sebastian Huber
c968b27fbd nios2: Add TLS support
Update #4214.
2021-02-01 06:26:18 +01:00
Sebastian Huber
e324f8270f nios2: Make _ISR_Is_in_progress() weak
This allows the BSP to override this function.
2021-02-01 06:26:18 +01:00
Sebastian Huber
98c95d15e5 nios2: Fix ISR dispatch variants
The thread dispatch disabled level moved to _Per_CPU_Information some
time ago.
2021-02-01 06:26:18 +01:00
Sebastian Huber
9523887904 rtems: Fix implicit type conversions
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:18 +01:00
Sebastian Huber
fe08e454c6 score: Remove unused _SMP_Assert() 2021-02-01 06:26:18 +01:00
Sebastian Huber
9e56c85033 score: Fix implicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:16 +01:00
Sebastian Huber
d52c49611c rtems: Fix explicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:26:13 +01:00
Sebastian Huber
23f4e5b6c9 libtest: Fix implicit type conversions
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
c4db00db23 rtems: Mark value as used
This fix relates to a Coverity issue (UNUSED_VALUE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
0c992065b8 score: Remove double assignment
This fix relates to a Coverity issue (UNUSED_VALUE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
3b8137b094 libtest: Check return values with RTEMS_DEBUG
This fix relates to a Coverity issue (UNINIT).
2021-02-01 06:22:20 +01:00
Sebastian Huber
8d099f4ab4 score: Remove superfluous type qualifier
This fix relates to a Coverity issue
(PW.USELESS_TYPE_QUALIFIER_ON_RETURN_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
2c0506330f score: Simplify _CORE_message_queue_Broadcast()
This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
ab97ea6443 bsp/leon3: Improve printk() support
Use the idle stack to buffer early uses of printk().  Print the buffered
characters during initialization when the UART is available and before
the idle stack is used normally.

This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
3dcdb9c9e3 score: Simplify _MRSP_Wait_for_ownership()
Do not shadow the queue_context parameter with a local variable.  Reuse
the queue context to reduce the required stack space.

This fix relates to a Coverity issue (PW.PARAMETER_HIDDEN).
2021-02-01 06:22:20 +01:00
Sebastian Huber
5dc4f9c7f4 score: Fix implicit type conversion
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
c44ab8984e bsp/leon3: Fix incompatible function types
This fix relates to a Coverity issue (PW.INCOMPATIBLE_PARAM).
2021-02-01 06:22:20 +01:00
Sebastian Huber
198e92635c kern_tc.c: Remove unused code
This fix relates to a Coverity issue (PW.DECLARED_BUT_NOT_REFERENCED).
2021-02-01 06:22:20 +01:00
Sebastian Huber
450c170536 score: Add comments and asserts for clarification
This fix relates to a Coverity issue (NULL_RETURNS).
2021-02-01 06:22:20 +01:00
Sebastian Huber
64189a7076 score: Fix _CORE_message_queue_Submit() indentation
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
dc2a69871d bsp/leon3: Fix bsp_fatal_extension) indentation
Remove superfluous include.  Fix comment formatting.

This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
395c15f655 score: Fix _Objects_Get_information() indentation
This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
2021-02-01 06:22:20 +01:00
Sebastian Huber
bf8d4b9479 score: Add _Thread_Get_objects_information()
We do not need all the checks if we have a valid indentifier to a thread
class object.

Using the new _Thread_Get_objects_information() instead of the inline
function _Thread_Get_objects_information_by_id() avoids dead code since
the identifier in a thread control is always valid and the return NULL
path in _Thread_Get_objects_information_by_id() would be dead code.  The
_Thread_Get_objects_information_by_id() should be an inline function
since it is used by _Thread_Get() and thus performance critical.  Static
analyzers which cannot derive that the identifier in a thread control is
always valid, may find a potential NULL pointer access (or otherwise
find dead code).

The identifier in an object control is always valid, see
_Objects_Initialize_information() and _Objects_Extend_information().

Move _RTEMS_tasks_Free() to the only source file which calls this
function.
2021-02-01 06:22:19 +01:00
Sebastian Huber
76eec484e5 score: Rename _Thread_Get_objects_information()
Rename _Thread_Get_objects_information() in
_Thread_Get_objects_information_by_id() to emphasize that this thread
method uses an object identifier and not a thread control.
2021-02-01 06:22:19 +01:00
Sebastian Huber
44ae183090 bsps/aarch64: Add missing include
Fixes:

bsps/shared/dev/irq/arm-gicv2.c:53:6: warning: no previous prototype for
'bsp_interrupt_dispatch' [-Wmissing-prototypes]

Close #4227.
2021-01-28 19:28:39 +01:00
Sebastian Huber
f8b6359415 bsp/leon3: Simplify bsp_interrupt_is_valid_vector()
There is not need to check that vector >= BSP_INTERRUPT_VECTOR_MIN since
BSP_INTERRUPT_VECTOR_MIN is zero and vector is unsigned.

This fix relates to CID 1399742 (NO_EFFECT).
2021-01-28 11:12:43 +01:00
Sebastian Huber
fcbefb5ee6 rtems: Use _Status_Get()
This fixes implicit conversions between different enum types.
2021-01-28 09:58:03 +01:00
Sebastian Huber
b361eabd93 bsps: Replace bsp_specs with an empty file
This fixes an issue with the latest tool chain which adds the default
linker script in the endfile specification.

Update #3250.
2021-01-28 06:28:33 +01:00
Sebastian Huber
e269e389ea libtest: Remove superfluous NULL pointer check
This fix relates to CID 1468683 (REVERSE_INULL).
2021-01-27 19:08:29 +01:00
Sebastian Huber
426b6cdba9 libtest: Use dependency injection
This helps static analyzers.
2021-01-27 19:08:29 +01:00
Sebastian Huber
361ec32070 cacheimpl.h: Avoid potential dead code
If CPU_DATA_CACHE_ALIGNMENT == CPU_INSTRUCTION_CACHE_ALIGNMENT we had
dead code with the previous implementation.

This fix relates to CID 1399776 (DEADCODE).
2021-01-27 19:02:03 +01:00
Sebastian Huber
3272dcb364 Update copyright notice to 2021 2021-01-27 09:41:07 +01:00
Sebastian Huber
b35ac9901c rtems: Add "Notes" paragraph header
Place the paragraphs in the same order as the directive documentation in
the RTEMS Classic API Guide.

Update #3993.
2021-01-27 06:01:48 +01:00
Sebastian Huber
30c71c3a69 heap: Fix _Heap_Area_overhead()
The first block must be a proper block.  Account for this in
_Heap_Area_overhead().
2021-01-26 15:29:36 +01:00
Sebastian Huber
c734e8660f cpucounter: Increase conversion accuracy
The maximum frequency is UINT32_MAX.  Converted to a uint64_t variable
it can be shifted by 32.  The addition does not overflow since bin_per_s
- 1 is UINT32_MAX.
2021-01-26 15:29:36 +01:00
Sebastian Huber
9d2db27adf build: Add CPPFLAGS to assembler command line
We use GCC to call the assembler.  This means the assembler files are
processed by the C preprocessor.
2021-01-26 15:29:36 +01:00
Sebastian Huber
9eb9813dc1 bsps: Add missing DWARF 5 sections
Sort alphabetically.
2021-01-26 15:29:36 +01:00
Sebastian Huber
40c4e2ecc3 build: Add test excludes 2021-01-26 07:17:50 +01:00
Sebastian Huber
33c12d5f92 bsps: Support DWARF 5 sections
GCC 11 uses DWARF 5 by default.
2021-01-25 12:56:00 +01:00
Sebastian Huber
a6689fb147 Improve file header comment in generated files 2021-01-25 06:49:27 +01:00
Sebastian Huber
c709017efb Fix RTEMS_LINKER_ROSET_ITEM_ORDERED_DECLARE()
Add "extern" similar to RTEMS_LINKER_RWSET_ITEM_ORDERED_DECLARE().

Close #4221.
2021-01-25 06:44:37 +01:00
Sebastian Huber
70c34fb58c splinkersets01: Fix declaration
GCC 11 produced warnings like this:

items.c:21:1: warning: ignoring attribute
'section (".rtemsrwset.test_rw.content.0.1")' because it conflicts with
previous 'section (".rtemsrwset.test_rw.content.1")' [-Wattributes]

items.c:23:1: warning: ignoring attribute
'section (".rtemsroset.test_ro.content.0.OC")' because it conflicts with
previous 'section (".rtemsroset.test_ro.content.1")' [-Wattributes]
2021-01-23 20:03:56 +01:00
Christian Mauderer
c45da42b7a bsps/shared: Build fsl-edma only for certain BSP
Move the Freescale EDMA driver to it's own object and build it only for
the BSP that is currently using it.
2021-01-22 15:51:14 +01:00