source: rtems/c/src/exec/sapi/headers/extension.h @ c64e4ed4

4.104.114.84.95
Last change on this file since c64e4ed4 was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 4.7 KB
Line 
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
28extern "C" {
29#endif
30
31#include <rtems/score/object.h>
32#include <rtems/score/userext.h>
33#include <rtems/rtems/status.h>  /* XXX */
34#include <rtems/rtems/types.h>  /* XXX */
35
36/*
37 *  Extension related types
38 */
39
40typedef User_extensions_routine                   rtems_extension;
41typedef User_extensions_thread_create_extension   rtems_task_create_extension;
42typedef User_extensions_thread_delete_extension   rtems_task_delete_extension;
43typedef User_extensions_thread_start_extension    rtems_task_start_extension;
44typedef User_extensions_thread_restart_extension  rtems_task_restart_extension;
45typedef User_extensions_thread_switch_extension   rtems_task_switch_extension;
46typedef User_extensions_thread_post_switch_extension 
47  rtems_task_post_switch_extension;
48typedef User_extensions_thread_begin_extension    rtems_task_begin_extension;
49typedef User_extensions_thread_exitted_extension  rtems_task_exitted_extension;
50typedef User_extensions_fatal_extension           rtems_fatal_extension;
51
52typedef User_extensions_Table                     rtems_extensions_table;
53
54/*
55 *  The following defines the information control block used to manage
56 *  this class of objects.
57 */
58
59EXTERN Objects_Information  _Extension_Information;
60
61/*
62 *  The following records define the control block used to manage
63 *  each extension.
64 */
65
66typedef struct {
67  Objects_Control          Object;
68  User_extensions_Control  Extension;
69}   Extension_Control;
70
71/*
72 *  _Extension_Manager_initialization
73 *
74 *  DESCRIPTION:
75 *
76 *  This routine performs the initialization necessary for this manager.
77 */
78
79void _Extension_Manager_initialization(
80  unsigned32 maximum_extensions
81);
82
83/*
84 *  rtems_extension_create
85 *
86 *  DESCRIPTION:
87 *
88 *  This routine implements the rtems_extension_create directive.  The
89 *  extension will have the name name.   The entry points of the
90 *  routines which constitute this extension set are in EXTENSION_TABLE.
91 *  It returns the id of the created extension in ID.
92 */
93
94rtems_status_code rtems_extension_create(
95  rtems_name              name,
96  rtems_extensions_table *extension_table,
97  Objects_Id              *id
98);
99
100/*
101 *  rtems_extension_ident
102 *
103 *  DESCRIPTION:
104 *
105 *  This routine implements the rtems_extension_ident directive.
106 *  This directive returns the extension ID associated with name.
107 *  If more than one extension is named name, then the extension
108 *  to which the ID belongs is arbitrary.
109 */
110
111rtems_status_code rtems_extension_ident(
112  rtems_name    name,
113  Objects_Id   *id
114);
115
116/*
117 *  rtems_extension_delete
118 *
119 *  DESCRIPTION:
120 *
121 *  This routine implements the rtems_extension_delete directive.  The
122 *  extension indicated by ID is deleted.
123 */
124
125rtems_status_code rtems_extension_delete(
126  Objects_Id id
127);
128
129/*
130 *  _Extension_Allocate
131 *
132 *  DESCRIPTION:
133 *
134 *  This function allocates a extension control block from
135 *  the inactive chain of free extension control blocks.
136 */
137
138STATIC INLINE Extension_Control *_Extension_Allocate( void );
139
140/*
141 *  _Extension_Free
142 *
143 *  DESCRIPTION:
144 *
145 *  This routine frees a extension control block to the
146 *  inactive chain of free extension control blocks.
147 */
148
149STATIC INLINE void _Extension_Free (
150  Extension_Control *the_extension
151);
152
153/*
154 *  _Extension_Get
155 *
156 *  DESCRIPTION:
157 *
158 *  This function maps extension IDs to extension control blocks.
159 *  If ID corresponds to a local extension, then it returns
160 *  the extension control pointer which maps to ID and location
161 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
162 *  to OBJECTS_ERROR and the returned value is undefined.
163 */
164
165STATIC INLINE Extension_Control *_Extension_Get (
166  Objects_Id         id,
167  Objects_Locations *location
168);
169
170/*
171 *  _Extension_Is_null
172 *
173 *  DESCRIPTION:
174 *
175 *  This function returns TRUE if the_extension is NULL and FALSE otherwise.
176 */
177
178STATIC INLINE boolean _Extension_Is_null(
179  Extension_Control *the_extension
180);
181
182#include <rtems/extension.inl>
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif
189/* end of include file */
Note: See TracBrowser for help on using the repository browser.