OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [src/] [taskresume.c] - Blame information for rev 587

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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.OARcorp.com/rtems/license.html.
11
 *
12
 *  $Id: taskresume.c,v 1.2 2001-09-27 11:59:19 chris Exp $
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_resume
34
 *
35
 *  This directive will remove the specified thread
36
 *  from the suspended state.
37
 *
38
 *  Input parameters:
39
 *    id - thread id
40
 *
41
 *  Output parameters:
42
 *    RTEMS_SUCCESSFUL - if successful
43
 *    error code        - if unsuccessful
44
 */
45
 
46
rtems_status_code rtems_task_resume(
47
  Objects_Id id
48
)
49
{
50
  register Thread_Control *the_thread;
51
  Objects_Locations        location;
52
 
53
  the_thread = _Thread_Get( id, &location );
54
  switch ( location ) {
55
 
56
    case OBJECTS_REMOTE:
57
#if defined(RTEMS_MULTIPROCESSING)
58
      return _RTEMS_tasks_MP_Send_request_packet(
59
          RTEMS_TASKS_MP_RESUME_REQUEST,
60
          id,
61
          0,          /* Not used */
62
          0,          /* Not used */
63
 
64
        );
65
#endif
66
 
67
    case OBJECTS_ERROR:
68
      return RTEMS_INVALID_ID;
69
 
70
    case OBJECTS_LOCAL:
71
      if ( _States_Is_suspended( the_thread->current_state ) ) {
72
        _Thread_Resume( the_thread, TRUE );
73
        _Thread_Enable_dispatch();
74
        return RTEMS_SUCCESSFUL;
75
      }
76
      _Thread_Enable_dispatch();
77
      return RTEMS_INCORRECT_STATE;
78
  }
79
 
80
  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
81
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.