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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [rtems/] [inline/] [rtems/] [rtems/] [tasks.inl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  tasks.inl
2
 *
3
 *  This file contains the static inline implementation of all inlined
4
 *  routines in the with RTEMS Tasks Manager.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  tasks.inl,v 1.12 1999/11/17 17:50:26 joel Exp
14
 */
15
 
16
#ifndef __RTEMS_TASKS_inl
17
#define __RTEMS_TASKS_inl
18
 
19
/*PAGE
20
 *
21
 *  _RTEMS_tasks_Allocate
22
 *
23
 *  DESCRIPTION:
24
 *
25
 *  This function allocates a task control block from
26
 *  the inactive chain of free task control blocks.
27
 */
28
 
29
RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void )
30
{
31
  return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information );
32
}
33
 
34
/*PAGE
35
 *
36
 *  _RTEMS_tasks_Free
37
 *
38
 *  DESCRIPTION:
39
 *
40
 *  This routine frees a task control block to the
41
 *  inactive chain of free task control blocks.
42
 */
43
 
44
RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free (
45
  Thread_Control *the_task
46
)
47
{
48
  _Objects_Free(
49
    _Objects_Get_information( the_task->Object.id ),
50
    &the_task->Object
51
  );
52
}
53
 
54
/*PAGE
55
 *
56
 *  _RTEMS_tasks_Priority_to_Core
57
 *
58
 *  DESCRIPTION:
59
 *
60
 *  This function converts an RTEMS API priority into a core priority.
61
 */
62
 
63
RTEMS_INLINE_ROUTINE Priority_Control _RTEMS_tasks_Priority_to_Core(
64
  rtems_task_priority   priority
65
)
66
{
67
  return (Priority_Control) priority;
68
}
69
 
70
/*PAGE
71
 *
72
 *  _RTEMS_tasks_Priority_is_valid
73
 *
74
 *  DESCRIPTION:
75
 *
76
 *  This function returns TRUE if the_priority is a valid user task priority
77
 *  and FALSE otherwise.
78
 */
79
 
80
RTEMS_INLINE_ROUTINE boolean _RTEMS_tasks_Priority_is_valid (
81
  rtems_task_priority the_priority
82
)
83
{
84
  return (  ( the_priority >= RTEMS_MINIMUM_PRIORITY ) &&
85
            ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) );
86
}
87
 
88
#endif
89
/* end of include file */

powered by: WebSVN 2.1.0

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