Commit Graph

997 Commits

Author SHA1 Message Date
Ryan Long
cc273ec10f Add macros to assert status and use it
These macros are to be used to check the status from calls that are flagged
by Coverity as 'Unchecked return value'.

Fix file assert.h
2021-02-12 17:13:10 -06:00
Chris Johns
03dff2019f libcsupport: Add sbrk greedy support to consume all sbrk memory
- Move the heap sbrk code into a separate routnine.

- Update heap and workspace greedy allocators to use the common
  sbrk greedy support.

Closes #3982
2021-02-10 17:28:32 +11:00
Sebastian Huber
286ff5868e basedefs: Add stringification of argument lists
Change RTEMS_STRING() and RTEMS_XSTRING() to accept a variable number of
arguments which is stringified.  This can be used for example to create
register lists for inline assembler statements.
2021-02-09 07:06:49 +01:00
Sebastian Huber
788fa865fb libtest: Add T_get_thread_timer_state() 2021-02-08 08:44:14 +01:00
Chris Johns
822cad8967 libcsupport: Add no_regular_file_mknod as a mount option to the mount table
- Add the bool flag no_regular_file_mknod to the mount table so a file
  system can indicate creating regular files is not done by
  use the mknod handler. The file system will handle creating a
  file node in the open handler.

- Note, the mount option is an enum which means there is only one
  exclusive option supported. As a result no encapsulation is
  provided and file systems need to set no_regular_file_mknod directly.

Closes #4222
2021-02-08 13:10:37 +11:00
Sebastian Huber
96ea09ac4c score: Add barrier thread queue operations
This fixes a missing decrement of the number of waiting threads during a
barrier wait timeout.

Close #4230.
2021-02-06 20:55:51 +01:00
Sebastian Huber
9477d9aedb score: Make FIFO thread queue ops public
Update #4230.
2021-02-06 20:55:51 +01:00
Sebastian Huber
2b5ce23b99 score: Constify Thread_queue_First_operation
Update #4230.
2021-02-06 20:42:26 +01:00
Sebastian Huber
aa0060f4c1 rtems: Clarify partition manager documentation
Unify the wording across similar directives of other managers.  Add
"Constraints" paragraph.

Update #3993.
2021-02-03 06:10:21 +01:00
Sebastian Huber
98549e4524 score: _Objects_Build_name() signed/unsigned char
Change _Objects_Build_name() so that the result is independent of the
signedness of char.

Close #4228.
2021-02-03 05:58:49 +01:00
Sebastian Huber
8a95e6f820 rtems: Rework object services API
Add a "Constraints" paragraph to the documentation.

Provide prototypes for programming language bindings.  Use the macro
implementation to implement the corresponding functions.

Update #3993.
2021-02-03 05:57:06 +01:00
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
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
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
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
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
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
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
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
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
Christian Mauderer
b2f265ab9f cpukit/spi: Allow driver specific ioctl
This allows a SPI driver to add a hardware specific ioctl.
2021-01-21 10:17:31 +01:00
Sebastian Huber
8ee22b2975 mrsp: Change error status for a nested seize
Return STATUS_DEADLOCK (RTEMS_INCORRECT_STATE) to indicate a nested
seize since this is a kind of deadlock.  This status code is also used
for other deadlocks.

Update #4217.
2021-01-21 10:10:34 +01:00
Chris Johns
7696533b97 cpukit: Merge FreeBSD values for the priorities
It seems we need valid values or assumptions in the FreeBSD about
these values breaks some of the code.

Closes #4207
2021-01-08 09:51:48 +11:00
Christian Mauderer
1618e69f0e shell: Add i2c and spi commands
This adds some commands that are usefull for debugging simple serial
interfaces.

Even if they are a complete re-implementation, the i2c* commands use a
simmilar call like the Linux i2c tools.
2020-12-14 10:48:57 +01:00
Sebastian Huber
fcd9618ac8 config: Fix invalid static assertions in C
Expressions in static assertions must be integral constant expressions.  In
integral constant expressions the use of address constant expressions is not
allowed.

In static initializers the address constant expressions are allowed.  Introduce
a new macro _CONFIGURE_ASSERT_NOT_NULL() which leads to a compile time error if
the second parameter is NULL.  It generates error messages like this if for
example

  #define CONFIGURE_INIT_TASK_ENTRY_POINT NULL

is provided by the application:

cpukit/include/rtems/confdefs/inittask.h:51:26: error: size of unnamed array is negative
   51 |     ( _type ) sizeof( int[ ( _value ) != NULL ? 1 : -1 ] ) )
      |                          ^
cpukit/include/rtems/confdefs/inittask.h:170:3: note: in expansion of macro '_CONFIGURE_ASSERT_NOT_NULL'
  170 |   _CONFIGURE_ASSERT_NOT_NULL(
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

This fix relates to CID 1470570 (PARSE_ERROR).

Update #4181.
2020-12-12 11:35:22 +01:00
Sebastian Huber
768327d06d rtems: Generate <rtems/rtems/timer.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-12-03 07:12:12 +01:00
Sebastian Huber
13bab346c5 score: Return a status in _Objects_Set_name() 2020-12-03 07:12:12 +01:00
Sebastian Huber
65969c1b73 rtems: Generate <rtems/rtems/object.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2020-12-03 07:12:12 +01:00
Sebastian Huber
1fa3821ad6 score: Fix Doxygen group membership
Update #3706.
2020-12-02 11:34:33 +01:00
Sebastian Huber
1c6062230f score: Fix Doxygen group name
Update #3706.
2020-12-02 11:34:29 +01:00
Sebastian Huber
c296d150db rtems: Fix Doxygen return description 2020-12-02 08:55:12 +01:00
Sebastian Huber
1af4493bdb rtems: Clarify invalid identifier descriptions
Update #3993.
2020-12-02 08:33:11 +01:00
Sebastian Huber
5a285e3844 rtems: Clarify rtems_partition_delete()
Move the PTCB sentence to the notes to be in line with
rtems_partition_create().

Update #3993.
2020-12-02 08:16:03 +01:00
Sebastian Huber
8756d5ce06 rtems: Clarify rtems_partition_create()
The rtems_partition_create() returns an object identifier and not just a
partition identifier.

Update #3993.
2020-12-02 08:16:03 +01:00
Sebastian Huber
5555c0cb98 rtems: Fix Doxygen group name
Update #3706.
2020-12-02 08:15:32 +01:00
Sebastian Huber
226b90b455 rtems: Fix Doxygen group memberships
Update #3706.
2020-12-02 08:13:26 +01:00
Sebastian Huber
70dbafbf5e config: Canonicalize @defgroup and @file comments
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group and file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
3db9c820e5 sapi: Canonicalize @defgroup and @file comments
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group and file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
9278f3d04f score: Canonicalize Doxygen @file comments
Use common phrases for the file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
6b5f22dcbb rtems: Canonicalize Doxygen @file comments
Use common phrases for the file brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00
Sebastian Huber
23494c2bfa score: Always define RTEMSScoreMRSP group
This fixes a Doxygen warning.
2020-12-02 07:45:53 +01:00
Sebastian Huber
c81ac0e750 score: Canonicalize Doxygen groups
Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group brief descriptions.

Update #3706.
2020-12-02 07:45:53 +01:00