summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/include/rtems/extensionimpl.h
blob: 50c15a6fa2b534afdf0ffea49dbc207d4ae2d841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
 * @file
 *
 * @ingroup ClassicUserExtensions
 *
 * @brief User Extensions API
 */

/*
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 */

#ifndef _RTEMS_EXTENSIONIMPL_H
#define _RTEMS_EXTENSIONIMPL_H

#include <rtems/extension.h>
#include <rtems/score/objectimpl.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef SAPI_EXT_EXTERN
#define SAPI_EXT_EXTERN extern
#endif

SAPI_EXT_EXTERN Objects_Information  _Extension_Information;

/**
 *  @brief Initialize extension manager.
 *
 *  This routine initializes all extension manager related data structures.
 */
void _Extension_Manager_initialization(void);

RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
{
  return (Extension_Control *) _Objects_Allocate( &_Extension_Information );
}

RTEMS_INLINE_ROUTINE void _Extension_Free (
  Extension_Control *the_extension
)
{
  _Objects_Free( &_Extension_Information, &the_extension->Object );
}

RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
  Objects_Id         id,
  Objects_Locations *location
)
{
  return (Extension_Control *)
    _Objects_Get( &_Extension_Information, id, location );
}

RTEMS_INLINE_ROUTINE bool _Extension_Is_null (
  Extension_Control *the_extension
)
{
  return ( the_extension == NULL );
}

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */