1 | /* extension.h |
---|
2 | * |
---|
3 | * This include file contains all the constants, structures, and |
---|
4 | * prototypes associated with the User Extension Manager. This manager |
---|
5 | * provides a mechanism for manipulating sets of user-defined extensions. |
---|
6 | * |
---|
7 | * Directives provided are: |
---|
8 | * |
---|
9 | * + create user extension set |
---|
10 | * + get ID of user extension set |
---|
11 | * + delete user extension set |
---|
12 | * |
---|
13 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
14 | * On-Line Applications Research Corporation (OAR). |
---|
15 | * All rights assigned to U.S. Government, 1994. |
---|
16 | * |
---|
17 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
18 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
19 | * notice must appear in all copies of this file and its derivatives. |
---|
20 | * |
---|
21 | * $Id$ |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef __RTEMS_EXTENSION_MANAGER_h |
---|
25 | #define __RTEMS_EXTENSION_MANAGER_h |
---|
26 | |
---|
27 | #ifdef __cplusplus |
---|
28 | extern "C" { |
---|
29 | #endif |
---|
30 | |
---|
31 | #include <rtems/object.h> |
---|
32 | #include <rtems/userext.h> |
---|
33 | |
---|
34 | /* |
---|
35 | * The following defines the information control block used to manage |
---|
36 | * this class of objects. |
---|
37 | */ |
---|
38 | |
---|
39 | EXTERN Objects_Information _Extension_Information; |
---|
40 | |
---|
41 | /* |
---|
42 | * The following records define the control block used to manage |
---|
43 | * each extension. |
---|
44 | */ |
---|
45 | |
---|
46 | typedef struct { |
---|
47 | Objects_Control Object; |
---|
48 | User_extensions_Control Extension; |
---|
49 | } Extension_Control; |
---|
50 | |
---|
51 | /* |
---|
52 | * _Extension_Manager_initialization |
---|
53 | * |
---|
54 | * DESCRIPTION: |
---|
55 | * |
---|
56 | * This routine performs the initialization necessary for this manager. |
---|
57 | */ |
---|
58 | |
---|
59 | void _Extension_Manager_initialization( |
---|
60 | unsigned32 maximum_extensions |
---|
61 | ); |
---|
62 | |
---|
63 | /* |
---|
64 | * rtems_extension_create |
---|
65 | * |
---|
66 | * DESCRIPTION: |
---|
67 | * |
---|
68 | * This routine implements the rtems_extension_create directive. The |
---|
69 | * extension will have the name name. The entry points of the |
---|
70 | * routines which constitute this extension set are in EXTENSION_TABLE. |
---|
71 | * It returns the id of the created extension in ID. |
---|
72 | */ |
---|
73 | |
---|
74 | rtems_status_code rtems_extension_create( |
---|
75 | Objects_Name name, |
---|
76 | rtems_extensions_table *extension_table, |
---|
77 | Objects_Id *id |
---|
78 | ); |
---|
79 | |
---|
80 | /* |
---|
81 | * rtems_extension_ident |
---|
82 | * |
---|
83 | * DESCRIPTION: |
---|
84 | * |
---|
85 | * This routine implements the rtems_extension_ident directive. |
---|
86 | * This directive returns the extension ID associated with name. |
---|
87 | * If more than one extension is named name, then the extension |
---|
88 | * to which the ID belongs is arbitrary. |
---|
89 | */ |
---|
90 | |
---|
91 | rtems_status_code rtems_extension_ident( |
---|
92 | Objects_Name name, |
---|
93 | Objects_Id *id |
---|
94 | ); |
---|
95 | |
---|
96 | /* |
---|
97 | * rtems_extension_delete |
---|
98 | * |
---|
99 | * DESCRIPTION: |
---|
100 | * |
---|
101 | * This routine implements the rtems_extension_delete directive. The |
---|
102 | * extension indicated by ID is deleted. |
---|
103 | */ |
---|
104 | |
---|
105 | rtems_status_code rtems_extension_delete( |
---|
106 | Objects_Id id |
---|
107 | ); |
---|
108 | |
---|
109 | /* |
---|
110 | * _Extension_Allocate |
---|
111 | * |
---|
112 | * DESCRIPTION: |
---|
113 | * |
---|
114 | * This function allocates a extension control block from |
---|
115 | * the inactive chain of free extension control blocks. |
---|
116 | */ |
---|
117 | |
---|
118 | STATIC INLINE Extension_Control *_Extension_Allocate( void ); |
---|
119 | |
---|
120 | /* |
---|
121 | * _Extension_Free |
---|
122 | * |
---|
123 | * DESCRIPTION: |
---|
124 | * |
---|
125 | * This routine frees a extension control block to the |
---|
126 | * inactive chain of free extension control blocks. |
---|
127 | */ |
---|
128 | |
---|
129 | STATIC INLINE void _Extension_Free ( |
---|
130 | Extension_Control *the_extension |
---|
131 | ); |
---|
132 | |
---|
133 | /* |
---|
134 | * _Extension_Get |
---|
135 | * |
---|
136 | * DESCRIPTION: |
---|
137 | * |
---|
138 | * This function maps extension IDs to extension control blocks. |
---|
139 | * If ID corresponds to a local extension, then it returns |
---|
140 | * the extension control pointer which maps to ID and location |
---|
141 | * is set to OBJECTS_LOCAL. Otherwise, location is set |
---|
142 | * to OBJECTS_ERROR and the returned value is undefined. |
---|
143 | */ |
---|
144 | |
---|
145 | STATIC INLINE Extension_Control *_Extension_Get ( |
---|
146 | Objects_Id id, |
---|
147 | Objects_Locations *location |
---|
148 | ); |
---|
149 | |
---|
150 | /* |
---|
151 | * _Extension_Is_null |
---|
152 | * |
---|
153 | * DESCRIPTION: |
---|
154 | * |
---|
155 | * This function returns TRUE if the_extension is NULL and FALSE otherwise. |
---|
156 | */ |
---|
157 | |
---|
158 | STATIC INLINE boolean _Extension_Is_null( |
---|
159 | Extension_Control *the_extension |
---|
160 | ); |
---|
161 | |
---|
162 | #include <rtems/extension.inl> |
---|
163 | |
---|
164 | #ifdef __cplusplus |
---|
165 | } |
---|
166 | #endif |
---|
167 | |
---|
168 | #endif |
---|
169 | /* end of include file */ |
---|