Commit Graph

199 Commits

Author SHA1 Message Date
Chris Johns
24d0ee57a4 cpukit, testsuite: Add rtems_printf and rtems_printer support.
This change adds rtems_printf and related functions and wraps the
RTEMS print plugin support into a user API. All references to the
plugin are removed and replaced with the rtems_printer interface.

Printk and related functions are made to return a valid number of
characters formatted and output.

The function attribute to check printf functions has been added
to rtems_printf and printk. No changes to remove warrnings are part
of this patch set.

The testsuite has been moved over to the rtems_printer. The testsuite
has a mix of rtems_printer access and direct print control via the
tmacros.h header file. The support for begink/endk has been removed
as it served no purpose and only confused the code base. The testsuite
has not been refactored to use rtems_printf. This is future work.
2016-05-25 15:47:34 +10:00
Sebastian Huber
e266d134eb Replace *_Get_interrupt_disable() with *_Get()
Uniformly use *_Get() to get an object by identifier with a lock
context.
2016-05-20 16:17:00 +02:00
Sebastian Huber
ceb0f6597c score: Remove the Giant lock
Update #2555.
2016-05-20 07:50:37 +02:00
Sebastian Huber
4b04cb6155 score: Rename _ISR_Disable_without_giant()
Rename _ISR_Disable_without_giant() into _ISR_Local_disable().  Rename
_ISR_Enable_without_giant() into _ISR_Local_enable().

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:50:34 +02:00
Sebastian Huber
dab902d5b2 testsuites: Avoid Giant lock
Replace _Thread_Disable_dispatch() with _Thread_Dispatch_disable().
Replace _Thread_Enable_dispatch() with _Thread_Dispatch_enable().

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:49:41 +02:00
Sebastian Huber
5eac967651 testsuites: Replace _Thread_Get()
Replace _Thread_Get() with _Thread_Get_interrupt_disable() to avoid the
Giant lock.

Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
9949d8a7d0 score: Add Thread_Change_life()
Add _Thread_Change_life_locked() as a general function to alter the
thread life state.  Use it to implement _Thread_Set_life_protection() as
a first step.

Update #2555.
Update #2626.
2016-05-20 07:49:37 +02:00
Sebastian Huber
41ce30a967 SMP: Add Mellor-Crummey and Scott (MCS) lock
Added only for evaluation purposes.  We have to compare the performance
against the ticket lock on the interesting platforms via
smptests/smplock01.

The following GCC shortcoming affects the MCS lock:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66867
2016-05-19 11:50:38 +02:00
Sebastian Huber
1379d840a4 smptests/smpcapture02: Adjust for clock changes
Fix overall clock tick count.  Change introduced by
90d8567d34.

Update #2554.
2016-05-12 13:24:42 +02:00
Sebastian Huber
bd12dda405 score: Use thread state lock for current state
In addition protect scheduler of thread by thread state lock.  Enables
use of scheduler per-instance locks.

Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
981eed2176 score: Add dummy Strong APA scheduler
Start with a copy of the Priority SMP scheduler implementation.

Update #2510.
2016-05-02 07:46:17 +02:00
Sebastian Huber
03b900d3ed score: Replace watchdog handler implementation
Use a red-black tree instead of delta chains.

Close #2344.
Update #2554.
Update #2555.
Close #2606.
2016-03-04 13:36:10 +01:00
Sebastian Huber
b3a4c48ebd score: Add _SMP_Online_processors 2016-03-04 13:36:09 +01:00
Sebastian Huber
eead8f7cf9 smptests/smpmrsp01: Fix test context 2016-03-03 09:10:14 +01:00
Sebastian Huber
10f28914f8 smptests/smpwakeafter01: Add scheduler config
Update #2554.
2016-02-17 11:53:27 +01:00
Sebastian Huber
3d1becf925 smptests/README: Delete obsolete information 2016-01-11 07:57:12 +01:00
Sebastian Huber
54406d9f6c Delete CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
This define accidentally re-appeared.
2015-10-15 11:56:15 +02:00
Sebastian Huber
258ad71e96 SMP: Fix and optimize thread dispatching
According to the C11 and C++11 memory models only a read-modify-write
operation guarantees that we read the last value written in modification
order.  Avoid the sequential consistent thread fence and instead use the
inter-processor interrupt to set the thread dispatch necessary
indicator.
2015-09-28 13:56:57 +02:00
Sebastian Huber
8d296cd54e score: Use uintptr_t for atomic pointer operations
Do not obfuscate the standard API.
2015-09-26 21:23:53 +02:00
Sebastian Huber
dafa5d8843 score: Implement priority boosting 2015-09-04 13:26:17 +02:00
Sebastian Huber
3995e6d9c2 score: Implement SMP-specific priority queue 2015-09-04 13:25:03 +02:00
Sebastian Huber
43d7005829 smptests/smpscheduler02: Reduce required CPU count 2015-06-03 09:19:34 +02:00
Sebastian Huber
2c14e67342 smptests/smpmrsp01: Reduce required CPU count 2015-06-03 09:19:34 +02:00
Sebastian Huber
f48b73deb6 smptests/smpscheduler03: Use proper lock 2015-06-03 09:19:34 +02:00
Sebastian Huber
33e30f393e smptests/smpscheduler03: Restructure
Restructure to avoid large maximum thread dispatch disabled times.
2015-05-19 15:14:34 +02:00
Sebastian Huber
900d337f96 score: Rework _Thread_Change_priority()
Move the writes to Thread_Control::current_priority and
Thread_Control::real_priority into _Thread_Change_priority() under the
protection of the thread lock.  Add a filter function to
_Thread_Change_priority() to enable specialized variants.

