Commit Graph

3645 Commits

Author SHA1 Message Date
Sebastian Huber
a9cc6a84c5 smptests/smpatomic01: New test cases
Demonstrate that a read-modify-write atomic operation may be necessary
on some archtitectures to observe the latest value written.
2016-06-01 09:53:43 +02:00
Sebastian Huber
73f2ddb915 rtems: Fix semaphore field name 2016-05-30 16:16:24 +02:00
Sebastian Huber
09c5ca4cb4 score: Simplify CORE mutex
Remove superfluous support for simple binary semaphores.  With this we
can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
2016-05-30 16:16:22 +02:00
Sebastian Huber
93306058c0 score: _CORE_mutex_Check_dispatch_for_seize()
Move the safety check performed by
_CORE_mutex_Check_dispatch_for_seize() out of the performance critical
path and generalize it.  Blocking on a thread queue with an unexpected
thread dispatch disabled level is illegal in all system states.

Add the expected thread dispatch disable level (which may be 1 or 2
depending on the operation) to Thread_queue_Context and use it in
_Thread_queue_Enqueue_critical().
2016-05-30 16:16:21 +02:00
Sebastian Huber
0e1d11f3f0 score: Add _Thread_queue_Context_set_MP_callout()
Add _Thread_queue_Context_set_MP_callout() to simplify
_Thread_queue_Context_initialize().  This makes it possible to more
easily add additional fields to Thread_queue_Context.
2016-05-30 16:16:21 +02:00
Sebastian Huber
dce487912d score: Add Status_Control for all APIs
Unify the status codes of the Classic and POSIX API to use the new enum
Status_Control.  This eliminates the Thread_Control::Wait::timeout_code
field and the timeout parameter of _Thread_queue_Enqueue_critical() and
_MPCI_Send_request_packet().  It gets rid of the status code translation
tables and instead uses simple bit operations to get the status for a
particular API.  This enables translation of status code constants at
compile time.  Add _Thread_Wait_get_status() to avoid direct access of
thread internal data structures.
2016-05-26 21:44:31 +02:00
Sebastian Huber
d887c1b5b3 posix: Fix sem_init() with too large initial value
Close #2721.
2016-05-26 21:44:30 +02:00
Sebastian Huber
39bcf7417e Fix semaphore post overflow status
Close #2720.
2016-05-26 21:44:30 +02:00
Sebastian Huber
dbedcf93f0 testsuites: Fix locked_printf() test printer 2016-05-26 21:41:47 +02:00
Chris Johns
3039e1840c testsuite: Fix networking samples to use the RTEMS printer. 2016-05-26 15:52:19 +10:00
Sebastian Huber
9ec7d492b9 posix: Fix pthread_spin_unlock() error status
Close #2719.
2016-05-25 12:43:54 +02:00
Sebastian Huber
631b3c8967 score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods.  Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.
2016-05-25 12:43:54 +02:00
Chris Johns
addf1aa868 testsuite: Fix printk format warnings. 2016-05-25 15:47:34 +10:00
Chris Johns
61ea345158 testsuite: Fix printk formating warning. 2016-05-25 15:47:34 +10:00
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
b1860df53d psxtests/psxmsgq01: Fix typo 2016-05-24 15:39:07 +02:00
Sebastian Huber
4b623d655b score: Fix blocking _CORE_message_queue_Submit()
Close #2718.
2016-05-24 15:37:10 +02:00
Sebastian Huber
7088340957 psxtests/psxmsgq01: Enable test case 2016-05-24 15:32:33 +02: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
62c528e633 rtems: _Semaphore_Get_interrupt_disable()
Use _Objects_Get_local() for _Semaphore_Get_interrupt_disable() to get
rid of the location parameter.  Move remote object handling to semaphore
MPCI support.
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
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
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
92f6883073 sptests/spintrcritical22: Avoid _Objects_Get()
Use _Semaphore_Get_interrupt_disable() instead.

Update #2555.
2016-05-20 07:49:40 +02:00
Sebastian Huber
33829ce155 score: Avoid Giant lock for _Thread_Start()
Update #2555.
2016-05-20 07:49:39 +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
12a1228c59 psxclassic01: Assume correct pthread_detach()
Update #2714.
2016-05-20 07:49:36 +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
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
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
9276fdec2e score: Fix CORE mutex initialization
The priority inheritance and ceiling CORE mutexes wrongly used the FIFO
queueing discipline.  Delete misleading _CORE_mutex_Is_priority().  Bug
introduced by 1e1a91ed11.

Add test sptests/spmutex01, since no existing uni-processor test covered
the thread priority queueing discipline for CORE mutexes.
2016-05-12 13:20:33 +02:00
Sebastian Huber
876dde7a7d score: Make _Objects_Information_table const
The _Objects_Information_table is statically initialized.  So, we can
make it read-only.
2016-05-04 07:24:30 +02:00
Sebastian Huber
1d40d81b4b rtems: Remove task variables
Update #2494.
Update #2555.
2016-05-04 07:24:30 +02:00
Sebastian Huber
e4fd35ddcb confdefs.h: Fix named object size estimate
Account for the terminating null character.  Use _POSIX_PATH_MAX instead
of NAME_MAX according to _POSIX_Semaphore_Manager_initialization() and
_POSIX_Message_queue_Manager_initialization().
2016-05-04 07:24:29 +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
500a8e9c62 score: Delete __RTEMS_STRICT_ORDER_MUTEX__
Remove support for strict order mutexes.

Close #2124.
2016-05-02 07:46:16 +02:00
Sebastian Huber
f009ed086d rtems: Avoid Giant lock for semaphores
Update #2555.
2016-05-02 07:46:15 +02:00
Sebastian Huber
c8982e5f6a posix: Simplify message queues
The mq_open() function returns a descriptor to a POSIX message queue
object identified by a name.  This is similar to sem_open().  In
contrast to the POSIX semaphore the POSIX message queues use a separate
object for the descriptor.  This extra object is superfluous, since the
object identifier can be used directly for this purpose, just like for
the semaphores.

Update #2702.
Update #2555.
2016-05-02 07:46:15 +02:00
Sebastian Huber
b46622684a score: Add _Thread_queue_Is_empty() 2016-04-22 09:25:08 +02:00
Sebastian Huber
36cd27c1e3 score: Simplify _Objects_Get_next()
Remove unused location parameter.
2016-04-21 07:29:40 +02:00
Sebastian Huber
f05eeb2091 score: Simplify _Objects_Initialize_information()
Remove unused supports_global parameter.  Convert
_Objects_Initialize_information() to a macro to avoid use of
RTEMS_MULTIPROCESSING define for each caller.
2016-04-21 07:29:39 +02:00