source: rtems/c/src/exec/rtems/inline/region.inl @ 1a8fde6c

4.104.114.84.95
Last change on this file since 1a8fde6c was 1a8fde6c, checked in by Joel Sherrill <joel.sherrill@…>, on 03/06/96 at 21:34:57

Removed prototyes for static inline routines and moved the comments into
the inline implementation. The impetus for this was twofold. First,
it is incorrect to have static inline prototypes when using the macro
implementation. Second, this reduced the number of lines in the include
files seen by rtems.h by about 2000 lines.

Next we restricted visibility for the inline routines to inside the
executive itself EXCEPT for a handful of objects. This reduced the
number of include files included by rtems.h by 40 files and reduced
the lines in the include files seen by rtems.h by about 6000 lines.

In total, these reduced the compile time of the entire RTEMS tree by 20%.
This results in about 8 minutes savings on the SparcStation? 10 morgana.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*  region.inl
2 *
3 *  This file contains the macro implementation of the inlined
4 *  routines from the Region Manager.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __REGION_inl
18#define __REGION_inl
19
20/*PAGE
21 *
22 *  _Region_Allocate
23 *
24 *  DESCRIPTION:
25 *
26 *  This function allocates a region control block from
27 *  the inactive chain of free region control blocks.
28 */
29
30STATIC INLINE Region_Control *_Region_Allocate( void )
31{
32  return (Region_Control *) _Objects_Allocate( &_Region_Information );
33}
34
35/*PAGE
36 *
37 *  _Region_Free
38 *
39 *  DESCRIPTION:
40 *
41 *  This routine frees a region control block to the
42 *  inactive chain of free region control blocks.
43 */
44
45STATIC INLINE void _Region_Free (
46  Region_Control *the_region
47)
48{
49  _Objects_Free( &_Region_Information, &the_region->Object );
50}
51
52/*PAGE
53 *
54 *  _Region_Get
55 *
56 *  DESCRIPTION:
57 *
58 *  This function maps region IDs to region control blocks.
59 *  If ID corresponds to a local region, then it returns
60 *  the_region control pointer which maps to ID and location
61 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
62 *  to OBJECTS_ERROR and the_region is undefined.
63 */
64
65STATIC INLINE Region_Control *_Region_Get (
66  Objects_Id         id,
67  Objects_Locations *location
68)
69{
70  return (Region_Control *)
71    _Objects_Get( &_Region_Information, id, location );
72}
73
74/*PAGE
75 *
76 *  _Region_Allocate_segment
77 *
78 *  DESCRIPTION:
79 *
80 *  This function attempts to allocate a segment from the_region.
81 *  If successful, it returns the address of the allocated segment.
82 *  Otherwise, it returns NULL.
83 */
84
85STATIC INLINE void *_Region_Allocate_segment (
86  Region_Control *the_region,
87  unsigned32      size
88)
89{
90   return _Heap_Allocate( &the_region->Memory, size );
91}
92
93/*PAGE
94 *
95 *  _Region_Free_segment
96 *
97 *  DESCRIPTION:
98 *
99 *  This function frees the_segment to the_region.
100 */
101
102STATIC INLINE boolean _Region_Free_segment (
103  Region_Control *the_region,
104  void           *the_segment
105)
106{
107  return _Heap_Free( &the_region->Memory, the_segment );
108}
109
110/*PAGE
111 *
112 *  _Region_Is_null
113 *
114 *  DESCRIPTION:
115 *
116 *  This function returns TRUE if the_region is NULL and FALSE otherwise.
117 */
118
119STATIC INLINE boolean _Region_Is_null (
120  Region_Control *the_region
121)
122{
123  return ( the_region == NULL  );
124}
125
126#endif
127/* end of include file */
Note: See TracBrowser for help on using the repository browser.