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. --- aclocal.m4 | 4 +- c/src/exec/posix/headers/Makefile.in | 10 +- c/src/exec/posix/headers/cond.h | 2 + c/src/exec/posix/headers/mqueue.h | 2 + c/src/exec/posix/headers/mutex.h | 2 + c/src/exec/posix/headers/pthread.h | 2 + c/src/exec/posix/headers/semaphore.h | 2 + c/src/exec/posix/include/rtems/posix/Makefile.in | 10 +- c/src/exec/posix/include/rtems/posix/cond.h | 2 + c/src/exec/posix/include/rtems/posix/mqueue.h | 2 + c/src/exec/posix/include/rtems/posix/mutex.h | 2 + c/src/exec/posix/include/rtems/posix/pthread.h | 2 + c/src/exec/posix/include/rtems/posix/semaphore.h | 2 + c/src/exec/posix/src/cond.c | 35 ++- c/src/exec/posix/src/mutex.c | 56 ++++- c/src/exec/rtems/headers/Makefile.in | 12 +- c/src/exec/rtems/headers/event.h | 2 + c/src/exec/rtems/headers/message.h | 4 + c/src/exec/rtems/headers/part.h | 2 + c/src/exec/rtems/headers/region.h | 2 + c/src/exec/rtems/headers/rtems.h | 2 + c/src/exec/rtems/headers/sem.h | 4 + c/src/exec/rtems/headers/signal.h | 2 + c/src/exec/rtems/headers/tasks.h | 2 + c/src/exec/rtems/headers/types.h | 6 + c/src/exec/rtems/include/rtems.h | 2 + c/src/exec/rtems/include/rtems/rtems/Makefile.in | 12 +- c/src/exec/rtems/include/rtems/rtems/event.h | 2 + c/src/exec/rtems/include/rtems/rtems/message.h | 4 + c/src/exec/rtems/include/rtems/rtems/part.h | 2 + c/src/exec/rtems/include/rtems/rtems/region.h | 2 + c/src/exec/rtems/include/rtems/rtems/sem.h | 4 + c/src/exec/rtems/include/rtems/rtems/signal.h | 2 + c/src/exec/rtems/include/rtems/rtems/tasks.h | 2 + c/src/exec/rtems/include/rtems/rtems/types.h | 6 + c/src/exec/rtems/inline/attr.inl | 2 + c/src/exec/rtems/inline/rtems/rtems/attr.inl | 2 + c/src/exec/rtems/macros/attr.inl | 2 + c/src/exec/rtems/macros/rtems/rtems/attr.inl | 2 + c/src/exec/rtems/optman/Makefile.in | 2 +- c/src/exec/rtems/optman/no-mp.c | 5 +- c/src/exec/rtems/src/Makefile.in | 10 +- c/src/exec/rtems/src/dpmem.c | 18 +- c/src/exec/rtems/src/event.c | 10 +- c/src/exec/rtems/src/msg.c | 99 ++++++-- c/src/exec/rtems/src/part.c | 42 +++- c/src/exec/rtems/src/ratemon.c | 27 ++- c/src/exec/rtems/src/region.c | 37 ++- c/src/exec/rtems/src/rtemstimer.c | 30 ++- c/src/exec/rtems/src/sem.c | 69 +++++- c/src/exec/rtems/src/signal.c | 11 +- c/src/exec/rtems/src/tasks.c | 97 ++++++-- c/src/exec/rtems/src/timer.c | 30 ++- c/src/exec/sapi/headers/config.h | 6 + c/src/exec/sapi/headers/sptables.h | 6 + c/src/exec/sapi/include/rtems/config.h | 6 + c/src/exec/sapi/include/rtems/sptables.h | 6 + c/src/exec/sapi/src/exinit.c | 15 ++ c/src/exec/sapi/src/rtemsapi.c | 4 + 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 +- c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in | 6 +- c/src/lib/libbsp/i386/force386/Makefile.in | 6 +- c/src/lib/libbsp/i960/cvme961/Makefile.in | 6 +- c/src/lib/libbsp/m68k/mvme136/Makefile.in | 6 +- c/src/lib/libbsp/m68k/mvme147s/Makefile.in | 6 +- c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in | 6 +- c/src/lib/libbsp/unix/posix/Makefile.in | 10 +- c/src/lib/libmisc/monitor/Makefile.in | 7 +- c/src/lib/libmisc/monitor/mon-object.c | 8 + c/src/lib/libmisc/monitor/monitor.h | 6 + c/src/libmisc/monitor/Makefile.in | 7 +- c/src/libmisc/monitor/mon-object.c | 8 + c/src/libmisc/monitor/monitor.h | 6 + c/src/optman/rtems/no-mp.c | 5 +- c/src/tests/sptests/spsize/size.c | 38 +++- configure | 277 ++++++++++++----------- configure.in | 12 +- cpukit/libmisc/monitor/mon-object.c | 8 + cpukit/libmisc/monitor/monitor.h | 6 + cpukit/posix/include/rtems/posix/cond.h | 2 + cpukit/posix/include/rtems/posix/mqueue.h | 2 + cpukit/posix/include/rtems/posix/mutex.h | 2 + cpukit/posix/include/rtems/posix/pthread.h | 2 + cpukit/posix/include/rtems/posix/semaphore.h | 2 + cpukit/posix/src/cond.c | 35 ++- cpukit/posix/src/mutex.c | 56 ++++- cpukit/rtems/include/rtems.h | 2 + cpukit/rtems/include/rtems/rtems/event.h | 2 + cpukit/rtems/include/rtems/rtems/message.h | 4 + cpukit/rtems/include/rtems/rtems/part.h | 2 + cpukit/rtems/include/rtems/rtems/region.h | 2 + cpukit/rtems/include/rtems/rtems/sem.h | 4 + cpukit/rtems/include/rtems/rtems/signal.h | 2 + cpukit/rtems/include/rtems/rtems/tasks.h | 2 + cpukit/rtems/include/rtems/rtems/types.h | 6 + cpukit/rtems/inline/rtems/rtems/attr.inl | 2 + cpukit/rtems/macros/rtems/rtems/attr.inl | 2 + cpukit/rtems/src/dpmem.c | 18 +- cpukit/rtems/src/event.c | 10 +- cpukit/rtems/src/msg.c | 99 ++++++-- cpukit/rtems/src/part.c | 42 +++- cpukit/rtems/src/ratemon.c | 27 ++- cpukit/rtems/src/region.c | 37 ++- cpukit/rtems/src/rtemstimer.c | 30 ++- cpukit/rtems/src/sem.c | 69 +++++- cpukit/rtems/src/signal.c | 11 +- cpukit/rtems/src/tasks.c | 97 ++++++-- cpukit/sapi/include/rtems/config.h | 6 + cpukit/sapi/src/exinit.c | 15 ++ cpukit/sapi/src/rtemsapi.c | 4 + cpukit/score/include/rtems/score/object.h | 2 + cpukit/score/include/rtems/score/thread.h | 8 + cpukit/score/src/coremsg.c | 6 + cpukit/score/src/coremutex.c | 5 +- cpukit/score/src/coresem.c | 2 + cpukit/score/src/mpci.c | 2 + cpukit/score/src/object.c | 12 + cpukit/score/src/thread.c | 2 + cpukit/score/src/threadq.c | 22 +- make/custom/FreeBSD-posix.cfg | 3 - make/custom/HPUX9-posix.cfg | 3 - make/custom/Linux-posix.cfg | 3 - make/custom/Solaris-posix.cfg | 3 - make/custom/cvme961.cfg | 3 - make/custom/default.cfg | 4 + make/custom/dmv177.cfg | 3 - make/custom/force386.cfg | 3 - make/custom/gensh1.cfg | 3 - make/custom/mvme136.cfg | 3 - make/custom/mvme147s.cfg | 3 - make/custom/no_bsp.cfg | 3 - make/custom/simhppa.cfg | 3 - make/leaf.cfg | 3 + make/target.cfg.in | 1 + testsuites/sptests/spsize/size.c | 38 +++- tools/cpu/generic/size_rtems.in | 19 +- 154 files changed, 1593 insertions(+), 494 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 17aa090fb1..39691625a0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -323,7 +323,7 @@ else *) # invalid for AC_PATH_PROG AC_MSG_RESULT("no") AC_MSG_ERROR([***] - [Environment variable $1 should ether] + [Environment variable $1 should either] [be unset (preferred) or contain an absolute path]) ;; esac @@ -354,7 +354,7 @@ dnl special treatment of ranlib else AC_MSG_ERROR([***] [Can't figure out how to build a library index] - [Nether ranlib nor ar -s seem to be available] ) + [Neither ranlib nor ar -s seem to be available] ) fi fi diff --git a/c/src/exec/posix/headers/Makefile.in b/c/src/exec/posix/headers/Makefile.in index 543917d7ed..3c75974208 100644 --- a/c/src/exec/posix/headers/Makefile.in +++ b/c/src/exec/posix/headers/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -H_PIECES= cond condmp config key mutex mutexmp posixapi \ - priority psignal pthread pthreadmp seterr threadsup time -#H_PIECES= cancel cond condmp intr key mqueue mqueuemp mutex \ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = condmp mutexmp pthreadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + +H_PIECES= cond config key mutex posixapi \ + priority psignal pthread seterr threadsup time +#H_PIECES= cancel cond intr key mqueue mqueuemp mutex \ # mutexmp pthread pthreadmp priority semaphore semaphoremp threadsup \ # time H_FILES=$(H_PIECES:%=$(srcdir)/%.h) diff --git a/c/src/exec/posix/headers/cond.h b/c/src/exec/posix/headers/cond.h index 92c2e453ae..0fb44d8042 100644 --- a/c/src/exec/posix/headers/cond.h +++ b/c/src/exec/posix/headers/cond.h @@ -119,7 +119,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/headers/mqueue.h b/c/src/exec/posix/headers/mqueue.h index 8e2851bfb5..f73cb509ce 100644 --- a/c/src/exec/posix/headers/mqueue.h +++ b/c/src/exec/posix/headers/mqueue.h @@ -175,7 +175,9 @@ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/headers/mutex.h b/c/src/exec/posix/headers/mutex.h index e6c5c44d39..b0d9526dd5 100644 --- a/c/src/exec/posix/headers/mutex.h +++ b/c/src/exec/posix/headers/mutex.h @@ -109,7 +109,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/headers/pthread.h b/c/src/exec/posix/headers/pthread.h index abf5933fc2..46e5834385 100644 --- a/c/src/exec/posix/headers/pthread.h +++ b/c/src/exec/posix/headers/pthread.h @@ -112,7 +112,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/headers/semaphore.h b/c/src/exec/posix/headers/semaphore.h index cc658ee32b..aaf0c4b898 100644 --- a/c/src/exec/posix/headers/semaphore.h +++ b/c/src/exec/posix/headers/semaphore.h @@ -124,7 +124,9 @@ int _POSIX_Semaphore_Name_to_id( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/include/rtems/posix/Makefile.in b/c/src/exec/posix/include/rtems/posix/Makefile.in index 543917d7ed..3c75974208 100644 --- a/c/src/exec/posix/include/rtems/posix/Makefile.in +++ b/c/src/exec/posix/include/rtems/posix/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -H_PIECES= cond condmp config key mutex mutexmp posixapi \ - priority psignal pthread pthreadmp seterr threadsup time -#H_PIECES= cancel cond condmp intr key mqueue mqueuemp mutex \ +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = condmp mutexmp pthreadmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + +H_PIECES= cond config key mutex posixapi \ + priority psignal pthread seterr threadsup time +#H_PIECES= cancel cond intr key mqueue mqueuemp mutex \ # mutexmp pthread pthreadmp priority semaphore semaphoremp threadsup \ # time H_FILES=$(H_PIECES:%=$(srcdir)/%.h) diff --git a/c/src/exec/posix/include/rtems/posix/cond.h b/c/src/exec/posix/include/rtems/posix/cond.h index 92c2e453ae..0fb44d8042 100644 --- a/c/src/exec/posix/include/rtems/posix/cond.h +++ b/c/src/exec/posix/include/rtems/posix/cond.h @@ -119,7 +119,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/include/rtems/posix/mqueue.h b/c/src/exec/posix/include/rtems/posix/mqueue.h index 8e2851bfb5..f73cb509ce 100644 --- a/c/src/exec/posix/include/rtems/posix/mqueue.h +++ b/c/src/exec/posix/include/rtems/posix/mqueue.h @@ -175,7 +175,9 @@ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/include/rtems/posix/mutex.h b/c/src/exec/posix/include/rtems/posix/mutex.h index e6c5c44d39..b0d9526dd5 100644 --- a/c/src/exec/posix/include/rtems/posix/mutex.h +++ b/c/src/exec/posix/include/rtems/posix/mutex.h @@ -109,7 +109,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/include/rtems/posix/pthread.h b/c/src/exec/posix/include/rtems/posix/pthread.h index abf5933fc2..46e5834385 100644 --- a/c/src/exec/posix/include/rtems/posix/pthread.h +++ b/c/src/exec/posix/include/rtems/posix/pthread.h @@ -112,7 +112,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/include/rtems/posix/semaphore.h b/c/src/exec/posix/include/rtems/posix/semaphore.h index cc658ee32b..aaf0c4b898 100644 --- a/c/src/exec/posix/include/rtems/posix/semaphore.h +++ b/c/src/exec/posix/include/rtems/posix/semaphore.h @@ -124,7 +124,9 @@ int _POSIX_Semaphore_Name_to_id( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/posix/src/cond.c b/c/src/exec/posix/src/cond.c index 248f836b94..0cb06ec192 100644 --- a/c/src/exec/posix/src/cond.c +++ b/c/src/exec/posix/src/cond.c @@ -17,6 +17,8 @@ * TEMPORARY */ + +#if defined(RTEMS_MULTIPROCESSING) void _POSIX_Condition_variables_MP_Send_process_packet ( POSIX_Condition_variables_MP_Remote_operations operation, Objects_Id condition_variables_id, @@ -33,6 +35,7 @@ void _POSIX_Condition_variables_MP_Send_extract_proxy( { (void) POSIX_MP_NOT_IMPLEMENTED(); } +#endif /* * END OF TEMPORARY @@ -190,6 +193,7 @@ int pthread_cond_init( return ENOMEM; } +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information, 0, the_cond->Object.id, FALSE ) ) ) { @@ -197,6 +201,7 @@ int pthread_cond_init( _Thread_Enable_dispatch(); return EAGAIN; } +#endif the_cond->process_shared = the_attr->process_shared; @@ -208,7 +213,11 @@ int pthread_cond_init( OBJECTS_POSIX_CONDITION_VARIABLES, THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_CONDITION_VARIABLE, +#if defined(RTEMS_MULTIPROCESSING) _POSIX_Condition_variables_MP_Send_extract_proxy, +#else + NULL, +#endif ETIMEDOUT ); @@ -220,6 +229,7 @@ int pthread_cond_init( *cond = the_cond->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) _POSIX_Condition_variables_MP_Send_process_packet( POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE, @@ -227,6 +237,7 @@ int pthread_cond_init( 0, /* Name not used */ 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); @@ -248,12 +259,17 @@ int pthread_cond_destroy( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + + case OBJECTS_ERROR: + return EINVAL; + + case OBJECTS_LOCAL: if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { @@ -268,6 +284,7 @@ int pthread_cond_destroy( _POSIX_Condition_variables_Free( the_cond ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) { _Objects_MP_Close( @@ -282,6 +299,7 @@ int pthread_cond_destroy( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return 0; } @@ -307,12 +325,15 @@ int _POSIX_Condition_variables_Signal_support( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: do { @@ -380,12 +401,14 @@ int _POSIX_Condition_variables_Wait_support( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { diff --git a/c/src/exec/posix/src/mutex.c b/c/src/exec/posix/src/mutex.c index fa2ccc9cc5..10a38a06e5 100644 --- a/c/src/exec/posix/src/mutex.c +++ b/c/src/exec/posix/src/mutex.c @@ -9,7 +9,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -18,6 +20,7 @@ * TEMPORARY */ +#if defined(RTEMS_MULTIPROCESSING) void _POSIX_Mutex_MP_Send_process_packet ( POSIX_Mutex_MP_Remote_operations operation, Objects_Id mutex_id, @@ -52,6 +55,7 @@ void POSIX_Threads_mutex_MP_support( { (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */ } +#endif /* * END OF TEMPORARY @@ -238,9 +242,9 @@ int pthread_mutex_init( mutex_in_use = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { + case OBJECTS_REMOTE: case OBJECTS_ERROR: break; - case OBJECTS_REMOTE: case OBJECTS_LOCAL: _Thread_Enable_dispatch(); return EBUSY; @@ -256,8 +260,10 @@ int pthread_mutex_init( assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return POSIX_MP_NOT_IMPLEMENTED(); +#endif /* * Determine the discipline of the mutex @@ -289,6 +295,7 @@ int pthread_mutex_init( return EAGAIN; } +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0, the_mutex->Object.id, FALSE ) ) ) { @@ -296,6 +303,7 @@ int pthread_mutex_init( _Thread_Enable_dispatch(); return EAGAIN; } +#endif the_mutex->process_shared = the_attr->process_shared; @@ -322,6 +330,7 @@ int pthread_mutex_init( *mutex = the_mutex->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) _POSIX_Mutex_MP_Send_process_packet( POSIX_MUTEX_MP_ANNOUNCE_CREATE, @@ -329,6 +338,7 @@ int pthread_mutex_init( 0, /* Name not used */ 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return 0; @@ -348,12 +358,14 @@ int pthread_mutex_destroy( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: /* * XXX: There is an error for the mutex being locked @@ -369,12 +381,17 @@ int pthread_mutex_destroy( _CORE_mutex_Flush( &the_mutex->Mutex, +#if defined(RTEMS_MULTIPROCESSING) _POSIX_Mutex_MP_Send_object_was_deleted, +#else + NULL, +#endif EINVAL ); _POSIX_Mutex_Free( the_mutex ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) { _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id ); @@ -386,6 +403,7 @@ int pthread_mutex_destroy( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return 0; } @@ -411,15 +429,17 @@ int _POSIX_Mutex_Lock_support( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _POSIX_Mutex_MP_Send_request_packet( POSIX_MUTEX_MP_OBTAIN_REQUEST, *mutex, 0, /* must define the option set */ WATCHDOG_NO_TIMEOUT ); +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: _CORE_mutex_Seize( &the_mutex->Mutex, @@ -480,20 +500,26 @@ int pthread_mutex_unlock( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _POSIX_Mutex_MP_Send_request_packet( POSIX_MUTEX_MP_RELEASE_REQUEST, *mutex, 0, /* Not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) POSIX_Threads_mutex_MP_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return _POSIX_Mutex_From_core_mutex_status( status ); @@ -634,11 +660,13 @@ int pthread_mutex_setprioceiling( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; /* impossible to get here */ case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) /* XXX It feels questionable to set the ceiling on a remote mutex. */ return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; /* impossible to get here */ case OBJECTS_LOCAL: *old_ceiling = _POSIX_Priority_From_core( the_mutex->Mutex.Attributes.priority_ceiling @@ -647,7 +675,11 @@ int pthread_mutex_setprioceiling( _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) POSIX_Threads_mutex_MP_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return 0; @@ -673,10 +705,12 @@ int pthread_mutex_getprioceiling( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */ +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: *prioceiling = _POSIX_Priority_From_core( the_mutex->Mutex.Attributes.priority_ceiling diff --git a/c/src/exec/rtems/headers/Makefile.in b/c/src/exec/rtems/headers/Makefile.in index adb4903db8..f5904f6d25 100644 --- a/c/src/exec/rtems/headers/Makefile.in +++ b/c/src/exec/rtems/headers/Makefile.in @@ -8,10 +8,14 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -H_PIECES=asr attr clock config dpmem event eventmp eventset \ - intr message modes mp msgmp options part partmp \ - ratemon region regionmp rtemsapi sem semmp signal signalmp status \ - support taskmp tasks timer types +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = eventmp mp msgmp partmp regionmp semmp signalmp taskmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + +H_PIECES=asr attr clock config dpmem event eventset \ + intr message modes options part \ + ratemon region rtemsapi sem signal status \ + support tasks timer types $(MP_PIECES) H_FILES=$(H_PIECES:%=$(srcdir)/%.h) # H_FILES that get installed externally diff --git a/c/src/exec/rtems/headers/event.h b/c/src/exec/rtems/headers/event.h index 48045bdade..576b1edbff 100644 --- a/c/src/exec/rtems/headers/event.h +++ b/c/src/exec/rtems/headers/event.h @@ -161,7 +161,9 @@ void _Event_Timeout ( RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state; +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifndef __RTEMS_APPLICATION__ #include #endif diff --git a/c/src/exec/rtems/headers/message.h b/c/src/exec/rtems/headers/message.h index 611d46fde8..283381eecc 100644 --- a/c/src/exec/rtems/headers/message.h +++ b/c/src/exec/rtems/headers/message.h @@ -316,15 +316,19 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Message_queue_Core_message_queue_mp_support ( Thread_Control *the_thread, Objects_Id id ); +#endif #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/headers/part.h b/c/src/exec/rtems/headers/part.h index 1d720db146..884c9a5426 100644 --- a/c/src/exec/rtems/headers/part.h +++ b/c/src/exec/rtems/headers/part.h @@ -158,7 +158,9 @@ rtems_status_code rtems_partition_return_buffer( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/headers/region.h b/c/src/exec/rtems/headers/region.h index 05418f6a95..93f279fcb5 100644 --- a/c/src/exec/rtems/headers/region.h +++ b/c/src/exec/rtems/headers/region.h @@ -201,7 +201,9 @@ rtems_status_code rtems_region_return_segment( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * _Region_Debug_Walk diff --git a/c/src/exec/rtems/headers/rtems.h b/c/src/exec/rtems/headers/rtems.h index 9a165c08dd..01c0b8478b 100644 --- a/c/src/exec/rtems/headers/rtems.h +++ b/c/src/exec/rtems/headers/rtems.h @@ -57,7 +57,9 @@ extern "C" { #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include diff --git a/c/src/exec/rtems/headers/sem.h b/c/src/exec/rtems/headers/sem.h index 191e62b414..96ae149192 100644 --- a/c/src/exec/rtems/headers/sem.h +++ b/c/src/exec/rtems/headers/sem.h @@ -214,10 +214,12 @@ rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( * is called by the core. */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_mutex_mp_support ( Thread_Control *the_thread, rtems_id id ); +#endif /*PAGE * @@ -238,7 +240,9 @@ void _Semaphore_Core_semaphore_mp_support ( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/headers/signal.h b/c/src/exec/rtems/headers/signal.h index 2b247762e9..c9424a2dfd 100644 --- a/c/src/exec/rtems/headers/signal.h +++ b/c/src/exec/rtems/headers/signal.h @@ -73,7 +73,9 @@ rtems_status_code rtems_signal_send( rtems_signal_set signal_set ); +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/headers/tasks.h b/c/src/exec/rtems/headers/tasks.h index 17730cee7f..82506a5409 100644 --- a/c/src/exec/rtems/headers/tasks.h +++ b/c/src/exec/rtems/headers/tasks.h @@ -411,7 +411,9 @@ void _RTEMS_tasks_Initialize_user_tasks( void ); #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/headers/types.h b/c/src/exec/rtems/headers/types.h index 4d2915bafa..10165a6180 100644 --- a/c/src/exec/rtems/headers/types.h +++ b/c/src/exec/rtems/headers/types.h @@ -22,9 +22,13 @@ extern "C" { #include #include +#include +#include #include +#if defined(RTEMS_MULTIPROCESSING) #include #include +#endif /* * RTEMS basic type definitions @@ -75,6 +79,7 @@ typedef Modes_Control rtems_mode; * MPCI related entries */ +#if defined(RTEMS_MULTIPROCESSING) typedef MP_packet_Classes rtems_mp_packet_classes; typedef MP_packet_Prefix rtems_packet_prefix; @@ -87,6 +92,7 @@ typedef MPCI_receive_entry rtems_mpci_receive_packet_entry; typedef MPCI_Entry rtems_mpci_entry; typedef MPCI_Control rtems_mpci_table; +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems.h b/c/src/exec/rtems/include/rtems.h index 9a165c08dd..01c0b8478b 100644 --- a/c/src/exec/rtems/include/rtems.h +++ b/c/src/exec/rtems/include/rtems.h @@ -57,7 +57,9 @@ extern "C" { #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include diff --git a/c/src/exec/rtems/include/rtems/rtems/Makefile.in b/c/src/exec/rtems/include/rtems/rtems/Makefile.in index adb4903db8..f5904f6d25 100644 --- a/c/src/exec/rtems/include/rtems/rtems/Makefile.in +++ b/c/src/exec/rtems/include/rtems/rtems/Makefile.in @@ -8,10 +8,14 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -H_PIECES=asr attr clock config dpmem event eventmp eventset \ - intr message modes mp msgmp options part partmp \ - ratemon region regionmp rtemsapi sem semmp signal signalmp status \ - support taskmp tasks timer types +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = eventmp mp msgmp partmp regionmp semmp signalmp taskmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + +H_PIECES=asr attr clock config dpmem event eventset \ + intr message modes options part \ + ratemon region rtemsapi sem signal status \ + support tasks timer types $(MP_PIECES) H_FILES=$(H_PIECES:%=$(srcdir)/%.h) # H_FILES that get installed externally diff --git a/c/src/exec/rtems/include/rtems/rtems/event.h b/c/src/exec/rtems/include/rtems/rtems/event.h index 48045bdade..576b1edbff 100644 --- a/c/src/exec/rtems/include/rtems/rtems/event.h +++ b/c/src/exec/rtems/include/rtems/rtems/event.h @@ -161,7 +161,9 @@ void _Event_Timeout ( RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state; +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifndef __RTEMS_APPLICATION__ #include #endif diff --git a/c/src/exec/rtems/include/rtems/rtems/message.h b/c/src/exec/rtems/include/rtems/rtems/message.h index 611d46fde8..283381eecc 100644 --- a/c/src/exec/rtems/include/rtems/rtems/message.h +++ b/c/src/exec/rtems/include/rtems/rtems/message.h @@ -316,15 +316,19 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Message_queue_Core_message_queue_mp_support ( Thread_Control *the_thread, Objects_Id id ); +#endif #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems/rtems/part.h b/c/src/exec/rtems/include/rtems/rtems/part.h index 1d720db146..884c9a5426 100644 --- a/c/src/exec/rtems/include/rtems/rtems/part.h +++ b/c/src/exec/rtems/include/rtems/rtems/part.h @@ -158,7 +158,9 @@ rtems_status_code rtems_partition_return_buffer( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems/rtems/region.h b/c/src/exec/rtems/include/rtems/rtems/region.h index 05418f6a95..93f279fcb5 100644 --- a/c/src/exec/rtems/include/rtems/rtems/region.h +++ b/c/src/exec/rtems/include/rtems/rtems/region.h @@ -201,7 +201,9 @@ rtems_status_code rtems_region_return_segment( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * _Region_Debug_Walk diff --git a/c/src/exec/rtems/include/rtems/rtems/sem.h b/c/src/exec/rtems/include/rtems/rtems/sem.h index 191e62b414..96ae149192 100644 --- a/c/src/exec/rtems/include/rtems/rtems/sem.h +++ b/c/src/exec/rtems/include/rtems/rtems/sem.h @@ -214,10 +214,12 @@ rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( * is called by the core. */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_mutex_mp_support ( Thread_Control *the_thread, rtems_id id ); +#endif /*PAGE * @@ -238,7 +240,9 @@ void _Semaphore_Core_semaphore_mp_support ( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems/rtems/signal.h b/c/src/exec/rtems/include/rtems/rtems/signal.h index 2b247762e9..c9424a2dfd 100644 --- a/c/src/exec/rtems/include/rtems/rtems/signal.h +++ b/c/src/exec/rtems/include/rtems/rtems/signal.h @@ -73,7 +73,9 @@ rtems_status_code rtems_signal_send( rtems_signal_set signal_set ); +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems/rtems/tasks.h b/c/src/exec/rtems/include/rtems/rtems/tasks.h index 17730cee7f..82506a5409 100644 --- a/c/src/exec/rtems/include/rtems/rtems/tasks.h +++ b/c/src/exec/rtems/include/rtems/rtems/tasks.h @@ -411,7 +411,9 @@ void _RTEMS_tasks_Initialize_user_tasks( void ); #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/include/rtems/rtems/types.h b/c/src/exec/rtems/include/rtems/rtems/types.h index 4d2915bafa..10165a6180 100644 --- a/c/src/exec/rtems/include/rtems/rtems/types.h +++ b/c/src/exec/rtems/include/rtems/rtems/types.h @@ -22,9 +22,13 @@ extern "C" { #include #include +#include +#include #include +#if defined(RTEMS_MULTIPROCESSING) #include #include +#endif /* * RTEMS basic type definitions @@ -75,6 +79,7 @@ typedef Modes_Control rtems_mode; * MPCI related entries */ +#if defined(RTEMS_MULTIPROCESSING) typedef MP_packet_Classes rtems_mp_packet_classes; typedef MP_packet_Prefix rtems_packet_prefix; @@ -87,6 +92,7 @@ typedef MPCI_receive_entry rtems_mpci_receive_packet_entry; typedef MPCI_Entry rtems_mpci_entry; typedef MPCI_Control rtems_mpci_table; +#endif #ifdef __cplusplus } diff --git a/c/src/exec/rtems/inline/attr.inl b/c/src/exec/rtems/inline/attr.inl index 3cec1edd3b..df4e8650b5 100644 --- a/c/src/exec/rtems/inline/attr.inl +++ b/c/src/exec/rtems/inline/attr.inl @@ -80,12 +80,14 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point( * enabled in the attribute_set and FALSE otherwise. */ +#if defined(RTEMS_MULTIPROCESSING) RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_GLOBAL ); } +#endif /*PAGE * diff --git a/c/src/exec/rtems/inline/rtems/rtems/attr.inl b/c/src/exec/rtems/inline/rtems/rtems/attr.inl index 3cec1edd3b..df4e8650b5 100644 --- a/c/src/exec/rtems/inline/rtems/rtems/attr.inl +++ b/c/src/exec/rtems/inline/rtems/rtems/attr.inl @@ -80,12 +80,14 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point( * enabled in the attribute_set and FALSE otherwise. */ +#if defined(RTEMS_MULTIPROCESSING) RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_GLOBAL ); } +#endif /*PAGE * diff --git a/c/src/exec/rtems/macros/attr.inl b/c/src/exec/rtems/macros/attr.inl index 290e7f7870..2d8303db11 100644 --- a/c/src/exec/rtems/macros/attr.inl +++ b/c/src/exec/rtems/macros/attr.inl @@ -48,8 +48,10 @@ * */ +#if defined(RTEMS_MULTIPROCESSING) #define _Attributes_Is_global( _attribute_set ) \ ( (_attribute_set) & RTEMS_GLOBAL ) +#endif /*PAGE * diff --git a/c/src/exec/rtems/macros/rtems/rtems/attr.inl b/c/src/exec/rtems/macros/rtems/rtems/attr.inl index 290e7f7870..2d8303db11 100644 --- a/c/src/exec/rtems/macros/rtems/rtems/attr.inl +++ b/c/src/exec/rtems/macros/rtems/rtems/attr.inl @@ -48,8 +48,10 @@ * */ +#if defined(RTEMS_MULTIPROCESSING) #define _Attributes_Is_global( _attribute_set ) \ ( (_attribute_set) & RTEMS_GLOBAL ) +#endif /*PAGE * diff --git a/c/src/exec/rtems/optman/Makefile.in b/c/src/exec/rtems/optman/Makefile.in index 41d7274161..d674921aba 100644 --- a/c/src/exec/rtems/optman/Makefile.in +++ b/c/src/exec/rtems/optman/Makefile.in @@ -8,7 +8,7 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -C_FILES= no-dpmem.c no-event.c no-mp.c no-msg.c \ +C_FILES= no-dpmem.c no-event.c no-msg.c no-mp.c \ no-part.c no-region.c no-rtmon.c no-sem.c no-signal.c no-timer.c S_FILES= diff --git a/c/src/exec/rtems/optman/no-mp.c b/c/src/exec/rtems/optman/no-mp.c index 71c38826f3..41fa81e597 100644 --- a/c/src/exec/rtems/optman/no-mp.c +++ b/c/src/exec/rtems/optman/no-mp.c @@ -14,6 +14,9 @@ */ #include +#if !defined(RTEMS_MULTIPROCESSING) +char rtems_no_multiprocessing; +#else #include #include #include @@ -197,5 +200,5 @@ MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ) ); return NULL; } - +#endif /* end of file */ diff --git a/c/src/exec/rtems/src/Makefile.in b/c/src/exec/rtems/src/Makefile.in index cfab26e662..fe68ccbe2d 100644 --- a/c/src/exec/rtems/src/Makefile.in +++ b/c/src/exec/rtems/src/Makefile.in @@ -8,9 +8,13 @@ VPATH = @srcdir@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ -C_PIECES=attr clock dpmem event eventmp intr intrbody mp msg msgmp \ - part partmp ratemon region regionmp sem semmp signal signalmp \ - taskmp tasks timer +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = eventmp mp msgmp partmp regionmp semmp signalmp taskmp +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + +C_PIECES=attr clock dpmem event intr intrbody msg \ + part ratemon region sem signal \ + tasks timer $(MP_PIECES) C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/exec/rtems/src/dpmem.c b/c/src/exec/rtems/src/dpmem.c index 9cc778df82..cb9ed3fa4d 100644 --- a/c/src/exec/rtems/src/dpmem.c +++ b/c/src/exec/rtems/src/dpmem.c @@ -168,10 +168,12 @@ rtems_status_code rtems_port_delete( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); _Dual_ported_memory_Free( the_port ); @@ -213,10 +215,12 @@ rtems_status_code rtems_port_internal_to_external( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) @@ -262,10 +266,12 @@ rtems_status_code rtems_port_external_to_internal( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) diff --git a/c/src/exec/rtems/src/event.c b/c/src/exec/rtems/src/event.c index a780ba7cf7..36c345ca8c 100644 --- a/c/src/exec/rtems/src/event.c +++ b/c/src/exec/rtems/src/event.c @@ -39,7 +39,9 @@ void _Event_Manager_initialization( void ) * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet ); +#endif } /*PAGE @@ -68,9 +70,8 @@ rtems_status_code rtems_event_send( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return( _Event_MP_Send_request_packet( EVENT_MP_SEND_REQUEST, @@ -78,6 +79,9 @@ rtems_status_code rtems_event_send( event_in ) ); +#endif + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_sets_Post( event_in, &api->pending_events ); @@ -352,8 +356,8 @@ void _Event_Timeout( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: case OBJECTS_REMOTE: /* impossible */ + case OBJECTS_ERROR: break; case OBJECTS_LOCAL: diff --git a/c/src/exec/rtems/src/msg.c b/c/src/exec/rtems/src/msg.c index f49e1cac21..7681bd52d6 100644 --- a/c/src/exec/rtems/src/msg.c +++ b/c/src/exec/rtems/src/msg.c @@ -22,7 +22,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -61,10 +63,12 @@ void _Message_queue_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_MESSAGE_QUEUE, _Message_queue_MP_Process_packet ); +#endif } @@ -123,14 +127,19 @@ rtems_status_code rtems_message_queue_create( { register Message_queue_Control *the_message_queue; CORE_message_queue_Attributes the_message_queue_attributes; + void *handler; +#if defined(RTEMS_MULTIPROCESSING) boolean is_global; +#endif if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; +#if defined(RTEMS_MULTIPROCESSING) if ( (is_global = _Attributes_Is_global( attribute_set ) ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; +#endif if (count == 0) return RTEMS_INVALID_NUMBER; @@ -138,6 +147,7 @@ rtems_status_code rtems_message_queue_create( if (max_message_size == 0) return RTEMS_INVALID_SIZE; +#if defined(RTEMS_MULTIPROCESSING) #if 1 /* * I am not 100% sure this should be an error. @@ -147,7 +157,7 @@ rtems_status_code rtems_message_queue_create( if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) ) return RTEMS_INVALID_SIZE; - +#endif #endif _Thread_Disable_dispatch(); /* protects object pointer */ @@ -159,6 +169,7 @@ rtems_status_code rtems_message_queue_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( is_global && !( _Objects_MP_Allocate_and_open( &_Message_queue_Information, name, the_message_queue->Object.id, FALSE ) ) ) { @@ -166,6 +177,7 @@ rtems_status_code rtems_message_queue_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif the_message_queue->attribute_set = attribute_set; @@ -176,16 +188,23 @@ rtems_status_code rtems_message_queue_create( the_message_queue_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; + handler = NULL; +#if defined(RTEMS_MULTIPROCESSING) + handler = _Message_queue_MP_Send_extract_proxy; +#endif + if ( ! _CORE_message_queue_Initialize( &the_message_queue->message_queue, OBJECTS_RTEMS_MESSAGE_QUEUES, &the_message_queue_attributes, count, max_message_size, - _Message_queue_MP_Send_extract_proxy ) ) { + handler ) ) { +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); +#endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); @@ -200,6 +219,7 @@ rtems_status_code rtems_message_queue_create( *id = the_message_queue->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Message_queue_MP_Send_process_packet( MESSAGE_QUEUE_MP_ANNOUNCE_CREATE, @@ -207,6 +227,7 @@ rtems_status_code rtems_message_queue_create( name, 0 ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -272,23 +293,31 @@ rtems_status_code rtems_message_queue_delete( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, &the_message_queue->Object ); +#if defined(RTEMS_MULTIPROCESSING) _CORE_message_queue_Close( &the_message_queue->message_queue, _Message_queue_MP_Send_object_was_deleted, CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED ); +#endif _Message_queue_Free( the_message_queue ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) { _Objects_MP_Close( &_Message_queue_Information, @@ -302,6 +331,7 @@ rtems_status_code rtems_message_queue_delete( 0 ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -394,9 +424,8 @@ rtems_status_code rtems_message_queue_broadcast( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; return @@ -408,6 +437,10 @@ rtems_status_code rtems_message_queue_broadcast( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: core_status = _CORE_message_queue_Broadcast( @@ -415,7 +448,11 @@ rtems_status_code rtems_message_queue_broadcast( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support, +#else + NULL, +#endif count ); @@ -461,10 +498,8 @@ rtems_status_code rtems_message_queue_receive( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; - case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_RECEIVE_REQUEST, id, @@ -473,6 +508,10 @@ rtems_status_code rtems_message_queue_receive( option_set, timeout ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: if ( _Options_Is_no_wait( option_set ) ) @@ -525,9 +564,8 @@ rtems_status_code rtems_message_queue_flush( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; return @@ -539,6 +577,10 @@ rtems_status_code rtems_message_queue_flush( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); @@ -575,13 +617,11 @@ rtems_status_code rtems_message_queue_get_number_pending( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST, id, 0, /* buffer not used */ @@ -589,6 +629,10 @@ rtems_status_code rtems_message_queue_get_number_pending( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: *count = the_message_queue->message_queue.number_of_pending_messages; @@ -635,14 +679,11 @@ rtems_status_code _Message_queue_Submit( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; - case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) switch ( submit_type ) { case MESSAGE_QUEUE_SEND_REQUEST: - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_SEND_REQUEST, id, buffer, @@ -652,8 +693,7 @@ rtems_status_code _Message_queue_Submit( ); case MESSAGE_QUEUE_URGENT_REQUEST: - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_URGENT_REQUEST, id, buffer, @@ -662,6 +702,11 @@ rtems_status_code _Message_queue_Submit( MPCI_DEFAULT_TIMEOUT ); } + break; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: switch ( submit_type ) { @@ -671,7 +716,11 @@ rtems_status_code _Message_queue_Submit( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support +#else + NULL +#endif ); break; case MESSAGE_QUEUE_URGENT_REQUEST: @@ -680,7 +729,11 @@ rtems_status_code _Message_queue_Submit( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support +#else + NULL +#endif ); break; default: @@ -749,6 +802,7 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Message_queue_Core_message_queue_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -762,3 +816,4 @@ void _Message_queue_Core_message_queue_mp_support ( the_thread ); } +#endif diff --git a/c/src/exec/rtems/src/part.c b/c/src/exec/rtems/src/part.c index 0698f0db71..4417db10cb 100644 --- a/c/src/exec/rtems/src/part.c +++ b/c/src/exec/rtems/src/part.c @@ -54,10 +54,12 @@ void _Partition_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_PARTITION, _Partition_MP_Process_packet ); +#endif } @@ -103,9 +105,11 @@ rtems_status_code rtems_partition_create( if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; +#endif _Thread_Disable_dispatch(); /* prevents deletion */ @@ -116,6 +120,7 @@ rtems_status_code rtems_partition_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && !( _Objects_MP_Allocate_and_open( &_Partition_Information, name, the_partition->Object.id, FALSE ) ) ) { @@ -123,6 +128,8 @@ rtems_status_code rtems_partition_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif + the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; @@ -135,6 +142,7 @@ rtems_status_code rtems_partition_create( _Objects_Open( &_Partition_Information, &the_partition->Object, &name ); *id = the_partition->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Partition_MP_Send_process_packet( PARTITION_MP_ANNOUNCE_CREATE, @@ -142,6 +150,7 @@ rtems_status_code rtems_partition_create( name, 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -203,15 +212,20 @@ rtems_status_code rtems_partition_delete( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { _Objects_Close( &_Partition_Information, &the_partition->Object ); _Partition_Free( the_partition ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_partition->attribute_set ) ) { _Objects_MP_Close( @@ -226,6 +240,7 @@ rtems_status_code rtems_partition_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -264,9 +279,8 @@ rtems_status_code rtems_partition_get_buffer( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = buffer; return( _Partition_MP_Send_request_packet( @@ -275,6 +289,11 @@ rtems_status_code rtems_partition_get_buffer( 0 /* Not used */ ) ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { @@ -316,16 +335,19 @@ rtems_status_code rtems_partition_return_buffer( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: - return( - _Partition_MP_Send_request_packet( +#if defined(RTEMS_MULTIPROCESSING) + return _Partition_MP_Send_request_packet( PARTITION_MP_RETURN_BUFFER_REQUEST, id, buffer - ) - ); + ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); diff --git a/c/src/exec/rtems/src/ratemon.c b/c/src/exec/rtems/src/ratemon.c index ff9bb5bc21..6832aac593 100644 --- a/c/src/exec/rtems/src/ratemon.c +++ b/c/src/exec/rtems/src/ratemon.c @@ -156,10 +156,12 @@ rtems_status_code rtems_rate_monotonic_cancel( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: return RTEMS_INTERNAL_ERROR; /* should never return this */ + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); @@ -197,10 +199,12 @@ rtems_status_code rtems_rate_monotonic_delete( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); (void) _Watchdog_Remove( &the_period->Timer ); @@ -243,10 +247,12 @@ rtems_status_code rtems_rate_monotonic_get_status( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: status->state = the_period->state; @@ -298,10 +304,12 @@ rtems_status_code rtems_rate_monotonic_period( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); @@ -431,9 +439,10 @@ void _Rate_monotonic_Timeout( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: case OBJECTS_REMOTE: /* impossible */ + case OBJECTS_ERROR: break; + case OBJECTS_LOCAL: the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && diff --git a/c/src/exec/rtems/src/region.c b/c/src/exec/rtems/src/region.c index c238bf51c5..14467c73da 100644 --- a/c/src/exec/rtems/src/region.c +++ b/c/src/exec/rtems/src/region.c @@ -53,10 +53,12 @@ void _Region_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_REGION, 0 /* XXX _Region_MP_Process_packet */ ); +#endif } @@ -128,7 +130,11 @@ rtems_status_code rtems_region_create( _Attributes_Is_priority( attribute_set ) ? THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_SEGMENT, +#if defined(RTEMS_MULTIPROCESSING) _Region_MP_Send_extract_proxy, +#else + NULL, +#endif RTEMS_TIMEOUT ); @@ -198,10 +204,12 @@ rtems_status_code rtems_region_delete( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 5 ); if ( the_region->number_of_used_blocks == 0 ) { @@ -250,10 +258,12 @@ rtems_status_code rtems_region_extend( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: heap_status = _Heap_Extend( @@ -322,10 +332,12 @@ rtems_status_code rtems_region_get_segment( executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) { _Thread_Enable_dispatch(); @@ -395,10 +407,12 @@ rtems_status_code rtems_region_get_segment_size( executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) { @@ -440,10 +454,13 @@ rtems_status_code rtems_region_return_segment( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 3 ); diff --git a/c/src/exec/rtems/src/rtemstimer.c b/c/src/exec/rtems/src/rtemstimer.c index 9d04686d40..9337df3a25 100644 --- a/c/src/exec/rtems/src/rtemstimer.c +++ b/c/src/exec/rtems/src/rtemstimer.c @@ -151,10 +151,12 @@ rtems_status_code rtems_timer_cancel( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -188,10 +190,12 @@ rtems_status_code rtems_timer_delete( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -234,10 +238,12 @@ rtems_status_code rtems_timer_fire_after( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_INTERVAL; @@ -289,10 +295,12 @@ rtems_status_code rtems_timer_fire_when( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY; @@ -331,10 +339,12 @@ rtems_status_code rtems_timer_reset( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Timer_Is_interval_class( the_timer->the_class ) ) { _Watchdog_Reset( &the_timer->Ticker ); diff --git a/c/src/exec/rtems/src/sem.c b/c/src/exec/rtems/src/sem.c index f1c1f1fbb9..31351dada1 100644 --- a/c/src/exec/rtems/src/sem.c +++ b/c/src/exec/rtems/src/sem.c @@ -39,7 +39,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include @@ -75,10 +77,12 @@ void _Semaphore_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_SEMAPHORE, _Semaphore_MP_Process_packet ); +#endif } @@ -118,6 +122,7 @@ rtems_status_code rtems_semaphore_create( if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) { if ( !_System_state_Is_multiprocessing ) @@ -126,7 +131,9 @@ rtems_status_code rtems_semaphore_create( if ( _Attributes_Is_inherit_priority( attribute_set ) ) return RTEMS_NOT_DEFINED; - } else if ( _Attributes_Is_inherit_priority( attribute_set ) || + } else +#endif + if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! ( _Attributes_Is_binary_semaphore( attribute_set ) && @@ -147,6 +154,7 @@ rtems_status_code rtems_semaphore_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && ! ( _Objects_MP_Allocate_and_open( &_Semaphore_Information, name, the_semaphore->Object.id, FALSE ) ) ) { @@ -154,6 +162,7 @@ rtems_status_code rtems_semaphore_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif the_semaphore->attribute_set = attribute_set; @@ -183,7 +192,11 @@ rtems_status_code rtems_semaphore_create( OBJECTS_RTEMS_SEMAPHORES, &the_mutex_attributes, lock, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_extract_proxy +#else + NULL +#endif ); } else { @@ -204,7 +217,11 @@ rtems_status_code rtems_semaphore_create( OBJECTS_RTEMS_SEMAPHORES, &the_semaphore_attributes, count, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_extract_proxy +#else + NULL +#endif ); } @@ -212,6 +229,7 @@ rtems_status_code rtems_semaphore_create( *id = the_semaphore->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Semaphore_MP_Send_process_packet( SEMAPHORE_MP_ANNOUNCE_CREATE, @@ -219,6 +237,7 @@ rtems_status_code rtems_semaphore_create( name, 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } @@ -279,11 +298,16 @@ rtems_status_code rtems_semaphore_delete( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) { @@ -293,14 +317,22 @@ rtems_status_code rtems_semaphore_delete( else _CORE_mutex_Flush( &the_semaphore->Core_control.mutex, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_object_was_deleted, +#else + NULL, +#endif CORE_MUTEX_WAS_DELETED ); } else _CORE_semaphore_Flush( &the_semaphore->Core_control.semaphore, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_object_was_deleted, +#else + NULL, +#endif CORE_SEMAPHORE_WAS_DELETED ); @@ -308,6 +340,7 @@ rtems_status_code rtems_semaphore_delete( _Semaphore_Free( the_semaphore ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_semaphore->attribute_set ) ) { _Objects_MP_Close( &_Semaphore_Information, the_semaphore->Object.id ); @@ -319,6 +352,7 @@ rtems_status_code rtems_semaphore_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } @@ -354,15 +388,19 @@ rtems_status_code rtems_semaphore_obtain( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Semaphore_MP_Send_request_packet( SEMAPHORE_MP_OBTAIN_REQUEST, id, option_set, timeout ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Options_Is_no_wait( option_set ) ) wait = FALSE; @@ -420,21 +458,30 @@ rtems_status_code rtems_semaphore_release( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Semaphore_MP_Send_request_packet( SEMAPHORE_MP_RELEASE_REQUEST, id, 0, /* Not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) { mutex_status = _CORE_mutex_Surrender( &the_semaphore->Core_control.mutex, id, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_Core_mutex_mp_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return _Semaphore_Translate_core_mutex_return_code( mutex_status ); @@ -443,7 +490,11 @@ rtems_status_code rtems_semaphore_release( semaphore_status = _CORE_semaphore_Surrender( &the_semaphore->Core_control.semaphore, id, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_Core_semaphore_mp_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return @@ -530,6 +581,7 @@ rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_mutex_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -543,6 +595,7 @@ void _Semaphore_Core_mutex_mp_support ( the_thread ); } +#endif /*PAGE @@ -556,6 +609,7 @@ void _Semaphore_Core_mutex_mp_support ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_semaphore_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -569,3 +623,4 @@ void _Semaphore_Core_semaphore_mp_support ( the_thread ); } +#endif diff --git a/c/src/exec/rtems/src/signal.c b/c/src/exec/rtems/src/signal.c index efdcf70eea..120233d2d5 100644 --- a/c/src/exec/rtems/src/signal.c +++ b/c/src/exec/rtems/src/signal.c @@ -39,10 +39,12 @@ void _Signal_Manager_initialization( void ) * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_SIGNAL, _Signal_MP_Process_packet ); +#endif } /*PAGE @@ -115,14 +117,19 @@ rtems_status_code rtems_signal_send( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Signal_MP_Send_request_packet( SIGNAL_MP_SEND_REQUEST, id, signal_set ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c index 723a769836..5f6c8366c4 100644 --- a/c/src/exec/rtems/src/tasks.c +++ b/c/src/exec/rtems/src/tasks.c @@ -206,10 +206,12 @@ void _RTEMS_tasks_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_TASKS, _RTEMS_tasks_MP_Process_packet ); +#endif } @@ -245,9 +247,11 @@ rtems_status_code rtems_task_create( ) { register Thread_Control *the_thread; - Objects_MP_Control *the_global_object = NULL; boolean is_fp; +#if defined(RTEMS_MULTIPROCESSING) + Objects_MP_Control *the_global_object = NULL; boolean is_global; +#endif boolean status; rtems_attribute the_attribute_set; Priority_Control core_priority; @@ -297,6 +301,7 @@ rtems_status_code rtems_task_create( core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_attribute_set ) ) { is_global = TRUE; @@ -306,6 +311,7 @@ rtems_status_code rtems_task_create( } else is_global = FALSE; +#endif /* * Make sure system is MP if this task is global @@ -334,6 +340,7 @@ rtems_status_code rtems_task_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) { the_global_object = _Objects_MP_Allocate_global_object(); @@ -343,6 +350,7 @@ rtems_status_code rtems_task_create( return RTEMS_TOO_MANY; } } +#endif /* * Initialize the core thread for this task. @@ -365,8 +373,10 @@ rtems_status_code rtems_task_create( ); if ( !status ) { +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); +#endif _RTEMS_tasks_Free( the_thread ); _Thread_Enable_dispatch(); return RTEMS_UNSATISFIED; @@ -379,6 +389,7 @@ rtems_status_code rtems_task_create( *id = the_thread->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) { the_thread->is_global = TRUE; @@ -397,6 +408,7 @@ rtems_status_code rtems_task_create( ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -470,11 +482,16 @@ rtems_status_code rtems_task_start( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Thread_Start( the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { @@ -516,11 +533,16 @@ rtems_status_code rtems_task_restart( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Thread_Restart( the_thread, NULL, argument ) ) { _Thread_Enable_dispatch(); @@ -561,11 +583,16 @@ rtems_status_code rtems_task_delete( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: the_information = _Objects_Get_information( the_thread->Object.id ); @@ -579,6 +606,7 @@ rtems_status_code rtems_task_delete( _RTEMS_tasks_Free( the_thread ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_thread->is_global ) { _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id ); @@ -589,6 +617,7 @@ rtems_status_code rtems_task_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -622,9 +651,9 @@ rtems_status_code rtems_task_suspend( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SUSPEND_REQUEST, id, @@ -632,6 +661,11 @@ rtems_status_code rtems_task_suspend( 0, /* Not used */ 0 /* Not used */ ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { _Thread_Set_state( the_thread, STATES_SUSPENDED ); @@ -669,18 +703,21 @@ rtems_status_code rtems_task_resume( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: - return( - _RTEMS_tasks_MP_Send_request_packet( +#if defined(RTEMS_MULTIPROCESSING) + return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_RESUME_REQUEST, id, 0, /* Not used */ 0, /* Not used */ 0 /* Not used */ - ) - ); + ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { _Thread_Resume( the_thread ); @@ -728,19 +765,22 @@ rtems_status_code rtems_task_set_priority( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = old_priority; - return( - _RTEMS_tasks_MP_Send_request_packet( + return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SET_PRIORITY_REQUEST, id, new_priority, 0, /* Not used */ 0 /* Not used */ - ) ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { @@ -897,9 +937,9 @@ rtems_status_code rtems_task_get_note( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = note; return _RTEMS_tasks_MP_Send_request_packet( @@ -909,6 +949,11 @@ rtems_status_code rtems_task_get_note( notepad, 0 /* Not used */ ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; @@ -967,9 +1012,9 @@ rtems_status_code rtems_task_set_note( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SET_NOTE_REQUEST, id, @@ -977,6 +1022,10 @@ rtems_status_code rtems_task_set_note( notepad, note ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; diff --git a/c/src/exec/rtems/src/timer.c b/c/src/exec/rtems/src/timer.c index 9d04686d40..9337df3a25 100644 --- a/c/src/exec/rtems/src/timer.c +++ b/c/src/exec/rtems/src/timer.c @@ -151,10 +151,12 @@ rtems_status_code rtems_timer_cancel( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -188,10 +190,12 @@ rtems_status_code rtems_timer_delete( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -234,10 +238,12 @@ rtems_status_code rtems_timer_fire_after( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_INTERVAL; @@ -289,10 +295,12 @@ rtems_status_code rtems_timer_fire_when( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY; @@ -331,10 +339,12 @@ rtems_status_code rtems_timer_reset( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Timer_Is_interval_class( the_timer->the_class ) ) { _Watchdog_Reset( &the_timer->Ticker ); diff --git a/c/src/exec/sapi/headers/config.h b/c/src/exec/sapi/headers/config.h index e3ae50d7d1..5a01286059 100644 --- a/c/src/exec/sapi/headers/config.h +++ b/c/src/exec/sapi/headers/config.h @@ -43,7 +43,9 @@ typedef void *posix_api_configuration_table; #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * The following records define the Multiprocessor Configuration @@ -57,7 +59,11 @@ typedef struct { unsigned32 maximum_nodes; /* maximum # nodes in system */ unsigned32 maximum_global_objects; /* maximum # global objects */ unsigned32 maximum_proxies; /* maximum # proxies */ +#if defined(RTEMS_MULTIPROCESSING) MPCI_Control *User_mpci_table; /* pointer to MPCI table */ +#else + void *User_mpci_table; /* pointer to MPCI table */ +#endif } rtems_multiprocessing_table; /* diff --git a/c/src/exec/sapi/headers/sptables.h b/c/src/exec/sapi/headers/sptables.h index 35b3d2d9ab..b8c417319a 100644 --- a/c/src/exec/sapi/headers/sptables.h +++ b/c/src/exec/sapi/headers/sptables.h @@ -35,7 +35,9 @@ extern "C" { #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -152,7 +154,11 @@ const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ] = { (void *) rtems_rate_monotonic_delete, /* 76 */ (void *) rtems_rate_monotonic_cancel, /* 77 */ (void *) rtems_rate_monotonic_period, /* 78 */ +#if defined(RTEMS_MULTIPROCESSING) (void *) rtems_multiprocessing_announce, /* 79 */ +#else + (void *) NULL, /* 79 */ +#endif (void *) rtems_debug_enable, /* 80 */ (void *) rtems_debug_disable /* 81 */ }; diff --git a/c/src/exec/sapi/include/rtems/config.h b/c/src/exec/sapi/include/rtems/config.h index e3ae50d7d1..5a01286059 100644 --- a/c/src/exec/sapi/include/rtems/config.h +++ b/c/src/exec/sapi/include/rtems/config.h @@ -43,7 +43,9 @@ typedef void *posix_api_configuration_table; #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * The following records define the Multiprocessor Configuration @@ -57,7 +59,11 @@ typedef struct { unsigned32 maximum_nodes; /* maximum # nodes in system */ unsigned32 maximum_global_objects; /* maximum # global objects */ unsigned32 maximum_proxies; /* maximum # proxies */ +#if defined(RTEMS_MULTIPROCESSING) MPCI_Control *User_mpci_table; /* pointer to MPCI table */ +#else + void *User_mpci_table; /* pointer to MPCI table */ +#endif } rtems_multiprocessing_table; /* diff --git a/c/src/exec/sapi/include/rtems/sptables.h b/c/src/exec/sapi/include/rtems/sptables.h index 35b3d2d9ab..b8c417319a 100644 --- a/c/src/exec/sapi/include/rtems/sptables.h +++ b/c/src/exec/sapi/include/rtems/sptables.h @@ -35,7 +35,9 @@ extern "C" { #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -152,7 +154,11 @@ const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ] = { (void *) rtems_rate_monotonic_delete, /* 76 */ (void *) rtems_rate_monotonic_cancel, /* 77 */ (void *) rtems_rate_monotonic_period, /* 78 */ +#if defined(RTEMS_MULTIPROCESSING) (void *) rtems_multiprocessing_announce, /* 79 */ +#else + (void *) NULL, /* 79 */ +#endif (void *) rtems_debug_enable, /* 80 */ (void *) rtems_debug_disable /* 81 */ }; diff --git a/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c index dabf21dcc0..43da0a9363 100644 --- a/c/src/exec/sapi/src/exinit.c +++ b/c/src/exec/sapi/src/exinit.c @@ -34,7 +34,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -107,11 +109,18 @@ rtems_interrupt_level rtems_initialize_executive_early( * Initialize the system state based on whether this is an MP system. */ +#if defined(RTEMS_MULTIPROCESSING) multiprocessing_table = configuration_table->User_multiprocessing_table; _System_state_Handler_initialization( (multiprocessing_table) ? TRUE : FALSE ); +#else + multiprocessing_table = NULL; + + _System_state_Handler_initialization( FALSE ); + +#endif /* * Provided just for user convenience. @@ -179,10 +188,12 @@ rtems_interrupt_level rtems_initialize_executive_early( multiprocessing_table->maximum_proxies ); +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Handler_initialization( multiprocessing_table->User_mpci_table, RTEMS_TIMEOUT ); +#endif /* MANAGERS */ @@ -215,7 +226,9 @@ rtems_interrupt_level rtems_initialize_executive_early( _Thread_Create_idle(); +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Create_server(); +#endif /* * Run the API and BSPs predriver hook. @@ -234,12 +247,14 @@ rtems_interrupt_level rtems_initialize_executive_early( _IO_Initialize_all_drivers(); +#if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) { _MPCI_Initialization(); _MPCI_Internal_packets_Send_process_packet( MPCI_PACKETS_SYSTEM_VERIFY ); } +#endif /* * Run the APIs and BSPs postdriver hooks. diff --git a/c/src/exec/sapi/src/rtemsapi.c b/c/src/exec/sapi/src/rtemsapi.c index d860ad7f99..65475e2399 100644 --- a/c/src/exec/sapi/src/rtemsapi.c +++ b/c/src/exec/sapi/src/rtemsapi.c @@ -31,7 +31,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -58,7 +60,9 @@ void _RTEMS_API_Initialize( _Interrupt_Manager_initialization(); +#if defined(RTEMS_MULTIPROCESSING) _Multiprocessing_Manager_initialization(); +#endif _RTEMS_tasks_Manager_initialization( api_configuration->maximum_tasks, 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 \ diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in index 2dc18158d3..867e6d0ae7 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in +++ b/c/src/lib/libbsp/hppa1.1/simhppa/Makefile.in @@ -11,7 +11,11 @@ PROJECT_ROOT = @PROJECT_ROOT@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories # NOTE: we pick up HPPA clock and timer from libcpu/hppa -SUB_DIRS=tools include start startup tty shmsupp wrapup +SUB_DIRS=tools include start startup tty $(MP_SUPPORT) wrapup diff --git a/c/src/lib/libbsp/i386/force386/Makefile.in b/c/src/lib/libbsp/i386/force386/Makefile.in index 47328bffdf..04cbc7bb97 100644 --- a/c/src/lib/libbsp/i386/force386/Makefile.in +++ b/c/src/lib/libbsp/i386/force386/Makefile.in @@ -11,6 +11,10 @@ PROJECT_ROOT = @PROJECT_ROOT@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include start startup clock console shmsupp timer wrapup +SUB_DIRS=include start startup clock console $(MP_SUPPORT) timer wrapup diff --git a/c/src/lib/libbsp/i960/cvme961/Makefile.in b/c/src/lib/libbsp/i960/cvme961/Makefile.in index 7a8d6260ed..ea49dac82a 100644 --- a/c/src/lib/libbsp/i960/cvme961/Makefile.in +++ b/c/src/lib/libbsp/i960/cvme961/Makefile.in @@ -11,6 +11,10 @@ PROJECT_ROOT = @PROJECT_ROOT@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include startup clock console shmsupp timer wrapup +SUB_DIRS=include startup clock console $(MP_SUPPORT) timer wrapup diff --git a/c/src/lib/libbsp/m68k/mvme136/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/Makefile.in index 7a8d6260ed..ea49dac82a 100644 --- a/c/src/lib/libbsp/m68k/mvme136/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme136/Makefile.in @@ -11,6 +11,10 @@ PROJECT_ROOT = @PROJECT_ROOT@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include startup clock console shmsupp timer wrapup +SUB_DIRS=include startup clock console $(MP_SUPPORT) timer wrapup diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/Makefile.in index c1ea214afa..759ad635bd 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme147s/Makefile.in @@ -11,7 +11,11 @@ PROJECT_ROOT = @PROJECT_ROOT@ include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg include $(RTEMS_ROOT)/make/directory.cfg +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include startup clock console timer shmsupp wrapup +SUB_DIRS=include startup clock console timer $(MP_SUPPORT) wrapup diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in b/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in index 1a32c77d85..18fdec1e6a 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in +++ b/c/src/lib/libbsp/no_cpu/no_bsp/Makefile.in @@ -15,6 +15,10 @@ SRCS=README all: $(SRCS) +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) + # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include startup clock console shmsupp timer wrapup +SUB_DIRS=include startup clock console $(MP_SUPPORT) timer wrapup diff --git a/c/src/lib/libbsp/unix/posix/Makefile.in b/c/src/lib/libbsp/unix/posix/Makefile.in index 856f926a51..72a3f29766 100644 --- a/c/src/lib/libbsp/unix/posix/Makefile.in +++ b/c/src/lib/libbsp/unix/posix/Makefile.in @@ -13,14 +13,12 @@ include $(RTEMS_ROOT)/make/directory.cfg SRCS=README -# MP_PARTS are the pieces of the BSP required in a MP environment -# We only build them if HAS_MP was defined - -MP_PARTS_yes_V = shmsupp -MP_PARTS = $(MP_PARTS_$(HAS_MP)_V) +# We only build the multiprocessing support if HAS_MP was defined +MP_SUPPORT_yes_V = shmsupp +MP_SUPPORT = $(MP_SUPPORT_$(HAS_MP)_V) all: $(SRCS) # wrapup is the one that actually builds and installs the library # from the individual .rel files built in other directories -SUB_DIRS=include startup clock console timer $(MP_PARTS) wrapup tools +SUB_DIRS=include startup clock console timer $(MP_SUPPORT) wrapup tools diff --git a/c/src/lib/libmisc/monitor/Makefile.in b/c/src/lib/libmisc/monitor/Makefile.in index 1ed5d13cb1..62fac8b2e7 100644 --- a/c/src/lib/libmisc/monitor/Makefile.in +++ b/c/src/lib/libmisc/monitor/Makefile.in @@ -9,10 +9,15 @@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ LIB=${ARCH}/libmonitor-tmp.a + # C source names, if any, go here -- minus the .c +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mon-mpci +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + C_PIECES=mon-command mon-symbols mon-prmisc mon-monitor mon-object mon-server \ mon-task mon-queue mon-driver mon-dname mon-itask \ - mon-extension mon-manager mon-config mon-mpci + mon-extension mon-manager mon-config $(MP_PIECES) C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/lib/libmisc/monitor/mon-object.c b/c/src/lib/libmisc/monitor/mon-object.c index 8d5a9c395f..8112372d86 100644 --- a/c/src/lib/libmisc/monitor/mon-object.c +++ b/c/src/lib/libmisc/monitor/mon-object.c @@ -42,11 +42,19 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] = }, { RTEMS_MONITOR_OBJECT_MPCI, (void *) 0, +#if defined(RTEMS_MULTIPROCESSING) sizeof(rtems_monitor_mpci_t), (rtems_monitor_object_next_fn) rtems_monitor_mpci_next, (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical, (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header, (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump, +#else + 0, + (rtems_monitor_object_next_fn) 0, + (rtems_monitor_object_canonical_fn) 0, + (rtems_monitor_object_dump_header_fn) 0, + (rtems_monitor_object_dump_fn) 0, +#endif }, { RTEMS_MONITOR_OBJECT_INIT_TASK, (void *) 0, diff --git a/c/src/lib/libmisc/monitor/monitor.h b/c/src/lib/libmisc/monitor/monitor.h index 16efd7c41f..a9584808f3 100644 --- a/c/src/lib/libmisc/monitor/monitor.h +++ b/c/src/lib/libmisc/monitor/monitor.h @@ -200,6 +200,7 @@ typedef struct { * MPCI config */ +#if defined(RTEMS_MULTIPROCESSING) typedef struct { unsigned32 node; /* local node number */ unsigned32 maximum_nodes; /* maximum # nodes in system */ @@ -214,6 +215,7 @@ typedef struct { rtems_monitor_symbol_t send_packet; rtems_monitor_symbol_t receive_packet; } rtems_monitor_mpci_t; +#endif /* * The generic canonical information union @@ -227,7 +229,9 @@ typedef union { rtems_monitor_driver_t driver; rtems_monitor_dname_t dname; rtems_monitor_config_t config; +#if defined(RTEMS_MULTIPROCESSING) rtems_monitor_mpci_t mpci; +#endif rtems_monitor_init_task_t itask; } rtems_monitor_union_t; @@ -370,10 +374,12 @@ void rtems_monitor_config_dump_header(boolean); void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose); /* mpci.c */ +#if defined(RTEMS_MULTIPROCESSING) void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *); void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *); void rtems_monitor_mpci_dump_header(boolean); void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose); +#endif /* itask.c */ void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *); diff --git a/c/src/libmisc/monitor/Makefile.in b/c/src/libmisc/monitor/Makefile.in index 1ed5d13cb1..62fac8b2e7 100644 --- a/c/src/libmisc/monitor/Makefile.in +++ b/c/src/libmisc/monitor/Makefile.in @@ -9,10 +9,15 @@ RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ LIB=${ARCH}/libmonitor-tmp.a + # C source names, if any, go here -- minus the .c +# We only build multiprocessing related files if HAS_MP was defined +MP_PIECES_yes_V = mon-mpci +MP_PIECES = $(MP_PIECES_$(HAS_MP)_V) + C_PIECES=mon-command mon-symbols mon-prmisc mon-monitor mon-object mon-server \ mon-task mon-queue mon-driver mon-dname mon-itask \ - mon-extension mon-manager mon-config mon-mpci + mon-extension mon-manager mon-config $(MP_PIECES) C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/libmisc/monitor/mon-object.c b/c/src/libmisc/monitor/mon-object.c index 8d5a9c395f..8112372d86 100644 --- a/c/src/libmisc/monitor/mon-object.c +++ b/c/src/libmisc/monitor/mon-object.c @@ -42,11 +42,19 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] = }, { RTEMS_MONITOR_OBJECT_MPCI, (void *) 0, +#if defined(RTEMS_MULTIPROCESSING) sizeof(rtems_monitor_mpci_t), (rtems_monitor_object_next_fn) rtems_monitor_mpci_next, (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical, (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header, (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump, +#else + 0, + (rtems_monitor_object_next_fn) 0, + (rtems_monitor_object_canonical_fn) 0, + (rtems_monitor_object_dump_header_fn) 0, + (rtems_monitor_object_dump_fn) 0, +#endif }, { RTEMS_MONITOR_OBJECT_INIT_TASK, (void *) 0, diff --git a/c/src/libmisc/monitor/monitor.h b/c/src/libmisc/monitor/monitor.h index 16efd7c41f..a9584808f3 100644 --- a/c/src/libmisc/monitor/monitor.h +++ b/c/src/libmisc/monitor/monitor.h @@ -200,6 +200,7 @@ typedef struct { * MPCI config */ +#if defined(RTEMS_MULTIPROCESSING) typedef struct { unsigned32 node; /* local node number */ unsigned32 maximum_nodes; /* maximum # nodes in system */ @@ -214,6 +215,7 @@ typedef struct { rtems_monitor_symbol_t send_packet; rtems_monitor_symbol_t receive_packet; } rtems_monitor_mpci_t; +#endif /* * The generic canonical information union @@ -227,7 +229,9 @@ typedef union { rtems_monitor_driver_t driver; rtems_monitor_dname_t dname; rtems_monitor_config_t config; +#if defined(RTEMS_MULTIPROCESSING) rtems_monitor_mpci_t mpci; +#endif rtems_monitor_init_task_t itask; } rtems_monitor_union_t; @@ -370,10 +374,12 @@ void rtems_monitor_config_dump_header(boolean); void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose); /* mpci.c */ +#if defined(RTEMS_MULTIPROCESSING) void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *); void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *); void rtems_monitor_mpci_dump_header(boolean); void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose); +#endif /* itask.c */ void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *); diff --git a/c/src/optman/rtems/no-mp.c b/c/src/optman/rtems/no-mp.c index 71c38826f3..41fa81e597 100644 --- a/c/src/optman/rtems/no-mp.c +++ b/c/src/optman/rtems/no-mp.c @@ -14,6 +14,9 @@ */ #include +#if !defined(RTEMS_MULTIPROCESSING) +char rtems_no_multiprocessing; +#else #include #include #include @@ -197,5 +200,5 @@ MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ) ); return NULL; } - +#endif /* end of file */ diff --git a/c/src/tests/sptests/spsize/size.c b/c/src/tests/sptests/spsize/size.c index 9ebad1aad6..97281c9ee3 100644 --- a/c/src/tests/sptests/spsize/size.c +++ b/c/src/tests/sptests/spsize/size.c @@ -82,13 +82,17 @@ #define PER_FPTASK (long) (CONTEXT_FP_SIZE) #define PER_GOBTBL (long) (sizeof (Chain_Control)*4) #define PER_NODE (long) PER_GOBTBL +#if defined(RTEMS_MULTIPROCESSING) #define PER_GOBJECT (long) (sizeof (Objects_MP_Control)) +#else +#define PER_GOBJECT (long) 0 +#endif #define PER_PROXY (long) (sizeof (Thread_Proxy_control)) -#if (CPU_ALL_TASKS_ARE_FP == TRUE) -#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) -#else +#if !defined(RTEMS_MULTIPROCESSING) || (CPU_ALL_TASKS_ARE_FP != TRUE) #define MPCI_RECEIVE_SERVER_FP (long) 0 +#else +#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) #endif #if (CPU_IDLE_TASK_IS_FP == TRUE) @@ -97,6 +101,10 @@ #define SYSTEM_IDLE_FP (long) 0 #endif +#if defined(RTEMS_MULTIPROCESSING) +#define MPCI_RECEIVE_SERVER_STACK_SIZE 0 +#endif + #define SYSTEM_TASKS \ (STACK_MINIMUM_SIZE + \ MPCI_RECEIVE_SERVER_STACK_SIZE + \ @@ -215,7 +223,9 @@ uninitialized = /*event.h*/ (sizeof _Event_Sync_state) + +#if defined(RTEMS_MULTIPROCESSING) /*eventmp.h*/ 0 + +#endif /*eventset.h*/ 0 + @@ -244,32 +254,46 @@ uninitialized = /*modes.h*/ 0 + +#if defined(RTEMS_MULTIPROCESSING) /*mp.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) + (sizeof _MPCI_Semaphore) + (sizeof _MPCI_table) + (sizeof _MPCI_Receive_server_tcb) + (sizeof _MPCI_Packet_processors) + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mppkt.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mptables.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*msgmp.h*/ 0 + +#endif /*object.h*/ (sizeof _Objects_Local_node) + (sizeof _Objects_Maximum_nodes) + (sizeof _Objects_Information_table) + +#if defined(RTEMS_MULTIPROCESSING) /*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) + (sizeof _Objects_MP_Inactive_global_objects) + +#endif /*options.h*/ 0 + /*part.h*/ (sizeof _Partition_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*partmp.h*/ 0 + +#endif /*priority.h*/ (sizeof _Priority_Major_bit_map) + (sizeof _Priority_Bit_map) + @@ -278,13 +302,17 @@ uninitialized = /*region.h*/ (sizeof _Region_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*regionmp.h*/ 0 + +#endif /*rtems.h*/ /* Not applicable */ /*sem.h*/ (sizeof _Semaphore_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*semmp.h*/ 0 + +#endif /*signal.h*/ 0 + @@ -301,7 +329,9 @@ uninitialized = /*system.h*/ (sizeof _CPU_Table) + +#if defined(RTEMS_MULTIPROCESSING) /*taskmp.h*/ 0 + +#endif /*tasks.h*/ (sizeof _RTEMS_tasks_Information) + (sizeof _RTEMS_tasks_User_initialization_tasks) + @@ -319,9 +349,11 @@ uninitialized = (sizeof _Thread_Internal_information) + (sizeof _Thread_Idle) + +#if defined(RTEMS_MULTIPROCESSING) /*threadmp.h*/ (sizeof _Thread_MP_Receive) + (sizeof _Thread_MP_Active_proxies) + (sizeof _Thread_MP_Inactive_proxies) + +#endif /*threadq.h*/ (sizeof _Thread_queue_Extract_table) + diff --git a/configure b/configure index a4271f0f51..272e3252fb 100644 --- a/configure +++ b/configure @@ -51,6 +51,9 @@ ac_help="$ac_help \ --enable-gmake-print-directory enable GNU Make's print directory" ac_help="$ac_help +\ + --enable-multiprocessing enable multiprocessing interface" +ac_help="$ac_help \ --enable-posix enable posix interface" ac_help="$ac_help @@ -592,7 +595,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:596: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:599: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -665,7 +668,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:669: checking host system type" >&5 +echo "configure:672: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -686,7 +689,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:690: checking target system type" >&5 +echo "configure:693: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -704,7 +707,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:708: checking build system type" >&5 +echo "configure:711: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -748,6 +751,20 @@ else fi +# Check whether --enable-multiprocessing or --disable-multiprocessing was given. +if test "${enable_multiprocessing+set}" = set; then + enableval="$enable_multiprocessing" + \ +case "${enableval}" in + yes) RTEMS_HAS_MULTIPROCESSING=yes ;; + no) RTEMS_HAS_MULTIPROCESSING=no ;; + *) { echo "configure: error: bad value ${enableval} for enable-multiprocessing option" 1>&2; exit 1; } ;; +esac +else + RTEMS_HAS_MULTIPROCESSING=no +fi + + # Check whether --enable-posix or --disable-posix was given. if test "${enable_posix+set}" = set; then enableval="$enable_posix" @@ -857,7 +874,7 @@ RTEMS_PREFIX=${target_cpu}-${target_vendor} # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:861: checking for $ac_word" >&5 +echo "configure:878: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -888,7 +905,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:892: checking for $ac_word" >&5 +echo "configure:909: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -919,7 +936,7 @@ fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:923: checking for $ac_word" >&5 +echo "configure:940: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -950,7 +967,7 @@ fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:954: checking for $ac_word" >&5 +echo "configure:971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -981,7 +998,7 @@ fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:985: checking for $ac_word" >&5 +echo "configure:1002: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1010,7 +1027,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1014: checking whether ln -s works" >&5 +echo "configure:1031: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1033,7 +1050,7 @@ fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1037: checking for $ac_word" >&5 +echo "configure:1054: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1064,7 +1081,7 @@ fi # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1068: checking for $ac_word" >&5 +echo "configure:1085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SORT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1103,7 +1120,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1107: checking for a BSD compatible install" >&5 +echo "configure:1124: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1155,7 +1172,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1159: checking for $ac_word" >&5 +echo "configure:1176: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1192,7 +1209,7 @@ fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1196: checking for $ac_word" >&5 +echo "configure:1213: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1224,7 +1241,7 @@ fi echo $ac_n "checking for working $MKDIR -m 0755""... $ac_c" 1>&6 -echo "configure:1228: checking for working $MKDIR -m 0755" >&5 +echo "configure:1245: checking for working $MKDIR -m 0755" >&5 if eval "test \"`echo '$''{'rtems_cv_prog_MKDIR_P'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1241,7 +1258,7 @@ echo "$ac_t""$rtems_cv_prog_MKDIR_M" 1>&6 echo $ac_n "checking for working $MKDIR -p""... $ac_c" 1>&6 -echo "configure:1245: checking for working $MKDIR -p" >&5 +echo "configure:1262: checking for working $MKDIR -p" >&5 if eval "test \"`echo '$''{'rtems_cv_prog_mkdir_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1261,7 +1278,7 @@ test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p" # Extract the first word of "touch", so it can be a program name with args. set dummy touch; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1265: checking for $ac_word" >&5 +echo "configure:1282: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1292,7 +1309,7 @@ fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1296: checking for $ac_word" >&5 +echo "configure:1313: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1324,7 +1341,7 @@ fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1328: checking for $ac_word" >&5 +echo "configure:1345: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1357,7 +1374,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1361: checking for $ac_word" >&5 +echo "configure:1378: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_M4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1394,7 +1411,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1398: checking for $ac_word" >&5 +echo "configure:1415: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1472,7 +1489,7 @@ case "${target}" in ;; *) echo $ac_n "checking rtems target cpu""... $ac_c" 1>&6 -echo "configure:1476: checking rtems target cpu" >&5 +echo "configure:1493: checking rtems target cpu" >&5 target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` echo "$ac_t""$target_cpu" 1>&6 @@ -1491,7 +1508,7 @@ fi # Is this a supported CPU? echo $ac_n "checking if cpu $target_cpu is supported""... $ac_c" 1>&6 -echo "configure:1495: checking if cpu $target_cpu is supported" >&5 +echo "configure:1512: checking if cpu $target_cpu is supported" >&5 if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then echo "$ac_t""yes" 1>&6 makefiles="$makefiles c/src/exec/score/cpu/$target_cpu/Makefile" @@ -1516,7 +1533,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1520: checking for $ac_word" >&5 +echo "configure:1537: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CC_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1556,7 +1573,7 @@ rtems_save_CFLAGS=$CFLAGS CC=$CC_FOR_TARGET echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1560: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1577: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1566,11 +1583,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1590,12 +1607,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1594: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1611: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1599: checking whether we are using GNU C" >&5 +echo "configure:1616: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1604,7 +1621,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1619,7 +1636,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1623: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1640: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1661,7 +1678,7 @@ unset ac_cv_prog_cc_cross echo $ac_n "checking whether $CC_FOR_TARGET accepts -specs""... $ac_c" 1>&6 -echo "configure:1665: checking whether $CC_FOR_TARGET accepts -specs" >&5 +echo "configure:1682: checking whether $CC_FOR_TARGET accepts -specs" >&5 if eval "test \"`echo '$''{'rtems_cv_gcc_specs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1682,7 +1699,7 @@ echo "$ac_t""$rtems_cv_gcc_specs" 1>&6 echo $ac_n "checking whether $CC_FOR_TARGET accepts --pipe""... $ac_c" 1>&6 -echo "configure:1686: checking whether $CC_FOR_TARGET accepts --pipe" >&5 +echo "configure:1703: checking whether $CC_FOR_TARGET accepts --pipe" >&5 if eval "test \"`echo '$''{'rtems_cv_gcc_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1723,7 +1740,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1727: checking for $ac_word" >&5 +echo "configure:1744: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CXX_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1763,7 +1780,7 @@ rtems_save_CXXFLAGS=$CXXFLAGS CXX=$CXX_FOR_TARGET echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1767: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1784: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1773,11 +1790,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1803,12 +1820,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1807: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1824: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1812: checking whether we are using GNU C++" >&5 +echo "configure:1829: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1817,7 +1834,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1832,7 +1849,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1836: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1853: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1876,7 +1893,7 @@ unset ac_cv_prog_cxx_cross { echo "configure: error: *** Inconsistency in compiler configuration: Target C compiler and Target C++ compiler - must both ether be cross compilers or native compilers + must both either be cross compilers or native compilers Hint: If building a posix bsp: LD_LIBRARY_PATH? " 1>&2; exit 1; } fi else @@ -1886,7 +1903,7 @@ fi echo $ac_n "checking target's ar""... $ac_c" 1>&6 -echo "configure:1890: checking target's ar" >&5 +echo "configure:1907: checking target's ar" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1919,7 +1936,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable AR_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:1923: checking whether environment variable AR_FOR_TARGET is an absolute path" >&5 +echo "configure:1940: checking whether environment variable AR_FOR_TARGET is an absolute path" >&5 case "$AR_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -1936,7 +1953,7 @@ echo "configure:1923: checking whether environment variable AR_FOR_TARGET is an # Extract the first word of ""$program_prefix"ar", so it can be a program name with args. set dummy "$program_prefix"ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1940: checking for $ac_word" >&5 +echo "configure:1957: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1969,7 +1986,7 @@ fi echo $ac_n "checking target's as""... $ac_c" 1>&6 -echo "configure:1973: checking target's as" >&5 +echo "configure:1990: checking target's as" >&5 if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2002,7 +2019,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable AS_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2006: checking whether environment variable AS_FOR_TARGET is an absolute path" >&5 +echo "configure:2023: checking whether environment variable AS_FOR_TARGET is an absolute path" >&5 case "$AS_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2019,7 +2036,7 @@ echo "configure:2006: checking whether environment variable AS_FOR_TARGET is an # Extract the first word of ""$program_prefix"as", so it can be a program name with args. set dummy "$program_prefix"as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2023: checking for $ac_word" >&5 +echo "configure:2040: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2052,7 +2069,7 @@ fi echo $ac_n "checking target's ld""... $ac_c" 1>&6 -echo "configure:2056: checking target's ld" >&5 +echo "configure:2073: checking target's ld" >&5 if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2085,7 +2102,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable LD_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2089: checking whether environment variable LD_FOR_TARGET is an absolute path" >&5 +echo "configure:2106: checking whether environment variable LD_FOR_TARGET is an absolute path" >&5 case "$LD_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2102,7 +2119,7 @@ echo "configure:2089: checking whether environment variable LD_FOR_TARGET is an # Extract the first word of ""$program_prefix"ld", so it can be a program name with args. set dummy "$program_prefix"ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2106: checking for $ac_word" >&5 +echo "configure:2123: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2135,7 +2152,7 @@ fi echo $ac_n "checking target's nm""... $ac_c" 1>&6 -echo "configure:2139: checking target's nm" >&5 +echo "configure:2156: checking target's nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2168,7 +2185,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable NM_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2172: checking whether environment variable NM_FOR_TARGET is an absolute path" >&5 +echo "configure:2189: checking whether environment variable NM_FOR_TARGET is an absolute path" >&5 case "$NM_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2185,7 +2202,7 @@ echo "configure:2172: checking whether environment variable NM_FOR_TARGET is an # Extract the first word of ""$program_prefix"nm", so it can be a program name with args. set dummy "$program_prefix"nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2189: checking for $ac_word" >&5 +echo "configure:2206: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2219,7 +2236,7 @@ fi echo $ac_n "checking target's ranlib""... $ac_c" 1>&6 -echo "configure:2223: checking target's ranlib" >&5 +echo "configure:2240: checking target's ranlib" >&5 if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2252,7 +2269,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable RANLIB_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2256: checking whether environment variable RANLIB_FOR_TARGET is an absolute path" >&5 +echo "configure:2273: checking whether environment variable RANLIB_FOR_TARGET is an absolute path" >&5 case "$RANLIB_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2269,7 +2286,7 @@ echo "configure:2256: checking whether environment variable RANLIB_FOR_TARGET is # Extract the first word of ""$program_prefix"ranlib", so it can be a program name with args. set dummy "$program_prefix"ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2273: checking for $ac_word" >&5 +echo "configure:2290: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2304,7 +2321,7 @@ fi # ranlib wasn't found; check if ar -s is available echo $ac_n "checking whether $AR_FOR_TARGET -s works""... $ac_c" 1>&6 -echo "configure:2308: checking whether $AR_FOR_TARGET -s works" >&5 +echo "configure:2325: checking whether $AR_FOR_TARGET -s works" >&5 if eval "test \"`echo '$''{'rtems_cv_AR_FOR_TARGET_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2313,8 +2330,8 @@ cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; }; } \ - && { ac_try='$AR_FOR_TARGET -sr conftest.a conftest.o'; { (eval echo configure:2318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \ +if { ac_try='$CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext'; { (eval echo configure:2334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \ + && { ac_try='$AR_FOR_TARGET -sr conftest.a conftest.o'; { (eval echo configure:2335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \ && test -s conftest.a ; \ then rtems_cv_AR_FOR_TARGET_S="yes" @@ -2339,7 +2356,7 @@ echo "$ac_t""$rtems_cv_AR_FOR_TARGET_S" 1>&6 echo $ac_n "checking target's objcopy""... $ac_c" 1>&6 -echo "configure:2343: checking target's objcopy" >&5 +echo "configure:2360: checking target's objcopy" >&5 if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2372,7 +2389,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable OBJCOPY_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2376: checking whether environment variable OBJCOPY_FOR_TARGET is an absolute path" >&5 +echo "configure:2393: checking whether environment variable OBJCOPY_FOR_TARGET is an absolute path" >&5 case "$OBJCOPY_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2389,7 +2406,7 @@ echo "configure:2376: checking whether environment variable OBJCOPY_FOR_TARGET i # Extract the first word of ""$program_prefix"objcopy", so it can be a program name with args. set dummy "$program_prefix"objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2393: checking for $ac_word" >&5 +echo "configure:2410: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_OBJCOPY_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2422,7 +2439,7 @@ fi echo $ac_n "checking target's size""... $ac_c" 1>&6 -echo "configure:2426: checking target's size" >&5 +echo "configure:2443: checking target's size" >&5 if eval "test \"`echo '$''{'ac_cv_path_SIZE_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2455,7 +2472,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable SIZE_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2459: checking whether environment variable SIZE_FOR_TARGET is an absolute path" >&5 +echo "configure:2476: checking whether environment variable SIZE_FOR_TARGET is an absolute path" >&5 case "$SIZE_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2472,7 +2489,7 @@ echo "configure:2459: checking whether environment variable SIZE_FOR_TARGET is a # Extract the first word of ""$program_prefix"size", so it can be a program name with args. set dummy "$program_prefix"size; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2476: checking for $ac_word" >&5 +echo "configure:2493: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SIZE_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2505,7 +2522,7 @@ fi echo $ac_n "checking target's strip""... $ac_c" 1>&6 -echo "configure:2509: checking target's strip" >&5 +echo "configure:2526: checking target's strip" >&5 if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2538,7 +2555,7 @@ else # will override the environment variable, which isn't what the user # intends echo $ac_n "checking whether environment variable STRIP_FOR_TARGET is an absolute path""... $ac_c" 1>&6 -echo "configure:2542: checking whether environment variable STRIP_FOR_TARGET is an absolute path" >&5 +echo "configure:2559: checking whether environment variable STRIP_FOR_TARGET is an absolute path" >&5 case "$STRIP_FOR_TARGET" in /*) # valid echo "$ac_t"""yes"" 1>&6 @@ -2555,7 +2572,7 @@ echo "configure:2542: checking whether environment variable STRIP_FOR_TARGET is # Extract the first word of ""$program_prefix"strip", so it can be a program name with args. set dummy "$program_prefix"strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2559: checking for $ac_word" >&5 +echo "configure:2576: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_STRIP_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2590,7 +2607,7 @@ fi if test "${target_cpu}" = "i386"; then echo $ac_n "checking for 16 bit mode assembler support""... $ac_c" 1>&6 -echo "configure:2594: checking for 16 bit mode assembler support" >&5 +echo "configure:2611: checking for 16 bit mode assembler support" >&5 if eval "test \"`echo '$''{'rtems_cv_prog_gas_code16'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2600,7 +2617,7 @@ else addr32 lgdt 0 EOF - if { ac_try='$AS_FOR_TARGET -o conftest.o conftest.s'; { (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='$AS_FOR_TARGET -o conftest.o conftest.s'; { (eval echo configure:2621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then rtems_cv_prog_gas_code16=yes else rtems_cv_prog_gas_code16=no @@ -2615,7 +2632,7 @@ echo "$ac_t""$rtems_cv_prog_gas_code16" 1>&6 # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2619: checking for $ac_word" >&5 +echo "configure:2636: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2644,7 +2661,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2648: checking for $ac_word" >&5 +echo "configure:2665: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2692,7 +2709,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2713: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2702,11 +2719,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2726,12 +2743,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2747: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2735: checking whether we are using GNU C" >&5 +echo "configure:2752: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2740,7 +2757,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2755,7 +2772,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2759: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2776: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2784,19 +2801,19 @@ fi echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6 -echo "configure:2788: checking for Cygwin32 environment" >&5 +echo "configure:2805: checking for Cygwin32 environment" >&5 if eval "test \"`echo '$''{'rtems_cv_cygwin32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rtems_cv_cygwin32=yes else @@ -2814,7 +2831,7 @@ CYGWIN32= test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2818: checking for executable suffix" >&5 +echo "configure:2835: checking for executable suffix" >&5 if eval "test \"`echo '$''{'rtems_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2855,12 +2872,12 @@ test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"} for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2859: checking for $ac_func" >&5 +echo "configure:2876: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2912,7 +2929,7 @@ if test "$target_cpu" = "unix" ; then echo $ac_n "checking whether $RTEMS_HOST supports System V semaphores""... $ac_c" 1>&6 -echo "configure:2916: checking whether $RTEMS_HOST supports System V semaphores" >&5 +echo "configure:2933: checking whether $RTEMS_HOST supports System V semaphores" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_sem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2921,7 +2938,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -2947,7 +2964,7 @@ int main () { } EOF -if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_sem="yes" else @@ -2970,7 +2987,7 @@ echo "$ac_t""$rtems_cv_sysv_sem" 1>&6 echo $ac_n "checking whether $RTEMS_HOST supports System V shared memory""... $ac_c" 1>&6 -echo "configure:2974: checking whether $RTEMS_HOST supports System V shared memory" >&5 +echo "configure:2991: checking whether $RTEMS_HOST supports System V shared memory" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_shm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2979,7 +2996,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -2995,7 +3012,7 @@ int main () { } EOF -if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_shm="yes" else @@ -3018,7 +3035,7 @@ echo "$ac_t""$rtems_cv_sysv_shm" 1>&6 echo $ac_n "checking whether $RTEMS_HOST supports System V messages""... $ac_c" 1>&6 -echo "configure:3022: checking whether $RTEMS_HOST supports System V messages" >&5 +echo "configure:3039: checking whether $RTEMS_HOST supports System V messages" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_msg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3027,7 +3044,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -3043,7 +3060,7 @@ int main () { } EOF -if { (eval echo configure:3047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_msg="yes" else @@ -3068,7 +3085,7 @@ fi # find all the Executive Makefiles echo $ac_n "checking for Makefile.in in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6 -echo "configure:3072: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5 +echo "configure:3089: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5 if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3083,7 +3100,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/exec/rtems""... $ac_c" 1>&6 -echo "configure:3087: checking for Makefile.in in c/src/exec/rtems" >&5 +echo "configure:3104: checking for Makefile.in in c/src/exec/rtems" >&5 if test -d $srcdir/c/src/exec/rtems; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3098,7 +3115,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/exec/sapi""... $ac_c" 1>&6 -echo "configure:3102: checking for Makefile.in in c/src/exec/sapi" >&5 +echo "configure:3119: checking for Makefile.in in c/src/exec/sapi" >&5 if test -d $srcdir/c/src/exec/sapi; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3115,7 +3132,7 @@ fi if test "$RTEMS_HAS_POSIX_API" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/exec/posix""... $ac_c" 1>&6 -echo "configure:3119: checking for Makefile.in in c/src/exec/posix" >&5 +echo "configure:3136: checking for Makefile.in in c/src/exec/posix" >&5 if test -d $srcdir/c/src/exec/posix; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3137,7 +3154,7 @@ if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then if test -z "$rtems_bsp"; then echo $ac_n "checking for bsps""... $ac_c" 1>&6 -echo "configure:3141: checking for bsps" >&5 +echo "configure:3158: checking for bsps" >&5 files=`ls $srcdir/c/src/lib/libbsp/$target_cpu` for file in $files; do case $file in @@ -3202,7 +3219,7 @@ echo "configure:3141: checking for bsps" >&5 bspdirs="$bspdirs $bspdir" echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir""... $ac_c" 1>&6 -echo "configure:3206: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5 +echo "configure:3223: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5 if test -d $srcdir/c/src/lib/libbsp/$bspcpudir$bspdir; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3217,7 +3234,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared""... $ac_c" 1>&6 -echo "configure:3221: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5 +echo "configure:3238: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5 if test -d $srcdir/c/src/lib/libbsp/${bspcpudir}shared; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3240,7 +3257,7 @@ fi # find all the CPU dependent library Makefiles echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6 -echo "configure:3244: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5 +echo "configure:3261: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5 if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3257,7 +3274,7 @@ fi if test "$skip_startfiles" != "yes"; then echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6 -echo "configure:3261: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5 +echo "configure:3278: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5 if test -d $srcdir/c/src/lib/start/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3289,12 +3306,12 @@ fi # If the TCP/IP stack is enabled, then find all TCP/IP Makefiles echo $ac_n "checking if networking is enabled? ""... $ac_c" 1>&6 -echo "configure:3293: checking if networking is enabled? " >&5 +echo "configure:3310: checking if networking is enabled? " >&5 echo "$ac_t""$RTEMS_HAS_NETWORKING" 1>&6 if test "$RTEMS_HAS_NETWORKING" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/lib/libnetworking""... $ac_c" 1>&6 -echo "configure:3298: checking for Makefile.in in c/src/lib/libnetworking" >&5 +echo "configure:3315: checking for Makefile.in in c/src/lib/libnetworking" >&5 if test -d $srcdir/c/src/lib/libnetworking; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3316,7 +3333,7 @@ fi # If the tests are enabled, then find all the test suite Makefiles echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6 -echo "configure:3320: checking if the test suites are enabled? " >&5 +echo "configure:3337: checking if the test suites are enabled? " >&5 tests_enabled=yes # Check whether --enable-tests or --disable-tests was given. if test "${enable_tests+set}" = set; then @@ -3335,7 +3352,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6 -echo "configure:3339: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5 +echo "configure:3356: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5 if test -d $srcdir/c/src/tests/tools/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3352,7 +3369,7 @@ fi if test "$tests_enabled" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6 -echo "configure:3356: checking for Makefile.in in c/src/tests/libtests" >&5 +echo "configure:3373: checking for Makefile.in in c/src/tests/libtests" >&5 if test -d $srcdir/c/src/tests/libtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3367,7 +3384,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6 -echo "configure:3371: checking for Makefile.in in c/src/tests/sptests" >&5 +echo "configure:3388: checking for Makefile.in in c/src/tests/sptests" >&5 if test -d $srcdir/c/src/tests/sptests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3382,7 +3399,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6 -echo "configure:3386: checking for Makefile.in in c/src/tests/tmtests" >&5 +echo "configure:3403: checking for Makefile.in in c/src/tests/tmtests" >&5 if test -d $srcdir/c/src/tests/tmtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3395,9 +3412,10 @@ else fi - + if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then + echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6 -echo "configure:3401: checking for Makefile.in in c/src/tests/mptests" >&5 +echo "configure:3419: checking for Makefile.in in c/src/tests/mptests" >&5 if test -d $srcdir/c/src/tests/mptests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3410,10 +3428,11 @@ else fi + fi if test "$RTEMS_HAS_POSIX_API" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6 -echo "configure:3417: checking for Makefile.in in c/src/tests/psxtests" >&5 +echo "configure:3436: checking for Makefile.in in c/src/tests/psxtests" >&5 if test -d $srcdir/c/src/tests/psxtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3431,7 +3450,7 @@ fi # If the HWAPI is enabled, the find the HWAPI Makefiles echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6 -echo "configure:3435: checking if the HWAPI is enabled? " >&5 +echo "configure:3454: checking if the HWAPI is enabled? " >&5 # Check whether --enable-hwapi or --disable-hwapi was given. if test "${enable_hwapi+set}" = set; then enableval="$enable_hwapi" @@ -3442,7 +3461,7 @@ if test "${enable_hwapi+set}" = set; then makefiles="$makefiles c/src/lib/libhwapi/Makefile" echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6 -echo "configure:3446: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5 +echo "configure:3465: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5 if test -d $srcdir/c/src/lib/libhwapi/analog; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3457,7 +3476,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6 -echo "configure:3461: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5 +echo "configure:3480: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5 if test -d $srcdir/c/src/lib/libhwapi/discrete; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3472,7 +3491,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6 -echo "configure:3476: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5 +echo "configure:3495: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5 if test -d $srcdir/c/src/lib/libhwapi/drivers; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3487,7 +3506,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6 -echo "configure:3491: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5 +echo "configure:3510: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5 if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3502,7 +3521,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6 -echo "configure:3506: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5 +echo "configure:3525: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5 if test -d $srcdir/c/src/lib/libhwapi/serial; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3517,7 +3536,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6 -echo "configure:3521: checking for Makefile.in in c/src/lib/libhwapi/support" >&5 +echo "configure:3540: checking for Makefile.in in c/src/lib/libhwapi/support" >&5 if test -d $srcdir/c/src/lib/libhwapi/support; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3532,7 +3551,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6 -echo "configure:3536: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5 +echo "configure:3555: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5 if test -d $srcdir/c/src/lib/libhwapi/wrapup; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3582,7 +3601,7 @@ fi # pick up all the Makefiles in required parts of the tree echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6 -echo "configure:3586: checking for Makefile.in in c/build-tools" >&5 +echo "configure:3605: checking for Makefile.in in c/build-tools" >&5 if test -d $srcdir/c/build-tools; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3597,7 +3616,7 @@ fi echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6 -echo "configure:3601: checking for Makefile.in in make" >&5 +echo "configure:3620: checking for Makefile.in in make" >&5 if test -d $srcdir/make; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3612,7 +3631,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libchip""... $ac_c" 1>&6 -echo "configure:3616: checking for Makefile.in in c/src/lib/libchip" >&5 +echo "configure:3635: checking for Makefile.in in c/src/lib/libchip" >&5 if test -d $srcdir/c/src/lib/libchip; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3627,7 +3646,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6 -echo "configure:3631: checking for Makefile.in in c/src/lib/libmisc" >&5 +echo "configure:3650: checking for Makefile.in in c/src/lib/libmisc" >&5 if test -d $srcdir/c/src/lib/libmisc; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3642,7 +3661,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6 -echo "configure:3646: checking for Makefile.in in c/src/tests/samples" >&5 +echo "configure:3665: checking for Makefile.in in c/src/tests/samples" >&5 if test -d $srcdir/c/src/tests/samples; then rtems_av_save_dir=`pwd`; cd $srcdir; diff --git a/configure.in b/configure.in index 24b8f8c102..a796507327 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,14 @@ AC_ARG_ENABLE(gmake-print-directory, \ *) AC_MSG_ERROR(bad value ${enableval} for gmake-print-directory option) ;; esac],[RTEMS_USE_OWN_PDIR=yes]) +AC_ARG_ENABLE(multiprocessing, \ +[ --enable-multiprocessing enable multiprocessing interface], \ +[case "${enableval}" in + yes) RTEMS_HAS_MULTIPROCESSING=yes ;; + no) RTEMS_HAS_MULTIPROCESSING=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;; +esac],[RTEMS_HAS_MULTIPROCESSING=no]) + AC_ARG_ENABLE(posix, \ [ --enable-posix enable posix interface], \ [case "${enableval}" in @@ -426,7 +434,9 @@ if test "$tests_enabled" = "yes"; then RTEMS_CHECK_MAKEFILE(c/src/tests/libtests) RTEMS_CHECK_MAKEFILE(c/src/tests/sptests) RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests) - RTEMS_CHECK_MAKEFILE(c/src/tests/mptests) + if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then + RTEMS_CHECK_MAKEFILE(c/src/tests/mptests) + fi if test "$RTEMS_HAS_POSIX_API" = "yes"; then RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests) fi diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c index 8d5a9c395f..8112372d86 100644 --- a/cpukit/libmisc/monitor/mon-object.c +++ b/cpukit/libmisc/monitor/mon-object.c @@ -42,11 +42,19 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] = }, { RTEMS_MONITOR_OBJECT_MPCI, (void *) 0, +#if defined(RTEMS_MULTIPROCESSING) sizeof(rtems_monitor_mpci_t), (rtems_monitor_object_next_fn) rtems_monitor_mpci_next, (rtems_monitor_object_canonical_fn) rtems_monitor_mpci_canonical, (rtems_monitor_object_dump_header_fn) rtems_monitor_mpci_dump_header, (rtems_monitor_object_dump_fn) rtems_monitor_mpci_dump, +#else + 0, + (rtems_monitor_object_next_fn) 0, + (rtems_monitor_object_canonical_fn) 0, + (rtems_monitor_object_dump_header_fn) 0, + (rtems_monitor_object_dump_fn) 0, +#endif }, { RTEMS_MONITOR_OBJECT_INIT_TASK, (void *) 0, diff --git a/cpukit/libmisc/monitor/monitor.h b/cpukit/libmisc/monitor/monitor.h index 16efd7c41f..a9584808f3 100644 --- a/cpukit/libmisc/monitor/monitor.h +++ b/cpukit/libmisc/monitor/monitor.h @@ -200,6 +200,7 @@ typedef struct { * MPCI config */ +#if defined(RTEMS_MULTIPROCESSING) typedef struct { unsigned32 node; /* local node number */ unsigned32 maximum_nodes; /* maximum # nodes in system */ @@ -214,6 +215,7 @@ typedef struct { rtems_monitor_symbol_t send_packet; rtems_monitor_symbol_t receive_packet; } rtems_monitor_mpci_t; +#endif /* * The generic canonical information union @@ -227,7 +229,9 @@ typedef union { rtems_monitor_driver_t driver; rtems_monitor_dname_t dname; rtems_monitor_config_t config; +#if defined(RTEMS_MULTIPROCESSING) rtems_monitor_mpci_t mpci; +#endif rtems_monitor_init_task_t itask; } rtems_monitor_union_t; @@ -370,10 +374,12 @@ void rtems_monitor_config_dump_header(boolean); void rtems_monitor_config_dump(rtems_monitor_config_t *, boolean verbose); /* mpci.c */ +#if defined(RTEMS_MULTIPROCESSING) void rtems_monitor_mpci_canonical(rtems_monitor_mpci_t *, void *); void *rtems_monitor_mpci_next(void *, rtems_monitor_mpci_t *, rtems_id *); void rtems_monitor_mpci_dump_header(boolean); void rtems_monitor_mpci_dump(rtems_monitor_mpci_t *, boolean verbose); +#endif /* itask.c */ void rtems_monitor_init_task_canonical(rtems_monitor_init_task_t *, void *); diff --git a/cpukit/posix/include/rtems/posix/cond.h b/cpukit/posix/include/rtems/posix/cond.h index 92c2e453ae..0fb44d8042 100644 --- a/cpukit/posix/include/rtems/posix/cond.h +++ b/cpukit/posix/include/rtems/posix/cond.h @@ -119,7 +119,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Condition_variables_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/posix/include/rtems/posix/mqueue.h b/cpukit/posix/include/rtems/posix/mqueue.h index 8e2851bfb5..f73cb509ce 100644 --- a/cpukit/posix/include/rtems/posix/mqueue.h +++ b/cpukit/posix/include/rtems/posix/mqueue.h @@ -175,7 +175,9 @@ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/posix/include/rtems/posix/mutex.h b/cpukit/posix/include/rtems/posix/mutex.h index e6c5c44d39..b0d9526dd5 100644 --- a/cpukit/posix/include/rtems/posix/mutex.h +++ b/cpukit/posix/include/rtems/posix/mutex.h @@ -109,7 +109,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Mutex_Is_null ( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/posix/include/rtems/posix/pthread.h b/cpukit/posix/include/rtems/posix/pthread.h index abf5933fc2..46e5834385 100644 --- a/cpukit/posix/include/rtems/posix/pthread.h +++ b/cpukit/posix/include/rtems/posix/pthread.h @@ -112,7 +112,9 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Threads_Is_null( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/posix/include/rtems/posix/semaphore.h b/cpukit/posix/include/rtems/posix/semaphore.h index cc658ee32b..aaf0c4b898 100644 --- a/cpukit/posix/include/rtems/posix/semaphore.h +++ b/cpukit/posix/include/rtems/posix/semaphore.h @@ -124,7 +124,9 @@ int _POSIX_Semaphore_Name_to_id( ); #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c index 248f836b94..0cb06ec192 100644 --- a/cpukit/posix/src/cond.c +++ b/cpukit/posix/src/cond.c @@ -17,6 +17,8 @@ * TEMPORARY */ + +#if defined(RTEMS_MULTIPROCESSING) void _POSIX_Condition_variables_MP_Send_process_packet ( POSIX_Condition_variables_MP_Remote_operations operation, Objects_Id condition_variables_id, @@ -33,6 +35,7 @@ void _POSIX_Condition_variables_MP_Send_extract_proxy( { (void) POSIX_MP_NOT_IMPLEMENTED(); } +#endif /* * END OF TEMPORARY @@ -190,6 +193,7 @@ int pthread_cond_init( return ENOMEM; } +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && !( _Objects_MP_Allocate_and_open( &_POSIX_Condition_variables_Information, 0, the_cond->Object.id, FALSE ) ) ) { @@ -197,6 +201,7 @@ int pthread_cond_init( _Thread_Enable_dispatch(); return EAGAIN; } +#endif the_cond->process_shared = the_attr->process_shared; @@ -208,7 +213,11 @@ int pthread_cond_init( OBJECTS_POSIX_CONDITION_VARIABLES, THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_CONDITION_VARIABLE, +#if defined(RTEMS_MULTIPROCESSING) _POSIX_Condition_variables_MP_Send_extract_proxy, +#else + NULL, +#endif ETIMEDOUT ); @@ -220,6 +229,7 @@ int pthread_cond_init( *cond = the_cond->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) _POSIX_Condition_variables_MP_Send_process_packet( POSIX_CONDITION_VARIABLES_MP_ANNOUNCE_CREATE, @@ -227,6 +237,7 @@ int pthread_cond_init( 0, /* Name not used */ 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); @@ -248,12 +259,17 @@ int pthread_cond_destroy( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + + case OBJECTS_ERROR: + return EINVAL; + + case OBJECTS_LOCAL: if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { @@ -268,6 +284,7 @@ int pthread_cond_destroy( _POSIX_Condition_variables_Free( the_cond ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_cond->process_shared == PTHREAD_PROCESS_SHARED ) { _Objects_MP_Close( @@ -282,6 +299,7 @@ int pthread_cond_destroy( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return 0; } @@ -307,12 +325,15 @@ int _POSIX_Condition_variables_Signal_support( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: do { @@ -380,12 +401,14 @@ int _POSIX_Condition_variables_Wait_support( the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { diff --git a/cpukit/posix/src/mutex.c b/cpukit/posix/src/mutex.c index fa2ccc9cc5..10a38a06e5 100644 --- a/cpukit/posix/src/mutex.c +++ b/cpukit/posix/src/mutex.c @@ -9,7 +9,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -18,6 +20,7 @@ * TEMPORARY */ +#if defined(RTEMS_MULTIPROCESSING) void _POSIX_Mutex_MP_Send_process_packet ( POSIX_Mutex_MP_Remote_operations operation, Objects_Id mutex_id, @@ -52,6 +55,7 @@ void POSIX_Threads_mutex_MP_support( { (void) POSIX_MP_NOT_IMPLEMENTED(); /* XXX: should never get here */ } +#endif /* * END OF TEMPORARY @@ -238,9 +242,9 @@ int pthread_mutex_init( mutex_in_use = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { + case OBJECTS_REMOTE: case OBJECTS_ERROR: break; - case OBJECTS_REMOTE: case OBJECTS_LOCAL: _Thread_Enable_dispatch(); return EBUSY; @@ -256,8 +260,10 @@ int pthread_mutex_init( assert( the_attr->process_shared == PTHREAD_PROCESS_PRIVATE ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return POSIX_MP_NOT_IMPLEMENTED(); +#endif /* * Determine the discipline of the mutex @@ -289,6 +295,7 @@ int pthread_mutex_init( return EAGAIN; } +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED && !( _Objects_MP_Allocate_and_open( &_POSIX_Mutex_Information, 0, the_mutex->Object.id, FALSE ) ) ) { @@ -296,6 +303,7 @@ int pthread_mutex_init( _Thread_Enable_dispatch(); return EAGAIN; } +#endif the_mutex->process_shared = the_attr->process_shared; @@ -322,6 +330,7 @@ int pthread_mutex_init( *mutex = the_mutex->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) _POSIX_Mutex_MP_Send_process_packet( POSIX_MUTEX_MP_ANNOUNCE_CREATE, @@ -329,6 +338,7 @@ int pthread_mutex_init( 0, /* Name not used */ 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return 0; @@ -348,12 +358,14 @@ int pthread_mutex_destroy( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return POSIX_MP_NOT_IMPLEMENTED(); return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: /* * XXX: There is an error for the mutex being locked @@ -369,12 +381,17 @@ int pthread_mutex_destroy( _CORE_mutex_Flush( &the_mutex->Mutex, +#if defined(RTEMS_MULTIPROCESSING) _POSIX_Mutex_MP_Send_object_was_deleted, +#else + NULL, +#endif EINVAL ); _POSIX_Mutex_Free( the_mutex ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_mutex->process_shared == PTHREAD_PROCESS_SHARED ) { _Objects_MP_Close( &_POSIX_Mutex_Information, the_mutex->Object.id ); @@ -386,6 +403,7 @@ int pthread_mutex_destroy( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return 0; } @@ -411,15 +429,17 @@ int _POSIX_Mutex_Lock_support( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _POSIX_Mutex_MP_Send_request_packet( POSIX_MUTEX_MP_OBTAIN_REQUEST, *mutex, 0, /* must define the option set */ WATCHDOG_NO_TIMEOUT ); +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: _CORE_mutex_Seize( &the_mutex->Mutex, @@ -480,20 +500,26 @@ int pthread_mutex_unlock( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _POSIX_Mutex_MP_Send_request_packet( POSIX_MUTEX_MP_RELEASE_REQUEST, *mutex, 0, /* Not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) POSIX_Threads_mutex_MP_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return _POSIX_Mutex_From_core_mutex_status( status ); @@ -634,11 +660,13 @@ int pthread_mutex_setprioceiling( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; /* impossible to get here */ case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) /* XXX It feels questionable to set the ceiling on a remote mutex. */ return EINVAL; +#endif + case OBJECTS_ERROR: + return EINVAL; /* impossible to get here */ case OBJECTS_LOCAL: *old_ceiling = _POSIX_Priority_From_core( the_mutex->Mutex.Attributes.priority_ceiling @@ -647,7 +675,11 @@ int pthread_mutex_setprioceiling( _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, +#if defined(RTEMS_MULTIPROCESSING) POSIX_Threads_mutex_MP_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return 0; @@ -673,10 +705,12 @@ int pthread_mutex_getprioceiling( the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { - case OBJECTS_ERROR: - return EINVAL; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return POSIX_MP_NOT_IMPLEMENTED(); /* XXX feels questionable */ +#endif + case OBJECTS_ERROR: + return EINVAL; case OBJECTS_LOCAL: *prioceiling = _POSIX_Priority_From_core( the_mutex->Mutex.Attributes.priority_ceiling diff --git a/cpukit/rtems/include/rtems.h b/cpukit/rtems/include/rtems.h index 9a165c08dd..01c0b8478b 100644 --- a/cpukit/rtems/include/rtems.h +++ b/cpukit/rtems/include/rtems.h @@ -57,7 +57,9 @@ extern "C" { #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h index 48045bdade..576b1edbff 100644 --- a/cpukit/rtems/include/rtems/rtems/event.h +++ b/cpukit/rtems/include/rtems/rtems/event.h @@ -161,7 +161,9 @@ void _Event_Timeout ( RTEMS_EXTERN volatile Event_Sync_states _Event_Sync_state; +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifndef __RTEMS_APPLICATION__ #include #endif diff --git a/cpukit/rtems/include/rtems/rtems/message.h b/cpukit/rtems/include/rtems/rtems/message.h index 611d46fde8..283381eecc 100644 --- a/cpukit/rtems/include/rtems/rtems/message.h +++ b/cpukit/rtems/include/rtems/rtems/message.h @@ -316,15 +316,19 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Message_queue_Core_message_queue_mp_support ( Thread_Control *the_thread, Objects_Id id ); +#endif #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h index 1d720db146..884c9a5426 100644 --- a/cpukit/rtems/include/rtems/rtems/part.h +++ b/cpukit/rtems/include/rtems/rtems/part.h @@ -158,7 +158,9 @@ rtems_status_code rtems_partition_return_buffer( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/include/rtems/rtems/region.h b/cpukit/rtems/include/rtems/rtems/region.h index 05418f6a95..93f279fcb5 100644 --- a/cpukit/rtems/include/rtems/rtems/region.h +++ b/cpukit/rtems/include/rtems/rtems/region.h @@ -201,7 +201,9 @@ rtems_status_code rtems_region_return_segment( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * _Region_Debug_Walk diff --git a/cpukit/rtems/include/rtems/rtems/sem.h b/cpukit/rtems/include/rtems/rtems/sem.h index 191e62b414..96ae149192 100644 --- a/cpukit/rtems/include/rtems/rtems/sem.h +++ b/cpukit/rtems/include/rtems/rtems/sem.h @@ -214,10 +214,12 @@ rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( * is called by the core. */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_mutex_mp_support ( Thread_Control *the_thread, rtems_id id ); +#endif /*PAGE * @@ -238,7 +240,9 @@ void _Semaphore_Core_semaphore_mp_support ( #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/include/rtems/rtems/signal.h b/cpukit/rtems/include/rtems/rtems/signal.h index 2b247762e9..c9424a2dfd 100644 --- a/cpukit/rtems/include/rtems/rtems/signal.h +++ b/cpukit/rtems/include/rtems/rtems/signal.h @@ -73,7 +73,9 @@ rtems_status_code rtems_signal_send( rtems_signal_set signal_set ); +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h index 17730cee7f..82506a5409 100644 --- a/cpukit/rtems/include/rtems/rtems/tasks.h +++ b/cpukit/rtems/include/rtems/rtems/tasks.h @@ -411,7 +411,9 @@ void _RTEMS_tasks_Initialize_user_tasks( void ); #ifndef __RTEMS_APPLICATION__ #include #endif +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/include/rtems/rtems/types.h b/cpukit/rtems/include/rtems/rtems/types.h index 4d2915bafa..10165a6180 100644 --- a/cpukit/rtems/include/rtems/rtems/types.h +++ b/cpukit/rtems/include/rtems/rtems/types.h @@ -22,9 +22,13 @@ extern "C" { #include #include +#include +#include #include +#if defined(RTEMS_MULTIPROCESSING) #include #include +#endif /* * RTEMS basic type definitions @@ -75,6 +79,7 @@ typedef Modes_Control rtems_mode; * MPCI related entries */ +#if defined(RTEMS_MULTIPROCESSING) typedef MP_packet_Classes rtems_mp_packet_classes; typedef MP_packet_Prefix rtems_packet_prefix; @@ -87,6 +92,7 @@ typedef MPCI_receive_entry rtems_mpci_receive_packet_entry; typedef MPCI_Entry rtems_mpci_entry; typedef MPCI_Control rtems_mpci_table; +#endif #ifdef __cplusplus } diff --git a/cpukit/rtems/inline/rtems/rtems/attr.inl b/cpukit/rtems/inline/rtems/rtems/attr.inl index 3cec1edd3b..df4e8650b5 100644 --- a/cpukit/rtems/inline/rtems/rtems/attr.inl +++ b/cpukit/rtems/inline/rtems/rtems/attr.inl @@ -80,12 +80,14 @@ RTEMS_INLINE_ROUTINE boolean _Attributes_Is_floating_point( * enabled in the attribute_set and FALSE otherwise. */ +#if defined(RTEMS_MULTIPROCESSING) RTEMS_INLINE_ROUTINE boolean _Attributes_Is_global( rtems_attribute attribute_set ) { return ( attribute_set & RTEMS_GLOBAL ); } +#endif /*PAGE * diff --git a/cpukit/rtems/macros/rtems/rtems/attr.inl b/cpukit/rtems/macros/rtems/rtems/attr.inl index 290e7f7870..2d8303db11 100644 --- a/cpukit/rtems/macros/rtems/rtems/attr.inl +++ b/cpukit/rtems/macros/rtems/rtems/attr.inl @@ -48,8 +48,10 @@ * */ +#if defined(RTEMS_MULTIPROCESSING) #define _Attributes_Is_global( _attribute_set ) \ ( (_attribute_set) & RTEMS_GLOBAL ) +#endif /*PAGE * diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c index 9cc778df82..cb9ed3fa4d 100644 --- a/cpukit/rtems/src/dpmem.c +++ b/cpukit/rtems/src/dpmem.c @@ -168,10 +168,12 @@ rtems_status_code rtems_port_delete( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); _Dual_ported_memory_Free( the_port ); @@ -213,10 +215,12 @@ rtems_status_code rtems_port_internal_to_external( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) @@ -262,10 +266,12 @@ rtems_status_code rtems_port_external_to_internal( the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c index a780ba7cf7..36c345ca8c 100644 --- a/cpukit/rtems/src/event.c +++ b/cpukit/rtems/src/event.c @@ -39,7 +39,9 @@ void _Event_Manager_initialization( void ) * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet ); +#endif } /*PAGE @@ -68,9 +70,8 @@ rtems_status_code rtems_event_send( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return( _Event_MP_Send_request_packet( EVENT_MP_SEND_REQUEST, @@ -78,6 +79,9 @@ rtems_status_code rtems_event_send( event_in ) ); +#endif + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_sets_Post( event_in, &api->pending_events ); @@ -352,8 +356,8 @@ void _Event_Timeout( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: case OBJECTS_REMOTE: /* impossible */ + case OBJECTS_ERROR: break; case OBJECTS_LOCAL: diff --git a/cpukit/rtems/src/msg.c b/cpukit/rtems/src/msg.c index f49e1cac21..7681bd52d6 100644 --- a/cpukit/rtems/src/msg.c +++ b/cpukit/rtems/src/msg.c @@ -22,7 +22,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -61,10 +63,12 @@ void _Message_queue_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_MESSAGE_QUEUE, _Message_queue_MP_Process_packet ); +#endif } @@ -123,14 +127,19 @@ rtems_status_code rtems_message_queue_create( { register Message_queue_Control *the_message_queue; CORE_message_queue_Attributes the_message_queue_attributes; + void *handler; +#if defined(RTEMS_MULTIPROCESSING) boolean is_global; +#endif if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; +#if defined(RTEMS_MULTIPROCESSING) if ( (is_global = _Attributes_Is_global( attribute_set ) ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; +#endif if (count == 0) return RTEMS_INVALID_NUMBER; @@ -138,6 +147,7 @@ rtems_status_code rtems_message_queue_create( if (max_message_size == 0) return RTEMS_INVALID_SIZE; +#if defined(RTEMS_MULTIPROCESSING) #if 1 /* * I am not 100% sure this should be an error. @@ -147,7 +157,7 @@ rtems_status_code rtems_message_queue_create( if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) ) return RTEMS_INVALID_SIZE; - +#endif #endif _Thread_Disable_dispatch(); /* protects object pointer */ @@ -159,6 +169,7 @@ rtems_status_code rtems_message_queue_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( is_global && !( _Objects_MP_Allocate_and_open( &_Message_queue_Information, name, the_message_queue->Object.id, FALSE ) ) ) { @@ -166,6 +177,7 @@ rtems_status_code rtems_message_queue_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif the_message_queue->attribute_set = attribute_set; @@ -176,16 +188,23 @@ rtems_status_code rtems_message_queue_create( the_message_queue_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; + handler = NULL; +#if defined(RTEMS_MULTIPROCESSING) + handler = _Message_queue_MP_Send_extract_proxy; +#endif + if ( ! _CORE_message_queue_Initialize( &the_message_queue->message_queue, OBJECTS_RTEMS_MESSAGE_QUEUES, &the_message_queue_attributes, count, max_message_size, - _Message_queue_MP_Send_extract_proxy ) ) { + handler ) ) { +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); +#endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); @@ -200,6 +219,7 @@ rtems_status_code rtems_message_queue_create( *id = the_message_queue->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Message_queue_MP_Send_process_packet( MESSAGE_QUEUE_MP_ANNOUNCE_CREATE, @@ -207,6 +227,7 @@ rtems_status_code rtems_message_queue_create( name, 0 ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -272,23 +293,31 @@ rtems_status_code rtems_message_queue_delete( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, &the_message_queue->Object ); +#if defined(RTEMS_MULTIPROCESSING) _CORE_message_queue_Close( &the_message_queue->message_queue, _Message_queue_MP_Send_object_was_deleted, CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED ); +#endif _Message_queue_Free( the_message_queue ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) { _Objects_MP_Close( &_Message_queue_Information, @@ -302,6 +331,7 @@ rtems_status_code rtems_message_queue_delete( 0 ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -394,9 +424,8 @@ rtems_status_code rtems_message_queue_broadcast( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; return @@ -408,6 +437,10 @@ rtems_status_code rtems_message_queue_broadcast( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: core_status = _CORE_message_queue_Broadcast( @@ -415,7 +448,11 @@ rtems_status_code rtems_message_queue_broadcast( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support, +#else + NULL, +#endif count ); @@ -461,10 +498,8 @@ rtems_status_code rtems_message_queue_receive( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; - case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_RECEIVE_REQUEST, id, @@ -473,6 +508,10 @@ rtems_status_code rtems_message_queue_receive( option_set, timeout ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: if ( _Options_Is_no_wait( option_set ) ) @@ -525,9 +564,8 @@ rtems_status_code rtems_message_queue_flush( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; return @@ -539,6 +577,10 @@ rtems_status_code rtems_message_queue_flush( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); @@ -575,13 +617,11 @@ rtems_status_code rtems_message_queue_get_number_pending( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = count; - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST, id, 0, /* buffer not used */ @@ -589,6 +629,10 @@ rtems_status_code rtems_message_queue_get_number_pending( 0, /* option_set not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: *count = the_message_queue->message_queue.number_of_pending_messages; @@ -635,14 +679,11 @@ rtems_status_code _Message_queue_Submit( the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; - case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) switch ( submit_type ) { case MESSAGE_QUEUE_SEND_REQUEST: - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_SEND_REQUEST, id, buffer, @@ -652,8 +693,7 @@ rtems_status_code _Message_queue_Submit( ); case MESSAGE_QUEUE_URGENT_REQUEST: - return - _Message_queue_MP_Send_request_packet( + return _Message_queue_MP_Send_request_packet( MESSAGE_QUEUE_MP_URGENT_REQUEST, id, buffer, @@ -662,6 +702,11 @@ rtems_status_code _Message_queue_Submit( MPCI_DEFAULT_TIMEOUT ); } + break; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: switch ( submit_type ) { @@ -671,7 +716,11 @@ rtems_status_code _Message_queue_Submit( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support +#else + NULL +#endif ); break; case MESSAGE_QUEUE_URGENT_REQUEST: @@ -680,7 +729,11 @@ rtems_status_code _Message_queue_Submit( buffer, size, id, +#if defined(RTEMS_MULTIPROCESSING) _Message_queue_Core_message_queue_mp_support +#else + NULL +#endif ); break; default: @@ -749,6 +802,7 @@ rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Message_queue_Core_message_queue_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -762,3 +816,4 @@ void _Message_queue_Core_message_queue_mp_support ( the_thread ); } +#endif diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c index 0698f0db71..4417db10cb 100644 --- a/cpukit/rtems/src/part.c +++ b/cpukit/rtems/src/part.c @@ -54,10 +54,12 @@ void _Partition_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_PARTITION, _Partition_MP_Process_packet ); +#endif } @@ -103,9 +105,11 @@ rtems_status_code rtems_partition_create( if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; +#endif _Thread_Disable_dispatch(); /* prevents deletion */ @@ -116,6 +120,7 @@ rtems_status_code rtems_partition_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && !( _Objects_MP_Allocate_and_open( &_Partition_Information, name, the_partition->Object.id, FALSE ) ) ) { @@ -123,6 +128,8 @@ rtems_status_code rtems_partition_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif + the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; @@ -135,6 +142,7 @@ rtems_status_code rtems_partition_create( _Objects_Open( &_Partition_Information, &the_partition->Object, &name ); *id = the_partition->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Partition_MP_Send_process_packet( PARTITION_MP_ANNOUNCE_CREATE, @@ -142,6 +150,7 @@ rtems_status_code rtems_partition_create( name, 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -203,15 +212,20 @@ rtems_status_code rtems_partition_delete( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { _Objects_Close( &_Partition_Information, &the_partition->Object ); _Partition_Free( the_partition ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_partition->attribute_set ) ) { _Objects_MP_Close( @@ -226,6 +240,7 @@ rtems_status_code rtems_partition_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -264,9 +279,8 @@ rtems_status_code rtems_partition_get_buffer( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = buffer; return( _Partition_MP_Send_request_packet( @@ -275,6 +289,11 @@ rtems_status_code rtems_partition_get_buffer( 0 /* Not used */ ) ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { @@ -316,16 +335,19 @@ rtems_status_code rtems_partition_return_buffer( the_partition = _Partition_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: - return( - _Partition_MP_Send_request_packet( +#if defined(RTEMS_MULTIPROCESSING) + return _Partition_MP_Send_request_packet( PARTITION_MP_RETURN_BUFFER_REQUEST, id, buffer - ) - ); + ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c index ff9bb5bc21..6832aac593 100644 --- a/cpukit/rtems/src/ratemon.c +++ b/cpukit/rtems/src/ratemon.c @@ -156,10 +156,12 @@ rtems_status_code rtems_rate_monotonic_cancel( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: return RTEMS_INTERNAL_ERROR; /* should never return this */ + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); @@ -197,10 +199,12 @@ rtems_status_code rtems_rate_monotonic_delete( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); (void) _Watchdog_Remove( &the_period->Timer ); @@ -243,10 +247,12 @@ rtems_status_code rtems_rate_monotonic_get_status( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: status->state = the_period->state; @@ -298,10 +304,12 @@ rtems_status_code rtems_rate_monotonic_period( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); @@ -431,9 +439,10 @@ void _Rate_monotonic_Timeout( the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: case OBJECTS_REMOTE: /* impossible */ + case OBJECTS_ERROR: break; + case OBJECTS_LOCAL: the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c index c238bf51c5..14467c73da 100644 --- a/cpukit/rtems/src/region.c +++ b/cpukit/rtems/src/region.c @@ -53,10 +53,12 @@ void _Region_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_REGION, 0 /* XXX _Region_MP_Process_packet */ ); +#endif } @@ -128,7 +130,11 @@ rtems_status_code rtems_region_create( _Attributes_Is_priority( attribute_set ) ? THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_SEGMENT, +#if defined(RTEMS_MULTIPROCESSING) _Region_MP_Send_extract_proxy, +#else + NULL, +#endif RTEMS_TIMEOUT ); @@ -198,10 +204,12 @@ rtems_status_code rtems_region_delete( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 5 ); if ( the_region->number_of_used_blocks == 0 ) { @@ -250,10 +258,12 @@ rtems_status_code rtems_region_extend( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: heap_status = _Heap_Extend( @@ -322,10 +332,12 @@ rtems_status_code rtems_region_get_segment( executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) { _Thread_Enable_dispatch(); @@ -395,10 +407,12 @@ rtems_status_code rtems_region_get_segment_size( executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Heap_Size_of_user_area( &the_region->Memory, segment, size ) ) { @@ -440,10 +454,13 @@ rtems_status_code rtems_region_return_segment( the_region = _Region_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: /* this error cannot be returned */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 3 ); diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c index 9d04686d40..9337df3a25 100644 --- a/cpukit/rtems/src/rtemstimer.c +++ b/cpukit/rtems/src/rtemstimer.c @@ -151,10 +151,12 @@ rtems_status_code rtems_timer_cancel( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -188,10 +190,12 @@ rtems_status_code rtems_timer_delete( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); (void) _Watchdog_Remove( &the_timer->Ticker ); @@ -234,10 +238,12 @@ rtems_status_code rtems_timer_fire_after( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_INTERVAL; @@ -289,10 +295,12 @@ rtems_status_code rtems_timer_fire_when( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY; @@ -331,10 +339,12 @@ rtems_status_code rtems_timer_reset( the_timer = _Timer_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: /* should never return this */ return RTEMS_INTERNAL_ERROR; + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Timer_Is_interval_class( the_timer->the_class ) ) { _Watchdog_Reset( &the_timer->Ticker ); diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c index f1c1f1fbb9..31351dada1 100644 --- a/cpukit/rtems/src/sem.c +++ b/cpukit/rtems/src/sem.c @@ -39,7 +39,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include @@ -75,10 +77,12 @@ void _Semaphore_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_SEMAPHORE, _Semaphore_MP_Process_packet ); +#endif } @@ -118,6 +122,7 @@ rtems_status_code rtems_semaphore_create( if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) { if ( !_System_state_Is_multiprocessing ) @@ -126,7 +131,9 @@ rtems_status_code rtems_semaphore_create( if ( _Attributes_Is_inherit_priority( attribute_set ) ) return RTEMS_NOT_DEFINED; - } else if ( _Attributes_Is_inherit_priority( attribute_set ) || + } else +#endif + if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! ( _Attributes_Is_binary_semaphore( attribute_set ) && @@ -147,6 +154,7 @@ rtems_status_code rtems_semaphore_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) && ! ( _Objects_MP_Allocate_and_open( &_Semaphore_Information, name, the_semaphore->Object.id, FALSE ) ) ) { @@ -154,6 +162,7 @@ rtems_status_code rtems_semaphore_create( _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } +#endif the_semaphore->attribute_set = attribute_set; @@ -183,7 +192,11 @@ rtems_status_code rtems_semaphore_create( OBJECTS_RTEMS_SEMAPHORES, &the_mutex_attributes, lock, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_extract_proxy +#else + NULL +#endif ); } else { @@ -204,7 +217,11 @@ rtems_status_code rtems_semaphore_create( OBJECTS_RTEMS_SEMAPHORES, &the_semaphore_attributes, count, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_extract_proxy +#else + NULL +#endif ); } @@ -212,6 +229,7 @@ rtems_status_code rtems_semaphore_create( *id = the_semaphore->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( attribute_set ) ) _Semaphore_MP_Send_process_packet( SEMAPHORE_MP_ANNOUNCE_CREATE, @@ -219,6 +237,7 @@ rtems_status_code rtems_semaphore_create( name, 0 /* Not used */ ); +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } @@ -279,11 +298,16 @@ rtems_status_code rtems_semaphore_delete( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) { @@ -293,14 +317,22 @@ rtems_status_code rtems_semaphore_delete( else _CORE_mutex_Flush( &the_semaphore->Core_control.mutex, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_object_was_deleted, +#else + NULL, +#endif CORE_MUTEX_WAS_DELETED ); } else _CORE_semaphore_Flush( &the_semaphore->Core_control.semaphore, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_MP_Send_object_was_deleted, +#else + NULL, +#endif CORE_SEMAPHORE_WAS_DELETED ); @@ -308,6 +340,7 @@ rtems_status_code rtems_semaphore_delete( _Semaphore_Free( the_semaphore ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_semaphore->attribute_set ) ) { _Objects_MP_Close( &_Semaphore_Information, the_semaphore->Object.id ); @@ -319,6 +352,7 @@ rtems_status_code rtems_semaphore_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } @@ -354,15 +388,19 @@ rtems_status_code rtems_semaphore_obtain( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Semaphore_MP_Send_request_packet( SEMAPHORE_MP_OBTAIN_REQUEST, id, option_set, timeout ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Options_Is_no_wait( option_set ) ) wait = FALSE; @@ -420,21 +458,30 @@ rtems_status_code rtems_semaphore_release( the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Semaphore_MP_Send_request_packet( SEMAPHORE_MP_RELEASE_REQUEST, id, 0, /* Not used */ MPCI_DEFAULT_TIMEOUT ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Attributes_Is_binary_semaphore( the_semaphore->attribute_set ) ) { mutex_status = _CORE_mutex_Surrender( &the_semaphore->Core_control.mutex, id, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_Core_mutex_mp_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return _Semaphore_Translate_core_mutex_return_code( mutex_status ); @@ -443,7 +490,11 @@ rtems_status_code rtems_semaphore_release( semaphore_status = _CORE_semaphore_Surrender( &the_semaphore->Core_control.semaphore, id, +#if defined(RTEMS_MULTIPROCESSING) _Semaphore_Core_semaphore_mp_support +#else + NULL +#endif ); _Thread_Enable_dispatch(); return @@ -530,6 +581,7 @@ rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_mutex_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -543,6 +595,7 @@ void _Semaphore_Core_mutex_mp_support ( the_thread ); } +#endif /*PAGE @@ -556,6 +609,7 @@ void _Semaphore_Core_mutex_mp_support ( * Output parameters: NONE */ +#if defined(RTEMS_MULTIPROCESSING) void _Semaphore_Core_semaphore_mp_support ( Thread_Control *the_thread, Objects_Id id @@ -569,3 +623,4 @@ void _Semaphore_Core_semaphore_mp_support ( the_thread ); } +#endif diff --git a/cpukit/rtems/src/signal.c b/cpukit/rtems/src/signal.c index efdcf70eea..120233d2d5 100644 --- a/cpukit/rtems/src/signal.c +++ b/cpukit/rtems/src/signal.c @@ -39,10 +39,12 @@ void _Signal_Manager_initialization( void ) * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_SIGNAL, _Signal_MP_Process_packet ); +#endif } /*PAGE @@ -115,14 +117,19 @@ rtems_status_code rtems_signal_send( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _Signal_MP_Send_request_packet( SIGNAL_MP_SEND_REQUEST, id, signal_set ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index 723a769836..5f6c8366c4 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -206,10 +206,12 @@ void _RTEMS_tasks_Manager_initialization( * Register the MP Process Packet routine. */ +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Register_packet_processor( MP_PACKET_TASKS, _RTEMS_tasks_MP_Process_packet ); +#endif } @@ -245,9 +247,11 @@ rtems_status_code rtems_task_create( ) { register Thread_Control *the_thread; - Objects_MP_Control *the_global_object = NULL; boolean is_fp; +#if defined(RTEMS_MULTIPROCESSING) + Objects_MP_Control *the_global_object = NULL; boolean is_global; +#endif boolean status; rtems_attribute the_attribute_set; Priority_Control core_priority; @@ -297,6 +301,7 @@ rtems_status_code rtems_task_create( core_priority = _RTEMS_tasks_Priority_to_Core( initial_priority ); +#if defined(RTEMS_MULTIPROCESSING) if ( _Attributes_Is_global( the_attribute_set ) ) { is_global = TRUE; @@ -306,6 +311,7 @@ rtems_status_code rtems_task_create( } else is_global = FALSE; +#endif /* * Make sure system is MP if this task is global @@ -334,6 +340,7 @@ rtems_status_code rtems_task_create( return RTEMS_TOO_MANY; } +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) { the_global_object = _Objects_MP_Allocate_global_object(); @@ -343,6 +350,7 @@ rtems_status_code rtems_task_create( return RTEMS_TOO_MANY; } } +#endif /* * Initialize the core thread for this task. @@ -365,8 +373,10 @@ rtems_status_code rtems_task_create( ); if ( !status ) { +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); +#endif _RTEMS_tasks_Free( the_thread ); _Thread_Enable_dispatch(); return RTEMS_UNSATISFIED; @@ -379,6 +389,7 @@ rtems_status_code rtems_task_create( *id = the_thread->Object.id; +#if defined(RTEMS_MULTIPROCESSING) if ( is_global ) { the_thread->is_global = TRUE; @@ -397,6 +408,7 @@ rtems_status_code rtems_task_create( ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -470,11 +482,16 @@ rtems_status_code rtems_task_start( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Thread_Start( the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { @@ -516,11 +533,16 @@ rtems_status_code rtems_task_restart( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _Thread_Restart( the_thread, NULL, argument ) ) { _Thread_Enable_dispatch(); @@ -561,11 +583,16 @@ rtems_status_code rtems_task_delete( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Dispatch(); return RTEMS_ILLEGAL_ON_REMOTE_OBJECT; +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: the_information = _Objects_Get_information( the_thread->Object.id ); @@ -579,6 +606,7 @@ rtems_status_code rtems_task_delete( _RTEMS_tasks_Free( the_thread ); +#if defined(RTEMS_MULTIPROCESSING) if ( the_thread->is_global ) { _Objects_MP_Close( &_RTEMS_tasks_Information, the_thread->Object.id ); @@ -589,6 +617,7 @@ rtems_status_code rtems_task_delete( 0 /* Not used */ ); } +#endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -622,9 +651,9 @@ rtems_status_code rtems_task_suspend( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SUSPEND_REQUEST, id, @@ -632,6 +661,11 @@ rtems_status_code rtems_task_suspend( 0, /* Not used */ 0 /* Not used */ ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { _Thread_Set_state( the_thread, STATES_SUSPENDED ); @@ -669,18 +703,21 @@ rtems_status_code rtems_task_resume( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: - return( - _RTEMS_tasks_MP_Send_request_packet( +#if defined(RTEMS_MULTIPROCESSING) + return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_RESUME_REQUEST, id, 0, /* Not used */ 0, /* Not used */ 0 /* Not used */ - ) - ); + ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { _Thread_Resume( the_thread ); @@ -728,19 +765,22 @@ rtems_status_code rtems_task_set_priority( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = old_priority; - return( - _RTEMS_tasks_MP_Send_request_packet( + return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SET_PRIORITY_REQUEST, id, new_priority, 0, /* Not used */ 0 /* Not used */ - ) ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { @@ -897,9 +937,9 @@ rtems_status_code rtems_task_get_note( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) _Thread_Executing->Wait.return_argument = note; return _RTEMS_tasks_MP_Send_request_packet( @@ -909,6 +949,11 @@ rtems_status_code rtems_task_get_note( notepad, 0 /* Not used */ ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; + case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; @@ -967,9 +1012,9 @@ rtems_status_code rtems_task_set_note( the_thread = _Thread_Get( id, &location ); switch ( location ) { - case OBJECTS_ERROR: - return RTEMS_INVALID_ID; + case OBJECTS_REMOTE: +#if defined(RTEMS_MULTIPROCESSING) return _RTEMS_tasks_MP_Send_request_packet( RTEMS_TASKS_MP_SET_NOTE_REQUEST, id, @@ -977,6 +1022,10 @@ rtems_status_code rtems_task_set_note( notepad, note ); +#endif + + case OBJECTS_ERROR: + return RTEMS_INVALID_ID; case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index e3ae50d7d1..5a01286059 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -43,7 +43,9 @@ typedef void *posix_api_configuration_table; #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /* * The following records define the Multiprocessor Configuration @@ -57,7 +59,11 @@ typedef struct { unsigned32 maximum_nodes; /* maximum # nodes in system */ unsigned32 maximum_global_objects; /* maximum # global objects */ unsigned32 maximum_proxies; /* maximum # proxies */ +#if defined(RTEMS_MULTIPROCESSING) MPCI_Control *User_mpci_table; /* pointer to MPCI table */ +#else + void *User_mpci_table; /* pointer to MPCI table */ +#endif } rtems_multiprocessing_table; /* diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index dabf21dcc0..43da0a9363 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -34,7 +34,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -107,11 +109,18 @@ rtems_interrupt_level rtems_initialize_executive_early( * Initialize the system state based on whether this is an MP system. */ +#if defined(RTEMS_MULTIPROCESSING) multiprocessing_table = configuration_table->User_multiprocessing_table; _System_state_Handler_initialization( (multiprocessing_table) ? TRUE : FALSE ); +#else + multiprocessing_table = NULL; + + _System_state_Handler_initialization( FALSE ); + +#endif /* * Provided just for user convenience. @@ -179,10 +188,12 @@ rtems_interrupt_level rtems_initialize_executive_early( multiprocessing_table->maximum_proxies ); +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Handler_initialization( multiprocessing_table->User_mpci_table, RTEMS_TIMEOUT ); +#endif /* MANAGERS */ @@ -215,7 +226,9 @@ rtems_interrupt_level rtems_initialize_executive_early( _Thread_Create_idle(); +#if defined(RTEMS_MULTIPROCESSING) _MPCI_Create_server(); +#endif /* * Run the API and BSPs predriver hook. @@ -234,12 +247,14 @@ rtems_interrupt_level rtems_initialize_executive_early( _IO_Initialize_all_drivers(); +#if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) { _MPCI_Initialization(); _MPCI_Internal_packets_Send_process_packet( MPCI_PACKETS_SYSTEM_VERIFY ); } +#endif /* * Run the APIs and BSPs postdriver hooks. diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c index d860ad7f99..65475e2399 100644 --- a/cpukit/sapi/src/rtemsapi.c +++ b/cpukit/sapi/src/rtemsapi.c @@ -31,7 +31,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif #include #include #include @@ -58,7 +60,9 @@ void _RTEMS_API_Initialize( _Interrupt_Manager_initialization(); +#if defined(RTEMS_MULTIPROCESSING) _Multiprocessing_Manager_initialization(); +#endif _RTEMS_tasks_Manager_initialization( api_configuration->maximum_tasks, diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 0198731b96..a0bf3707b6 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/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/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 7fc3361c39..574d0493d2 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/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/cpukit/score/src/coremsg.c b/cpukit/score/src/coremsg.c index 34778d26cd..1300b49951 100644 --- a/cpukit/score/src/coremsg.c +++ b/cpukit/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/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index dac5a5172b..bda01a06e9 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/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/cpukit/score/src/coresem.c b/cpukit/score/src/coresem.c index 074ba2cb22..b0b471bad6 100644 --- a/cpukit/score/src/coresem.c +++ b/cpukit/score/src/coresem.c @@ -24,7 +24,9 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include +#endif /*PAGE * diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index efe63160f3..ad9ae9c47e 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -16,8 +16,10 @@ #include #include #include +#if defined(RTEMS_MULTIPROCESSING) #include #include +#endif #include #include #include diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c index 7585235d3b..81bca89d7c 100644 --- a/cpukit/score/src/object.c +++ b/cpukit/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/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index 292e042d57..b663eb6bba 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/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/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c index 3cdca9701b..34f0a12383 100644 --- a/cpukit/score/src/threadq.c +++ b/cpukit/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/make/custom/FreeBSD-posix.cfg b/make/custom/FreeBSD-posix.cfg index 99225f0d9a..16afdcbe87 100644 --- a/make/custom/FreeBSD-posix.cfg +++ b/make/custom/FreeBSD-posix.cfg @@ -34,9 +34,6 @@ HAS_CPLUSPLUS=yes CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA) endif -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/HPUX9-posix.cfg b/make/custom/HPUX9-posix.cfg index 31f1f8e180..401a7863a3 100644 --- a/make/custom/HPUX9-posix.cfg +++ b/make/custom/HPUX9-posix.cfg @@ -33,9 +33,6 @@ LIBC_DEFINES=-DRTEMS_UNIXLIB -DRTEMS_UNIX -DMALLOC_PROVIDED -DRTEMS_DEBUG LIBC_DEFINES += -DWORKSPACE_MB=2 LIBC_DEFINES += -DHEAPSPACE_MB=1 -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/Linux-posix.cfg b/make/custom/Linux-posix.cfg index fcd9c9be5b..106ac47d8f 100644 --- a/make/custom/Linux-posix.cfg +++ b/make/custom/Linux-posix.cfg @@ -35,9 +35,6 @@ HAS_CPLUSPLUS=yes CPLUS_LD_LIBS += $(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA) endif -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/Solaris-posix.cfg b/make/custom/Solaris-posix.cfg index 0120081bb7..0d86f96bc1 100644 --- a/make/custom/Solaris-posix.cfg +++ b/make/custom/Solaris-posix.cfg @@ -33,9 +33,6 @@ HAS_CPLUSPLUS=yes CPLUS_LD_LIBS=$(PROJECT_RELEASE)/lib/librtems++$(LIBSUFFIX_VA) endif -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/cvme961.cfg b/make/custom/cvme961.cfg index a868c79964..59ca215544 100644 --- a/make/custom/cvme961.cfg +++ b/make/custom/cvme961.cfg @@ -25,9 +25,6 @@ CPU_CFLAGS = -mca # -O4 is ok for RTEMS CFLAGS_OPTIMIZE_V=-O4 -mleaf-procedures -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/default.cfg b/make/custom/default.cfg index afa1779f3d..dcb7a92c3a 100644 --- a/make/custom/default.cfg +++ b/make/custom/default.cfg @@ -58,7 +58,11 @@ HAS_CPLUSPLUS=no endif # Define this to yes if this target supports multiprocessor environments. +ifeq ($(RTEMS_HAS_MULTIPROCESSING),yes) +HAS_MP=yes +else HAS_MP=no +endif # Define this to yes if this target wants the TCP/IP stack ifeq ($(RTEMS_HAS_NETWORKING),yes) diff --git a/make/custom/dmv177.cfg b/make/custom/dmv177.cfg index 006f81968b..ba19d94782 100644 --- a/make/custom/dmv177.cfg +++ b/make/custom/dmv177.cfg @@ -80,9 +80,6 @@ CPU_CFLAGS = -mcpu=603 # NOTE: some level of -O may be actually required by inline assembler CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=no - # Define this to yes if this target supports a real-time clock. HAS_RTC=yes diff --git a/make/custom/force386.cfg b/make/custom/force386.cfg index 89e7532e10..45e4cd80a7 100644 --- a/make/custom/force386.cfg +++ b/make/custom/force386.cfg @@ -21,9 +21,6 @@ CPU_CFLAGS = # -O4 is ok for RTEMS CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/gensh1.cfg b/make/custom/gensh1.cfg index b53b3418b0..2ee7beeb4b 100644 --- a/make/custom/gensh1.cfg +++ b/make/custom/gensh1.cfg @@ -24,9 +24,6 @@ RTEMS_BSP_FAMILY=gensh1 # CPU_CFLAGS=-m1 -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=no - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/mvme136.cfg b/make/custom/mvme136.cfg index 019ddabbb9..8a1ea00bdb 100644 --- a/make/custom/mvme136.cfg +++ b/make/custom/mvme136.cfg @@ -22,9 +22,6 @@ CPU_CFLAGS = # -O4 is ok for RTEMS CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/mvme147s.cfg b/make/custom/mvme147s.cfg index 95dfa70f29..6c2686af5c 100644 --- a/make/custom/mvme147s.cfg +++ b/make/custom/mvme147s.cfg @@ -13,7 +13,4 @@ include $(RTEMS_ROOT)/make/custom/mvme147.cfg # This is the actual bsp directory used during the build process. RTEMS_BSP_FAMILY=mvme147s -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # Miscellaneous additions go here diff --git a/make/custom/no_bsp.cfg b/make/custom/no_bsp.cfg index d4ef58fad9..36e757aeec 100644 --- a/make/custom/no_bsp.cfg +++ b/make/custom/no_bsp.cfg @@ -24,9 +24,6 @@ RTEMS_USE_NEWLIB=no # HAS_CPLUSPLUS=no -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/custom/simhppa.cfg b/make/custom/simhppa.cfg index 6a7f022336..2426ebbae5 100644 --- a/make/custom/simhppa.cfg +++ b/make/custom/simhppa.cfg @@ -35,9 +35,6 @@ CFLAGS_DEFAULT = $(CPU_CFLAGS) -Wall -ansi -fasm -mgas # NOTE: some level of -O may be actually required by inline assembler CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions -# Define this to yes if this target supports multiprocessor environments. -HAS_MP=yes - # This target does NOT support the TCP/IP stack so ignore requests # to enable it. HAS_NETWORKING=no diff --git a/make/leaf.cfg b/make/leaf.cfg index 0553cefdf2..a553943b13 100644 --- a/make/leaf.cfg +++ b/make/leaf.cfg @@ -164,6 +164,9 @@ ifeq (${RTEMS_USE_MACROS},yes) else @echo "#define USE_INLINES 1" >>$@ endif +ifeq ($(RTEMS_HAS_MULTIPROCESSING),yes) + @echo "#define RTEMS_MULTIPROCESSING 1" >>$@ +endif ifeq ($(RTEMS_HAS_POSIX_API),yes) @echo "#define RTEMS_POSIX_API 1" >>$@ endif diff --git a/make/target.cfg.in b/make/target.cfg.in index decb674781..2da16b15cc 100644 --- a/make/target.cfg.in +++ b/make/target.cfg.in @@ -39,6 +39,7 @@ RTEMS_CROSS_TARGET=@rtems_cv_prog_cc_cross@ RTEMS_HOST = @RTEMS_HOST@ RTEMS_USE_OWN_PDIR = @RTEMS_USE_OWN_PDIR@ +RTEMS_HAS_MULTIPROCESSING = @RTEMS_HAS_MULTIPROCESSING@ RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@ RTEMS_HAS_POSIX_1H_API = @RTEMS_HAS_POSIX_1H_API@ RTEMS_HAS_NETWORKING = @RTEMS_HAS_NETWORKING@ diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c index 9ebad1aad6..97281c9ee3 100644 --- a/testsuites/sptests/spsize/size.c +++ b/testsuites/sptests/spsize/size.c @@ -82,13 +82,17 @@ #define PER_FPTASK (long) (CONTEXT_FP_SIZE) #define PER_GOBTBL (long) (sizeof (Chain_Control)*4) #define PER_NODE (long) PER_GOBTBL +#if defined(RTEMS_MULTIPROCESSING) #define PER_GOBJECT (long) (sizeof (Objects_MP_Control)) +#else +#define PER_GOBJECT (long) 0 +#endif #define PER_PROXY (long) (sizeof (Thread_Proxy_control)) -#if (CPU_ALL_TASKS_ARE_FP == TRUE) -#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) -#else +#if !defined(RTEMS_MULTIPROCESSING) || (CPU_ALL_TASKS_ARE_FP != TRUE) #define MPCI_RECEIVE_SERVER_FP (long) 0 +#else +#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) #endif #if (CPU_IDLE_TASK_IS_FP == TRUE) @@ -97,6 +101,10 @@ #define SYSTEM_IDLE_FP (long) 0 #endif +#if defined(RTEMS_MULTIPROCESSING) +#define MPCI_RECEIVE_SERVER_STACK_SIZE 0 +#endif + #define SYSTEM_TASKS \ (STACK_MINIMUM_SIZE + \ MPCI_RECEIVE_SERVER_STACK_SIZE + \ @@ -215,7 +223,9 @@ uninitialized = /*event.h*/ (sizeof _Event_Sync_state) + +#if defined(RTEMS_MULTIPROCESSING) /*eventmp.h*/ 0 + +#endif /*eventset.h*/ 0 + @@ -244,32 +254,46 @@ uninitialized = /*modes.h*/ 0 + +#if defined(RTEMS_MULTIPROCESSING) /*mp.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) + (sizeof _MPCI_Semaphore) + (sizeof _MPCI_table) + (sizeof _MPCI_Receive_server_tcb) + (sizeof _MPCI_Packet_processors) + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mppkt.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*mptables.h*/ 0 + +#endif +#if defined(RTEMS_MULTIPROCESSING) /*msgmp.h*/ 0 + +#endif /*object.h*/ (sizeof _Objects_Local_node) + (sizeof _Objects_Maximum_nodes) + (sizeof _Objects_Information_table) + +#if defined(RTEMS_MULTIPROCESSING) /*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) + (sizeof _Objects_MP_Inactive_global_objects) + +#endif /*options.h*/ 0 + /*part.h*/ (sizeof _Partition_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*partmp.h*/ 0 + +#endif /*priority.h*/ (sizeof _Priority_Major_bit_map) + (sizeof _Priority_Bit_map) + @@ -278,13 +302,17 @@ uninitialized = /*region.h*/ (sizeof _Region_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*regionmp.h*/ 0 + +#endif /*rtems.h*/ /* Not applicable */ /*sem.h*/ (sizeof _Semaphore_Information) + +#if defined(RTEMS_MULTIPROCESSING) /*semmp.h*/ 0 + +#endif /*signal.h*/ 0 + @@ -301,7 +329,9 @@ uninitialized = /*system.h*/ (sizeof _CPU_Table) + +#if defined(RTEMS_MULTIPROCESSING) /*taskmp.h*/ 0 + +#endif /*tasks.h*/ (sizeof _RTEMS_tasks_Information) + (sizeof _RTEMS_tasks_User_initialization_tasks) + @@ -319,9 +349,11 @@ uninitialized = (sizeof _Thread_Internal_information) + (sizeof _Thread_Idle) + +#if defined(RTEMS_MULTIPROCESSING) /*threadmp.h*/ (sizeof _Thread_MP_Receive) + (sizeof _Thread_MP_Active_proxies) + (sizeof _Thread_MP_Inactive_proxies) + +#endif /*threadq.h*/ (sizeof _Thread_queue_Extract_table) + diff --git a/tools/cpu/generic/size_rtems.in b/tools/cpu/generic/size_rtems.in index 72c96e842c..d4f80870cd 100644 --- a/tools/cpu/generic/size_rtems.in +++ b/tools/cpu/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