Changeset 52a661e8 in rtems


Ignore:
Timestamp:
Aug 2, 2016, 6:55:00 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b20b736
Parents:
15b5678d
git-author:
Sebastian Huber <sebastian.huber@…> (08/02/16 06:55:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/08/16 07:55:27)
Message:

score: Add scheduler node implementation header

Update #2556.

Location:
cpukit/score
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/Makefile.am

    r15b5678d r52a661e8  
    7474include_rtems_score_HEADERS += include/rtems/score/scheduleredfimpl.h
    7575include_rtems_score_HEADERS += include/rtems/score/schedulernode.h
     76include_rtems_score_HEADERS += include/rtems/score/schedulernodeimpl.h
    7677include_rtems_score_HEADERS += include/rtems/score/schedulerpriority.h
    7778include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityimpl.h
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r15b5678d r52a661e8  
    110110#endif
    111111}
    112 
    113 #if defined(RTEMS_SMP)
    114 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_user(
    115   const Scheduler_Node *node
    116 )
    117 {
    118   return node->user;
    119 }
    120 #endif
    121112
    122113ISR_LOCK_DECLARE( extern, _Scheduler_Lock )
     
    780771}
    781772
    782 RTEMS_INLINE_ROUTINE void _Scheduler_Node_do_initialize(
    783   Scheduler_Node   *node,
    784   Thread_Control   *the_thread,
    785   Priority_Control  priority
    786 )
    787 {
    788   node->owner = the_thread;
    789 
    790   node->Priority.value = priority;
    791   node->Priority.prepend_it = false;
    792 
    793 #if defined(RTEMS_SMP)
    794   node->user = the_thread;
    795   node->help_state = SCHEDULER_HELP_YOURSELF;
    796   node->idle = NULL;
    797   node->accepts_help = the_thread;
    798   _SMP_sequence_lock_Initialize( &node->Priority.Lock );
    799 #else
    800   (void) the_thread;
    801 #endif
    802 }
    803 
    804 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_owner(
    805   const Scheduler_Node *node
    806 )
    807 {
    808   return node->owner;
    809 }
    810 
    811 RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Node_get_priority(
    812   Scheduler_Node *node,
    813   bool           *prepend_it_p
    814 )
    815 {
    816   Priority_Control priority;
    817   bool             prepend_it;
    818 
    819 #if defined(RTEMS_SMP)
    820   unsigned int     seq;
    821 
    822   do {
    823     seq = _SMP_sequence_lock_Read_begin( &node->Priority.Lock );
    824 #endif
    825 
    826     priority = node->Priority.value;
    827     prepend_it = node->Priority.prepend_it;
    828 
    829 #if defined(RTEMS_SMP)
    830   } while ( _SMP_sequence_lock_Read_retry( &node->Priority.Lock, seq ) );
    831 #endif
    832 
    833   *prepend_it_p = prepend_it;
    834 
    835   return priority;
    836 }
    837 
    838 RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority(
    839   Scheduler_Node   *node,
    840   Priority_Control  new_priority,
    841   bool              prepend_it
    842 )
    843 {
    844 #if defined(RTEMS_SMP)
    845   unsigned int seq;
    846 
    847   seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );
    848 #endif
    849 
    850   node->Priority.value = new_priority;
    851   node->Priority.prepend_it = prepend_it;
    852 
    853 #if defined(RTEMS_SMP)
    854   _SMP_sequence_lock_Write_end( &node->Priority.Lock, seq );
    855 #endif
    856 }
    857 
    858773RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_priority(
    859774  Thread_Control   *the_thread,
     
    893808  Thread_Control    *idle
    894809);
    895 
    896 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Node_get_idle(
    897   const Scheduler_Node *node
    898 )
    899 {
    900   return node->idle;
    901 }
    902 
    903 RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_user(
    904   Scheduler_Node *node,
    905   Thread_Control *user
    906 )
    907 {
    908   node->user = user;
    909 }
    910810
    911811RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_node(
  • cpukit/score/include/rtems/score/schedulernode.h

    r15b5678d r52a661e8  
    206206} Scheduler_Node;
    207207
    208 #define SCHEDULER_NODE_OF_WAIT_CHAIN_NODE( node ) \
    209   RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.Chain )
    210 
    211 #define SCHEDULER_NODE_OF_WAIT_RBTREE_NODE( node ) \
    212   RTEMS_CONTAINER_OF( node, Scheduler_Node, Wait.Node.RBTree )
    213 
    214208#ifdef __cplusplus
    215209}
  • cpukit/score/include/rtems/score/threadimpl.h

    r15b5678d r52a661e8  
    2929#include <rtems/score/objectimpl.h>
    3030#include <rtems/score/resourceimpl.h>
     31#include <rtems/score/schedulernodeimpl.h>
    3132#include <rtems/score/statesimpl.h>
    3233#include <rtems/score/status.h>
  • cpukit/score/preinstall.am

    r15b5678d r52a661e8  
    260260        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulernode.h
    261261PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulernode.h
     262
     263$(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h: include/rtems/score/schedulernodeimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     264        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h
     265PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulernodeimpl.h
    262266
    263267$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h: include/rtems/score/schedulerpriority.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
Note: See TracChangeset for help on using the changeset viewer.