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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [inline/] [rtems/] [rtems/] [dpmem.inl] - Blame information for rev 30

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

Line No. Rev Author Line
1 30 unneback
/*  inline/dpmem.inl
2
 *
3
 *  This include file contains the inline routine used in conjunction
4
 *  with the Dual Ported Memory 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
 *  $Id: dpmem.inl,v 1.2 2001-09-27 11:59:18 chris Exp $
14
 */
15
 
16
#ifndef __INLINE_DPMEM_inl
17
#define __INLINE_DPMEM_inl
18
 
19
 
20
/*PAGE
21
 *
22
 *  _Dual_ported_memory_Allocate
23
 *
24
 *  DESCRIPTION:
25
 *
26
 *  This routine allocates a port control block from the inactive chain
27
 *  of free port control blocks.
28
 */
29
 
30
RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
31
   *_Dual_ported_memory_Allocate ( void )
32
{
33
  return (Dual_ported_memory_Control *)
34
     _Objects_Allocate( &_Dual_ported_memory_Information );
35
}
36
 
37
/*PAGE
38
 *
39
 *  _Dual_ported_memory_Free
40
 *
41
 *  DESCRIPTION:
42
 *
43
 *  This routine frees a port control block to the inactive chain
44
 *  of free port control blocks.
45
 */
46
 
47
RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
48
   Dual_ported_memory_Control *the_port
49
)
50
{
51
  _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
52
}
53
 
54
/*PAGE
55
 *
56
 *  _Dual_ported_memory_Get
57
 *
58
 *  DESCRIPTION:
59
 *
60
 *  This function maps port IDs to port control blocks.  If ID
61
 *  corresponds to a local port, then it returns the_port control
62
 *  pointer which maps to ID and location is set to OBJECTS_LOCAL.
63
 *  Global ports are not supported, thus if ID  does not map to a
64
 *  local port, location is set to OBJECTS_ERROR and the_port is
65
 *  undefined.
66
 */
67
 
68
RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
69
  Objects_Id         id,
70
  Objects_Locations *location
71
)
72
{
73
  return (Dual_ported_memory_Control *)
74
     _Objects_Get( &_Dual_ported_memory_Information, id, location );
75
}
76
 
77
/*PAGE
78
 *
79
 *  _Dual_ported_memory_Is_null
80
 *
81
 *  DESCRIPTION:
82
 *
83
 *  This function returns TRUE if the_port is NULL and FALSE otherwise.
84
 */
85
 
86
RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
87
  Dual_ported_memory_Control *the_port
88
)
89
{
90
  return ( the_port == NULL );
91
}
92
 
93
#endif
94
/* end of include file */

powered by: WebSVN 2.1.0

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