source: rtems/c/src/exec/rtems/inline/dpmem.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.2 KB
Line 
1/*  inline/dpmem.inl
2 *
3 *  This include file contains the inline routine used in conjunction
4 *  with the Dual Ported Memory 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 __INLINE_DPMEM_inl
18#define __INLINE_DPMEM_inl
19
20
21/*PAGE
22 *
23 *  _Dual_ported_memory_Allocate
24 *
25 *  DESCRIPTION:
26 *
27 *  This routine allocates a port control block from the inactive chain
28 *  of free port control blocks.
29 */
30
31STATIC INLINE Dual_ported_memory_Control
32   *_Dual_ported_memory_Allocate ( void )
33{
34  return (Dual_ported_memory_Control *)
35     _Objects_Allocate( &_Dual_ported_memory_Information );
36}
37
38/*PAGE
39 *
40 *  _Dual_ported_memory_Free
41 *
42 *  DESCRIPTION:
43 *
44 *  This routine frees a port control block to the inactive chain
45 *  of free port control blocks.
46 */
47
48STATIC INLINE void _Dual_ported_memory_Free (
49   Dual_ported_memory_Control *the_port
50)
51{
52  _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object );
53}
54
55/*PAGE
56 *
57 *  _Dual_ported_memory_Get
58 *
59 *  DESCRIPTION:
60 *
61 *  This function maps port IDs to port control blocks.  If ID
62 *  corresponds to a local port, then it returns the_port control
63 *  pointer which maps to ID and location is set to OBJECTS_LOCAL.
64 *  Global ports are not supported, thus if ID  does not map to a
65 *  local port, location is set to OBJECTS_ERROR and the_port is
66 *  undefined.
67 */
68
69STATIC INLINE Dual_ported_memory_Control *_Dual_ported_memory_Get (
70  Objects_Id         id,
71  Objects_Locations *location
72)
73{
74  return (Dual_ported_memory_Control *)
75     _Objects_Get( &_Dual_ported_memory_Information, id, location );
76}
77
78/*PAGE
79 *
80 *  _Dual_ported_memory_Is_null
81 *
82 *  DESCRIPTION:
83 *
84 *  This function returns TRUE if the_port is NULL and FALSE otherwise.
85 */
86
87STATIC INLINE boolean _Dual_ported_memory_Is_null(
88  Dual_ported_memory_Control *the_port
89)
90{
91  return ( the_port == NULL );
92}
93
94#endif
95/* end of include file */
Note: See TracBrowser for help on using the repository browser.