source: rtems/cpukit/rtems/src/taskresume.c @ c18e0ba

4.115
Last change on this file since c18e0ba was c18e0ba, checked in by Alex Ivanov <alexivanov97@…>, on 12/04/12 at 22:59:11

rtems misc: Clean up Doxygen GCI Task #4

http://www.google-melange.com/gci/task/view/google/gci2012/7950205

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Resume Task
5 *  @ingroup ClassicTasks
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/rtems/status.h>
23#include <rtems/rtems/support.h>
24#include <rtems/rtems/modes.h>
25#include <rtems/score/object.h>
26#include <rtems/score/stack.h>
27#include <rtems/score/states.h>
28#include <rtems/rtems/tasks.h>
29#include <rtems/score/thread.h>
30#include <rtems/score/threadq.h>
31#include <rtems/score/tod.h>
32#include <rtems/score/wkspace.h>
33#include <rtems/score/apiext.h>
34#include <rtems/score/sysstate.h>
35
36rtems_status_code rtems_task_resume(
37  rtems_id id
38)
39{
40  register Thread_Control *the_thread;
41  Objects_Locations        location;
42
43  the_thread = _Thread_Get( id, &location );
44  switch ( location ) {
45
46    case OBJECTS_LOCAL:
47      if ( _States_Is_suspended( the_thread->current_state ) ) {
48        _Thread_Resume( the_thread );
49        _Thread_Enable_dispatch();
50        return RTEMS_SUCCESSFUL;
51      }
52      _Thread_Enable_dispatch();
53      return RTEMS_INCORRECT_STATE;
54
55#if defined(RTEMS_MULTIPROCESSING)
56    case OBJECTS_REMOTE:
57      return _RTEMS_tasks_MP_Send_request_packet(
58          RTEMS_TASKS_MP_RESUME_REQUEST,
59          id,
60          0,          /* Not used */
61          0,          /* Not used */
62          0           /* Not used */
63        );
64#endif
65
66    case OBJECTS_ERROR:
67      break;
68  }
69
70  return RTEMS_INVALID_ID;
71}
Note: See TracBrowser for help on using the repository browser.