Commit Graph

4541 Commits

Author SHA1 Message Date
Sebastian Huber
8b8c068df3 testsuites: Remove CONFIGURE_MALLOC_STATISTICS
This configuration option is obsolete since 2014.

Update #1367.
2020-03-31 15:21:58 +02:00
Sebastian Huber
d05a900a5b sptests/sptls02: Add test case
Add a test case which requires the use of __tls_guard() and
__tls_init().

Change license to BSD-2-Clause.
2020-03-23 15:44:41 +01:00
Sebastian Huber
ab42b3e100 record: Add rtems_record_dump()
Add rtems_record_dump_base64() and rtems_record_dump_base64_zlib().

Add CONFIGURE_RECORD_FATAL_DUMP_BASE64 and
CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB configuration options.

Update #3904.
2020-03-18 07:20:52 +01:00
Sebastian Huber
a6b3633459 score: Add _IO_Base64()
Update #3904.
2020-03-16 11:54:26 +01:00
Sebastian Huber
c2287ba2cf libio: Robust file descriptor reference counting
There was a race conditon in the reference counting of file descriptors
during a close() operation.  After the call to the close handler, the
rtems_libio_free() function cleared the flags to zero.  However, at this
point in time there may still exist some holders of the file descriptor.
With RTEMS_DEBUG enabled this could lead to failed assertions in
rtems_libio_iop_drop().

Change the code to use only atomic read-modify-write operations on the
rtems_libio_iop::flags.
2020-03-13 09:57:04 +01:00
Sebastian Huber
0161b93d50 imfs: Replace devfs with an IMFS specialization
Add a simplified path evaluation function IMFS_eval_path_devfs() for a
device only IMFS configuration.

The code size can be further reduced by the application if it disables
the support for legacy IO drivers via:

  #define CONFIGURE_IMFS_DISABLE_MKNOD
  #define CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE

Obsolete CONFIGURE_MAXIMUM_DEVICES.  Remove BSP_MAXIMUM_DEVICES.

Update #3894.
Update #3898.
2020-03-09 17:26:54 +01:00
Sebastian Huber
fa44c3903a imfs: Add IMFS_add_node()
Update #3894.
2020-03-04 09:30:03 +01:00
Sebastian Huber
fdeaa64e17 config: Remove <rtems/btimer.h> include
The use of CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER does not define
anything, so remove the <rtems/btimer.h> include.

Update #3875.
2020-03-04 08:43:45 +01:00
Sebastian Huber
60b769335e sptests/spheapprot: Fix warning 2020-03-04 08:43:45 +01:00
Sebastian Huber
c4d5a341bd fstests/fsrename: Rename a file twice 2020-03-03 11:35:11 +01:00
Sebastian Huber
198c07e5a5 sptests/spextensions01: Add comment
Update #3885.
2020-03-03 07:30:04 +01:00
Sebastian Huber
180201094e rtems: Add rtems_scheduler_map_priority_from_posix()
Update #3881.
2020-03-03 07:10:55 +01:00
Sebastian Huber
38736c69f8 rtems: Add rtems_scheduler_map_priority_to_posix()
Update #3881.
2020-03-03 07:09:59 +01:00
Sebastian Huber
fcb11510c6 score: Fix context switch extensions (SMP)
In uniprocessor and SMP configurations, the context switch extensions
were called during _Thread_Do_dispatch():

void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level )
{
  Thread_Control *executing;

  executing = cpu_self->executing;

  ...
  do {
    Thread_Control *heir;

    heir = _Thread_Get_heir_and_make_it_executing( cpu_self );
    ...
    _User_extensions_Thread_switch( executing, heir );
    ...
    _Context_Switch( &executing->Registers, &heir->Registers );
    ...
  } while ( cpu_self->dispatch_necessary );
  ...
}

In uniprocessor configurations, this is fine and the context switch
extensions are called for all thread switches except the very first
thread switch to the initialization thread.  However, in SMP
configurations, the context switch may be invalidated and updated in the
low-level _Context_Switch() routine.  See:

  https://docs.rtems.org/branches/master/c-user/symmetric_multiprocessing_services.html#thread-dispatch-details

In case such an update happens, a thread will execute on the processor
which was not seen in the previous call of the context switch
extensions.  This can confuse for example event record consumers which
use events generated by a context switch extension.

Fixing this is not straight forward.  The context switch extensions call
must move after the low-level context switch.  The problem here is that
we may end up in _Thread_Handler().  Adding the context switch
extensions call to _Thread_Handler() covers now also the thread switch
to the initialization thread.  We also have to save the last executing
thread (ancestor) of the processor.  Registers or the stack cannot be
used for this purpose.  We have to add it to the per-processor
information.  Existing extensions may be affected, since now context
switch extensions use the stack of the heir thread.  The stack checker
is affected by this.

