Changeset 4a03e752 in rtems


Ignore:
Timestamp:
Jan 13, 2017, 8:45:59 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
6b13287
Parents:
dc703190
Message:

configure: Remove SIZEOF_PTHREAD_SPINLOCK_T

Location:
cpukit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/configure.ac

    rdc703190 r4a03e752  
    7575AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
    7676AC_CHECK_TYPES([struct _Thread_queue_Queue],[],[],[#include <sys/lock.h>])
    77 AC_CHECK_SIZEOF([pthread_spinlock_t],[],[],[#include <pthread.h>])
    7877AC_CHECK_MEMBER([struct _Thread_queue_Queue._name],[],[RTEMS_TOOL_CHAIN_ERROR],[#include <sys/lock.h>])
    7978
  • cpukit/posix/include/rtems/posix/spinlockimpl.h

    rdc703190 r4a03e752  
    3535#endif
    3636
    37 #if SIZEOF_PTHREAD_SPINLOCK_T > 4
    38 #define POSIX_SPINLOCKS_ARE_SELF_CONTAINED
    39 #endif
    40 
    4137typedef struct {
    4238#if defined(RTEMS_SMP)
     
    4844} POSIX_Spinlock_Control;
    4945
    50 #if !defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
    51 extern POSIX_Spinlock_Control _POSIX_Spinlock_Global;
    52 
    53 extern int _POSIX_Spinlock_Nest_level;
    54 
    55 #if defined(RTEMS_SMP)
    56 extern uint32_t _POSIX_Spinlock_Owner;
    57 #endif
    58 #endif
    59 
    6046RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
    6147  pthread_spinlock_t *lock
    6248)
    6349{
    64 #if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
    6550  return (POSIX_Spinlock_Control *) lock;
    66 #else
    67   (void) lock;
    68   return &_POSIX_Spinlock_Global;
    69 #endif
    7051}
    7152
  • cpukit/posix/src/pspindestroy.c

    rdc703190 r4a03e752  
    2525int pthread_spin_destroy( pthread_spinlock_t *spinlock )
    2626{
    27 #if defined(RTEMS_SMP) && defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
     27#if defined(RTEMS_SMP)
    2828  POSIX_Spinlock_Control *the_spinlock;
    2929
  • cpukit/posix/src/pspininit.c

    rdc703190 r4a03e752  
    3030)
    3131{
    32 #if defined(RTEMS_SMP) && defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
     32#if defined(RTEMS_SMP)
    3333  POSIX_Spinlock_Control *the_spinlock;
    3434
  • cpukit/posix/src/pspinlock.c

    rdc703190 r4a03e752  
    2323#include <rtems/posix/spinlockimpl.h>
    2424
    25 #if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
    2625RTEMS_STATIC_ASSERT(
    2726#if defined(RTEMS_SMP)
     
    5453  POSIX_SPINLOCK_T_SIZE
    5554);
    56 #else
    57 POSIX_Spinlock_Control _POSIX_Spinlock_Global;
    58 
    59 int _POSIX_Spinlock_Nest_level;
    60 
    61 #if defined(RTEMS_SMP)
    62 uint32_t _POSIX_Spinlock_Owner = 0xffffffff;
    63 #endif
    64 #endif
    6555
    6656int pthread_spin_lock( pthread_spinlock_t *spinlock )
     
    7464  the_spinlock = _POSIX_Spinlock_Get( spinlock );
    7565  _ISR_Local_disable( level );
    76 #if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
    7766#if defined(RTEMS_SMP)
    7867#if defined(RTEMS_PROFILING)
     
    8776#endif
    8877  the_spinlock->interrupt_state = level;
    89 #else
    90 #if defined(RTEMS_SMP)
    91   if ( _POSIX_Spinlock_Owner != _SMP_Get_current_processor() ) {
    92 #if defined(RTEMS_PROFILING)
    93     cpu_self = _Per_CPU_Get();
    94 #endif
    95     _SMP_ticket_lock_Acquire(
    96       &the_spinlock->Lock,
    97       &cpu_self->Lock_stats,
    98       &cpu_self->Lock_stats_context
    99     );
    100     _POSIX_Spinlock_Owner = _SMP_Get_current_processor();
    101   }
    102 #endif
    103 
    104   if ( ++_POSIX_Spinlock_Nest_level == 1) {
    105     the_spinlock->interrupt_state = level;
    106   }
    107 #endif
    10878  return 0;
    10979}
  • cpukit/posix/src/pspinunlock.c

    rdc703190 r4a03e752  
    3232  the_spinlock = _POSIX_Spinlock_Get( lock );
    3333  level = the_spinlock->interrupt_state;
    34 #if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
    3534#if defined(RTEMS_SMP)
    3635  _SMP_ticket_lock_Release(
     
    4039#endif
    4140  _ISR_Local_enable( level );
    42 #else
    43   if ( --_POSIX_Spinlock_Nest_level == 0 ) {
    44 #if defined(RTEMS_SMP)
    45     _POSIX_Spinlock_Owner = 0xffffffff;
    46     _SMP_ticket_lock_Release(
    47       &the_spinlock->Lock,
    48       &_Per_CPU_Get()->Lock_stats_context
    49     );
    50 #endif
    51     _ISR_Local_enable( level );
    52   }
    53 #endif
    5441  return 0;
    5542}
Note: See TracChangeset for help on using the changeset viewer.