source: rtems/cpukit/rtems/include/rtems/rtems/dpmem.h @ 3235ad9

4.104.114.84.95
Last change on this file since 3235ad9 was 3235ad9, checked in by Joel Sherrill <joel.sherrill@…>, on 08/23/95 at 19:30:23

Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view.

Both inline and macro implementations were tested.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*  dpmem.h
2 *
3 *  This include file contains all the constants and structures associated
4 *  with the Dual Ported Memory Manager. This manager provides a mechanism
5 *  for converting addresses between internal and external representations
6 *  for multiple dual-ported memory areas.
7 *
8 *  Directives provided are:
9 *
10 *     + create a port
11 *     + get ID of a port
12 *     + delete a port
13 *     + convert external to internal address
14 *     + convert internal to external address
15 *
16 *
17 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
18 *  On-Line Applications Research Corporation (OAR).
19 *  All rights assigned to U.S. Government, 1994.
20 *
21 *  This material may be reproduced by or for the U.S. Government pursuant
22 *  to the copyright license under the clause at DFARS 252.227-7013.  This
23 *  notice must appear in all copies of this file and its derivatives.
24 *
25 *  $Id$
26 */
27
28#ifndef __RTEMS_DUAL_PORTED_MEMORY_h
29#define __RTEMS_DUAL_PORTED_MEMORY_h
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <rtems.h>
36#include <rtems/object.h>
37
38/*
39 *  The following structure defines the port control block.  Each port
40 *  has a control block associated with it.  This control block contains
41 *  all information required to support the port related operations.
42 */
43
44typedef struct {
45  Objects_Control  Object;
46  void            *internal_base; /* base internal address */
47  void            *external_base; /* base external address */
48  unsigned32       length;        /* length of dual-ported area */
49}   Dual_ported_memory_Control;
50
51/*
52 *  The following define the internal Dual Ported Memory information.
53 */
54
55EXTERN Objects_Information  _Dual_ported_memory_Information;
56
57/*
58 *  _Dual_ported_memory_Manager_initialization
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine performs the initialization necessary for this manager.
63 */
64
65void _Dual_ported_memory_Manager_initialization(
66  unsigned32 maximum_ports
67);
68
69/*
70 *  rtems_port_create
71 *
72 *  DESCRIPTION:
73 *
74 *  This routine implements the rtems_port_create directive.  The port
75 *  will have the name name.  The port maps onto an area of dual ported
76 *  memory of length bytes which has internal_start and external_start
77 *  as the internal and external starting addresses, respectively.
78 *  It returns the id of the created port in ID.
79 */
80
81rtems_status_code rtems_port_create(
82  rtems_name    name,
83  void         *internal_start,
84  void         *external_start,
85  unsigned32    length,
86  Objects_Id   *id
87);
88
89/*
90 *  rtems_port_ident
91 *
92 *  DESCRIPTION:
93 *
94 *  This routine implements the rtems_port_ident directive.  This directive
95 *  returns the port ID associated with name.  If more than one port is
96 *  named name, then the port to which the ID belongs is arbitrary.
97 */
98
99rtems_status_code rtems_port_ident(
100  rtems_name    name,
101  Objects_Id   *id
102);
103
104/*
105 *  rtems_port_delete
106 *
107 *  DESCRIPTION:
108 *
109 *  This routine implements the rtems_port_delete directive.  It deletes
110 *  the port associated with ID.
111 */
112
113rtems_status_code rtems_port_delete(
114  Objects_Id id
115);
116
117/*
118 *  rtems_port_external_to_internal
119 *
120 *  DESCRIPTION:
121 *
122 *  This routine implements the rtems_port_external_to_internal directive.
123 *  It returns the internal port address which maps to the provided
124 *  external port address for the specified port ID.
125 */
126
127rtems_status_code rtems_port_external_to_internal(
128  Objects_Id   id,
129  void        *external,
130  void       **internal
131);
132
133/*
134 *  rtems_port_internal_to_external
135 *
136 *  DESCRIPTION:
137 *
138 *  This routine implements the Port_internal_to_external directive.
139 *  It returns the external port address which maps to the provided
140 *  internal port address for the specified port ID.
141 */
142
143rtems_status_code rtems_port_internal_to_external(
144  Objects_Id   id,
145  void        *internal,
146  void       **external
147);
148
149/*
150 *  _Dual_ported_memory_Allocate
151 *
152 *  DESCRIPTION:
153 *
154 *  This routine allocates a port control block from the inactive chain
155 *  of free port control blocks.
156 */
157
158STATIC INLINE Dual_ported_memory_Control
159  *_Dual_ported_memory_Allocate ( void );
160
161/*
162 *  _Dual_ported_memory_Free
163 *
164 *  DESCRIPTION:
165 *
166 *  This routine frees a port control block to the inactive chain
167 *  of free port control blocks.
168 */
169
170STATIC INLINE void _Dual_ported_memory_Free (
171   Dual_ported_memory_Control *the_port
172);
173
174/*
175 *  _Dual_ported_memory_Get
176 *
177 *  DESCRIPTION:
178 *
179 *  This function maps port IDs to port control blocks.  If ID
180 *  corresponds to a local port, then it returns the_port control
181 *  pointer which maps to ID and location is set to OBJECTS_LOCAL.
182 *  Global ports are not supported, thus if ID  does not map to a
183 *  local port, location is set to OBJECTS_ERROR and the_port is
184 *  undefined.
185 */
186
187STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
188  Objects_Id         id,
189  Objects_Locations *location
190);
191
192/*
193 *  _Dual_ported_memory_Is_null
194 *
195 *  DESCRIPTION:
196 *
197 *  This function returns TRUE if the_port is NULL and FALSE otherwise.
198 */
199
200STATIC INLINE boolean _Dual_ported_memory_Is_null(
201  Dual_ported_memory_Control *the_port
202);
203
204#include <rtems/dpmem.inl>
205
206#ifdef __cplusplus
207}
208#endif
209
210#endif
211/* end of include file */
Note: See TracBrowser for help on using the repository browser.