diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 22:56:38 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-16 22:56:38 +0000 |
commit | aad726ebd45d0b25d62056639b0654fb74b1092e (patch) | |
tree | 5d2e1fb9a183ef0cad166dbe0c817de657e0105f /cpukit/rtems/src/tasks.c | |
parent | Added proper nesting level for dispatch disable check. (diff) | |
download | rtems-aad726ebd45d0b25d62056639b0654fb74b1092e.tar.bz2 |
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.
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/src/tasks.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index e05aecca3f..d49236cadf 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -56,7 +56,7 @@ boolean _RTEMS_tasks_Create_extension( api->pending_events = EVENT_SETS_NONE_PENDING; _ASR_Initialize( &api->Signal ); - api->task_variables = NULL; + created->task_variables = NULL; return TRUE; } @@ -94,17 +94,14 @@ User_extensions_routine _RTEMS_tasks_Delete_extension( Thread_Control *deleted ) { - RTEMS_API_Control *api; rtems_task_variable_t *tvp, *next; - api = executing->API_Extensions[ THREAD_API_RTEMS ]; - /* * Free per task variable memory */ - tvp = api->task_variables; - api->task_variables = NULL; + tvp = deleted->task_variables; + deleted->task_variables = NULL; while (tvp) { next = tvp->next; _Workspace_Free( tvp ); @@ -115,8 +112,7 @@ User_extensions_routine _RTEMS_tasks_Delete_extension( * Free API specific memory */ - (void) _Workspace_Free( api ); - + (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] ); deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL; } @@ -132,23 +128,19 @@ void _RTEMS_tasks_Switch_extension( Thread_Control *heir ) { - RTEMS_API_Control *api; rtems_task_variable_t *tvp; /* * Per Task Variables */ - - api = executing->API_Extensions[ THREAD_API_RTEMS ]; - tvp = api->task_variables; + tvp = executing->task_variables; while (tvp) { tvp->var = *tvp->ptr; tvp = tvp->next; } - api = heir->API_Extensions[ THREAD_API_RTEMS ]; - tvp = api->task_variables; + tvp = heir->task_variables; while (tvp) { *tvp->ptr = tvp->var; tvp = tvp->next; |