source: rtems/doc/user/dpmem.t @ f68a8bf3

Last change on this file since f68a8bf3 was f68a8bf3, checked in by Glenn Humphrey <glenn.humphrey@…>, on 11/28/07 at 16:25:29

2007-11-28 Glenn Humphrey <glenn.humphrey@…>

  • user/clock.t, user/concepts.t, user/conf.t, user/datatypes.t, user/dpmem.t, user/fatal.t, user/init.t, user/mp.t, user/msg.t, user/part.t, user/region.t, user/rtmon.t, user/sem.t, user/task.t, user/timer.t: Corrected various errors in the documentation.
  • Property mode set to 100644
File size: 9.7 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2002.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Dual-Ported Memory Manager
10
11@cindex ports
12@cindex dual ported memory
13
14@section Introduction
15
16The dual-ported memory manager provides a mechanism
17for converting addresses between internal and external
18representations for multiple dual-ported memory areas (DPMA).
19The directives provided by the dual-ported memory manager are:
20
21@itemize @bullet
22@item @code{@value{DIRPREFIX}port_create} - Create a port
23@item @code{@value{DIRPREFIX}port_ident} - Get ID of a port
24@item @code{@value{DIRPREFIX}port_delete} - Delete a port
25@item @code{@value{DIRPREFIX}port_external_to_internal} - Convert external to internal address
26@item @code{@value{DIRPREFIX}port_internal_to_external} - Convert internal to external address
27@end itemize
28
29@section Background
30
31@cindex dual ported memory, definition
32@cindex external addresses, definition
33@cindex internal addresses, definition
34
35A dual-ported memory area (DPMA) is an contiguous
36block of RAM owned by a particular processor but which can be
37accessed by other processors in the system.  The owner accesses
38the memory using internal addresses, while other processors must
39use external addresses.  RTEMS defines a port as a particular
40mapping of internal and external addresses.
41
42There are two system configurations in which
43dual-ported memory is commonly found.  The first is
44tightly-coupled multiprocessor computer systems where the
45dual-ported memory is shared between all nodes and is used for
46inter-node communication.  The second configuration is computer
47systems with intelligent peripheral controllers.  These
48controllers typically utilize the DPMA for high-performance data
49transfers.
50
51@section Operations
52
53@subsection Creating a Port
54
55The @code{@value{DIRPREFIX}port_create} directive creates a port into a DPMA
56with the user-defined name.  The user specifies the association
57between internal and external representations for the port being
58created.  RTEMS allocates a Dual-Ported Memory Control Block
59(DPCB) from the DPCB free list to maintain the newly created
60DPMA.  RTEMS also generates a unique dual-ported memory port ID
61which is returned to the calling task.  RTEMS does not
62initialize the dual-ported memory area or access any memory
63within it.
64
65@subsection Obtaining Port IDs
66
67When a port is created, RTEMS generates a unique port
68ID and assigns it to the created port until it is deleted.  The
69port ID may be obtained by either of two methods.  First, as the
70result of an invocation of the
71@code{@value{DIRPREFIX}port_create} directive, the task
72ID is stored in a user provided location.  Second, the port ID
73may be obtained later using the
74@code{@value{DIRPREFIX}port_ident} directive.  The port
75ID is used by other dual-ported memory manager directives to
76access this port.
77
78@subsection Converting an Address
79
80The @code{@value{DIRPREFIX}port_external_to_internal} directive is used to
81convert an address from external to internal representation for
82the specified port. 
83The @code{@value{DIRPREFIX}port_internal_to_external} directive is
84used to convert an address from internal to external
85representation for the specified port.  If an attempt is made to
86convert an address which lies outside the specified DPMA, then
87the address to be converted will be returned.
88
89@subsection Deleting a DPMA Port
90
91A port can be removed from the system and returned to
92RTEMS with the @code{@value{DIRPREFIX}port_delete} directive.  When a port is deleted,
93its control block is returned to the DPCB free list.
94
95@section Directives
96
97This section details the dual-ported memory manager's
98directives.  A subsection is dedicated to each of this manager's
99directives and describes the calling sequence, related
100constants, usage, and status codes.
101
102@c
103@c
104@c
105@page
106@subsection PORT_CREATE - Create a port
107
108@cindex create a port
109
110@subheading CALLING SEQUENCE:
111
112@ifset is-C
113@findex rtems_port_create
114@example
115rtems_status_code rtems_port_create(
116  rtems_name  name,
117  void       *internal_start,
118  void       *external_start,
119  uint32_t    length,
120  rtems_id   *id
121);
122@end example
123@end ifset
124
125@ifset is-Ada
126@example
127procedure Port_Create (
128   Name           : in     RTEMS.Name;
129   Internal_Start : in     RTEMS.Address;
130   External_Start : in     RTEMS.Address;
131   Length         : in     RTEMS.Unsigned32;
132   ID             :    out RTEMS.ID;
133   Result         :    out RTEMS.Status_Codes
134);
135@end example
136@end ifset
137
138@subheading DIRECTIVE STATUS CODES:
139@code{@value{RPREFIX}SUCCESSFUL} - port created successfully@*
140@code{@value{RPREFIX}INVALID_NAME} - invalid task name@*
141@code{@value{RPREFIX}INVALID_ADDRESS} - address not on four byte boundary@*
142@code{@value{RPREFIX}INVALID_ADDRESS} - @code{id} is NULL@*
143@code{@value{RPREFIX}TOO_MANY} - too many DP memory areas created
144
145@subheading DESCRIPTION:
146
147This directive creates a port which resides on the
148local node for the specified DPMA.  The assigned port id is
149returned in id.  This port id is used as an argument to other
150dual-ported memory manager directives to convert addresses
151within this DPMA.
152
153For control and maintenance of the port, RTEMS
154allocates and initializes an DPCB from the DPCB free pool.  Thus
155memory from the dual-ported memory area is not used to store the
156DPCB.
157
158@subheading NOTES:
159
160The internal_address and external_address parameters
161must be on a four byte boundary.
162
163This directive will not cause the calling task to be
164preempted.
165
166@c
167@c
168@c
169@page
170@subsection PORT_IDENT - Get ID of a port
171
172@cindex get ID of a port
173@cindex obtain ID of a port
174
175@subheading CALLING SEQUENCE:
176
177@ifset is-C
178@findex rtems_port_ident
179@example
180rtems_status_code rtems_port_ident(
181  rtems_name  name,
182  rtems_id   *id
183);
184@end example
185@end ifset
186
187@ifset is-Ada
188@example
189procedure Port_Ident (
190   Name   : in     RTEMS.Name;
191   ID     :    out RTEMS.ID;
192   Result :    out RTEMS.Status_Codes
193);
194@end example
195@end ifset
196
197@subheading DIRECTIVE STATUS CODES:
198@code{@value{RPREFIX}SUCCESSFUL} - port identified successfully@*
199@code{@value{RPREFIX}INVALID_ADDRESS} - @code{id} is NULL@*
200@code{@value{RPREFIX}INVALID_NAME} - port name not found
201
202@subheading DESCRIPTION:
203
204This directive obtains the port id associated with
205the specified name to be acquired.  If the port name is not
206unique, then the port id will match one of the DPMAs with that
207name.  However, this port id is not guaranteed to correspond to
208the desired DPMA.  The port id is used to access this DPMA in
209other dual-ported memory area related directives.
210
211@subheading NOTES:
212
213This directive will not cause the running task to be
214preempted.
215
216@c
217@c
218@c
219@page
220@subsection PORT_DELETE - Delete a port
221
222@cindex delete a port
223
224@subheading CALLING SEQUENCE:
225
226@ifset is-C
227@findex rtems_port_delete
228@example
229rtems_status_code rtems_port_delete(
230  rtems_id id
231);
232@end example
233@end ifset
234
235@ifset is-Ada
236@example
237procedure Port_Delete (
238   ID     : in     RTEMS.ID;
239   Result :    out RTEMS.Status_Codes
240);
241@end example
242@end ifset
243
244@subheading DIRECTIVE STATUS CODES:
245@code{@value{RPREFIX}SUCCESSFUL} - port deleted successfully@*
246@code{@value{RPREFIX}INVALID_ID} - invalid port id
247
248@subheading DESCRIPTION:
249
250This directive deletes the dual-ported memory area
251specified by id.  The DPCB for the deleted dual-ported memory
252area is reclaimed by RTEMS.
253
254@subheading NOTES:
255
256This directive will not cause the calling task to be
257preempted.
258
259The calling task does not have to be the task that
260created the port.  Any local task that knows the port id can
261delete the port.
262
263@c
264@c
265@c
266@page
267@subsection PORT_EXTERNAL_TO_INTERNAL - Convert external to internal address
268
269@cindex convert external to internal address
270
271@subheading CALLING SEQUENCE:
272
273@ifset is-C
274@findex rtems_port_external_to_internal
275@example
276rtems_status_code rtems_port_external_to_internal(
277  rtems_id   id,
278  void      *external,
279  void     **internal
280);
281@end example
282@end ifset
283
284@ifset is-Ada
285@example
286procedure Port_External_To_Internal (
287   ID       : in     RTEMS.ID;
288   External : in     RTEMS.Address;
289   Internal :    out RTEMS.Address;
290   Result   :    out RTEMS.Status_Codes
291);
292@end example
293@end ifset
294
295@subheading DIRECTIVE STATUS CODES:
296@code{@value{RPREFIX}INVALID_ADDRESS} - @code{internal} is NULL@*
297@code{@value{RPREFIX}SUCCESSFUL} - successful conversion
298
299@subheading DESCRIPTION:
300
301This directive converts a dual-ported memory address
302from external to internal representation for the specified port.
303If the given external address is invalid for the specified
304port, then the internal address is set to the given external
305address.
306
307@subheading NOTES:
308
309This directive is callable from an ISR.
310
311This directive will not cause the calling task to be
312preempted.
313
314@c
315@c
316@c
317@page
318@subsection PORT_INTERNAL_TO_EXTERNAL - Convert internal to external address
319
320@cindex convert internal to external address
321
322@subheading CALLING SEQUENCE:
323
324@ifset is-C
325@findex rtems_port_internal_to_external
326@example
327rtems_status_code rtems_port_internal_to_external(
328  rtems_id   id,
329  void      *internal,
330  void     **external
331);
332@end example
333@end ifset
334
335@ifset is-Ada
336@example
337procedure Port_Internal_To_External (
338   ID       : in     RTEMS.ID;
339   Internal : in     RTEMS.Address;
340   External :    out RTEMS.Address;
341   Result   :    out RTEMS.Status_Codes
342);
343@end example
344@end ifset
345
346@subheading DIRECTIVE STATUS CODES:
347@code{@value{RPREFIX}INVALID_ADDRESS} - @code{external} is NULL@*
348@code{@value{RPREFIX}SUCCESSFUL} - successful conversion
349
350@subheading DESCRIPTION:
351
352This directive converts a dual-ported memory address
353from internal to external representation so that it can be
354passed to owner of the DPMA represented by the specified port.
355If the given internal address is an invalid dual-ported address,
356then the external address is set to the given internal address.
357
358@subheading NOTES:
359
360This directive is callable from an ISR.
361
362This directive will not cause the calling task to be
363preempted.
364
Note: See TracBrowser for help on using the repository browser.