Commit Graph

29503 Commits

Author SHA1 Message Date
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
92f6883073 sptests/spintrcritical22: Avoid _Objects_Get()
Use _Semaphore_Get_interrupt_disable() instead.

Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
f36ada320d rtems: Avoid Giant lock for rtems_task_delete()
Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
64fe16636b posix: Avoid Giant lock for pthread_kill()
Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
da82656065 posix: Rework thread cancellation
Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX
thread cancellation to use the thread life states.

Update #2555.
Update #2626.
2016-05-20 07:49:39 +02:00
Sebastian Huber
33829ce155 score: Avoid Giant lock for _Thread_Start()
Update #2555.
2016-05-20 07:49:39 +02:00
Sebastian Huber
54550e048d posix: Rework pthread_join()
Rework pthread_join() to use _Thread_Join().

Close #2402.
Update #2555.
Update #2626.
Close #2714.
2016-05-20 07:49:39 +02:00
Sebastian Huber
29e1ecab87 score: Simplify _Thread_Life_action_handler()
Use _Thread_Change_life_locked() to avoid duplicated code.  Avoid Giant
lock in _Thread_Life_action_handler().

Update #2555.
Update #2626.
2016-05-20 07:49:39 +02:00
Sebastian Huber
ef09017ebb score: Rework _Thread_Cancel()
Rework _Thread_Cancel() to use _Thread_Change_life_locked().

Update #2555.
Update #2626.
2016-05-20 07:49:39 +02:00
Sebastian Huber
862a0eeb11 score: Rework _Thread_Restart_other()
Rework _Thread_Restart_other() to use _Thread_Change_life_locked().
Cope with concurrent change requests by means of a pending request
counter.

Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
9388390777 score: Split _Thread_Restart()
Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other().  Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self().  Avoid Giant
lock for thread restart.  _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().

Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
0475cca9a0 score: Add _Thread_Dispatch_disable_with_CPU()
Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
f410ea82a4 score: Add _Thread_Clear_state_locked()
This makes it possible to do thread state and thread life changes
together under protection of the thread state lock.

Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
9a99ce15d0 score: Add _Thread_Set_state_locked()
This makes it possible to do thread state and thread life changes
together under protection of the thread state lock.

Update #2555.
Update #2626.
2016-05-20 07:49:38 +02:00
Sebastian Huber
232147ddc1 score: Add _Thread_Join() and _Thread_Cancel()
Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to
prepare for a re-use in pthread_join() and pthread_cancel().

Update #2555.
Update #2626.
2016-05-20 07:49:37 +02:00
Sebastian Huber
c99eb50b9f score: Rework _Thread_Exit()
Rework _Thread_Exit() to use _Thread_Change_life_locked().

Update #2555.
Update #2626.
2016-05-20 07:49:37 +02:00
Sebastian Huber
7023d82ca6 score: Add _Thread_Raise_real_priority()
Update #2555.
Update #2626.
2016-05-20 07:49:37 +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
69c722f3f6 score: Delete unused variable
Update #2555.
Update #2626.
2016-05-20 07:49:37 +02:00
Sebastian Huber
270394eef8 score: Avoid superfluous life protection
Disable thread dispatching is enough to prevent deletion of the
executing thread.  There is no need for an additional life protection.

Update #2555.
Update #2626.
2016-05-20 07:49:36 +02:00
Sebastian Huber
b7f5e391c0 score: Add _Thread_Exit()
The goal is to make _Thread_Exit() a no-return function in follow up
patches.

Update #2555.
Update #2626.
2016-05-20 07:49:36 +02:00
Sebastian Huber
e753748703 score: Delete redundant thread life enums
This makes it easier to add more states in the future.

Update #2555.
Update #2626.
2016-05-20 07:49:36 +02:00
Sebastian Huber
12a1228c59 psxclassic01: Assume correct pthread_detach()
Update #2714.
2016-05-20 07:49:36 +02:00
Pavel Pisa
8830bfe65b arm/raspberrypi: add cmdline support for rpi bsp. 2016-05-19 13:21:40 +02:00
YANG Qiao
54c197a2af arm/raspberrypi: add VideoCore frame buffer control support 2016-05-19 13:21:40 +02:00
YANG Qiao
33e39d3102 arm/raspberrypi: add VideoCore mailbox support read and write 2016-05-19 13:21:40 +02:00
Pavel Pisa
12582291e0 arm/raspberrypi: add locking around GPIO pin function selection.
This is required if function or direction is changed by some driver
after start of thread multitasking or in interrupts drivers.

There can be problem with calling GPIO function selection before
data section is initialized. But actual ticket lock implementation
seems to be compatible even with memory initialized to zero oven
on SMP.
2016-05-19 13:21:40 +02:00
Pavel Pisa
4b62192f05 arm/raspberrypi: correct GPIO pin function selection.
Original implementation does only bitwise-or with previous register
value for all functions except IN. Switch from one to other function
would lead to incorrect value.
2016-05-19 13:21:40 +02:00
Pavel Pisa
e706a9d17c arm/raspberrypi: ensure that RTEMS application image can be started by U-boot.
The current versions of U-boot start kernel/RTEMS application image
with instruction and data caches enabled and it sets exception
base register to new address after its self-relocation.

        ldr     r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */
        mcr     p15, 0, r0, c12, c0, 0  /* Set VBAR */

Included changes in bsp_start_hook_0 restore default state to
allow RTEMS image to run after startup from newer U-boot version
on Raspberry Pi.

Clear interrupt enable registers in interrupt controller
to ensure that RTEMS starts from well defined state.
2016-05-19 13:21:40 +02:00
Pavel Pisa
6fbc692fe2 bsps/arm: CP15 support for flush prefetch buffer and table base control. 2016-05-19 13:21:39 +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
26fafd5a2f SMP: Add and use lock statistics helper 2016-05-19 11:50:37 +02:00
Sebastian Huber
a7668b2a88 SMP: Move ticket lock to separate header file 2016-05-19 11:50:35 +02:00
Sebastian Huber
2aae3a7032 SMP: Move lock stats to separate header file 2016-05-19 11:50:34 +02:00
Sebastian Huber
ae0f048ff3 psxtests/psxualarm: Avoid output in signal handler
Avoid output in signal handler to not disturb the timings which are
checked in this test.  Use asserts to ensure proper signal handler
invocations.
2016-05-18 11:11:21 +02:00
Sebastian Huber
3c20d2810a posix: Fix return states of pthread_kill()
POSIX mandates that an error code is returned and not -1 plus errno.

Close #2715.
2016-05-17 13:41:56 +02:00
Sebastian Huber
9d8ee11e55 psxtests/psxcancel: Add pthread_detach() tests
Update #2714.
2016-05-17 10:58:10 +02:00
Sebastian Huber
f014f84eb3 psxtests/psxcancel: Add resource check 2016-05-17 09:41:34 +02:00
Sebastian Huber
adc819ef76 sptests/spthreadlife01: Add self delete test case 2016-05-17 09:02:17 +02:00
Sebastian Huber
9fd72713c9 posix: Fix return status of pthread_cancel()
POSIX recommends ESRCH in case no thread exists for the specified
identifier.

Close #2713.
2016-05-17 08:39:30 +02:00
Sebastian Huber
df23f464be capture: Fix use of per-processor data
Get the current processor index only once and with interrupts disabled.

Close #2707.
2016-05-12 13:24:43 +02:00
Sebastian Huber
d449c12df3 capture: Remove superfluous includes 2016-05-12 13:24:43 +02:00
Sebastian Huber
7bd18697f8 capture: Compact rtems_capture_record_t
Order fields according to alignment to reduce structure internal
padding.
2016-05-12 13:24:42 +02:00
Sebastian Huber
2f11d4a014 capture: Fix buffer allocation and free
Do not use function static variables.  Remove superfluous volatile
qualifiers.  Use proper integer types.

Close #2706.
2016-05-12 13:24:42 +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
0727760336 rtems: Add rtems_interrupt_lock_interrupt_disable
Update #2707.
2016-05-12 13:24:42 +02:00
Sebastian Huber
ef6f8a8377 score: Avoid Giant lock for scheduler set/get
Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
8bc6bf28aa posix: Avoid Giant lock for some pthread functions
Avoid Giant lock for pthread_getattr_np(), pthread_setschedparam() and
pthread_getschedparam().  Replace POSIX threads scheduler lock with
thread state lock.

Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
d995299994 score: Avoid Giant lock _Scheduler_Get_affinity()
Update #2555.
2016-05-12 13:24:41 +02:00
Sebastian Huber
e135271b93 score: Avoid Giant lock _Scheduler_Set_affinity()
Update #2555.
2016-05-12 13:24:41 +02:00