From 7fa1ce86feb5a1bd1ab0ea22f93fea1139485539 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 25 Sep 2006 14:03:51 +0000 Subject: 2006-09-25 Joel Sherrill * sapi/include/confdefs.h, sapi/src/posixapi.c, sapi/src/rtemsapi.c: Add Classic API Barriers and commented out hooks to initialize . --- cpukit/ChangeLog | 5 ++++ cpukit/sapi/include/confdefs.h | 56 +++++++++++++++++++++++++++++++++++++++--- cpukit/sapi/src/posixapi.c | 17 ++++++++++++- cpukit/sapi/src/rtemsapi.c | 3 +++ 4 files changed, 77 insertions(+), 4 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 09e860a9f1..3f45e2e9bc 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2006-09-25 Joel Sherrill + + * sapi/include/confdefs.h, sapi/src/posixapi.c, sapi/src/rtemsapi.c: + Add Classic API Barriers and commented out hooks to initialize . + 2006-09-25 Joel Sherrill * rtems/Makefile.am, rtems/preinstall.am, rtems/include/rtems.h, diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index ae6ba1ada9..3856c5b047 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -26,7 +26,7 @@ */ /* - * COPYRIGHT (c) 1989-2002. + * COPYRIGHT (c) 1989-2006. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -511,6 +511,10 @@ rtems_multiprocessing_table Multiprocessing_configuration = { #define CONFIGURE_MAXIMUM_PERIODS 0 #endif +#ifndef CONFIGURE_MAXIMUM_BARRIERS +#define CONFIGURE_MAXIMUM_BARRIERS 0 +#endif + #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 #endif @@ -565,12 +569,15 @@ rtems_extensions_table Configuration_Initial_Extensions[] = { #include #include #include +#include #include #include #include #include #include +#include #include +#include #include #include @@ -606,6 +613,18 @@ rtems_extensions_table Configuration_Initial_Extensions[] = { #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 #endif +#ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS +#define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 +#endif + +#ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS +#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 +#endif + +#ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS +#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 +#endif + #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE @@ -679,12 +698,31 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = { ( sizeof( POSIX_Message_queue_Control) + \ CONFIGURE_OBJECT_TABLE_STUFF + \ NAME_MAX ) ) + #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ ((_semaphores) * \ ( sizeof( POSIX_Semaphore_Control) + \ CONFIGURE_OBJECT_TABLE_STUFF + \ NAME_MAX ) ) +#define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_semaphores) \ + ((_semaphores) * \ + ( sizeof( POSIX_Barrier_Control) + \ + CONFIGURE_OBJECT_TABLE_STUFF + \ + NAME_MAX ) ) + +#define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ + ((_spinlocks) * \ + ( sizeof( POSIX_Spinlock_Control) + \ + CONFIGURE_OBJECT_TABLE_STUFF + \ + NAME_MAX ) ) + +#define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ + ((_rwlocks) * \ + ( sizeof( POSIX_RWLock_Control) + \ + CONFIGURE_OBJECT_TABLE_STUFF + \ + NAME_MAX ) ) + #define CONFIGURE_MEMORY_FOR_POSIX \ ( \ CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ @@ -697,11 +735,14 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = { CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ + CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ) + \ + CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ + CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ + CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ + CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ ) - - #else #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 @@ -947,6 +988,10 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = { ( (_periods) * \ ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) +#define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ + ( (_barriers) * \ + ( sizeof(Barrier_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) + #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ ( (_extensions) * \ ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) @@ -1038,6 +1083,7 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = { CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \ CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ + CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \ CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \ CONFIGURE_STACK_CHECKER_EXTENSION ) + \ @@ -1088,6 +1134,7 @@ rtems_api_configuration_table Configuration_RTEMS_API = { CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION, CONFIGURE_MAXIMUM_PORTS, CONFIGURE_MAXIMUM_PERIODS, + CONFIGURE_MAXIMUM_BARRIERS, CONFIGURE_INIT_TASK_TABLE_SIZE, CONFIGURE_INIT_TASK_TABLE }; @@ -1104,6 +1151,9 @@ posix_api_configuration_table Configuration_POSIX_API = { CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, + CONFIGURE_MAXIMUM_POSIX_BARRIERS, + CONFIGURE_MAXIMUM_POSIX_RWLOCKS, + CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME }; diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c index a86962c912..843716edeb 100644 --- a/cpukit/sapi/src/posixapi.c +++ b/cpukit/sapi/src/posixapi.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -41,8 +42,10 @@ #include #include #include +#include #include #include +#include #include /*PAGE @@ -62,6 +65,9 @@ posix_api_configuration_table _POSIX_Default_configuration = { 0, /* number_of_initialization_threads */ 0, /* maximum_message_queues */ 0, /* maximum_semaphores */ + 0, /* maximum_barriers */ + 0, /* maximum_spinlocks */ + 0, /* maximum_rwlocks */ NULL /* User_initialization_threads_table */ }; @@ -112,7 +118,16 @@ void _POSIX_API_Initialize( api_configuration->maximum_semaphores ); - _POSIX_Timer_Manager_initialization ( api_configuration->maximum_timers ); + _POSIX_Timer_Manager_initialization( api_configuration->maximum_timers ); + + /* temporary while working */ +#if 0 + _POSIX_Barrier_Manager_initialization( api_configuration->maximum_barriers ); + + _POSIX_RWLock_Manager_initialization( api_configuration->maximum_rwlocks ); + + _POSIX_Spinlock_Manager_initialization(api_configuration->maximum_spinlocks); +#endif } #endif diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c index 282f697e7e..23daa0700f 100644 --- a/cpukit/sapi/src/rtemsapi.c +++ b/cpukit/sapi/src/rtemsapi.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -96,6 +97,8 @@ void _RTEMS_API_Initialize( _Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports); _Rate_monotonic_Manager_initialization( api_configuration->maximum_periods ); + + _Barrier_Manager_initialization( api_configuration->maximum_barriers ); } /* end of file */ -- cgit v1.2.3