diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-13 09:45:59 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-13 09:45:59 +0100 |
commit | 4a03e752189b17f4d1d3f590f66125293cb2b4df (patch) | |
tree | b5ad2bfcc604a2848c69bc6ffc4b52d1b61a8825 | |
parent | configure: Remove HAVE_THREADS_H support (diff) | |
download | rtems-4a03e752189b17f4d1d3f590f66125293cb2b4df.tar.bz2 |
configure: Remove SIZEOF_PTHREAD_SPINLOCK_T
-rw-r--r-- | cpukit/configure.ac | 1 | ||||
-rw-r--r-- | cpukit/posix/include/rtems/posix/spinlockimpl.h | 19 | ||||
-rw-r--r-- | cpukit/posix/src/pspindestroy.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/pspininit.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/pspinlock.c | 30 | ||||
-rw-r--r-- | cpukit/posix/src/pspinunlock.c | 13 |
6 files changed, 2 insertions, 65 deletions
diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 945bd309a4..444b886d63 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -74,7 +74,6 @@ AC_CHECK_HEADERS([envlock.h]) AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>]) AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>]) AC_CHECK_TYPES([struct _Thread_queue_Queue],[],[],[#include <sys/lock.h>]) -AC_CHECK_SIZEOF([pthread_spinlock_t],[],[],[#include <pthread.h>]) AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>]) # Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME diff --git a/cpukit/posix/include/rtems/posix/spinlockimpl.h b/cpukit/posix/include/rtems/posix/spinlockimpl.h index c251e455e0..d28e0391fc 100644 --- a/cpukit/posix/include/rtems/posix/spinlockimpl.h +++ b/cpukit/posix/include/rtems/posix/spinlockimpl.h @@ -34,10 +34,6 @@ extern "C" { #endif -#if SIZEOF_PTHREAD_SPINLOCK_T > 4 -#define POSIX_SPINLOCKS_ARE_SELF_CONTAINED -#endif - typedef struct { #if defined(RTEMS_SMP) SMP_ticket_lock_Control Lock; @@ -47,26 +43,11 @@ typedef struct { ISR_Level interrupt_state; } POSIX_Spinlock_Control; -#if !defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) -extern POSIX_Spinlock_Control _POSIX_Spinlock_Global; - -extern int _POSIX_Spinlock_Nest_level; - -#if defined(RTEMS_SMP) -extern uint32_t _POSIX_Spinlock_Owner; -#endif -#endif - RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get( pthread_spinlock_t *lock ) { -#if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) return (POSIX_Spinlock_Control *) lock; -#else - (void) lock; - return &_POSIX_Spinlock_Global; -#endif } #ifdef __cplusplus diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c index f5de88f04b..3963fe8da2 100644 --- a/cpukit/posix/src/pspindestroy.c +++ b/cpukit/posix/src/pspindestroy.c @@ -24,7 +24,7 @@ int pthread_spin_destroy( pthread_spinlock_t *spinlock ) { -#if defined(RTEMS_SMP) && defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) +#if defined(RTEMS_SMP) POSIX_Spinlock_Control *the_spinlock; the_spinlock = _POSIX_Spinlock_Get( spinlock ); diff --git a/cpukit/posix/src/pspininit.c b/cpukit/posix/src/pspininit.c index 313633a11e..6a7bd03842 100644 --- a/cpukit/posix/src/pspininit.c +++ b/cpukit/posix/src/pspininit.c @@ -29,7 +29,7 @@ int pthread_spin_init( int pshared ) { -#if defined(RTEMS_SMP) && defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) +#if defined(RTEMS_SMP) POSIX_Spinlock_Control *the_spinlock; the_spinlock = _POSIX_Spinlock_Get( spinlock ); diff --git a/cpukit/posix/src/pspinlock.c b/cpukit/posix/src/pspinlock.c index 2bcd59b430..9bacd367b6 100644 --- a/cpukit/posix/src/pspinlock.c +++ b/cpukit/posix/src/pspinlock.c @@ -22,7 +22,6 @@ #include <rtems/posix/spinlockimpl.h> -#if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) RTEMS_STATIC_ASSERT( #if defined(RTEMS_SMP) offsetof( POSIX_Spinlock_Control, Lock.next_ticket ) @@ -53,15 +52,6 @@ RTEMS_STATIC_ASSERT( sizeof( POSIX_Spinlock_Control ) == sizeof( pthread_spinlock_t ), POSIX_SPINLOCK_T_SIZE ); -#else -POSIX_Spinlock_Control _POSIX_Spinlock_Global; - -int _POSIX_Spinlock_Nest_level; - -#if defined(RTEMS_SMP) -uint32_t _POSIX_Spinlock_Owner = 0xffffffff; -#endif -#endif int pthread_spin_lock( pthread_spinlock_t *spinlock ) { @@ -73,7 +63,6 @@ int pthread_spin_lock( pthread_spinlock_t *spinlock ) the_spinlock = _POSIX_Spinlock_Get( spinlock ); _ISR_Local_disable( level ); -#if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) #if defined(RTEMS_SMP) #if defined(RTEMS_PROFILING) /* The lock statistics are incorrect in case of nested pthread spinlocks */ @@ -86,25 +75,6 @@ int pthread_spin_lock( pthread_spinlock_t *spinlock ) ); #endif the_spinlock->interrupt_state = level; -#else -#if defined(RTEMS_SMP) - if ( _POSIX_Spinlock_Owner != _SMP_Get_current_processor() ) { -#if defined(RTEMS_PROFILING) - cpu_self = _Per_CPU_Get(); -#endif - _SMP_ticket_lock_Acquire( - &the_spinlock->Lock, - &cpu_self->Lock_stats, - &cpu_self->Lock_stats_context - ); - _POSIX_Spinlock_Owner = _SMP_Get_current_processor(); - } -#endif - - if ( ++_POSIX_Spinlock_Nest_level == 1) { - the_spinlock->interrupt_state = level; - } -#endif return 0; } diff --git a/cpukit/posix/src/pspinunlock.c b/cpukit/posix/src/pspinunlock.c index b508df7384..74baa7cad7 100644 --- a/cpukit/posix/src/pspinunlock.c +++ b/cpukit/posix/src/pspinunlock.c @@ -31,7 +31,6 @@ int pthread_spin_unlock( pthread_spinlock_t *lock ) the_spinlock = _POSIX_Spinlock_Get( lock ); level = the_spinlock->interrupt_state; -#if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED) #if defined(RTEMS_SMP) _SMP_ticket_lock_Release( &the_spinlock->Lock, @@ -39,17 +38,5 @@ int pthread_spin_unlock( pthread_spinlock_t *lock ) ); #endif _ISR_Local_enable( level ); -#else - if ( --_POSIX_Spinlock_Nest_level == 0 ) { -#if defined(RTEMS_SMP) - _POSIX_Spinlock_Owner = 0xffffffff; - _SMP_ticket_lock_Release( - &the_spinlock->Lock, - &_Per_CPU_Get()->Lock_stats_context - ); -#endif - _ISR_Local_enable( level ); - } -#endif return 0; } |