Calling the thread switch extensions in the low-level context switch is
difficult since at this point an intermediate stack is used which is
only large enough to enable servicing of interrupts.

Update #3885.
2020-02-28 07:50:19 +01:00
Sebastian Huber
c36fae22fe config: Initialize IO drivers on demand 2020-02-26 08:23:28 +01:00
Sebastian Huber
c7f748a100 config: Remove CONFIGURE_DISABLE_SMP_CONFIGURATION
The CONFIGURE_DISABLE_SMP_CONFIGURATION configuration option and
rtems_configuration_is_smp_enabled() were added during the SMP support
development cycle as a workaround to fix some testsuite failures in SMP
configurations.  All use cases were replaced with tests for specific
conditions.  The configuration option and test macro were undocumented.

Close #3876.
2020-02-25 07:18:36 +01:00
Sebastian Huber
5b8d80d726 config: CONFIGURE_INIT_TASK_INITIAL_MODES
Determine the default for CONFIGURE_INIT_TASK_INITIAL_MODES depeding on
whether RTEMS_SMP is defined or not.

In the tests, use CONFIGURE_INIT_TASK_INITIAL_MODES to explicitly
request RTEMS_NO_PREEMPT mode if necessary.

Update #3876.
2020-02-25 07:18:35 +01:00
Sebastian Huber
ba74ebde74 libio: Add POSIX user environment pointer to TCB
The IO library used a POSIX key to store an optional POSIX user
environment pointer.  This pulled in the POSIX keys support in every
application configuration.  Add a user environment pointer to the thread
control block (TCB) instead.  Applications which do not need the POSIX
user environment will just get an overhead of one pointer per thread.

Close #3882.
2020-02-25 07:18:26 +01:00
Sebastian Huber
3b4795b46f config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options.  These two options are probably unused, see also:

* https://lists.rtems.org/pipermail/users/2019-April/033129.html

* https://lists.rtems.org/pipermail/users/2019-April/033130.html

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE would have required the
use of the undocumented CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME and
CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE configuration options.

Update #3874.
2020-02-25 07:15:18 +01:00
Sebastian Huber
9bdb6aa31c config: Bring back RTEMS 4.11 configuration table
This improves API backward compatibility of RTEMS 5.1 to previous
versions.
2020-02-25 07:15:18 +01:00
Sebastian Huber
6b0873ffdf config: Remove CONFIGURE_HAS_OWN_INIT_TASK_TABLE
The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options.  These two options are probably unused, see also:

  * https://lists.rtems.org/pipermail/users/2019-April/033129.html

  * https://lists.rtems.org/pipermail/users/2019-April/033130.html

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_HAS_OWN_INIT_TASK_TABLE would have required the use of
the undocumented CONFIGURE_INIT_TASK_TABLE and
CONFIGURE_INIT_TASK_TABLE_SIZE configuration options.

Update #3873.
2020-02-25 07:15:18 +01:00
Sebastian Huber
77ee8276ef sptests/spcbssched03: Include missing header file
Update #3875.
2020-02-25 07:15:18 +01:00
Sebastian Huber
5d1d3485cb libtests/stackchk: Include missing header file
Update #3875.
2020-02-25 07:15:17 +01:00
Sebastian Huber
f6fcfea12f mptests/mp14: Include missing header file
Include <mpci.h> for MPCI_Print_statistics().

Update #3875.
2020-02-25 07:01:31 +01:00
Chris Johns
3f7ebddfa4 testsuite/newlib: Check newlib does not touch an assigned std FILE pointer
Update #3870
2020-02-18 08:47:47 +11:00
Sebastian Huber
88c40ef8d8 score: Remove unused _Workspace_Allocate_aligned() 2020-02-17 08:03:55 +01:00
Sebastian Huber
b89b44224c smpschededf02: Improve readability 2020-02-14 16:02:54 +01:00
Sebastian Huber
33d89aff99 smpfatal09: Fix test case
Update #3838.
2020-02-14 10:06:10 +01:00
Sebastian Huber
d252e20ab5 score: Simplify _Thread_Initialize()
Allocate new thread queue heads during objects information extend.  This
removes an error case and the last dependency on the workspace in
_Thread_Initialize().

Update #3835.
2020-02-12 09:08:41 +01:00
Sebastian Huber
4eab96bbb4 score: Add _Freechain_Pop()
Update #3835.
2020-02-12 09:08:41 +01:00
Sebastian Huber
8ff1af1655 score: Add _Freechain_Is_empty()
Update #3835.
2020-02-12 09:08:40 +01:00
Sebastian Huber
32991495b4 score: Statically allocate idle/MPCI stacks
Place idle and MPCI stacks into extra linker sections.  This can be
optionally used by applications to control the placement of the stacks.

