From 0d5a9f1bb72c0fae779bf6ab1e59b315b381e903 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Wed, 27 Apr 2011 17:18:59 +0000 Subject: 2011-04-27 Jennifer Averett PR 1784 * sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/include/rtems/bspsmp.h, score/src/percpu.c, score/src/smp.c, score/src/threadcreateidle.c: Split bspsmp.h into two files smp.h and bspsmp.h * score/include/rtems/score/smp.h: New file. --- cpukit/ChangeLog | 9 +++ cpukit/sapi/src/exinit.c | 2 +- cpukit/score/Makefile.am | 2 +- cpukit/score/include/rtems/bspsmp.h | 67 ++------------------ cpukit/score/include/rtems/score/smp.h | 112 +++++++++++++++++++++++++++++++++ cpukit/score/preinstall.am | 4 ++ cpukit/score/src/percpu.c | 2 +- cpukit/score/src/smp.c | 1 + cpukit/score/src/threadcreateidle.c | 2 +- 9 files changed, 136 insertions(+), 65 deletions(-) create mode 100644 cpukit/score/include/rtems/score/smp.h (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index f7a38efc32..05e08292cf 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,12 @@ +2011-04-27 Jennifer Averett + + PR 1784 + * sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, + score/include/rtems/bspsmp.h, score/src/percpu.c, score/src/smp.c, + score/src/threadcreateidle.c: Split bspsmp.h into two files smp.h and + bspsmp.h + * score/include/rtems/score/smp.h: New file. + 2011-04-25 Jennifer Averett * score/include/rtems/bspsmp.h: Did some prototype cleanup. diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index b63d5e57c4..860d758774 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -58,7 +58,7 @@ #endif #if defined(RTEMS_SMP) - #include + #include #include #endif diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 36cae4cfee..bdbc3979a4 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -37,7 +37,7 @@ include_rtems_score_HEADERS = include/rtems/score/address.h \ include/rtems/score/tqdata.h include/rtems/score/userext.h \ include/rtems/score/watchdog.h include/rtems/score/wkspace.h \ include/rtems/score/cpuopts.h include/rtems/score/basedefs.h \ - include/rtems/score/smplock.h + include/rtems/score/smplock.h include/rtems/score/smp.h if HAS_PTHREADS include_rtems_score_HEADERS += include/rtems/score/corespinlock.h \ diff --git a/cpukit/score/include/rtems/bspsmp.h b/cpukit/score/include/rtems/bspsmp.h index 0d4cfe9ba4..84aef5f0e4 100644 --- a/cpukit/score/include/rtems/bspsmp.h +++ b/cpukit/score/include/rtems/bspsmp.h @@ -44,43 +44,8 @@ extern "C" { #endif -/** - * This defines the bit which indicates the interprocessor interrupt - * has been requested so that RTEMS will reschedule on this CPU - * because the currently executing thread needs to be switched out. - */ -#define RTEMS_BSP_SMP_CONTEXT_SWITCH_NECESSARY 0x01 - -/** - * This defines the bit which indicates the interprocessor interrupt - * has been requested so that RTEMS will reschedule on this CPU - * because the currently executing thread has been sent a signal. - */ -#define RTEMS_BSP_SMP_SIGNAL_TO_SELF 0x02 - -/** - * This defines the bit which indicates the interprocessor interrupt - * has been requested so that this CPU will be shutdown. This is done - * as part of rtems_executive_shutdown(). - */ -#define RTEMS_BSP_SMP_SHUTDOWN 0x04 - -/** - * This defines the bit which indicates the interprocessor interrupt - * has been requested that the receiving CPU needs to perform a context - * switch to the first task. - */ -#define RTEMS_BSP_SMP_FIRST_TASK 0x08 #ifndef ASM -/** - * @brief Number of CPUs in SMP System - * - * This variable is set during the SMP initialization sequence to - * indicate the number of CPUs in this system. - */ -SCORE_EXTERN uint32_t _SMP_Processor_count; - /** * @brief Maximum Number of CPUs in SMP System * @@ -130,32 +95,6 @@ void rtems_smp_send_message( uint32_t message ); -/** - * @brief Make Request of Others CPUs - * - * This method is invoked by RTEMS when it needs to make a request - * of the other CPUs. It should be implemented using some type of - * interprocessor interrupt. CPUs not including the originating - * CPU should receive the message. - * - * @param [in] message is message to send - */ -void bsp_smp_broadcast_message( - uint32_t message -); - -/** - * @brief Make Request of Others CPUs - * - * This method is invoked by XXX when it needs to make a request - * of the other CPUs. - * - * @param [in] message is message to send - */ -void rtems_smp_broadcast_message( - uint32_t message -); - /** * @brief Generate a Interprocessor Broadcast Interrupt * @@ -230,6 +169,12 @@ void rtems_smp_initialize_per_cpu(int cpu); */ void rtems_smp_process_interrupt(void); +void bsp_smp_wait_for( + volatile unsigned int *address, + unsigned int desired, + int maximum_usecs +); + #endif #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h new file mode 100644 index 0000000000..54e4300ec4 --- /dev/null +++ b/cpukit/score/include/rtems/score/smp.h @@ -0,0 +1,112 @@ +/** + * @file rtems/score/smp.h + * + * This include file defines the interface to the SuperCore + * SMP support that is used internally to RTEMS. + */ + +/* + * COPYRIGHT (c) 1989-2011. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifndef _RTEMS_SCORE_SMP_H +#define _RTEMS_SCORE_SMP_H + +#if defined (RTEMS_SMP) +#include + +/** + * @defgroup SuperCore SMP Support + * + * This defines the interface of the SuperCore support + * code for SMP support. + */ + +/**@{*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This defines the bit which indicates the interprocessor interrupt + * has been requested so that RTEMS will reschedule on this CPU + * because the currently executing thread needs to be switched out. + */ +#define RTEMS_BSP_SMP_CONTEXT_SWITCH_NECESSARY 0x01 + +/** + * This defines the bit which indicates the interprocessor interrupt + * has been requested so that RTEMS will reschedule on this CPU + * because the currently executing thread has been sent a signal. + */ +#define RTEMS_BSP_SMP_SIGNAL_TO_SELF 0x02 + +/** + * This defines the bit which indicates the interprocessor interrupt + * has been requested so that this CPU will be shutdown. This is done + * as part of rtems_executive_shutdown(). + */ +#define RTEMS_BSP_SMP_SHUTDOWN 0x04 + +/** + * This defines the bit which indicates the interprocessor interrupt + * has been requested that the receiving CPU needs to perform a context + * switch to the first task. + */ +#define RTEMS_BSP_SMP_FIRST_TASK 0x08 + +#ifndef ASM +/** + * @brief Number of CPUs in SMP System + * + * This variable is set during the SMP initialization sequence to + * indicate the number of CPUs in this system. + */ +SCORE_EXTERN uint32_t _SMP_Processor_count; + +/** + * @brief Make Request of Others CPUs + * + * This method is invoked by RTEMS when it needs to make a request + * of the other CPUs. It should be implemented using some type of + * interprocessor interrupt. CPUs not including the originating + * CPU should receive the message. + * + * @param [in] message is message to send + */ +void _SMP_Broadcast_message( + uint32_t message +); + +/** + * @brief Request Dispatch on Other Cores + * + * Send message to other cores requesting them to perform + * a thread dispatch operation. + */ +void _SMP_Request_other_cores_to_dispatch(void); + +/** + * @Brief Request Other Cores to Shutdown + * + * Send message to other cores requesting them to shutdown. + */ +void _SMP_Request_other_cores_to_shutdown(void); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif +#endif +/* end of include file */ diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am index d228c69d86..831bb5b132 100644 --- a/cpukit/score/preinstall.am +++ b/cpukit/score/preinstall.am @@ -199,6 +199,10 @@ $(PROJECT_INCLUDE)/rtems/score/smplock.h: include/rtems/score/smplock.h $(PROJEC $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/smplock.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/smplock.h +$(PROJECT_INCLUDE)/rtems/score/smp.h: include/rtems/score/smp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/smp.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/smp.h + if HAS_PTHREADS $(PROJECT_INCLUDE)/rtems/score/corespinlock.h: include/rtems/score/corespinlock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/corespinlock.h diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c index 219dc7ac48..98eb3a413e 100644 --- a/cpukit/score/src/percpu.c +++ b/cpukit/score/src/percpu.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #if defined(RTEMS_SMP) diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index b9d6f9799a..068285c114 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -15,6 +15,7 @@ #include #include +#include #include #if defined(RTEMS_SMP) diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index 6a4bf65e9c..c03ea25cf7 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include static inline void _Thread_Create_idle_helper( uint32_t name_u32, -- cgit v1.2.3