diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/src/taskvariableget.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/cpukit/rtems/src/taskvariableget.c b/cpukit/rtems/src/taskvariableget.c index 8b200f8779..fbe3b10d7f 100644 --- a/cpukit/rtems/src/taskvariableget.c +++ b/cpukit/rtems/src/taskvariableget.c @@ -44,37 +44,35 @@ rtems_status_code rtems_task_variable_get( the_thread = _Thread_Get (tid, &location); switch (location) { -#if defined(RTEMS_MULTIPROCESSING) - case OBJECTS_REMOTE: - _Thread_Dispatch(); - return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; -#endif - case OBJECTS_ERROR: - default: - return RTEMS_INVALID_ID; - - case OBJECTS_LOCAL: + case OBJECTS_LOCAL: + /* + * Figure out if the variable is in this task's list. + */ + tvp = the_thread->task_variables; + while (tvp) { + if (tvp->ptr == ptr) { + /* + * Should this return the current (i.e not the + * saved) value if `tid' is the current task? + */ + *result = tvp->tval; + _Thread_Enable_dispatch(); + return RTEMS_SUCCESSFUL; + } + tvp = (rtems_task_variable_t *)tvp->next; + } + _Thread_Enable_dispatch(); + return RTEMS_INVALID_ADDRESS; - /* - * Figure out if the variable is in this task's list. - */ +#if defined(RTEMS_MULTIPROCESSING) + case OBJECTS_REMOTE: + _Thread_Dispatch(); + return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif - tvp = the_thread->task_variables; - while (tvp) { - if (tvp->ptr == ptr) { - /* - * Should this return the current (i.e not the - * saved) value if `tid' is the current task? - */ - *result = tvp->tval; - _Thread_Enable_dispatch(); - return RTEMS_SUCCESSFUL; - } - tvp = (rtems_task_variable_t *)tvp->next; - } - _Thread_Enable_dispatch(); - return RTEMS_INVALID_ADDRESS; + case OBJECTS_ERROR: + break; } - return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ + return RTEMS_INVALID_ID; } |