Update #3835.
2020-02-12 09:08:36 +01:00
Sebastian Huber
b2ddf4f7af sptests/spregion_err01: Reduce memory demands
Make functions and data static.
2020-02-11 08:04:48 +01:00
Sebastian Huber
2d07ce6d21 config: Add CONFIGURE_DIRTY_MEMORY
Replace the BSP_DIRTY_MEMORY BSP option with a CONFIGURE_DIRTY_MEMORY
configuration option.

Update #3843.
2020-02-06 15:19:36 +01:00
Sebastian Huber
8ecbc3826e sysinit: Add RTEMS_SYSINIT_ZERO_MEMORY
Use a dedicate system initialization step to zero the memory used for
the workspace and C program heap.

This avoids dead code in case CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is
not configured.
2020-02-06 15:19:35 +01:00
Sebastian Huber
1d43a976a8 config: CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
Canonicalize CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY and use
defined/undefined instead of TRUE/FALSE.

Close #3862.
2020-02-06 15:19:35 +01:00
Sebastian Huber
6fad1f0aba samples/iostream: Simplify configuration
Remove CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY since it is not needed and
just increases the boot time.
2020-02-06 15:19:35 +01:00
Sebastian Huber
ccaec9661f libtests/malloc04: Fix typo
Update #3838.
2020-02-04 11:25:45 +01:00
Sebastian Huber
1cd283a723 fstests/fsstatvfs: Include missing header file 2020-02-04 06:24:33 +01:00
Sebastian Huber
e44ae805f7 config: Add CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
Update #3861.
2020-02-04 06:24:26 +01:00
Sebastian Huber
f7c5f94360 sysinit: Add RTEMS_SYSINIT_ORDER_LAST_BUT_[1-9]
Update #3838.
2020-02-04 06:06:42 +01:00
Sebastian Huber
eea21eaca1 bsps: Rework work area initialization
The work area initialization was done by the BSP through
bsp_work_area_initialize(). This approach predated the system
initialization through the system initialization linker set. The
workspace and C program heap were unconditionally initialized.  The aim
is to support RTEMS application configurations which do not need the
workspace and C program heap.  In these configurations, the workspace
and C prgram heap should not get initialized.

Change all bsp_work_area_initialize() to implement _Memory_Get()
instead.  Move the dirty memory, sbrk(), per-CPU data, workspace, and
malloc() heap initialization into separate system initialization steps.
This makes it also easier to test the individual initialization steps.

This change adds a dependency to _Heap_Extend() to all BSPs.  This
dependency will be removed in a follow up change.

Update #3838.
2020-02-04 06:06:41 +01:00
Sebastian Huber
b4387313f7 psxmsgq03: Adjust test case
Commit e225545357 changed the error status
from ENOMEM to EAGAIN.

Update #3857.
2020-01-28 15:09:58 +01:00
Sebastian Huber
e7a7e6cad6 smptests/smpmulticast01: Fix test configuration
Problem introduced by 77ac1519e8.
2020-01-28 15:09:58 +01:00
Joel Sherrill
5e7b3c6533 posix_devctl - Add support for SOCKCLOSE
The FACE Technical Standard, Edition 3.0 and later require the definition
of the subcommand SOCKCLOSE in <devctl.h>.

Reference: ​https://www.opengroup.org/face

closes #3856.
2020-01-17 16:13:35 -06:00
Sebastian Huber
453bb4b642 rtems: Fix MPCI initialization
Update #2408.
2020-01-02 09:26:59 +01:00
Sebastian Huber
7c21077db6 sppercpudata01: Test PER_CPU_DATA_OFFSET()
Make sure PER_CPU_DATA_OFFSET() is tested also in uniprocessor
configurations.
2019-12-20 13:35:13 +01:00
Sebastian Huber
556e45f24b libtest: Add T_check_task_context() action 2019-12-20 11:06:13 +01:00
Sebastian Huber
77ac1519e8 libtest: Use test configuration in T_now()
Use the user provided now handler of the test configuration to get the
time in T_now().
2019-12-20 11:06:13 +01:00
Sebastian Huber
806fe963a2 config: Improve EDF SMP scheduler configuration
Use CONFIGURE_MAXIMUM_PROCESSORS to configure the EDF SMP scheduler
context.  This avoids hard to debug configuration errors resulting in
memory corruptions.

Close #3815.
2019-12-19 14:21:05 +01:00