OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [itron/] [src/] [sus_tsk.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  COPYRIGHT (c) 1989-1999.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *
5
 *  The license and distribution terms for this file may be
6
 *  found in the file LICENSE in this distribution or at
7
 *  http://www.OARcorp.com/rtems/license.html.
8
 *
9
 *  $Id: sus_tsk.c,v 1.2 2001-09-27 11:59:13 chris Exp $
10
 */
11
 
12
#include <limits.h>
13
#include <itron.h>
14
 
15
#include <rtems/score/thread.h>
16
#include <rtems/score/userext.h>
17
#include <rtems/score/wkspace.h>
18
#include <rtems/score/apiext.h>
19
#include <rtems/score/sysstate.h>
20
 
21
#include <rtems/itron/task.h>
22
 
23
 
24
/*
25
 *  Task-Dependent Synchronization Functions
26
 */
27
 
28
/*
29
 *  sus_tsk - Suspend Other Task
30
 */
31
 
32
ER sus_tsk(
33
  ID tskid
34
)
35
{
36
  register Thread_Control *the_thread;
37
  Objects_Locations        location;
38
 
39
  the_thread = _ITRON_Task_Get( tskid, &location );
40
  switch ( location ) {
41
    case OBJECTS_REMOTE:
42
    case OBJECTS_ERROR:
43
      return _ITRON_Task_Clarify_get_id_error( tskid );
44
 
45
    case OBJECTS_LOCAL:
46
 
47
      if ( _Thread_Is_executing( the_thread ) )
48
        _ITRON_return_errorno( E_OBJ );
49
 
50
      if (the_thread->suspend_count == INT_MAX )
51
        _ITRON_return_errorno( E_QOVR );
52
 
53
      _Thread_Suspend( the_thread );
54
      break;
55
  }
56
 
57
  _ITRON_return_errorno( E_OK );
58
}
59
 
60
 
61
 
62
 
63
 
64
 
65
 

powered by: WebSVN 2.1.0

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