source: rtems/cpukit/itron/inline/rtems/itron/fmempool.inl @ ef49476

4.104.114.95
Last change on this file since ef49476 was ef49476, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/19/08 at 08:32:59

Add header guard to force indirect inclusion.

  • Property mode set to 100644
File size: 4.1 KB
Line 
1/**
2 * @file rtems/itron/fmempool.inl
3 */
4
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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _RTEMS_ITRON_FMEMPOOL_H
17# error "Never use <rtems/itron/fmempool.inl> directly; include <rtems/itron/fmempool.h> instead."
18#endif
19
20#ifndef _RTEMS_ITRON_FMEMPOOL_INL
21#define _RTEMS_ITRON_FMEMPOOL_INL
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
28 *  _ITRON_Fixed_memory_pool_Allocate
29 *
30 *  DESCRIPTION:
31 *
32 *  This routine allocates the fixed_memory_pool associated with the specified
33 *  fixed_memory_pool ID from the pool of inactive fixed_memory_pools.
34 *
35 *  Input parameters:
36 *    mpfid   - id of fixed_memory_pool to allocate
37 *    status  - pointer to status variable
38 *
39 *  Output parameters:
40 *    returns - pointer to the fixed_memory_pool control block
41 *    *status - status
42 */
43
44RTEMS_INLINE_ROUTINE ITRON_Fixed_memory_pool_Control
45 *_ITRON_Fixed_memory_pool_Allocate(
46  ID   mpfid
47)
48{
49  return (ITRON_Fixed_memory_pool_Control *)_ITRON_Objects_Allocate_by_index(
50    &_ITRON_Fixed_memory_pool_Information,
51    mpfid,
52    sizeof(ITRON_Fixed_memory_pool_Control)
53  );
54}
55
56/*
57 *  _ITRON_Fixed_memory_pool_Clarify_allocation_id_error
58 *
59 *  This function is invoked when an object allocation ID error
60 *  occurs to determine the specific ITRON error code to return.
61 */
62
63#define _ITRON_Fixed_memory_pool_Clarify_allocation_id_error( _id ) \
64  _ITRON_Objects_Clarify_allocation_id_error( \
65      &_ITRON_Fixed_memory_pool_Information, (_id) )
66
67/*
68 *  _ITRON_Fixed_memory_pool_Clarify_get_id_error
69 *
70 *  This function is invoked when an object get ID error
71 *  occurs to determine the specific ITRON error code to return.
72 */
73
74#define _ITRON_Fixed_memory_pool_Clarify_get_id_error( _id ) \
75 _ITRON_Objects_Clarify_get_id_error( \
76    &_ITRON_Fixed_memory_pool_Information, (_id) )
77
78/*
79 *  _ITRON_Fixed_memory_pool_Free
80 *
81 *  DESCRIPTION:
82 *
83 *  This routine frees a fixed_memory_pool control block to the
84 *  inactive chain of free fixed_memory_pool control blocks.
85 *
86 *  Input parameters:
87 *    the_fixed_memory_pool - pointer to fixed_memory_pool control block
88 *
89 *  Output parameters: NONE
90 */
91
92RTEMS_INLINE_ROUTINE void _ITRON_Fixed_memory_pool_Free (
93  ITRON_Fixed_memory_pool_Control *the_fixed_memory_pool
94)
95{
96  _ITRON_Objects_Free(
97    &_ITRON_Fixed_memory_pool_Information,
98    &the_fixed_memory_pool->Object
99  );
100}
101
102/*PAGE
103 *
104 *  _ITRON_Fixed_memory_pool_Get
105 *
106 *  DESCRIPTION:
107 *
108 *  This function maps fixed memory pool IDs to control blocks.
109 *  If ID corresponds to a local fixed memory pool, then it returns
110 *  the_fixed memory pool control pointer which maps to ID and location
111 *  is set to OBJECTS_LOCAL.  if the fixed memory pool ID is global and
112 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
113 *  and the fixed memory pool is undefined.  Otherwise, location is set
114 *  to OBJECTS_ERROR and the fixed memory pool is undefined.
115 *
116 *  Input parameters:
117 *    id            - ITRON fixed memory pool ID.
118 *    the_location  - pointer to a location variable
119 *
120 *  Output parameters:
121 *    *the_location  - location of the object
122 */
123
124RTEMS_INLINE_ROUTINE ITRON_Fixed_memory_pool_Control
125  *_ITRON_Fixed_memory_pool_Get (
126  ID                 id,
127  Objects_Locations *location
128)
129{
130  return (ITRON_Fixed_memory_pool_Control *)
131    _ITRON_Objects_Get( &_ITRON_Fixed_memory_pool_Information, id, location );
132}
133
134/*PAGE
135 *
136 *  _ITRON_Fixed_memory_pool_Is_null
137 *
138 *  This function returns TRUE if the_fixed_memory_pool is NULL
139 *  and FALSE otherwise.
140 *
141 *  Input parameters:
142 *    the_fixed_memory_pool - pointer to fixed_memory_pool control block
143 *
144 *  Output parameters:
145 *    TRUE  - if the_fixed_memory_pool is NULL
146 *    FALSE - otherwise
147 */
148
149RTEMS_INLINE_ROUTINE boolean _ITRON_Fixed_memory_pool_Is_null (
150  ITRON_Fixed_memory_pool_Control *the_fixed_memory_pool
151)
152{
153  return ( the_fixed_memory_pool == NULL );
154}
155
156/* 
157 *  XXX insert inline routines here
158 */
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif
165/* end of include file */
166
Note: See TracBrowser for help on using the repository browser.