[ac7d5ef0] | 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 | |
---|
[3235ad9] | 31 | #include <rtems.h> |
---|
[ac7d5ef0] | 32 | #include <rtems/object.h> |
---|
| 33 | #include <rtems/userext.h> |
---|
| 34 | |
---|
| 35 | /* |
---|
| 36 | * The following defines the information control block used to manage |
---|
| 37 | * this class of objects. |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | EXTERN Objects_Information _Extension_Information; |
---|
| 41 | |
---|
| 42 | /* |
---|
| 43 | * The following records define the control block used to manage |
---|
| 44 | * each extension. |
---|
| 45 | */ |
---|
| 46 | |
---|
| 47 | typedef struct { |
---|
| 48 | Objects_Control Object; |
---|
| 49 | User_extensions_Control Extension; |
---|
| 50 | } Extension_Control; |
---|
| 51 | |
---|
| 52 | /* |
---|
| 53 | * _Extension_Manager_initialization |
---|
| 54 | * |
---|
| 55 | * DESCRIPTION: |
---|
| 56 | * |
---|
| 57 | * This routine performs the initialization necessary for this manager. |
---|
| 58 | */ |
---|
| 59 | |
---|
| 60 | void _Extension_Manager_initialization( |
---|
| 61 | unsigned32 maximum_extensions |
---|
| 62 | ); |
---|
| 63 | |
---|
| 64 | /* |
---|
| 65 | * rtems_extension_create |
---|
| 66 | * |
---|
| 67 | * DESCRIPTION: |
---|
| 68 | * |
---|
| 69 | * This routine implements the rtems_extension_create directive. The |
---|
| 70 | * extension will have the name name. The entry points of the |
---|
| 71 | * routines which constitute this extension set are in EXTENSION_TABLE. |
---|
| 72 | * It returns the id of the created extension in ID. |
---|
| 73 | */ |
---|
| 74 | |
---|
| 75 | rtems_status_code rtems_extension_create( |
---|
[3235ad9] | 76 | rtems_name name, |
---|
[ac7d5ef0] | 77 | rtems_extensions_table *extension_table, |
---|
| 78 | Objects_Id *id |
---|
| 79 | ); |
---|
| 80 | |
---|
| 81 | /* |
---|
| 82 | * rtems_extension_ident |
---|
| 83 | * |
---|
| 84 | * DESCRIPTION: |
---|
| 85 | * |
---|
| 86 | * This routine implements the rtems_extension_ident directive. |
---|
| 87 | * This directive returns the extension ID associated with name. |
---|
| 88 | * If more than one extension is named name, then the extension |
---|
| 89 | * to which the ID belongs is arbitrary. |
---|
| 90 | */ |
---|
| 91 | |
---|
| 92 | rtems_status_code rtems_extension_ident( |
---|
[3235ad9] | 93 | rtems_name name, |
---|
[ac7d5ef0] | 94 | Objects_Id *id |
---|
| 95 | ); |
---|
| 96 | |
---|
| 97 | /* |
---|
| 98 | * rtems_extension_delete |
---|
| 99 | * |
---|
| 100 | * DESCRIPTION: |
---|
| 101 | * |
---|
| 102 | * This routine implements the rtems_extension_delete directive. The |
---|
| 103 | * extension indicated by ID is deleted. |
---|
| 104 | */ |
---|
| 105 | |
---|
| 106 | rtems_status_code rtems_extension_delete( |
---|
| 107 | Objects_Id id |
---|
| 108 | ); |
---|
| 109 | |
---|
| 110 | /* |
---|
| 111 | * _Extension_Allocate |
---|
| 112 | * |
---|
| 113 | * DESCRIPTION: |
---|
| 114 | * |
---|
| 115 | * This function allocates a extension control block from |
---|
| 116 | * the inactive chain of free extension control blocks. |
---|
| 117 | */ |
---|
| 118 | |
---|
| 119 | STATIC INLINE Extension_Control *_Extension_Allocate( void ); |
---|
| 120 | |
---|
| 121 | /* |
---|
| 122 | * _Extension_Free |
---|
| 123 | * |
---|
| 124 | * DESCRIPTION: |
---|
| 125 | * |
---|
| 126 | * This routine frees a extension control block to the |
---|
| 127 | * inactive chain of free extension control blocks. |
---|
| 128 | */ |
---|
| 129 | |
---|
| 130 | STATIC INLINE void _Extension_Free ( |
---|
| 131 | Extension_Control *the_extension |
---|
| 132 | ); |
---|
| 133 | |
---|
| 134 | /* |
---|
| 135 | * _Extension_Get |
---|
| 136 | * |
---|
| 137 | * DESCRIPTION: |
---|
| 138 | * |
---|
| 139 | * This function maps extension IDs to extension control blocks. |
---|
| 140 | * If ID corresponds to a local extension, then it returns |
---|
| 141 | * the extension control pointer which maps to ID and location |
---|
| 142 | * is set to OBJECTS_LOCAL. Otherwise, location is set |
---|
| 143 | * to OBJECTS_ERROR and the returned value is undefined. |
---|
| 144 | */ |
---|
| 145 | |
---|
| 146 | STATIC INLINE Extension_Control *_Extension_Get ( |
---|
| 147 | Objects_Id id, |
---|
| 148 | Objects_Locations *location |
---|
| 149 | ); |
---|
| 150 | |
---|
| 151 | /* |
---|
| 152 | * _Extension_Is_null |
---|
| 153 | * |
---|
| 154 | * DESCRIPTION: |
---|
| 155 | * |
---|
| 156 | * This function returns TRUE if the_extension is NULL and FALSE otherwise. |
---|
| 157 | */ |
---|
| 158 | |
---|
| 159 | STATIC INLINE boolean _Extension_Is_null( |
---|
| 160 | Extension_Control *the_extension |
---|
| 161 | ); |
---|
| 162 | |
---|
| 163 | #include <rtems/extension.inl> |
---|
| 164 | |
---|
| 165 | #ifdef __cplusplus |
---|
| 166 | } |
---|
| 167 | #endif |
---|
| 168 | |
---|
| 169 | #endif |
---|
| 170 | /* end of include file */ |
---|