summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-07 17:53:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-07 17:55:59 +0200
commit0960fee4067febf90823778a118f9ed2d7c1a8a5 (patch)
tree57be21d75e3e1512ceb5aa94482511e1031f5d48
parent6c36946fea7bace4006168fc02e35aacd1d2e4a2 (diff)
downloadrtems-0960fee4067febf90823778a118f9ed2d7c1a8a5.tar.bz2
rtems: Fix ASR SMP support
Initialize the ISR lock only once and destroy it properly.
-rw-r--r--cpukit/rtems/include/rtems/rtems/asrimpl.h10
-rw-r--r--cpukit/rtems/src/tasks.c17
2 files changed, 24 insertions, 3 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/asrimpl.h b/cpukit/rtems/include/rtems/rtems/asrimpl.h
index 4d8d7f4401..38ee35d83a 100644
--- a/cpukit/rtems/include/rtems/rtems/asrimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/asrimpl.h
@@ -46,7 +46,17 @@ RTEMS_INLINE_ROUTINE void _ASR_Initialize (
asr->signals_posted = 0;
asr->signals_pending = 0;
asr->nest_level = 0;
+}
+
+RTEMS_INLINE_ROUTINE void _ASR_Create( ASR_Information *asr )
+{
_ISR_lock_Initialize( &asr->Lock, "ASR" );
+ _ASR_Initialize( asr );
+}
+
+RTEMS_INLINE_ROUTINE void _ASR_Destroy( ASR_Information *asr )
+{
+ _ISR_lock_Destroy( &asr->Lock );
}
/**
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index f989fff580..c8c0accab0 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -56,7 +56,7 @@ static bool _RTEMS_tasks_Create_extension(
_Event_Initialize( &api->Event );
_Event_Initialize( &api->System_event );
- _ASR_Initialize( &api->Signal );
+ _ASR_Create( &api->Signal );
_Thread_Action_initialize( &api->Signal_action, _Signal_Action_handler );
#if !defined(RTEMS_SMP)
created->task_variables = NULL;
@@ -90,11 +90,22 @@ static void _RTEMS_tasks_Start_extension(
_Event_Initialize( &api->System_event );
}
+static void _RTEMS_tasks_Delete_extension(
+ Thread_Control *executing,
+ Thread_Control *deleted
+)
+{
+ RTEMS_API_Control *api;
+
+ api = deleted->API_Extensions[ THREAD_API_RTEMS ];
+
+ _ASR_Destroy( &api->Signal );
+}
+
static void _RTEMS_tasks_Terminate_extension(
Thread_Control *executing
)
{
-
/*
* Free per task variable memory
*
@@ -172,7 +183,7 @@ User_extensions_Control _RTEMS_tasks_User_extensions = {
{ _RTEMS_tasks_Create_extension, /* create */
_RTEMS_tasks_Start_extension, /* start */
_RTEMS_tasks_Start_extension, /* restart */
- NULL, /* delete */
+ _RTEMS_tasks_Delete_extension, /* delete */
RTEMS_TASKS_SWITCH_EXTENSION, /* switch */
NULL, /* begin */
NULL, /* exitted */