Avoid race conditions during a thread priority restore with the new
Thread_Control::priority_restore_hint for an important average case
optimizations used by priority inheritance mutexes.

Update #2273.
2015-05-19 12:00:47 +02:00
Sebastian Huber
b1b5ddf028 smptests/smpcache01: Restructure
Restructure to avoid large maximum thread dispatch disabled times.
2015-05-15 13:23:03 +02:00
Sebastian Huber
be0366bb62 score: Fix scheduler helping protocol
Account for priority changes of threads executing in a foreign
partition.  Exchange idle threads in case a victim node uses an idle
thread and the new scheduled node needs an idle thread.
2015-05-11 08:58:40 +02:00
Daniel Cederman
3641320161 smptests/smpcache01: Enable interrupts before waiting for other CPUs
Otherwise there is a risk that a CPU misses a cache manager message
from another CPU and the test hangs.
2015-04-22 09:29:56 +02:00
Sebastian Huber
26c142e5ad score: Refactor SMP cache manager support 2015-04-20 08:23:25 +02:00
Sebastian Huber
e7e86ba65f smpmigration01: Delete timing dependent assert
The cycles per runner depends too heavily on the hardware timing making
the assert unreliable.  Delete runner tasks before we print out the
status.
2015-03-25 11:46:04 +01:00
Sebastian Huber
4f10ed61d0 smptests/smpfatal08: Workaround for QorIQ BSPs 2015-03-24 14:35:05 +01:00
Sebastian Huber
8c7eb0039c testsupport: Add worker setup handler
Add rtems_test_parallel_get_task_id().
2015-03-17 10:32:57 +01:00
Alexander Krutwig
33b72fde61 testsupport: Add cascade option to parallel test 2015-03-06 16:20:20 +01:00
Alexander Krutwig
7f577d3a56 tests: Refactor parallel test execution 2015-03-05 09:12:14 +01:00
Sebastian Huber
c5436ff482 smptests/smpcapture01: Avoid livelock condition 2015-03-04 11:59:45 +01:00
Sebastian Huber
0324410836 smptests: Do not use Giant directly
This ensures that thread dispatching is disabled.  A Giant
acquire/release pair must take place in the same processor.
2015-03-04 07:46:16 +01:00
Sebastian Huber
4e3d9a4d6c score: Make <rtems/score/atomic.h> available
Make <rtems/score/atomic.h> available for all RTEMS configurations.  Use
inline functions instead of macros.  Use ISR disable/enable on
uni-processor configurations to ensure atomicity.

Update #2273.
2015-02-19 10:05:48 +01:00
Sebastian Huber
c34f94f72d score: Add _CPU_SMP_Prepare_start_multitasking()
Update #2268.
2015-02-17 09:41:27 +01:00
Daniel Cederman
8d8573acc8 smpcapture02: Add test of functionality to add custom entries to capture trace 2015-02-11 15:35:26 +01:00
Sebastian Huber
77c5ddd496 smptests/smpmrsp01: Fix task delete race condition
Do not supsend self while waiting for termination since the
rtems_task_delete() may take place while the rtems_task_suspend() waits
for the Giant lock preventing delivery of the inter-processor interrupt.
The result is a suspended and terminated thread (this is a valid state,
but leads in this case to a test failure).
2015-01-14 07:40:49 +01:00
Sebastian Huber
e7d175affb smptests/smpwakeafter01: Fix task count 2015-01-09 14:03:32 +01:00
Sebastian Huber
ad0743db07 smptests/smpmrsp01: Update run indicator only once
On the Freescale T2080 the excessive concurrent write/read lead to a
livelock condition.
2015-01-09 14:03:32 +01:00
Sebastian Huber
864d3475a5 smp: Fix timeout for MrsP semaphores
The previous timeout handling was flawed.  In case a waiting thread
helped out the owner could use the scheduler node indefinitely long.
Update the resource tree in _MRSP_Timeout() to avoid this issue.

Bug reported by Luca Bonato.
2014-12-18 08:33:29 +01:00
Sebastian Huber
1207288022 Update bug report URL 2014-12-05 07:47:32 +01:00
Sebastian Huber
0ff1c29d96 smptests/smpmrsp01: Use busy waits
Use busy waits instead of sleeps to avoid unnecessary switches to the
idle thread.
2014-11-27 10:33:31 +01:00
Sebastian Huber
5bd822a779 smp: Fix scheduler helping protocol
Ensure that scheduler nodes in the SCHEDULER_HELP_ACTIVE_OWNER or
SCHEDULER_HELP_ACTIVE_RIVAL helping state are always
SCHEDULER_SMP_NODE_READY or SCHEDULER_SMP_NODE_SCHEDULED to ensure the
MrsP protocol properties.
2014-11-27 10:33:31 +01:00
Jennifer Averett
39af57c3f7 smp09: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
6291e9627e smp07: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
2c474a056f smp05: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00