From 6c2b8a4b35536a5f99ba1ef91139485b011dafc1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 29 Nov 2017 06:23:27 +0100 Subject: score: Use self-contained API mutex Use a self-contained recursive mutex for API_Mutex_Control. The API mutexes are protected against asynchronous thread cancellation. Add dedicated mutexes for libatomic and TOD. Close #2629. Close #2630. --- cpukit/sapi/include/confdefs.h | 10 +--------- cpukit/sapi/src/exinit.c | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'cpukit/sapi') diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index ca4ee47b2b..8066d9a426 100755 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -2793,13 +2793,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #define CONFIGURE_MEMORY_OVERHEAD 0 #endif -/** - * RTEMS uses two instance of an internal mutex class. This accounts - * for these mutexes. - */ -#define _CONFIGURE_API_MUTEX_MEMORY \ - _Configure_Object_RAM(2, sizeof(API_Mutex_Control)) - /** * This calculates the amount of memory reserved for the IDLE tasks. * In an SMP system, each CPU core has its own idle task. @@ -2829,8 +2822,7 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; */ #define _CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ ( _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS + \ - _CONFIGURE_INTERRUPT_STACK_MEMORY + \ - _CONFIGURE_API_MUTEX_MEMORY \ + _CONFIGURE_INTERRUPT_STACK_MEMORY \ ) /** diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index ed269d5566..6ec5a7662e 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -59,10 +58,6 @@ _Objects_Information_table[ OBJECTS_APIS_LAST + 1 ] = { &_POSIX_Objects[ 0 ] }; -API_Mutex_Control *_RTEMS_Allocator_Mutex; - -API_Mutex_Control *_Once_Mutex; - static void rtems_initialize_data_structures(void) { /* @@ -83,10 +78,6 @@ static void rtems_initialize_data_structures(void) _ISR_Handler_initialization(); - _API_Mutex_Initialization( 2 ); - _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); - _API_Mutex_Allocate( &_Once_Mutex ); - _Thread_Handler_initialization(); _Scheduler_Handler_initialization(); -- cgit v1.2.3