Changeset 3045738 in rtems


Ignore:
Timestamp:
May 28, 2014, 11:38:48 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
9553e7a6
Parents:
6c7caa1a
git-author:
Sebastian Huber <sebastian.huber@…> (05/28/14 11:38:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/03/14 06:15:16)
Message:

score: Add resource node to thread control block

Location:
cpukit/score
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/thread.h

    r6c7caa1a r3045738  
    2929#include <rtems/score/percpu.h>
    3030#include <rtems/score/priority.h>
     31#include <rtems/score/resource.h>
    3132#include <rtems/score/stack.h>
    3233#include <rtems/score/states.h>
     
    473474  Chain_Control            lock_mutex;
    474475#endif
     476#if defined(RTEMS_SMP)
     477  /**
     478   * @brief Resource node to build a dependency tree in case this thread owns
     479   * resources or depends on a resource.
     480   */
     481  Resource_Node            Resource_node;
     482#endif
    475483     /*================= end of common block =================*/
    476484#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/score/include/rtems/score/threadimpl.h

    r6c7caa1a r3045738  
    2727#include <rtems/score/isr.h>
    2828#include <rtems/score/objectimpl.h>
     29#include <rtems/score/resourceimpl.h>
    2930#include <rtems/score/statesimpl.h>
    3031#include <rtems/score/sysstate.h>
     
    792793 * counter.  This counter is used by semaphore objects for example.
    793794 *
     795 * In addition to the resource counter there is a resource dependency tree
     796 * available on SMP configurations.  In case this tree is non-empty, then the
     797 * thread owns resources.
     798 *
    794799 * @param[in] the_thread The thread.
    795800 */
     
    799804{
    800805  bool owns_resources = the_thread->resource_count != 0;
     806
     807#if defined(RTEMS_SMP)
     808  owns_resources = owns_resources
     809    || _Resource_Node_owns_resources( &the_thread->Resource_node );
     810#endif
    801811
    802812  return owns_resources;
  • cpukit/score/src/threadinitialize.c

    r6c7caa1a r3045738  
    2020
    2121#include <rtems/score/threadimpl.h>
     22#include <rtems/score/resourceimpl.h>
    2223#include <rtems/score/schedulerimpl.h>
    2324#include <rtems/score/stackimpl.h>
     
    183184#if defined(RTEMS_SMP)
    184185  the_thread->scheduler               = scheduler;
     186  _Resource_Node_initialize( &the_thread->Resource_node );
    185187  _CPU_Context_Set_is_executing( &the_thread->Registers, false );
    186188#endif
Note: See TracChangeset for help on using the changeset viewer.