From 64f55e7c32cb7a2ff069f527ec28b1cfa71de31a Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 29 Nov 1999 15:40:38 +0000 Subject: Made sure POSIX would build with MP enabled. --- c/src/exec/posix/src/Makefile.am | 1 + c/src/exec/posix/src/mutexmp.c | 2 +- c/src/exec/posix/src/mutexsetprioceiling.c | 2 +- c/src/exec/posix/src/mutexunlock.c | 2 +- c/src/exec/posix/src/semaphoremp.c | 125 ++++++++++++++++++++++++++++- c/src/exec/posix/src/sempost.c | 2 +- c/src/exec/posix/src/semunlink.c | 3 +- cpukit/posix/src/Makefile.am | 1 + cpukit/posix/src/mutexmp.c | 2 +- cpukit/posix/src/mutexsetprioceiling.c | 2 +- cpukit/posix/src/mutexunlock.c | 2 +- cpukit/posix/src/semaphoremp.c | 125 ++++++++++++++++++++++++++++- cpukit/posix/src/sempost.c | 2 +- cpukit/posix/src/semunlink.c | 3 +- 14 files changed, 254 insertions(+), 20 deletions(-) diff --git a/c/src/exec/posix/src/Makefile.am b/c/src/exec/posix/src/Makefile.am index 06509bd125..38a9615125 100644 --- a/c/src/exec/posix/src/Makefile.am +++ b/c/src/exec/posix/src/Makefile.am @@ -32,6 +32,7 @@ MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ mqueuesendsupp.c mqueuesetattr.c mqueuetimedreceive.c mqueuetimedsend.c \ mqueueunlink.c + MUTEX_C_FILES = mutex.c mutexattrdestroy.c mutexattrgetprioceiling.c \ mutexattrgetprotocol.c mutexattrgetpshared.c mutexattrinit.c \ mutexattrsetprioceiling.c mutexattrsetprotocol.c mutexattrsetpshared.c \ diff --git a/c/src/exec/posix/src/mutexmp.c b/c/src/exec/posix/src/mutexmp.c index 9726c0beff..dbdb44b708 100644 --- a/c/src/exec/posix/src/mutexmp.c +++ b/c/src/exec/posix/src/mutexmp.c @@ -48,7 +48,7 @@ int _POSIX_Mutex_MP_Send_request_packet ( return POSIX_MP_NOT_IMPLEMENTED(); } -void POSIX_Threads_mutex_MP_support( +void _POSIX_Threads_mutex_MP_support( Thread_Control *the_thread, Objects_Id id ) diff --git a/c/src/exec/posix/src/mutexsetprioceiling.c b/c/src/exec/posix/src/mutexsetprioceiling.c index ff9229f5ec..9d491d438b 100644 --- a/c/src/exec/posix/src/mutexsetprioceiling.c +++ b/c/src/exec/posix/src/mutexsetprioceiling.c @@ -66,7 +66,7 @@ int pthread_mutex_setprioceiling( &the_mutex->Mutex, the_mutex->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Threads_mutex_MP_support + _POSIX_Threads_mutex_MP_support #else NULL #endif diff --git a/c/src/exec/posix/src/mutexunlock.c b/c/src/exec/posix/src/mutexunlock.c index 3f5d5a03f3..3b6fdcc7e0 100644 --- a/c/src/exec/posix/src/mutexunlock.c +++ b/c/src/exec/posix/src/mutexunlock.c @@ -49,7 +49,7 @@ int pthread_mutex_unlock( &the_mutex->Mutex, the_mutex->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Threads_mutex_MP_support + _POSIX_Threads_mutex_MP_support #else NULL #endif diff --git a/c/src/exec/posix/src/semaphoremp.c b/c/src/exec/posix/src/semaphoremp.c index ef83a4ee6c..9eed7d67d6 100644 --- a/c/src/exec/posix/src/semaphoremp.c +++ b/c/src/exec/posix/src/semaphoremp.c @@ -16,10 +16,127 @@ #include #include -void POSIX_Semaphore_MP_support( - Thread_Control *the_thread, - Objects_Id id +#if defined(RTEMS_MULTIPROCESSING) +/* + * _POSIX_Semaphore_MP_Send_process_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * process operation can be performed on another node. + */ + +void _POSIX_Semaphore_MP_Send_process_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + Objects_Name name, + Objects_Id proxy_id +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_request_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive operation can be initiated on another node. + */ + +int _POSIX_Semaphore_MP_Send_request_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + boolean wait, /* XXX options */ + Watchdog_Interval timeout ) { - (void) POSIX_MP_NOT_IMPLEMENTED(); + POSIX_MP_NOT_IMPLEMENTED(); + return 0; } + +/* + * _POSIX_Semaphore_MP_Send_response_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive can be performed on another node. + */ + +void _POSIX_Semaphore_MP_Send_response_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + Thread_Control *the_thread +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * + * _POSIX_Semaphore_MP_Process_packet + * + * DESCRIPTION: + * + * This routine performs the actions specific to this package for + * the request from another node. + */ + +void _POSIX_Semaphore_MP_Process_packet( + MP_packet_Prefix *the_packet_prefix +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_object_was_deleted + * + * DESCRIPTION: + * + * This routine is invoked indirectly by the thread queue + * when a proxy has been removed from the thread queue and + * the remote node must be informed of this. + */ + +void _POSIX_Semaphore_MP_Send_object_was_deleted( + Thread_Control *the_proxy +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_extract_proxy + * + * DESCRIPTION: + * + * This routine is invoked when a task is deleted and it + * has a proxy which must be removed from a thread queue and + * the remote node must be informed of this. + */ + +void _POSIX_Semaphore_MP_Send_extract_proxy( + Thread_Control *the_thread +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Get_packet + * + * DESCRIPTION: + * + * This function is used to obtain a semaphore mp packet. + */ + +POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet( void ) +{ + POSIX_MP_NOT_IMPLEMENTED(); + return NULL; +} + +#endif /* endif RTEMS_MULTIPROCESSING */ diff --git a/c/src/exec/posix/src/sempost.c b/c/src/exec/posix/src/sempost.c index d3375ce80d..5a646eee82 100644 --- a/c/src/exec/posix/src/sempost.c +++ b/c/src/exec/posix/src/sempost.c @@ -41,7 +41,7 @@ int sem_post( &the_semaphore->Semaphore, the_semaphore->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Semaphore_MP_support + NULL /* XXX need to define a routine to handle this case */ #else NULL #endif diff --git a/c/src/exec/posix/src/semunlink.c b/c/src/exec/posix/src/semunlink.c index 2690758417..d687629e46 100644 --- a/c/src/exec/posix/src/semunlink.c +++ b/c/src/exec/posix/src/semunlink.c @@ -33,7 +33,6 @@ int sem_unlink( int status; register POSIX_Semaphore_Control *the_semaphore; Objects_Id the_semaphore_id; - Objects_Locations location; _Thread_Disable_dispatch(); @@ -52,7 +51,7 @@ int sem_unlink( set_errno_and_return_minus_one( ENOSYS ); } - the_semaphore = _Objects_Get_local_object( + the_semaphore = (POSIX_Semaphore_Control *) _Objects_Get_local_object( &_POSIX_Semaphore_Information, _Objects_Get_index( the_semaphore_id ) ); diff --git a/cpukit/posix/src/Makefile.am b/cpukit/posix/src/Makefile.am index 06509bd125..38a9615125 100644 --- a/cpukit/posix/src/Makefile.am +++ b/cpukit/posix/src/Makefile.am @@ -32,6 +32,7 @@ MESSAGE_QUEUE_C_FILES = mqueue.c mqueueclose.c mqueuecreatesupp.c \ mqueueopen.c mqueuereceive.c mqueuerecvsupp.c mqueuesend.c \ mqueuesendsupp.c mqueuesetattr.c mqueuetimedreceive.c mqueuetimedsend.c \ mqueueunlink.c + MUTEX_C_FILES = mutex.c mutexattrdestroy.c mutexattrgetprioceiling.c \ mutexattrgetprotocol.c mutexattrgetpshared.c mutexattrinit.c \ mutexattrsetprioceiling.c mutexattrsetprotocol.c mutexattrsetpshared.c \ diff --git a/cpukit/posix/src/mutexmp.c b/cpukit/posix/src/mutexmp.c index 9726c0beff..dbdb44b708 100644 --- a/cpukit/posix/src/mutexmp.c +++ b/cpukit/posix/src/mutexmp.c @@ -48,7 +48,7 @@ int _POSIX_Mutex_MP_Send_request_packet ( return POSIX_MP_NOT_IMPLEMENTED(); } -void POSIX_Threads_mutex_MP_support( +void _POSIX_Threads_mutex_MP_support( Thread_Control *the_thread, Objects_Id id ) diff --git a/cpukit/posix/src/mutexsetprioceiling.c b/cpukit/posix/src/mutexsetprioceiling.c index ff9229f5ec..9d491d438b 100644 --- a/cpukit/posix/src/mutexsetprioceiling.c +++ b/cpukit/posix/src/mutexsetprioceiling.c @@ -66,7 +66,7 @@ int pthread_mutex_setprioceiling( &the_mutex->Mutex, the_mutex->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Threads_mutex_MP_support + _POSIX_Threads_mutex_MP_support #else NULL #endif diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c index 3f5d5a03f3..3b6fdcc7e0 100644 --- a/cpukit/posix/src/mutexunlock.c +++ b/cpukit/posix/src/mutexunlock.c @@ -49,7 +49,7 @@ int pthread_mutex_unlock( &the_mutex->Mutex, the_mutex->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Threads_mutex_MP_support + _POSIX_Threads_mutex_MP_support #else NULL #endif diff --git a/cpukit/posix/src/semaphoremp.c b/cpukit/posix/src/semaphoremp.c index ef83a4ee6c..9eed7d67d6 100644 --- a/cpukit/posix/src/semaphoremp.c +++ b/cpukit/posix/src/semaphoremp.c @@ -16,10 +16,127 @@ #include #include -void POSIX_Semaphore_MP_support( - Thread_Control *the_thread, - Objects_Id id +#if defined(RTEMS_MULTIPROCESSING) +/* + * _POSIX_Semaphore_MP_Send_process_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * process operation can be performed on another node. + */ + +void _POSIX_Semaphore_MP_Send_process_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + Objects_Name name, + Objects_Id proxy_id +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_request_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive operation can be initiated on another node. + */ + +int _POSIX_Semaphore_MP_Send_request_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + boolean wait, /* XXX options */ + Watchdog_Interval timeout ) { - (void) POSIX_MP_NOT_IMPLEMENTED(); + POSIX_MP_NOT_IMPLEMENTED(); + return 0; } + +/* + * _POSIX_Semaphore_MP_Send_response_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive can be performed on another node. + */ + +void _POSIX_Semaphore_MP_Send_response_packet( + POSIX_Semaphore_MP_Remote_operations operation, + Objects_Id semaphore_id, + Thread_Control *the_thread +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * + * _POSIX_Semaphore_MP_Process_packet + * + * DESCRIPTION: + * + * This routine performs the actions specific to this package for + * the request from another node. + */ + +void _POSIX_Semaphore_MP_Process_packet( + MP_packet_Prefix *the_packet_prefix +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_object_was_deleted + * + * DESCRIPTION: + * + * This routine is invoked indirectly by the thread queue + * when a proxy has been removed from the thread queue and + * the remote node must be informed of this. + */ + +void _POSIX_Semaphore_MP_Send_object_was_deleted( + Thread_Control *the_proxy +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Send_extract_proxy + * + * DESCRIPTION: + * + * This routine is invoked when a task is deleted and it + * has a proxy which must be removed from a thread queue and + * the remote node must be informed of this. + */ + +void _POSIX_Semaphore_MP_Send_extract_proxy( + Thread_Control *the_thread +) +{ + POSIX_MP_NOT_IMPLEMENTED(); +} + +/* + * _POSIX_Semaphore_MP_Get_packet + * + * DESCRIPTION: + * + * This function is used to obtain a semaphore mp packet. + */ + +POSIX_Semaphore_MP_Packet *_POSIX_Semaphore_MP_Get_packet( void ) +{ + POSIX_MP_NOT_IMPLEMENTED(); + return NULL; +} + +#endif /* endif RTEMS_MULTIPROCESSING */ diff --git a/cpukit/posix/src/sempost.c b/cpukit/posix/src/sempost.c index d3375ce80d..5a646eee82 100644 --- a/cpukit/posix/src/sempost.c +++ b/cpukit/posix/src/sempost.c @@ -41,7 +41,7 @@ int sem_post( &the_semaphore->Semaphore, the_semaphore->Object.id, #if defined(RTEMS_MULTIPROCESSING) - POSIX_Semaphore_MP_support + NULL /* XXX need to define a routine to handle this case */ #else NULL #endif diff --git a/cpukit/posix/src/semunlink.c b/cpukit/posix/src/semunlink.c index 2690758417..d687629e46 100644 --- a/cpukit/posix/src/semunlink.c +++ b/cpukit/posix/src/semunlink.c @@ -33,7 +33,6 @@ int sem_unlink( int status; register POSIX_Semaphore_Control *the_semaphore; Objects_Id the_semaphore_id; - Objects_Locations location; _Thread_Disable_dispatch(); @@ -52,7 +51,7 @@ int sem_unlink( set_errno_and_return_minus_one( ENOSYS ); } - the_semaphore = _Objects_Get_local_object( + the_semaphore = (POSIX_Semaphore_Control *) _Objects_Get_local_object( &_POSIX_Semaphore_Information, _Objects_Get_index( the_semaphore_id ) ); -- cgit v1.2.3