1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ClassicDPMEMImpl |
---|
5 | * |
---|
6 | * @brief Dual Ported Memory Manager Implementation |
---|
7 | */ |
---|
8 | |
---|
9 | /* COPYRIGHT (c) 1989-2008. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _RTEMS_RTEMS_DPMEM_INL |
---|
18 | #define _RTEMS_RTEMS_DPMEM_INL |
---|
19 | |
---|
20 | #include <rtems/rtems/dpmemdata.h> |
---|
21 | #include <rtems/score/objectimpl.h> |
---|
22 | |
---|
23 | #ifdef __cplusplus |
---|
24 | extern "C" { |
---|
25 | #endif |
---|
26 | |
---|
27 | /** |
---|
28 | * @defgroup ClassicDPMEMImpl Dual Ported Memory Manager Implementation |
---|
29 | * |
---|
30 | * @ingroup ClassicDPMEM |
---|
31 | * |
---|
32 | * @{ |
---|
33 | */ |
---|
34 | |
---|
35 | /** |
---|
36 | * @brief Define the internal Dual Ported Memory information |
---|
37 | * The following define the internal Dual Ported Memory information. |
---|
38 | */ |
---|
39 | extern Objects_Information _Dual_ported_memory_Information; |
---|
40 | |
---|
41 | /** |
---|
42 | * @brief Allocates a port control block from the inactive chain |
---|
43 | * of free port control blocks. |
---|
44 | * |
---|
45 | * This routine allocates a port control block from the inactive chain |
---|
46 | * of free port control blocks. |
---|
47 | */ |
---|
48 | RTEMS_INLINE_ROUTINE Dual_ported_memory_Control |
---|
49 | *_Dual_ported_memory_Allocate ( void ) |
---|
50 | { |
---|
51 | return (Dual_ported_memory_Control *) |
---|
52 | _Objects_Allocate( &_Dual_ported_memory_Information ); |
---|
53 | } |
---|
54 | |
---|
55 | /** |
---|
56 | * @brief Frees a port control block to the inactive chain |
---|
57 | * of free port control blocks. |
---|
58 | * |
---|
59 | * This routine frees a port control block to the inactive chain |
---|
60 | * of free port control blocks. |
---|
61 | */ |
---|
62 | RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free ( |
---|
63 | Dual_ported_memory_Control *the_port |
---|
64 | ) |
---|
65 | { |
---|
66 | _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object ); |
---|
67 | } |
---|
68 | |
---|
69 | RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get( |
---|
70 | Objects_Id id, |
---|
71 | ISR_lock_Context *lock_context |
---|
72 | ) |
---|
73 | { |
---|
74 | return (Dual_ported_memory_Control *) |
---|
75 | _Objects_Get( id, lock_context, &_Dual_ported_memory_Information ); |
---|
76 | } |
---|
77 | |
---|
78 | /**@}*/ |
---|
79 | |
---|
80 | #ifdef __cplusplus |
---|
81 | } |
---|
82 | #endif |
---|
83 | |
---|
84 | #endif /* _RTEMS_RTEMS_DPMEM_INL */ |
---|
85 | /* end of include file */ |
---|