source: rtems/cpukit/rtems/src/taskrestart.c @ 7a39c88

Last change on this file since 7a39c88 was 7a39c88, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:47:18

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems.h, include/rtems/rtems/asr.h, include/rtems/rtems/attr.h, include/rtems/rtems/cache.h, include/rtems/rtems/clock.h, include/rtems/rtems/config.h, include/rtems/rtems/dpmem.h, include/rtems/rtems/event.h, include/rtems/rtems/eventmp.h, include/rtems/rtems/eventset.h, include/rtems/rtems/intr.h, include/rtems/rtems/message.h, include/rtems/rtems/modes.h, include/rtems/rtems/mp.h, include/rtems/rtems/msgmp.h, include/rtems/rtems/options.h, include/rtems/rtems/part.h, include/rtems/rtems/partmp.h, include/rtems/rtems/ratemon.h, include/rtems/rtems/region.h, include/rtems/rtems/regionmp.h, include/rtems/rtems/rtemsapi.h, include/rtems/rtems/sem.h, include/rtems/rtems/semmp.h, include/rtems/rtems/signal.h, include/rtems/rtems/signalmp.h, include/rtems/rtems/status.h, include/rtems/rtems/support.h, include/rtems/rtems/taskmp.h, include/rtems/rtems/tasks.h, include/rtems/rtems/timer.h, include/rtems/rtems/types.h, inline/rtems/rtems/asr.inl, inline/rtems/rtems/attr.inl, inline/rtems/rtems/dpmem.inl, inline/rtems/rtems/event.inl, inline/rtems/rtems/eventset.inl, inline/rtems/rtems/message.inl, inline/rtems/rtems/modes.inl, inline/rtems/rtems/options.inl, inline/rtems/rtems/part.inl, inline/rtems/rtems/ratemon.inl, inline/rtems/rtems/region.inl, inline/rtems/rtems/sem.inl, inline/rtems/rtems/status.inl, inline/rtems/rtems/support.inl, inline/rtems/rtems/tasks.inl, inline/rtems/rtems/timer.inl, macros/rtems/rtems/asr.inl, macros/rtems/rtems/attr.inl, macros/rtems/rtems/dpmem.inl, macros/rtems/rtems/event.inl, macros/rtems/rtems/eventset.inl, macros/rtems/rtems/message.inl, macros/rtems/rtems/modes.inl, macros/rtems/rtems/options.inl, macros/rtems/rtems/part.inl, macros/rtems/rtems/ratemon.inl, macros/rtems/rtems/region.inl, macros/rtems/rtems/sem.inl, macros/rtems/rtems/status.inl, macros/rtems/rtems/support.inl, macros/rtems/rtems/tasks.inl, macros/rtems/rtems/timer.inl, src/attr.c, src/clockget.c, src/clockset.c, src/clocktick.c, src/dpmem.c, src/dpmemcreate.c, src/dpmemdelete.c, src/dpmemexternal2internal.c, src/dpmemident.c, src/dpmeminternal2external.c, src/event.c, src/eventmp.c, src/eventreceive.c, src/eventseize.c, src/eventsend.c, src/eventsurrender.c, src/eventtimeout.c, src/intr.c, src/intrbody.c, src/intrcatch.c, src/mp.c, src/msg.c, src/msgmp.c, src/msgqallocate.c, src/msgqbroadcast.c, src/msgqcreate.c, src/msgqdelete.c, src/msgqflush.c, src/msgqgetnumberpending.c, src/msgqident.c, src/msgqreceive.c, src/msgqsend.c, src/msgqsubmit.c, src/msgqtranslatereturncode.c, src/msgqurgent.c, src/part.c, src/partcreate.c, src/partdelete.c, src/partgetbuffer.c, src/partident.c, src/partmp.c, src/partreturnbuffer.c, src/ratemon.c, src/ratemoncancel.c, src/ratemoncreate.c, src/ratemondelete.c, src/ratemongetstatus.c, src/ratemonident.c, src/ratemonperiod.c, src/ratemontimeout.c, src/region.c, src/regioncreate.c, src/regiondelete.c, src/regionextend.c, src/regiongetinfo.c, src/regiongetsegment.c, src/regiongetsegmentsize.c, src/regionident.c, src/regionmp.c, src/regionreturnsegment.c, src/rtclock.c, src/rtemstimer.c, src/sem.c, src/semcreate.c, src/semdelete.c, src/semflush.c, src/semident.c, src/semmp.c, src/semobtain.c, src/semrelease.c, src/semtranslatereturncode.c, src/signal.c, src/signalcatch.c, src/signalmp.c, src/signalsend.c, src/taskcreate.c, src/taskdelete.c, src/taskgetnote.c, src/taskident.c, src/taskinitusers.c, src/taskissuspended.c, src/taskmode.c, src/taskmp.c, src/taskrestart.c, src/taskresume.c, src/tasks.c, src/tasksetnote.c, src/tasksetpriority.c, src/taskstart.c, src/tasksuspend.c, src/taskvariableadd.c, src/taskvariabledelete.c, src/taskvariableget.c, src/taskwakeafter.c, src/taskwakewhen.c, src/timercancel.c, src/timercreate.c, src/timerdelete.c, src/timerfireafter.c, src/timerfirewhen.c, src/timergetinfo.c, src/timerident.c, src/timerreset.c, src/timerserver.c, src/timerserverfireafter.c, src/timerserverfirewhen.c: URL for license changed.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  RTEMS Task Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/rtems/status.h>
17#include <rtems/rtems/support.h>
18#include <rtems/rtems/modes.h>
19#include <rtems/score/object.h>
20#include <rtems/score/stack.h>
21#include <rtems/score/states.h>
22#include <rtems/rtems/tasks.h>
23#include <rtems/score/thread.h>
24#include <rtems/score/threadq.h>
25#include <rtems/score/tod.h>
26#include <rtems/score/userext.h>
27#include <rtems/score/wkspace.h>
28#include <rtems/score/apiext.h>
29#include <rtems/score/sysstate.h>
30
31/*PAGE
32 *
33 *  rtems_task_restart
34 *
35 *  This directive readies the specified thread.  It restores
36 *  the thread environment to the original values established
37 *  at thread creation and start time.  A thread can be restarted
38 *  from any state except the dormant state.
39 *
40 *  Input parameters:
41 *    id       - thread id
42 *    argument - thread argument
43 *
44 *  Output parameters:
45 *    RTEMS_SUCCESSFUL - if successful
46 *    error code        - if unsuccessful
47 */
48
49rtems_status_code rtems_task_restart(
50  Objects_Id id,
51  unsigned32 argument
52)
53{
54  register Thread_Control *the_thread;
55  Objects_Locations        location;
56
57  the_thread = _Thread_Get( id, &location );
58  switch ( location ) {
59
60    case OBJECTS_REMOTE:
61#if defined(RTEMS_MULTIPROCESSING)
62      _Thread_Dispatch();
63      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
64#endif
65
66    case OBJECTS_ERROR:
67      return RTEMS_INVALID_ID;
68
69    case OBJECTS_LOCAL:
70      if ( _Thread_Restart( the_thread, NULL, argument ) ) {
71        _Thread_Enable_dispatch();
72        return RTEMS_SUCCESSFUL;
73      }
74      _Thread_Enable_dispatch();
75      return RTEMS_INCORRECT_STATE;
76  }
77
78  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
79}
Note: See TracBrowser for help on using the repository browser.