2011-05-26 Jennifer Averett <Jennifer.Averett@OARcorp.com>

PR 1796/cpukit
	* sapi/src/exshutdown.c, score/include/rtems/score/percpu.h,
	score/include/rtems/score/smp.h, score/src/smp.c,
	score/src/threaddispatch.c, score/src/threadhandler.c: Added SMP
	interprocess communications.
This commit is contained in:
Jennifer Averett committed 2011-05-26 18:07:07 +00:00
1 parent 27f09f172b
commit d4dc7c8196
7 files changed
+227 -40

No files matched your search

+8
View File
@@ -1,3 +1,11 @@
2011-05-26 Jennifer Averett <Jennifer.Averett@OARcorp.com>
PR 1796/cpukit
* sapi/src/exshutdown.c, score/include/rtems/score/percpu.h,
score/include/rtems/score/smp.h, score/src/smp.c,
score/src/threaddispatch.c, score/src/threadhandler.c: Added SMP
interprocess communications.
2011-05-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* score/include/rtems/score/percpu.h,
+8 -1
View File
@@ -1,7 +1,7 @@
/*
* Initialization Manager
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -20,6 +20,10 @@
#include <rtems/score/thread.h>
#include <rtems/score/interr.h>
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
/*
* rtems_shutdown_executive
*
@@ -37,6 +41,9 @@ void rtems_shutdown_executive(
)
{
if ( _System_state_Is_up( _System_state_Get() ) ) {
#if defined(RTEMS_SMP)
_SMP_Request_other_cores_to_shutdown();
#endif
_System_state_Set( SYSTEM_STATE_SHUTDOWN );
_Thread_Stop_multitasking();
}
+7 -1
View File
@@ -77,11 +77,17 @@ typedef enum {
*/
RTEMS_BSP_SMP_CPU_INITIALIZED = 2,
/**
* This defines the constant used to indicate that the cpu code has
* completed basic initialization and awaits further commands.
*/
RTEMS_BSP_SMP_CPU_UP = 3,
/**
* This defines the constant used to indicate that the cpu code has
* shut itself down.
*/
RTEMS_BSP_SMP_CPU_SHUTDOWN = 3
RTEMS_BSP_SMP_CPU_SHUTDOWN = 4
} bsp_smp_cpu_state;
/**
+8
View File
@@ -86,6 +86,14 @@ void _SMP_Broadcast_message(
uint32_t message
);
/**
* @brief Request Other Cores to Perform First Context Switch
*
* Send message to other cores requesting them to perform
* their first context switch operation.
*/
void _SMP_Request_other_cores_to_perform_first_context_switch(void);
/**
* @brief Request Dispatch on Other Cores
*
+162 -33
View File
File diff suppressed because it is too large. Load diff
+20 -3
View File
@@ -33,6 +33,10 @@
#include <rtems/score/timestamp.h>
#endif
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
/**
* _Thread_Dispatch
*
@@ -47,18 +51,28 @@
* dispatch thread
* no dispatch thread
*/
void _Thread_Dispatch( void )
{
Thread_Control *executing;
Thread_Control *heir;
ISR_Level level;
_Thread_Disable_dispatch();
#if defined(RTEMS_SMP)
/*
* If necessary, send dispatch request to other cores.
*/
_SMP_Request_other_cores_to_dispatch();
#endif
/*
* Now determine if we need to perform a dispatch on the current CPU.
*/
executing = _Thread_Executing;
_ISR_Disable( level );
while ( _Thread_Dispatch_necessary == true ) {
heir = _Thread_Heir;
_Thread_Dispatch_set_disable_level( 1 );
_Thread_Dispatch_necessary = false;
_Thread_Executing = heir;
@@ -96,7 +110,10 @@ void _Thread_Dispatch( void )
_Thread_Time_of_last_context_switch = uptime;
}
#else
heir->cpu_time_used++;
{
TOD_Get_uptime( &_Thread_Time_of_last_context_switch );
heir->cpu_time_used++;
}
#endif
/*
+14 -2
View File
@@ -2,7 +2,7 @@
* Thread Handler
*
*
* COPYRIGHT (c) 1989-2009.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -51,6 +51,11 @@
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
#endif
/*PAGE
*
* _Thread_Handler
@@ -138,8 +143,15 @@ void _Thread_Handler( void )
*/
if (!doneCons) /* && (volatile void *)_init) */ {
INIT_NAME ();
#if defined(RTEMS_SMP)
_Thread_Disable_dispatch();
_SMP_Request_other_cores_to_perform_first_context_switch();
_Thread_Enable_dispatch();
#endif
}
#endif
#endif
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =