Commit Graph

29467 Commits

Author SHA1 Message Date
Sebastian Huber
28ba7e20aa posix: Remove dead code and shrink comment 2016-05-20 16:16:58 +02:00
Sebastian Huber
05f9b02e3c posix: Add and use _POSIX_Get_object_body() 2016-05-20 16:16:26 +02:00
Sebastian Huber
8a040fe4ee score: Use _RBTree_Insert_inline()
Use _RBTree_Insert_inline() for priority thread queues.

Update #2556.
2016-05-20 16:11:02 +02:00
Sebastian Huber
7dfb4b970c score: Add per scheduler instance maximum priority
The priority values are only valid within a scheduler instance.  Thus,
the maximum priority value must be defined per scheduler instance.  The
first scheduler instance defines PRIORITY_MAXIMUM.  This implies that
RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only
valid for threads of the first scheduler instance.  Further
API/implementation changes are necessary to fix this.

Update #2556.
2016-05-20 16:11:02 +02:00
Sebastian Huber
452b7f83c4 fat: Fix for invalid cluster sizes
A cluster size > 32KiB resulted in an infinite loop in
fat_init_volume_info() due to an integer overflow.

Close #2717.
2016-05-20 07:50:38 +02:00
Sebastian Huber
ceb0f6597c score: Remove the Giant lock
Update #2555.
2016-05-20 07:50:37 +02:00
Sebastian Huber
c2f301b580 score: Rename _ISR_Flash() into _ISR_Local_flash()
This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:50:37 +02:00
Sebastian Huber
2471316321 score: Rename _ISR_Disable() and _ISR_Enable()
Rename _ISR_Disable() into _ISR_Local_disable().  Rename _ISR_Enable()
into _ISR_Local_enable().  Remove _Debug_Is_owner_of_giant().

This is a preparation to 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
d2bacb6c38 score: _Thread_Dispatch_increment_disable_level()
Avoid _Thread_Dispatch_increment_disable_level() and
_Thread_Dispatch_decrement_disable_level() and thus the Giant
lock.

This is a preparation to remove the Giant lock.

Update #2555.
2016-05-20 07:49:41 +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
b80156cf15 score: Avoid Giant _Objects_Extend_information()
Avoid Giant lock for _Objects_Extend_information().

Update #2280.
Update #2555.
2016-05-20 07:49:41 +02:00
Sebastian Huber
ee710ef483 score: Delete unused _Objects_Get()
Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
23294fd225 score: Delete unused _Thread_Get()
Update #2555.
2016-05-20 07:49:40 +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
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