summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-13 09:45:59 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-13 09:45:59 +0100
commit4a03e752189b17f4d1d3f590f66125293cb2b4df (patch)
treeb5ad2bfcc604a2848c69bc6ffc4b52d1b61a8825 /cpukit/posix/src
parentconfigure: Remove HAVE_THREADS_H support (diff)
downloadrtems-4a03e752189b17f4d1d3f590f66125293cb2b4df.tar.bz2
configure: Remove SIZEOF_PTHREAD_SPINLOCK_T
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/pspindestroy.c2
-rw-r--r--cpukit/posix/src/pspininit.c2
-rw-r--r--cpukit/posix/src/pspinlock.c30
-rw-r--r--cpukit/posix/src/pspinunlock.c13
4 files changed, 2 insertions, 45 deletions
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;
}