OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [itron/] [inline/] [rtems/] [itron/] [vmempool.inl] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  COPYRIGHT (c) 1989-1999.
3
 *  On-Line Applications Research Corporation (OAR).
4
 *
5
 *  The license and distribution terms for this file may be
6
 *  found in the file LICENSE in this distribution or at
7
 *  http://www.OARcorp.com/rtems/license.html.
8
 *
9
 *  $Id: vmempool.inl,v 1.2 2001-09-27 11:59:13 chris Exp $
10
 */
11
 
12
#ifndef __ITRON_VARIABLE_MEMORY_POOL_inl_
13
#define __ITRON_VARIABLE_MEMORY_POOL_inl_
14
 
15
#ifdef __cplusplus
16
extern "C" {
17
#endif
18
 
19
/*
20
 *  _ITRON_Variable_memory_pool_Allocate
21
 *
22
 *  DESCRIPTION:
23
 *
24
 *  This routine allocates the variable memory pool associated with
25
 *  the specified variable memory pool ID from the pool of inactive
26
 *  variable memory pools.
27
 *
28
 *  Input parameters:
29
 *    mplid   - id of variable memory pool to allocate
30
 *    status  - pointer to status variable
31
 *
32
 *  Output parameters:
33
 *    returns - pointer to the variable memory pool control block
34
 *    *status - status
35
 */
36
 
37
RTEMS_INLINE_ROUTINE ITRON_Variable_memory_pool_Control
38
  *_ITRON_Variable_memory_pool_Allocate(
39
  ID   mplid
40
)
41
{
42
  return (ITRON_Variable_memory_pool_Control *)_ITRON_Objects_Allocate_by_index(
43
    &_ITRON_Variable_memory_pool_Information,
44
    mplid,
45
    sizeof(ITRON_Variable_memory_pool_Control)
46
  );
47
}
48
 
49
/*
50
 *  _ITRON_Variable_memory_pool_Clarify_allocation_id_error
51
 *
52
 *  This function is invoked when an object allocation ID error
53
 *  occurs to determine the specific ITRON error code to return.
54
 */
55
 
56
#define _ITRON_Variable_memory_pool_Clarify_allocation_id_error( _id ) \
57
  _ITRON_Objects_Clarify_allocation_id_error( \
58
      &_ITRON_Variable_memory_pool_Information, (_id) )
59
 
60
/*
61
 *  _ITRON_Variable_memory_pool_Clarify_get_id_error
62
 *
63
 *  This function is invoked when an object get ID error
64
 *  occurs to determine the specific ITRON error code to return.
65
 */
66
 
67
#define _ITRON_Variable_memory_pool_Clarify_get_id_error( _id ) \
68
 _ITRON_Objects_Clarify_get_id_error( &_ITRON_Variable_memory_pool_Information, (_id) )
69
 
70
/*
71
 *  _ITRON_Variable_memory_pool_Free
72
 *
73
 *  DESCRIPTION:
74
 *
75
 *  This routine frees a variable memory pool control block to the
76
 *  inactive chain of free variable memory pool control blocks.
77
 *
78
 *  Input parameters:
79
 *    the_variable_memory_pool - pointer to variable memory pool control block
80
 *
81
 *  Output parameters: NONE
82
 */
83
 
84
RTEMS_INLINE_ROUTINE void _ITRON_Variable_memory_pool_Free (
85
  ITRON_Variable_memory_pool_Control *the_variable_memory_pool
86
)
87
{
88
  _ITRON_Objects_Free(
89
    &_ITRON_Variable_memory_pool_Information,
90
    &the_variable_memory_pool->Object
91
  );
92
}
93
 
94
/*PAGE
95
 *
96
 *  _ITRON_Variable_memory_pool_Get
97
 *
98
 *  DESCRIPTION:
99
 *
100
 *  This function maps variable memory pool IDs to variable memory pool
101
 *  control blocks.  If ID corresponds to a local variable memory pool,
102
 *  then it returns the variable memory pool control pointer which maps
103
 *  to ID and location is set to OBJECTS_LOCAL.  if the variable memory
104
 *  pool ID is global and resides on a remote node, then location is set
105
 *  to OBJECTS_REMOTE, and the variable memory pool is undefined.  Otherwise,
106
 *  location is set to OBJECTS ERROR and the variable memory pool is undefined.
107
 *
108
 *  Input parameters:
109
 *    id            - ITRON variable memory pool ID.
110
 *    the_location  - pointer to a location variable
111
 *
112
 *  Output parameters:
113
 *    *the_location  - location of the object
114
 */
115
 
116
RTEMS_INLINE_ROUTINE ITRON_Variable_memory_pool_Control
117
  *_ITRON_Variable_memory_pool_Get (
118
  ID                 id,
119
  Objects_Locations *location
120
)
121
{
122
  return (ITRON_Variable_memory_pool_Control *) _ITRON_Objects_Get(
123
    &_ITRON_Variable_memory_pool_Information,
124
    id,
125
    location
126
  );
127
}
128
 
129
/*PAGE
130
 *
131
 *  _ITRON_Variable_memory_pool_Is_null
132
 *
133
 *  This function returns TRUE if the_variable_memory_pool is NULL
134
 *  and FALSE otherwise.
135
 *
136
 *  Input parameters:
137
 *    the_variable_memory_pool - pointer to variable memory pool control block
138
 *
139
 *  Output parameters:
140
 *    TRUE  - if the_variable_memory_pool is NULL
141
 *    FALSE - otherwise
142
 */
143
 
144
RTEMS_INLINE_ROUTINE boolean _ITRON_Variable_memory_pool_Is_null (
145
  ITRON_Variable_memory_pool_Control *the_variable_memory_pool
146
)
147
{
148
  return ( the_variable_memory_pool == NULL );
149
}
150
 
151
/*
152
 *  XXX insert inline routines here
153
 */
154
 
155
#ifdef __cplusplus
156
}
157
#endif
158
 
159
#endif
160
/* end of include file */
161
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.