From 97e2729d1a3432b9792b82ce88ce6d804a104f7a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 23 Nov 1998 17:38:09 +0000 Subject: Added --disable-multiprocessing flag and modified a lot of files to make it work. --- c/src/exec/score/headers/Makefile.in | 8 ++++++-- c/src/exec/score/headers/object.h | 2 ++ c/src/exec/score/headers/thread.h | 8 ++++++++ c/src/exec/score/include/rtems/score/Makefile.in | 8 ++++++-- c/src/exec/score/include/rtems/score/object.h | 2 ++ c/src/exec/score/include/rtems/score/thread.h | 8 ++++++++ c/src/exec/score/inline/Makefile.in | 8 ++++++-- c/src/exec/score/inline/rtems/score/Makefile.in | 8 ++++++-- c/src/exec/score/macros/Makefile.in | 8 ++++++-- c/src/exec/score/macros/rtems/score/Makefile.in | 8 ++++++-- c/src/exec/score/src/Makefile.in | 8 ++++++-- c/src/exec/score/src/coremsg.c | 6 ++++++ c/src/exec/score/src/coremutex.c | 5 ++++- c/src/exec/score/src/coresem.c | 2 ++ c/src/exec/score/src/mpci.c | 2 ++ c/src/exec/score/src/object.c | 12 ++++++++++++ c/src/exec/score/src/thread.c | 2 ++ c/src/exec/score/src/threadq.c | 22 +++++++++++++++++++--- c/src/exec/score/tools/generic/size_rtems.in | 19 ++++++++++++------- 19 files changed, 121 insertions(+), 25 deletions(-) (limited to 'c/src/exec/score') diff --git a/c/src/exec/score/headers/Makefile.in b/c/src/exec/score/headers/Makefile.in index 920e738c03..792ca73fce 100644 --- a/c/src/exec/score/headers/Makefile.in +++ b/c/src/exec/score/headers/Makefile.in @@ -8,10 +8,14 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mpci mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + # H_FILES that get installed in the rtems/score subdirectoy H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \ - coresem heap interr isr mpci mppkt object objectmp \ - priority stack states sysstate thread threadmp threadq \ + coresem heap interr isr object \ + priority stack states sysstate thread threadq \ tod tqdata userext watchdog wkspace H_FILES=$(H_PIECES:%=$(srcdir)/%.h) diff --git a/c/src/exec/score/headers/object.h b/c/src/exec/score/headers/object.h index 0198731b96..a0bf3707b6 100644 --- a/c/src/exec/score/headers/object.h +++ b/c/src/exec/score/headers/object.h @@ -387,7 +387,9 @@ Objects_Information *_Objects_Get_information( */ #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/score/headers/thread.h b/c/src/exec/score/headers/thread.h index 7fc3361c39..574d0493d2 100644 --- a/c/src/exec/score/headers/thread.h +++ b/c/src/exec/score/headers/thread.h @@ -23,7 +23,9 @@ extern "C" { #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -141,7 +143,9 @@ typedef struct { unsigned32 resource_count; Thread_Wait_information Wait; Watchdog_Control Timer; +#if defined(RTEMS_MULTIPROCESSING) MP_packet_Prefix *receive_packet; +#endif /****************** end of common block ********************/ Chain_Node Active; } Thread_Proxy_control; @@ -171,7 +175,9 @@ struct Thread_Control_struct { unsigned32 resource_count; Thread_Wait_information Wait; Watchdog_Control Timer; +#if defined(RTEMS_MULTIPROCESSING) MP_packet_Prefix *receive_packet; +#endif /****************** end of common block ********************/ boolean is_global; boolean do_post_task_switch_extension; @@ -619,7 +625,9 @@ Thread _Thread_Idle_body( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/score/include/rtems/score/Makefile.in b/c/src/exec/score/include/rtems/score/Makefile.in index 920e738c03..792ca73fce 100644 --- a/c/src/exec/score/include/rtems/score/Makefile.in +++ b/c/src/exec/score/include/rtems/score/Makefile.in @@ -8,10 +8,14 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mpci mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + # H_FILES that get installed in the rtems/score subdirectoy H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \ - coresem heap interr isr mpci mppkt object objectmp \ - priority stack states sysstate thread threadmp threadq \ + coresem heap interr isr object \ + priority stack states sysstate thread threadq \ tod tqdata userext watchdog wkspace H_FILES=$(H_PIECES:%=$(srcdir)/%.h) diff --git a/c/src/exec/score/include/rtems/score/object.h b/c/src/exec/score/include/rtems/score/object.h index 0198731b96..a0bf3707b6 100644 --- a/c/src/exec/score/include/rtems/score/object.h +++ b/c/src/exec/score/include/rtems/score/object.h @@ -387,7 +387,9 @@ Objects_Information *_Objects_Get_information( */ #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/score/include/rtems/score/thread.h b/c/src/exec/score/include/rtems/score/thread.h index 7fc3361c39..574d0493d2 100644 --- a/c/src/exec/score/include/rtems/score/thread.h +++ b/c/src/exec/score/include/rtems/score/thread.h @@ -23,7 +23,9 @@ extern "C" { #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -141,7 +143,9 @@ typedef struct { unsigned32 resource_count; Thread_Wait_information Wait; Watchdog_Control Timer; +#if defined(RTEMS_MULTIPROCESSING) MP_packet_Prefix *receive_packet; +#endif /****************** end of common block ********************/ Chain_Node Active; } Thread_Proxy_control; @@ -171,7 +175,9 @@ struct Thread_Control_struct { unsigned32 resource_count; Thread_Wait_information Wait; Watchdog_Control Timer; +#if defined(RTEMS_MULTIPROCESSING) MP_packet_Prefix *receive_packet; +#endif /****************** end of common block ********************/ boolean is_global; boolean do_post_task_switch_extension; @@ -619,7 +625,9 @@ Thread _Thread_Idle_body( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/score/inline/Makefile.in b/c/src/exec/score/inline/Makefile.in index f97d3bfcf3..228ef54748 100644 --- a/c/src/exec/score/inline/Makefile.in +++ b/c/src/exec/score/inline/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + I_PIECES= address chain coremsg coremutex coresem heap \ - isr mppkt object objectmp priority stack states sysstate thread \ - threadmp tod tqdata userext watchdog wkspace + isr object priority stack states sysstate thread \ + tod tqdata userext watchdog wkspace $(MP_PIECES) I_FILES=$(I_PIECES:%=$(srcdir)/%.inl) SRCS=$(I_FILES) diff --git a/c/src/exec/score/inline/rtems/score/Makefile.in b/c/src/exec/score/inline/rtems/score/Makefile.in index f97d3bfcf3..228ef54748 100644 --- a/c/src/exec/score/inline/rtems/score/Makefile.in +++ b/c/src/exec/score/inline/rtems/score/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + I_PIECES= address chain coremsg coremutex coresem heap \ - isr mppkt object objectmp priority stack states sysstate thread \ - threadmp tod tqdata userext watchdog wkspace + isr object priority stack states sysstate thread \ + tod tqdata userext watchdog wkspace $(MP_PIECES) I_FILES=$(I_PIECES:%=$(srcdir)/%.inl) SRCS=$(I_FILES) diff --git a/c/src/exec/score/macros/Makefile.in b/c/src/exec/score/macros/Makefile.in index f97d3bfcf3..228ef54748 100644 --- a/c/src/exec/score/macros/Makefile.in +++ b/c/src/exec/score/macros/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + I_PIECES= address chain coremsg coremutex coresem heap \ - isr mppkt object objectmp priority stack states sysstate thread \ - threadmp tod tqdata userext watchdog wkspace + isr object priority stack states sysstate thread \ + tod tqdata userext watchdog wkspace $(MP_PIECES) I_FILES=$(I_PIECES:%=$(srcdir)/%.inl) SRCS=$(I_FILES) diff --git a/c/src/exec/score/macros/rtems/score/Makefile.in b/c/src/exec/score/macros/rtems/score/Makefile.in index f97d3bfcf3..228ef54748 100644 --- a/c/src/exec/score/macros/rtems/score/Makefile.in +++ b/c/src/exec/score/macros/rtems/score/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mppkt objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + I_PIECES= address chain coremsg coremutex coresem heap \ - isr mppkt object objectmp priority stack states sysstate thread \ - threadmp tod tqdata userext watchdog wkspace + isr object priority stack states sysstate thread \ + tod tqdata userext watchdog wkspace $(MP_PIECES) I_FILES=$(I_PIECES:%=$(srcdir)/%.inl) SRCS=$(I_FILES) diff --git a/c/src/exec/score/src/Makefile.in b/c/src/exec/score/src/Makefile.in index 4548b4cdde..840f2ff15c 100644 --- a/c/src/exec/score/src/Makefile.in +++ b/c/src/exec/score/src/Makefile.in @@ -8,10 +8,14 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mpci objectmp threadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + # C and C++ source names, if any, go here -- minus the .c or .cc C_PIECES=apiext chain coremsg coremutex coresem heap interr \ - isr mpci object objectmp thread threadmp threadq tod userext \ - watchdog wkspace + isr object thread threadq tod userext \ + watchdog wkspace $(MP_PIECES) C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/exec/score/src/coremsg.c b/c/src/exec/score/src/coremsg.c index 34778d26cd..1300b49951 100644 --- a/c/src/exec/score/src/coremsg.c +++ b/c/src/exec/score/src/coremsg.c @@ -26,7 +26,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /*PAGE * @@ -217,8 +219,10 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast( *(unsigned32 *)the_thread->Wait.return_argument_1 = size; +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); +#endif } *count = number_broadcasted; @@ -394,8 +398,10 @@ CORE_message_queue_Status _CORE_message_queue_Submit( ); *(unsigned32 *)the_thread->Wait.return_argument_1 = size; +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); +#endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } diff --git a/c/src/exec/score/src/coremutex.c b/c/src/exec/score/src/coremutex.c index dac5a5172b..bda01a06e9 100644 --- a/c/src/exec/score/src/coremutex.c +++ b/c/src/exec/score/src/coremutex.c @@ -293,6 +293,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) { +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) { the_mutex->holder = NULL; @@ -301,7 +302,9 @@ CORE_mutex_Status _CORE_mutex_Surrender( ( *api_mutex_mp_support)( the_thread, id ); - } else { + } else +#endif + { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; diff --git a/c/src/exec/score/src/coresem.c b/c/src/exec/score/src/coresem.c index 074ba2cb22..b0b471bad6 100644 --- a/c/src/exec/score/src/coresem.c +++ b/c/src/exec/score/src/coresem.c @@ -24,7 +24,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /*PAGE * diff --git a/c/src/exec/score/src/mpci.c b/c/src/exec/score/src/mpci.c index efe63160f3..ad9ae9c47e 100644 --- a/c/src/exec/score/src/mpci.c +++ b/c/src/exec/score/src/mpci.c @@ -16,8 +16,10 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include #include +#endif #include #include #include diff --git a/c/src/exec/score/src/object.c b/c/src/exec/score/src/object.c index 7585235d3b..81bca89d7c 100644 --- a/c/src/exec/score/src/object.c +++ b/c/src/exec/score/src/object.c @@ -16,7 +16,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -51,11 +53,13 @@ void _Objects_Handler_initialization( _Objects_Local_node = node; _Objects_Maximum_nodes = maximum_nodes; +#if defined(RTEMS_MULTIPROCESSING) _Objects_MP_Handler_initialization( node, maximum_nodes, maximum_global_objects ); +#endif } /*PAGE @@ -378,7 +382,11 @@ Objects_Name_to_id_errors _Objects_Name_to_id( if ( _Objects_Is_local_node( node ) || node == OBJECTS_SEARCH_LOCAL_NODE ) return OBJECTS_INVALID_NAME; +#if defined(RTEMS_MULTIPROCESSING) return ( _Objects_MP_Global_name_search( information, name, node, id ) ); +#else + return OBJECTS_INVALID_NAME; +#endif } /*PAGE @@ -423,8 +431,12 @@ Objects_Control *_Objects_Get( return( NULL ); } *location = OBJECTS_ERROR; +#if defined(RTEMS_MULTIPROCESSING) _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; +#else + return NULL; +#endif } diff --git a/c/src/exec/score/src/thread.c b/c/src/exec/score/src/thread.c index 292e042d57..b663eb6bba 100644 --- a/c/src/exec/score/src/thread.c +++ b/c/src/exec/score/src/thread.c @@ -81,7 +81,9 @@ void _Thread_Handler_initialization( for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) _Chain_Initialize_empty( &_Thread_Ready_chain[ index ] ); +#if defined(RTEMS_MULTIPROCESSING) _Thread_MP_Handler_initialization( maximum_proxies ); +#endif /* * Initialize this class of objects. diff --git a/c/src/exec/score/src/threadq.c b/c/src/exec/score/src/threadq.c index 3cdca9701b..34f0a12383 100644 --- a/c/src/exec/score/src/threadq.c +++ b/c/src/exec/score/src/threadq.c @@ -97,9 +97,11 @@ void _Thread_queue_Enqueue( the_thread = _Thread_Executing; +#if defined(RTEMS_MULTIPROCESSING) if ( _Thread_MP_Is_receive( the_thread ) && the_thread->receive_packet ) the_thread = _Thread_MP_Allocate_proxy( the_thread_queue->state ); else +#endif _Thread_Set_state( the_thread, the_thread_queue->state ); if ( timeout ) { @@ -255,10 +257,12 @@ void _Thread_queue_Flush( Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { - if ( _Objects_Is_local_id( the_thread->Object.id ) ) - the_thread->Wait.return_code = status; - else +#if defined(RTEMS_MULTIPROCESSING) + if ( !_Objects_Is_local_id( the_thread->Object.id ) ) ( *remote_extract_callout )( the_thread ); + else +#endif + the_thread->Wait.return_code = status; } } @@ -423,8 +427,10 @@ void _Thread_queue_Enqueue_fifo ( _Thread_Unblock( the_thread ); +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif } @@ -468,8 +474,10 @@ Thread_Control *_Thread_queue_Dequeue_fifo( _Thread_Unblock( the_thread ); } +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif return the_thread; } @@ -532,8 +540,10 @@ void _Thread_queue_Extract_fifo( _Thread_Unblock( the_thread ); +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif } @@ -753,8 +763,10 @@ synchronize: _Thread_Unblock( the_thread ); +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif } /*PAGE @@ -852,8 +864,10 @@ dequeue: _Thread_Unblock( the_thread ); } +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif return( the_thread ); } @@ -929,8 +943,10 @@ void _Thread_queue_Extract_priority( _Thread_Unblock( the_thread ); } +#if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); +#endif } else _ISR_Enable( level ); diff --git a/c/src/exec/score/tools/generic/size_rtems.in b/c/src/exec/score/tools/generic/size_rtems.in index 72c96e842c..d4f80870cd 100644 --- a/c/src/exec/score/tools/generic/size_rtems.in +++ b/c/src/exec/score/tools/generic/size_rtems.in @@ -130,17 +130,22 @@ ${SAPIOBJ}/exinit.o \ ${SAPIOBJ}/io.o \ ${SAPIOBJ}/rtemsapi.o \ " -MPLIST="\ -${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \ -${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \ -${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \ -${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \ -" + +if [ -r ${RTEMSOBJ}/mp.o ] ; then + MPLIST="\ + ${RTEMSOBJ}/mp.o ${RTEMSOBJ}/eventmp.o \ + ${COREOBJ}/mpci.o ${RTEMSOBJ}/msgmp.o ${COREOBJ}/objectmp.o \ + ${RTEMSOBJ}/partmp.o ${RTEMSOBJ}/regionmp.o ${RTEMSOBJ}/semmp.o \ + ${RTEMSOBJ}/signalmp.o ${RTEMSOBJ}/taskmp.o ${COREOBJ}/threadmp.o \ + " + + MPOBJLIST=${OPTOBJ}/no-msg.rel +fi OPTMANLIST="\ ${OPTOBJ}/no-dpmem.rel \ ${OPTOBJ}/no-event.rel \ -${OPTOBJ}/no-mp.rel \ +${MPOBJLIST} \ ${OPTOBJ}/no-msg.rel \ ${OPTOBJ}/no-part.rel \ ${OPTOBJ}/no-region.rel \ -- cgit v1.2.3