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

Subversion Repositories or1k

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

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

Line No. Rev Author Line
1 1026 ivang
/*  sem.inl
2
 *
3
 *  This file contains the static inlin implementation of the inlined
4
 *  routines from the Semaphore 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
 *  sem.inl,v 1.9 2000/07/06 19:39:20 joel Exp
14
 */
15
 
16
#ifndef __SEMAPHORE_inl
17
#define __SEMAPHORE_inl
18
 
19
/*PAGE
20
 *
21
 *  _Semaphore_Allocate
22
 *
23
 *  DESCRIPTION:
24
 *
25
 *  This function allocates a semaphore control block from
26
 *  the inactive chain of free semaphore control blocks.
27
 */
28
 
29
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )
30
{
31
  return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );
32
}
33
 
34
/*PAGE
35
 *
36
 *  _Semaphore_Free
37
 *
38
 *  DESCRIPTION:
39
 *
40
 *  This routine frees a semaphore control block to the
41
 *  inactive chain of free semaphore control blocks.
42
 */
43
 
44
RTEMS_INLINE_ROUTINE void _Semaphore_Free (
45
  Semaphore_Control *the_semaphore
46
)
47
{
48
  _Objects_Free( &_Semaphore_Information, &the_semaphore->Object );
49
}
50
 
51
/*PAGE
52
 *
53
 *  _Semaphore_Get
54
 *
55
 *  DESCRIPTION:
56
 *
57
 *  This function maps semaphore IDs to semaphore control blocks.
58
 *  If ID corresponds to a local semaphore, then it returns
59
 *  the_semaphore control pointer which maps to ID and location
60
 *  is set to OBJECTS_LOCAL.  if the semaphore ID is global and
61
 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
62
 *  and the_semaphore is undefined.  Otherwise, location is set
63
 *  to OBJECTS_ERROR and the_semaphore is undefined.
64
 */
65
 
66
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
67
  Objects_Id         id,
68
  Objects_Locations *location
69
)
70
{
71
  return (Semaphore_Control *)
72
    _Objects_Get( &_Semaphore_Information, id, location );
73
}
74
 
75
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get_interrupt_disable (
76
  Objects_Id         id,
77
  Objects_Locations *location,
78
  ISR_Level         *level
79
)
80
{
81
  return (Semaphore_Control *)
82
    _Objects_Get_isr_disable( &_Semaphore_Information, id, location, level );
83
}
84
 
85
/*PAGE
86
 *
87
 *  _Semaphore_Is_null
88
 *
89
 *  DESCRIPTION:
90
 *
91
 *  This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
92
 */
93
 
94
RTEMS_INLINE_ROUTINE boolean _Semaphore_Is_null (
95
  Semaphore_Control *the_semaphore
96
)
97
{
98
  return ( the_semaphore == NULL );
99
}
100
 
101
#endif
102
/*  end of include file */

powered by: WebSVN 2.1.0

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