forked from Imagelibrary/rtems
2002-04-08 Chris Johns <ccj@acm.org>
* Per PR142, make task switch extension its own list. * include/rtems/score/userext.h: Reflect above by adding User_extensions_Switch_control and adding it to User_extenions_Control. * inline/rtems/score/userext.inl: Allocate all memory in one chunk to minimize overhead. Address processing dedicated switch chain.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2002-04-08 Chris Johns <ccj@acm.org>
|
||||||
|
|
||||||
|
* Per PR142, make task switch extension its own list.
|
||||||
|
* include/rtems/score/userext.h: Reflect above by adding
|
||||||
|
User_extensions_Switch_control and adding it to User_extenions_Control.
|
||||||
|
* inline/rtems/score/userext.inl: Allocate all memory in one chunk
|
||||||
|
to minimize overhead. Address processing dedicated switch chain.
|
||||||
|
|
||||||
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* cpu/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
* cpu/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||||
|
|||||||
@@ -18,6 +18,33 @@
|
|||||||
|
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
|
|
||||||
|
/*PAGE
|
||||||
|
*
|
||||||
|
* _User_extensions_Add_set
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine is used to add a user extension set to the active list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
|
||||||
|
User_extensions_Control *the_extension,
|
||||||
|
User_extensions_Table *extension_table
|
||||||
|
)
|
||||||
|
{
|
||||||
|
the_extension->Callouts = *extension_table;
|
||||||
|
|
||||||
|
_Chain_Append( &_User_extensions_List, &the_extension->Node );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a switch handler is present, append it to the switch chain.
|
||||||
|
*/
|
||||||
|
if ( extension_table->thread_switch != NULL ) {
|
||||||
|
the_extension->Switch.thread_switch = extension_table->thread_switch;
|
||||||
|
_Chain_Append( &_User_extensions_Switches_list, &the_extension->Switch.Node );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _User_extensions_Handler_initialization
|
* _User_extensions_Handler_initialization
|
||||||
@@ -36,40 +63,31 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
|
|||||||
unsigned32 i;
|
unsigned32 i;
|
||||||
|
|
||||||
_Chain_Initialize_empty( &_User_extensions_List );
|
_Chain_Initialize_empty( &_User_extensions_List );
|
||||||
|
_Chain_Initialize_empty( &_User_extensions_Switches_list );
|
||||||
|
|
||||||
if ( initial_extensions ) {
|
if ( initial_extensions ) {
|
||||||
for (i=0 ; i<number_of_extensions ; i++ ) {
|
extension =
|
||||||
extension =
|
_Workspace_Allocate_or_fatal_error(
|
||||||
_Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
|
number_of_extensions * sizeof( User_extensions_Control )
|
||||||
|
);
|
||||||
|
|
||||||
extension->Callouts = initial_extensions[i];
|
memset (
|
||||||
_Chain_Append( &_User_extensions_List, &extension->Node );
|
extension,
|
||||||
|
0,
|
||||||
|
number_of_extensions * sizeof( User_extensions_Control )
|
||||||
|
);
|
||||||
|
|
||||||
|
for ( i = 0 ; i < number_of_extensions ; i++ ) {
|
||||||
|
_User_extensions_Add_set (extension, &initial_extensions[i]);
|
||||||
|
extension++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _User_extensions_Add_set
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is used to add a user extension set to the active list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
|
|
||||||
User_extensions_Control *the_extension,
|
|
||||||
User_extensions_Table *extension_table
|
|
||||||
)
|
|
||||||
{
|
|
||||||
the_extension->Callouts = *extension_table;
|
|
||||||
|
|
||||||
_Chain_Append( &_User_extensions_List, &the_extension->Node );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _User_extensions_Add_API_set
|
* _User_extensions_Add_API_set
|
||||||
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This routine is used to add an API extension set to the active list.
|
* This routine is used to add an API extension set to the active list.
|
||||||
@@ -79,7 +97,7 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
|
|||||||
User_extensions_Control *the_extension
|
User_extensions_Control *the_extension
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Chain_Prepend( &_User_extensions_List, &the_extension->Node );
|
_User_extensions_Add_set( the_extension );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
@@ -96,6 +114,13 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Chain_Extract( &the_extension->Node );
|
_Chain_Extract( &the_extension->Node );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a switch handler is present, remove it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( the_extension->Callouts.thread_switch != NULL )
|
||||||
|
_Chain_Extract( &the_extension->Switch.Node );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
@@ -113,17 +138,16 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
|
|||||||
Thread_Control *heir
|
Thread_Control *heir
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Chain_Node *the_node;
|
Chain_Node *the_node;
|
||||||
User_extensions_Control *the_extension;
|
User_extensions_Switch_control *the_extension_switch;
|
||||||
|
|
||||||
for ( the_node = _User_extensions_List.first ;
|
for ( the_node = _User_extensions_Switches_list.first ;
|
||||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
!_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ;
|
||||||
the_node = the_node->next ) {
|
the_node = the_node->next ) {
|
||||||
|
|
||||||
the_extension = (User_extensions_Control *) the_node;
|
the_extension_switch = (User_extensions_Switch_control *) the_node;
|
||||||
|
|
||||||
if ( the_extension->Callouts.thread_switch != NULL )
|
(*the_extension_switch->thread_switch)( executing, heir );
|
||||||
(*the_extension->Callouts.thread_switch)( executing, heir );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
2002-04-08 Chris Johns <ccj@acm.org>
|
||||||
|
|
||||||
|
* Per PR142, make task switch extension its own list.
|
||||||
|
* include/rtems/score/userext.h: Reflect above by adding
|
||||||
|
User_extensions_Switch_control and adding it to User_extenions_Control.
|
||||||
|
* inline/rtems/score/userext.inl: Allocate all memory in one chunk
|
||||||
|
to minimize overhead. Address processing dedicated switch chain.
|
||||||
|
|
||||||
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* cpu/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
* cpu/Makefile.am: Remove AUTOMAKE_OPTIONS.
|
||||||
|
|||||||
@@ -18,6 +18,33 @@
|
|||||||
|
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
|
|
||||||
|
/*PAGE
|
||||||
|
*
|
||||||
|
* _User_extensions_Add_set
|
||||||
|
*
|
||||||
|
* DESCRIPTION:
|
||||||
|
*
|
||||||
|
* This routine is used to add a user extension set to the active list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
|
||||||
|
User_extensions_Control *the_extension,
|
||||||
|
User_extensions_Table *extension_table
|
||||||
|
)
|
||||||
|
{
|
||||||
|
the_extension->Callouts = *extension_table;
|
||||||
|
|
||||||
|
_Chain_Append( &_User_extensions_List, &the_extension->Node );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a switch handler is present, append it to the switch chain.
|
||||||
|
*/
|
||||||
|
if ( extension_table->thread_switch != NULL ) {
|
||||||
|
the_extension->Switch.thread_switch = extension_table->thread_switch;
|
||||||
|
_Chain_Append( &_User_extensions_Switches_list, &the_extension->Switch.Node );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _User_extensions_Handler_initialization
|
* _User_extensions_Handler_initialization
|
||||||
@@ -36,40 +63,31 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
|
|||||||
unsigned32 i;
|
unsigned32 i;
|
||||||
|
|
||||||
_Chain_Initialize_empty( &_User_extensions_List );
|
_Chain_Initialize_empty( &_User_extensions_List );
|
||||||
|
_Chain_Initialize_empty( &_User_extensions_Switches_list );
|
||||||
|
|
||||||
if ( initial_extensions ) {
|
if ( initial_extensions ) {
|
||||||
for (i=0 ; i<number_of_extensions ; i++ ) {
|
extension =
|
||||||
extension =
|
_Workspace_Allocate_or_fatal_error(
|
||||||
_Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
|
number_of_extensions * sizeof( User_extensions_Control )
|
||||||
|
);
|
||||||
|
|
||||||
extension->Callouts = initial_extensions[i];
|
memset (
|
||||||
_Chain_Append( &_User_extensions_List, &extension->Node );
|
extension,
|
||||||
|
0,
|
||||||
|
number_of_extensions * sizeof( User_extensions_Control )
|
||||||
|
);
|
||||||
|
|
||||||
|
for ( i = 0 ; i < number_of_extensions ; i++ ) {
|
||||||
|
_User_extensions_Add_set (extension, &initial_extensions[i]);
|
||||||
|
extension++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
|
||||||
*
|
|
||||||
* _User_extensions_Add_set
|
|
||||||
*
|
|
||||||
* DESCRIPTION:
|
|
||||||
*
|
|
||||||
* This routine is used to add a user extension set to the active list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
|
|
||||||
User_extensions_Control *the_extension,
|
|
||||||
User_extensions_Table *extension_table
|
|
||||||
)
|
|
||||||
{
|
|
||||||
the_extension->Callouts = *extension_table;
|
|
||||||
|
|
||||||
_Chain_Append( &_User_extensions_List, &the_extension->Node );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
*
|
*
|
||||||
* _User_extensions_Add_API_set
|
* _User_extensions_Add_API_set
|
||||||
|
*
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
*
|
*
|
||||||
* This routine is used to add an API extension set to the active list.
|
* This routine is used to add an API extension set to the active list.
|
||||||
@@ -79,7 +97,7 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
|
|||||||
User_extensions_Control *the_extension
|
User_extensions_Control *the_extension
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Chain_Prepend( &_User_extensions_List, &the_extension->Node );
|
_User_extensions_Add_set( the_extension );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
@@ -96,6 +114,13 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
_Chain_Extract( &the_extension->Node );
|
_Chain_Extract( &the_extension->Node );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a switch handler is present, remove it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( the_extension->Callouts.thread_switch != NULL )
|
||||||
|
_Chain_Extract( &the_extension->Switch.Node );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*PAGE
|
/*PAGE
|
||||||
@@ -113,17 +138,16 @@ RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
|
|||||||
Thread_Control *heir
|
Thread_Control *heir
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Chain_Node *the_node;
|
Chain_Node *the_node;
|
||||||
User_extensions_Control *the_extension;
|
User_extensions_Switch_control *the_extension_switch;
|
||||||
|
|
||||||
for ( the_node = _User_extensions_List.first ;
|
for ( the_node = _User_extensions_Switches_list.first ;
|
||||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
!_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ;
|
||||||
the_node = the_node->next ) {
|
the_node = the_node->next ) {
|
||||||
|
|
||||||
the_extension = (User_extensions_Control *) the_node;
|
the_extension_switch = (User_extensions_Switch_control *) the_node;
|
||||||
|
|
||||||
if ( the_extension->Callouts.thread_switch != NULL )
|
(*the_extension_switch->thread_switch)( executing, heir );
|
||||||
(*the_extension->Callouts.thread_switch)( executing, heir );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user