Changeset af746b0 in rtems


Ignore:
Timestamp:
May 25, 2016, 2:30:23 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
3ca6e618
Parents:
93306058
git-author:
Sebastian Huber <sebastian.huber@…> (05/25/16 14:30:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/30/16 14:16:21)
Message:

score: Use thread queue lock for MrsP

Replace the ISR lock in MRSP_Control with a thread queue. This
simplifies the Classic semaphore implementation. Only the lock part of
the thread queue is used.

Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/semobtain.c

    r93306058 raf746b0  
    3333  Core_control.semaphore.Wait_queue
    3434);
     35
     36#if defined(RTEMS_SMP)
     37THREAD_QUEUE_OBJECT_ASSERT(
     38  Semaphore_Control,
     39  Core_control.mrsp.Wait_queue
     40);
     41#endif
    3542
    3643rtems_status_code rtems_semaphore_obtain(
  • cpukit/score/include/rtems/score/mrsp.h

    r93306058 raf746b0  
    2121
    2222#include <rtems/score/chain.h>
    23 #include <rtems/score/isrlock.h>
    2423#include <rtems/score/scheduler.h>
    2524#include <rtems/score/thread.h>
     25#include <rtems/score/threadq.h>
    2626
    2727#ifdef __cplusplus
     
    116116struct MRSP_Control {
    117117  /**
     118   * @brief Lock to protect the resource dependency tree.
     119   *
     120   * This is a thread queue since this simplifies the Classic semaphore
     121   * implementation.  Only the lock part of the thread queue is used.
     122   */
     123  Thread_queue_Control Wait_queue;
     124
     125  /**
    118126   * @brief Basic resource control.
    119127   */
     
    126134   */
    127135  Chain_Control Rivals;
    128 
    129   /**
    130    * @brief Lock to protect the resource dependency tree.
    131    */
    132   ISR_LOCK_MEMBER( Lock )
    133136
    134137  /**
  • cpukit/score/include/rtems/score/mrspimpl.h

    r93306058 raf746b0  
    2525#include <rtems/score/schedulerimpl.h>
    2626#include <rtems/score/status.h>
     27#include <rtems/score/threadqimpl.h>
    2728#include <rtems/score/watchdogimpl.h>
    2829#include <rtems/score/wkspace.h>
     
    6667)
    6768{
    68   _ISR_lock_Acquire( &mrsp->Lock, &queue_context->Lock_context );
     69  _Thread_queue_Acquire_critical(
     70    &mrsp->Wait_queue,
     71    &queue_context->Lock_context
     72  );
    6973}
    7074
     
    7478)
    7579{
    76   _ISR_lock_Release_and_ISR_enable( &mrsp->Lock, &queue_context->Lock_context );
     80  _Thread_queue_Release( &mrsp->Wait_queue, &queue_context->Lock_context );
    7781}
    7882
     
    161165  _Resource_Initialize( &mrsp->Resource );
    162166  _Chain_Initialize_empty( &mrsp->Rivals );
    163   _ISR_lock_Initialize( &mrsp->Lock, "MrsP" );
     167  _Thread_queue_Initialize( &mrsp->Wait_queue );
    164168
    165169  return STATUS_SUCCESSFUL;
     
    439443{
    440444  _MRSP_Release( mrsp, queue_context );
    441   _ISR_lock_Destroy( &mrsp->Lock );
     445  _Thread_queue_Destroy( &mrsp->Wait_queue );
    442446  _Workspace_Free( mrsp->ceiling_priorities );
    443447}
Note: See TracChangeset for help on using the changeset viewer.