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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [itron/] [src/] [sus_tsk.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  sus_tsk.c,v 1.7 2001/01/24 14:15:04 joel Exp
10
 */
11
 
12
#if HAVE_CONFIG_H
13
#include "config.h"
14
#endif
15
 
16
#include <limits.h>
17
#include <itron.h>
18
 
19
#include <rtems/score/thread.h>
20
#include <rtems/score/userext.h>
21
#include <rtems/score/wkspace.h>
22
#include <rtems/score/apiext.h>
23
#include <rtems/score/sysstate.h>
24
 
25
#include <rtems/itron/task.h>
26
 
27
 
28
/*
29
 *  Task-Dependent Synchronization Functions
30
 */
31
 
32
/*
33
 *  sus_tsk - Suspend Other Task
34
 */
35
 
36
ER sus_tsk(
37
  ID tskid
38
)
39
{
40
  register Thread_Control *the_thread;
41
  Objects_Locations        location;
42
 
43
  the_thread = _ITRON_Task_Get( tskid, &location );
44
  switch ( location ) {
45
    case OBJECTS_REMOTE:
46
    case OBJECTS_ERROR:
47
      return _ITRON_Task_Clarify_get_id_error( tskid );
48
 
49
    case OBJECTS_LOCAL:
50
 
51
      if ( _Thread_Is_executing( the_thread ) )
52
        _ITRON_return_errorno( E_OBJ );
53
 
54
      if (the_thread->suspend_count == INT_MAX )
55
        _ITRON_return_errorno( E_QOVR );
56
 
57
      _Thread_Suspend( the_thread );
58
      break;
59
  }
60
 
61
  _ITRON_return_errorno( E_OK );
62
}
63
 
64
 
65
 
66
 
67
 
68
 
69
 

powered by: WebSVN 2.1.0

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