Changeset aad726e in rtems


Ignore:
Timestamp:
Nov 16, 1999, 10:56:38 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
38d65f80
Parents:
987445b
Message:

Moved task_variable pointer to basic shared part of TCB instead of
RTEMS API extension to avoid problems when the extension is freed.
Eventually the task variable switch extension should become part
of the core context switch and the Ada tcb self implemented in
terms of it.

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/rtems/include/rtems/rtems/tasks.h

    r987445b raad726e  
    148148
    149149/*
    150  *  Per task variable structure
    151  */
    152 
    153 struct rtems_task_variable_tt;
    154 
    155 struct rtems_task_variable_tt {
    156   struct rtems_task_variable_tt  *next;
    157   int                            *ptr;
    158   int                             var;
    159 };
    160 
    161 typedef struct rtems_task_variable_tt   rtems_task_variable_t;
    162 
    163 /*
    164150 *  This is the API specific information required by each thread for
    165151 *  the RTEMS API to function correctly.
     
    172158  rtems_event_set          event_condition;
    173159  ASR_Information          Signal;
    174   rtems_task_variable_t   *task_variables;
    175160}  RTEMS_API_Control;
    176161
  • c/src/exec/rtems/src/tasks.c

    r987445b raad726e  
    5757  api->pending_events = EVENT_SETS_NONE_PENDING;
    5858  _ASR_Initialize( &api->Signal );
    59   api->task_variables = NULL;
     59  created->task_variables = NULL;
    6060  return TRUE;
    6161}
     
    9595)
    9696{
    97   RTEMS_API_Control     *api;
    9897  rtems_task_variable_t *tvp, *next;
    9998
    100   api = executing->API_Extensions[ THREAD_API_RTEMS ];
    101 
    10299  /*
    103100   *  Free per task variable memory
    104101   */
    105102
    106   tvp = api->task_variables;
    107   api->task_variables = NULL;
     103  tvp = deleted->task_variables;
     104  deleted->task_variables = NULL;
    108105  while (tvp) {
    109106    next = tvp->next;
     
    116113   */
    117114
    118   (void) _Workspace_Free( api );
    119  
     115  (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] );
    120116  deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL;
    121117}
     
    133129)
    134130{
    135   RTEMS_API_Control     *api;
    136131  rtems_task_variable_t *tvp;
    137132
     
    140135   */
    141136
    142 
    143   api = executing->API_Extensions[ THREAD_API_RTEMS ];
    144   tvp = api->task_variables;
     137  tvp = executing->task_variables;
    145138  while (tvp) {
    146139    tvp->var = *tvp->ptr;
     
    148141  }
    149142
    150   api = heir->API_Extensions[ THREAD_API_RTEMS ];
    151   tvp = api->task_variables;
     143  tvp = heir->task_variables;
    152144  while (tvp) {
    153145    *tvp->ptr = tvp->var;
  • c/src/exec/rtems/src/taskvariableadd.c

    r987445b raad726e  
    3131  Thread_Control        *the_thread;
    3232  Objects_Locations      location;
    33   RTEMS_API_Control     *api;
    3433  rtems_task_variable_t *tvp, *new;
    3534
     
    4948
    5049  case OBJECTS_LOCAL:
    51     api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    5250
    5351    /*
     
    5553     */
    5654
    57     tvp = api->task_variables;
     55    tvp = the_thread->task_variables;
    5856    while (tvp) {
    5957      if (tvp->ptr == ptr) {
     
    7775    new->ptr = ptr;
    7876
    79     new->next = api->task_variables;
    80     api->task_variables = new;
     77    new->next = the_thread->task_variables;
     78    the_thread->task_variables = new;
    8179    _Thread_Enable_dispatch();
    8280    return RTEMS_SUCCESSFUL;
  • c/src/exec/rtems/src/taskvariabledelete.c

    r987445b raad726e  
    3131  Thread_Control        *the_thread;
    3232  Objects_Locations      location;
    33   RTEMS_API_Control     *api;
    3433  rtems_task_variable_t *tvp, *prev;
    3534
     
    5150
    5251  case OBJECTS_LOCAL:
    53     api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    54     tvp = api->task_variables;
     52    tvp = the_thread->task_variables;
    5553    while (tvp) {
    5654      if (tvp->ptr == ptr) {
    5755        if (prev) prev->next = tvp->next;
    58         else      api->task_variables = tvp->next;
     56        else      the_thread->task_variables = tvp->next;
    5957        _Thread_Enable_dispatch();
    6058        _Workspace_Free(tvp);
  • c/src/exec/score/include/rtems/score/thread.h

    r987445b raad726e  
    8686
    8787typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
     88
     89/*
     90 *  Per task variable structure
     91 */
     92
     93struct rtems_task_variable_tt;
     94
     95struct rtems_task_variable_tt {
     96  struct rtems_task_variable_tt  *next;
     97  int                            *ptr;
     98  int                             var;
     99};
     100
     101typedef struct rtems_task_variable_tt   rtems_task_variable_t;
    88102
    89103/*
     
    204218  void                                 *API_Extensions[ THREAD_API_LAST + 1 ];
    205219  void                                **extensions;
     220  rtems_task_variable_t                *task_variables;
    206221};
    207222
  • cpukit/rtems/include/rtems/rtems/tasks.h

    r987445b raad726e  
    148148
    149149/*
    150  *  Per task variable structure
    151  */
    152 
    153 struct rtems_task_variable_tt;
    154 
    155 struct rtems_task_variable_tt {
    156   struct rtems_task_variable_tt  *next;
    157   int                            *ptr;
    158   int                             var;
    159 };
    160 
    161 typedef struct rtems_task_variable_tt   rtems_task_variable_t;
    162 
    163 /*
    164150 *  This is the API specific information required by each thread for
    165151 *  the RTEMS API to function correctly.
     
    172158  rtems_event_set          event_condition;
    173159  ASR_Information          Signal;
    174   rtems_task_variable_t   *task_variables;
    175160}  RTEMS_API_Control;
    176161
  • cpukit/rtems/src/tasks.c

    r987445b raad726e  
    5757  api->pending_events = EVENT_SETS_NONE_PENDING;
    5858  _ASR_Initialize( &api->Signal );
    59   api->task_variables = NULL;
     59  created->task_variables = NULL;
    6060  return TRUE;
    6161}
     
    9595)
    9696{
    97   RTEMS_API_Control     *api;
    9897  rtems_task_variable_t *tvp, *next;
    9998
    100   api = executing->API_Extensions[ THREAD_API_RTEMS ];
    101 
    10299  /*
    103100   *  Free per task variable memory
    104101   */
    105102
    106   tvp = api->task_variables;
    107   api->task_variables = NULL;
     103  tvp = deleted->task_variables;
     104  deleted->task_variables = NULL;
    108105  while (tvp) {
    109106    next = tvp->next;
     
    116113   */
    117114
    118   (void) _Workspace_Free( api );
    119  
     115  (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] );
    120116  deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL;
    121117}
     
    133129)
    134130{
    135   RTEMS_API_Control     *api;
    136131  rtems_task_variable_t *tvp;
    137132
     
    140135   */
    141136
    142 
    143   api = executing->API_Extensions[ THREAD_API_RTEMS ];
    144   tvp = api->task_variables;
     137  tvp = executing->task_variables;
    145138  while (tvp) {
    146139    tvp->var = *tvp->ptr;
     
    148141  }
    149142
    150   api = heir->API_Extensions[ THREAD_API_RTEMS ];
    151   tvp = api->task_variables;
     143  tvp = heir->task_variables;
    152144  while (tvp) {
    153145    *tvp->ptr = tvp->var;
  • cpukit/rtems/src/taskvariableadd.c

    r987445b raad726e  
    3131  Thread_Control        *the_thread;
    3232  Objects_Locations      location;
    33   RTEMS_API_Control     *api;
    3433  rtems_task_variable_t *tvp, *new;
    3534
     
    4948
    5049  case OBJECTS_LOCAL:
    51     api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    5250
    5351    /*
     
    5553     */
    5654
    57     tvp = api->task_variables;
     55    tvp = the_thread->task_variables;
    5856    while (tvp) {
    5957      if (tvp->ptr == ptr) {
     
    7775    new->ptr = ptr;
    7876
    79     new->next = api->task_variables;
    80     api->task_variables = new;
     77    new->next = the_thread->task_variables;
     78    the_thread->task_variables = new;
    8179    _Thread_Enable_dispatch();
    8280    return RTEMS_SUCCESSFUL;
  • cpukit/rtems/src/taskvariabledelete.c

    r987445b raad726e  
    3131  Thread_Control        *the_thread;
    3232  Objects_Locations      location;
    33   RTEMS_API_Control     *api;
    3433  rtems_task_variable_t *tvp, *prev;
    3534
     
    5150
    5251  case OBJECTS_LOCAL:
    53     api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
    54     tvp = api->task_variables;
     52    tvp = the_thread->task_variables;
    5553    while (tvp) {
    5654      if (tvp->ptr == ptr) {
    5755        if (prev) prev->next = tvp->next;
    58         else      api->task_variables = tvp->next;
     56        else      the_thread->task_variables = tvp->next;
    5957        _Thread_Enable_dispatch();
    6058        _Workspace_Free(tvp);
  • cpukit/score/include/rtems/score/thread.h

    r987445b raad726e  
    8686
    8787typedef void (*Thread_CPU_budget_algorithm_callout )( Thread_Control * );
     88
     89/*
     90 *  Per task variable structure
     91 */
     92
     93struct rtems_task_variable_tt;
     94
     95struct rtems_task_variable_tt {
     96  struct rtems_task_variable_tt  *next;
     97  int                            *ptr;
     98  int                             var;
     99};
     100
     101typedef struct rtems_task_variable_tt   rtems_task_variable_t;
    88102
    89103/*
     
    204218  void                                 *API_Extensions[ THREAD_API_LAST + 1 ];
    205219  void                                **extensions;
     220  rtems_task_variable_t                *task_variables;
    206221};
    207222
Note: See TracChangeset for help on using the changeset viewer.