diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-16 14:50:09 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-23 12:52:06 +0100 |
commit | c42be504c92d76d2e06d0fc8ebd05fc913376d2d (patch) | |
tree | 259f8a712a6139f427888647955bc3c95480877e /cpukit/sapi/include | |
parent | score: Add RTEMS_ALIAS() (diff) | |
download | rtems-c42be504c92d76d2e06d0fc8ebd05fc913376d2d.tar.bz2 |
posix: Add self-contained pthread spinlock
Turn pthread_spinlock_t into a self-contained object. On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations. On SMP configurations, a ticket lock is a acquired
and released in addition.
The self-contained pthread_spinlock_t object is defined by Newlib in
<sys/_pthreadtypes.h>.
typedef struct {
struct _Ticket_lock_Control _lock;
__uint32_t _interrupt_state;
} pthread_spinlock_t;
This implementation is simple and efficient. However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:
https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c
There is only limited support for profiling on SMP configurations.
Delete CORE spinlock implementation.
Update #2674.
Diffstat (limited to 'cpukit/sapi/include')
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index be817bbf1d..3a718ba452 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -2068,10 +2068,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS \ rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) #endif - #if !defined(CONFIGURE_MAXIMUM_POSIX_SPINLOCKS) - #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS \ - rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) - #endif #endif /* RTEMS_POSIX_API */ #endif /* CONFIGURE_UNLIMITED_OBJECTS */ @@ -2468,7 +2464,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #include <rtems/posix/pthread.h> #include <rtems/posix/rwlock.h> #include <rtems/posix/semaphore.h> - #include <rtems/posix/spinlock.h> #include <rtems/posix/threadsup.h> #include <rtems/posix/timer.h> @@ -2616,23 +2611,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; /** * This configuration parameter specifies the maximum number of - * POSIX API spinlocks. - */ - #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS - #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 - #endif - - /** - * This macro is calculated to specify the memory required for - * POSIX API spinlocks. - * - * This is an internal parameter. - */ - #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ - _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) ) - - /** - * This configuration parameter specifies the maximum number of * POSIX API rwlocks. */ #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS @@ -2871,8 +2849,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \ CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ - CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ - CONFIGURE_MAXIMUM_POSIX_SPINLOCKS) + \ CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ CONFIGURE_MAXIMUM_POSIX_RWLOCKS) + \ CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS)) @@ -3339,7 +3315,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, CONFIGURE_MAXIMUM_POSIX_BARRIERS, CONFIGURE_MAXIMUM_POSIX_RWLOCKS, - CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME }; @@ -3554,7 +3529,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; uint32_t POSIX_MESSAGE_QUEUES; uint32_t POSIX_SEMAPHORES; uint32_t POSIX_BARRIERS; - uint32_t POSIX_SPINLOCKS; uint32_t POSIX_RWLOCKS; #endif @@ -3608,7 +3582,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), - CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), #endif @@ -3680,7 +3653,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ - (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) #error "CONFIGURATION ERROR: POSIX API support not configured!!" |