summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/macros/rtems/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-03-17 16:01:03 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-03-17 16:01:03 +0000
commitf4a8ee1c55788aeb053ede7571b07906a9847a45 (patch)
tree7417825a9a351aaf100374b08d314756523bef5f /c/src/exec/score/macros/rtems/score
parentSuggested rephrasing of inline versus macros option by Chris Johns (diff)
downloadrtems-f4a8ee1c55788aeb053ede7571b07906a9847a45.tar.bz2
Unlimited objects patch from Chris Johns <ccj@acm.org>. Email follows:
First, the unlimited patch. I have compiled the unlmited patch for the Linux posix BSP only and it seems to work cleanly. I would like a really major application run on this change before commiting as the changes are very core and significant. I am currently building all the tests to run. I have no targets suitable to test on at the moment. I have tested the patch for inline functions and macros. Turning macros on has found some core bugs. I have fixed these but have not run all the tests. Please review the patch for these changes. They are: 1) The conditional compilation for MP support broke the core messages code. You cannot embed a conditional macro in another macro. The Send and Urgent Send calls are macros. 2) User extensions handler initialisation now has two parameters. I have updated the macros to support the extra parameter. The patch also contains the gcc-target-default.cfg fix required to build the kernel. More of a by product than a fix for you.
Diffstat (limited to 'c/src/exec/score/macros/rtems/score')
-rw-r--r--c/src/exec/score/macros/rtems/score/object.inl30
-rw-r--r--c/src/exec/score/macros/rtems/score/userext.inl16
2 files changed, 36 insertions, 10 deletions
diff --git a/c/src/exec/score/macros/rtems/score/object.inl b/c/src/exec/score/macros/rtems/score/object.inl
index cce2cbde9b..62994ee4e5 100644
--- a/c/src/exec/score/macros/rtems/score/object.inl
+++ b/c/src/exec/score/macros/rtems/score/object.inl
@@ -93,21 +93,39 @@
/*PAGE
*
- * _Objects_Allocate
+ * _Objects_Get_local_object
*
*/
-#define _Objects_Allocate( _information ) \
- (Objects_Control *) _Chain_Get( &(_information)->Inactive )
+#define _Objects_Get_local_object( information, index ) \
+ ( ( index > information->maximum) ? NULL : \
+ information->local_table[ index ] )
/*PAGE
*
- * _Objects_Free
+ * _Objects_Set_local_object
*
*/
-#define _Objects_Free( _information, _the_object ) \
- _Chain_Append( &(_information)->Inactive, &(_the_object)->Node )
+#define _Objects_Set_local_object( information, index, the_object ) \
+ { \
+ if ( index <= information->maximum) \
+ information->local_table[ index ] = the_object; \
+ }
+
+
+/*PAGE
+ *
+ * _Objects_Get_information
+ *
+ */
+
+#define _Objects_Get_information( id ) \
+ ( \
+ ( !_Objects_Is_class_valid( _Objects_Get_class( id ) ) ) ? \
+ NULL : \
+ _Objects_Information_table[ _Objects_Get_class( id ) ] \
+ )
/*PAGE
*
diff --git a/c/src/exec/score/macros/rtems/score/userext.inl b/c/src/exec/score/macros/rtems/score/userext.inl
index 37b0bf8d2a..69fd0de4b1 100644
--- a/c/src/exec/score/macros/rtems/score/userext.inl
+++ b/c/src/exec/score/macros/rtems/score/userext.inl
@@ -23,14 +23,22 @@
*
*/
-#define _User_extensions_Handler_initialization( _initial_extensions ) \
+#define _User_extensions_Handler_initialization( \
+ number_of_extensions, _initial_extensions \
+) \
{ \
+ User_extensions_Control *extension; \
+ unsigned32 i; \
_Chain_Initialize_empty( &_User_extensions_List ); \
\
if ( (_initial_extensions) ) { \
- _User_extensions_Initial.Callouts = *(_initial_extensions); \
- _Chain_Append( \
- &_User_extensions_List, &_User_extensions_Initial.Node ); \
+ for (i=0 ; i<number_of_extensions ; i++ ) { \
+ extension = \
+ _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) ); \
+ \
+ extension->Callouts = _initial_extensions[i]; \
+ _Chain_Append( &_User_extensions_List, &extension->Node ); \
+ } \
} \
}