RTEMS
|
SMP Support. More...
Files | |
file | smp.h |
SuperCore SMP Support API. | |
Macros | |
#define | SMP_MESSAGE_SHUTDOWN 0x1UL |
SMP message to request a processor shutdown. More... | |
#define | SMP_MESSAGE_PERFORM_JOBS 0x2UL |
SMP message to perform per-processor jobs. More... | |
Typedefs | |
typedef void(* | SMP_Action_handler) (void *arg) |
Enumerations | |
enum | SMP_Fatal_code { SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER, SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT, SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR, SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR, SMP_FATAL_SHUTDOWN, SMP_FATAL_SHUTDOWN_RESPONSE, SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED, SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED, SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS } |
SMP fatal codes. | |
Functions | |
static uint32_t | _SMP_Get_processor_maximum (void) |
static uint32_t | _SMP_Get_current_processor (void) |
static void | _SMP_Fatal (SMP_Fatal_code code) |
Terminates with the given code. More... | |
void | _SMP_Handler_initialize (void) |
Initializes SMP Handler. More... | |
void | _SMP_Start_multitasking_on_secondary_processor (Per_CPU_Control *cpu_self) RTEMS_NO_RETURN |
Performs high-level initialization of a secondary processor and runs the application threads. More... | |
static long unsigned | _SMP_Inter_processor_interrupt_handler (Per_CPU_Control *cpu_self) |
Interrupts handler for inter-processor interrupts. More... | |
bool | _SMP_Should_start_processor (uint32_t cpu_index) |
Checks if the processor with the specified index should be started. More... | |
void | _SMP_Send_message (uint32_t cpu_index, unsigned long message) |
Sends an SMP message to a processor. More... | |
void | _SMP_Send_message_broadcast (unsigned long message) |
Sends an SMP message to all other online processors. More... | |
void | _SMP_Send_message_multicast (const Processor_mask *targets, unsigned long message) |
Sends an SMP message to a set of processors. More... | |
void | _SMP_Multicast_action (const Processor_mask *targets, SMP_Action_handler handler, void *arg) |
Initiates an SMP multicast action to the set of target processors. More... | |
void | _SMP_Broadcast_action (SMP_Action_handler handler, void *arg) |
Initiates an SMP multicast action to the set of all online processors. More... | |
void | _SMP_Othercast_action (SMP_Action_handler handler, void *arg) |
Initiates an SMP multicast action to the set of all online processors excluding the current processor. More... | |
void | _SMP_Unicast_action (uint32_t cpu_index, SMP_Action_handler handler, void *arg) |
Initiates an SMP action on the specified target processor. More... | |
void | _SMP_Synchronize (void) |
Ensures that all store operations issued by the current processor before the call this function are visible to all other online processors. More... | |
void | _SMP_Request_start_multitasking (void) |
Requests a multitasking start on all configured and available processors. | |
void | _SMP_Request_shutdown (void) |
Requests a shutdown of all processors. More... | |
static __inline__ const Processor_mask * | _SMP_Get_online_processors (void) |
Gets all online processors. More... | |
static __inline__ const bool | _SMP_Need_inter_processor_interrupts (void) |
Indicate if inter-processor interrupts are needed. More... | |
Variables | |
const uint32_t | _SMP_Processor_configured_maximum |
The configured processor maximum. More... | |
uint32_t | _SMP_Processor_maximum |
Processor_mask | _SMP_Online_processors |
Set of online processors. More... | |
SMP Support.
This defines the interface of the SuperCore SMP support.
#define SMP_MESSAGE_PERFORM_JOBS 0x2UL |
SMP message to perform per-processor jobs.
#define SMP_MESSAGE_SHUTDOWN 0x1UL |
SMP message to request a processor shutdown.
void _SMP_Broadcast_action | ( | SMP_Action_handler | handler, |
void * | arg | ||
) |
Initiates an SMP multicast action to the set of all online processors.
Simply calls _SMP_Multicast_action() with _SMP_Get_online_processors() as the target processor set.
handler | The multicast action handler. |
arg | The multicast action argument. |
Definition at line 202 of file smpmulticastaction.c.
|
inlinestatic |
|
static |
void _SMP_Handler_initialize | ( | void | ) |
|
inlinestatic |
void _SMP_Multicast_action | ( | const Processor_mask * | targets, |
SMP_Action_handler | handler, | ||
void * | arg | ||
) |
Initiates an SMP multicast action to the set of target processors.
The current processor may be part of the set. The caller must ensure that no thread dispatch can happen during the call of this function, otherwise the behaviour is undefined. In case a target processor is in a wrong state to process per-processor jobs, then this function results in an SMP_FATAL_WRONG_CPU_STATE_TO_PERFORM_JOBS fatal SMP error.
targets | The set of target processors for the action. |
handler | The multicast action handler. |
arg | The multicast action argument. |
Definition at line 183 of file smpmulticastaction.c.
|
static |
void _SMP_Othercast_action | ( | SMP_Action_handler | handler, |
void * | arg | ||
) |
Initiates an SMP multicast action to the set of all online processors excluding the current processor.
Simply calls _SMP_Multicast_action() with _SMP_Get_online_processors() as the target processor set excluding the current processor.
handler | The multicast action handler. |
arg | The multicast action argument. |
Definition at line 210 of file smpmulticastaction.c.
void _SMP_Request_shutdown | ( | void | ) |
Requests a shutdown of all processors.
This function is a part of the system termination procedure.
void _SMP_Send_message | ( | uint32_t | cpu_index, |
unsigned long | message | ||
) |
void _SMP_Send_message_broadcast | ( | unsigned long | message | ) |
void _SMP_Send_message_multicast | ( | const Processor_mask * | targets, |
unsigned long | message | ||
) |
bool _SMP_Should_start_processor | ( | uint32_t | cpu_index | ) |
void _SMP_Start_multitasking_on_secondary_processor | ( | Per_CPU_Control * | cpu_self | ) |
Performs high-level initialization of a secondary processor and runs the application threads.
The low-level initialization code must call this function to hand over the control of this processor to RTEMS. Interrupts must be disabled. It must be possible to send inter-processor interrupts to this processor. Since interrupts are disabled the inter-processor interrupt delivery is postponed until interrupts are enabled the first time. Interrupts are enabled during the execution begin of threads in case they have interrupt level zero (this is the default).
The pre-requisites for the call to this function are
This function must not be called by the main processor. The main processor uses _Thread_Start_multitasking() instead.
This function does not return to the caller.
cpu_self | The current processor control. |
void _SMP_Synchronize | ( | void | ) |
Ensures that all store operations issued by the current processor before the call this function are visible to all other online processors.
Simply calls _SMP_Othercast_action() with an empty multicast action.
Definition at line 227 of file smpmulticastaction.c.
void _SMP_Unicast_action | ( | uint32_t | cpu_index, |
SMP_Action_handler | handler, | ||
void * | arg | ||
) |
Initiates an SMP action on the specified target processor.
This is an optimized variant of _SMP_Multicast_action().
cpu_index | The index of the target processor. |
handler | The action handler. |
arg | The action argument. |
Definition at line 34 of file smpunicastaction.c.
Processor_mask _SMP_Online_processors |
Set of online processors.
A processor is online if was started during system initialization. In this case its corresponding bit in the mask is set.
const uint32_t _SMP_Processor_configured_maximum |
The configured processor maximum.
In SMP configurations, this constant is defined by the application configuration via <rtems/confdefs.h>, otherwise it is a compile-time constant with the value one.