source: rtems/cpukit/rtems/inline/rtems/rtems/dpmem.inl @ 98e4ebf5

4.104.114.84.95
Last change on this file since 98e4ebf5 was 98e4ebf5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/97 at 15:45:54

Fixed typo in the pointer to the license terms.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*  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-1997.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __INLINE_DPMEM_inl
18#define __INLINE_DPMEM_inl
19
20
21/*PAGE
22 *
23 *  _Dual_ported_memory_Allocate
24 *
25 *  DESCRIPTION:
26 *
27 *  This routine allocates a port control block from the inactive chain
28 *  of free port control blocks.
29 */
30
31RTEMS_INLINE_ROUTINE Dual_ported_memory_Control
32   *_Dual_ported_memory_Allocate ( void )
33{
34  return (Dual_ported_memory_Control *)
35     _Objects_Allocate( &_Dual_ported_memory_Information );
36}
37
38/*PAGE
39 *
40 *  _Dual_ported_memory_Free
41 *
42 *  DESCRIPTION:
43 *
44 *  This routine frees a port control block to the inactive chain
45 *  of free port control blocks.
46 */
47
48RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free (
49   Dual_ported_memory_Control *the_port
50)
51{
52  _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
53}
54
55/*PAGE
56 *
57 *  _Dual_ported_memory_Get
58 *
59 *  DESCRIPTION:
60 *
61 *  This function maps port IDs to port control blocks.  If ID
62 *  corresponds to a local port, then it returns the_port control
63 *  pointer which maps to ID and location is set to OBJECTS_LOCAL.
64 *  Global ports are not supported, thus if ID  does not map to a
65 *  local port, location is set to OBJECTS_ERROR and the_port is
66 *  undefined.
67 */
68
69RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
70  Objects_Id         id,
71  Objects_Locations *location
72)
73{
74  return (Dual_ported_memory_Control *)
75     _Objects_Get( &_Dual_ported_memory_Information, id, location );
76}
77
78/*PAGE
79 *
80 *  _Dual_ported_memory_Is_null
81 *
82 *  DESCRIPTION:
83 *
84 *  This function returns TRUE if the_port is NULL and FALSE otherwise.
85 */
86
87RTEMS_INLINE_ROUTINE boolean _Dual_ported_memory_Is_null(
88  Dual_ported_memory_Control *the_port
89)
90{
91  return ( the_port == NULL );
92}
93
94#endif
95/* end of include file */
Note: See TracBrowser for help on using the repository browser.