Ticket #1910: smplocks_modular.patch

File smplocks_modular.patch, 3.4 KB (added by Marta Rybczynska, on 09/08/11 at 08:58:14)

Configurable SMP locks implementation

  • cpukit/score/cpu/i386/rtems/score/cpu.h

    diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
    index 0e47c28..acbd9fa 100644
    a b uint32_t _CPU_ISR_Get_level( void ); 
    503503
    504504/* end of Bitfield handler macros */
    505505
     506/* SMP configuration */
     507
     508/**
     509 *  The i386 port uses generic SMP lock types.
     510 */
     511#define CPU_USE_GENERIC_SMPLOCK_TYPES TRUE
     512
     513/**
     514 *  The i386 port uses generic SMP lock handling code.
     515 */
     516#define CPU_USE_GENERIC_SMPLOCK_CODE TRUE
     517
     518/* End of SMP configuration */
     519
     520
     521
    506522/*
    507523 *  Priority handler macros
    508524 *
  • cpukit/score/cpu/no_cpu/rtems/score/cpu.h

    diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
    index 82b7ce6..6873d2e 100644
    a b uint32_t _CPU_ISR_Get_level( void ); 
    10061006
    10071007/* end of Bitfield handler macros */
    10081008
     1009/* SMP configuration */
     1010
     1011/**
     1012 *  This definition is set to TRUE if the port uses generic types
     1013 *  for SMP locks. If the architecture requires special types, set
     1014 *  this variable to FALSE and define simple and recursive lock.
     1015 */
     1016#define CPU_USE_GENERIC_SMPLOCK_TYPES TRUE
     1017
     1018/**
     1019 *  This definition is set to TRUE if the port uses generic
     1020 *  implementation of SMP locks. If the architecture requires special
     1021 *  handling, set this variable to FALSE and implement the lock functions.
     1022 */
     1023#define CPU_USE_GENERIC_SMPLOCK_CODE TRUE
     1024
     1025/* End of SMP configuration */
     1026
    10091027/**
    10101028 *  This routine builds the mask which corresponds to the bit fields
    10111029 *  as searched by @ref _CPU_Bitfield_Find_first_bit.  See the discussion
  • cpukit/score/cpu/sparc/rtems/score/cpu.h

    diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
    index 536345b..06d36a9 100644
    a b void _CPU_Context_Initialize( 
    10971097
    10981098/* end of Bitfield handler macros */
    10991099
     1100/* SMP configuration */
     1101
     1102/**
     1103 *  The SPARC port uses generic SMP lock types.
     1104 */
     1105#define CPU_USE_GENERIC_SMPLOCK_TYPES TRUE
     1106
     1107/**
     1108 *  The SPARC port uses generic SMP lock handling code.
     1109 */
     1110#define CPU_USE_GENERIC_SMPLOCK_CODE TRUE
     1111
     1112/* End of SMP configuration */
     1113
    11001114/* functions */
    11011115
    11021116/**
  • cpukit/score/include/rtems/score/smplock.h

    diff --git a/cpukit/score/include/rtems/score/smplock.h b/cpukit/score/include/rtems/score/smplock.h
    index df20599..fcf54bf 100644
    a b  
    3434extern "C" {
    3535#endif
    3636
     37#if ( CPU_USE_GENERIC_SMPLOCK_TYPES == TRUE )
    3738/**
    3839 *  This type is used to lock elements for atomic access.
    3940 *  This spinlock is a simple non-nesting spinlock, and
    typedef struct { 
    5354  uint32_t  count;
    5455  int       cpu_id;
    5556} SMP_lock_spinlock_nested_Control;
     57#endif
    5658
    5759/**
    5860 *  @brief Initialize a Lock
  • cpukit/score/src/smplock.c

    diff --git a/cpukit/score/src/smplock.c b/cpukit/score/src/smplock.c
    index 6a737f2..ce4c11a 100644
    a b  
    1818#include <rtems/score/smp.h>
    1919#include <rtems/score/isr.h>
    2020
     21#if ( CPU_USE_GENERIC_SMPLOCK_CODE == TRUE )
     22
    2123/*
    2224 * Some debug stuff that is being left in, but disabled.  This will keep
    2325 * a log of lock/unlock sequences that can be printed out when the
    ISR_Level _SMP_lock_spinlock_nested_Obtain( 
    281283    } while (1);
    282284  }
    283285#endif
     286
     287#endif