rtems: Fix MPCI initialization

Update #2408.
This commit is contained in:
Sebastian Huber
2019-12-29 17:43:46 +01:00
parent a320aeddd9
commit 453bb4b642
16 changed files with 77 additions and 158 deletions

View File

@@ -166,17 +166,6 @@ rtems_status_code _Message_queue_MP_Urgent(
size_t size size_t size
); );
/**
*
* @brief _Message_queue_MP_Process_packet
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _Message_queue_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix
);
/** /**
* @brief _Message_queue_MP_Send_object_was_deleted * @brief _Message_queue_MP_Send_object_was_deleted
* *

View File

@@ -100,17 +100,6 @@ rtems_status_code _Partition_MP_Return_buffer(
void *buffer void *buffer
); );
/**
*
* @brief Partition_MP_Process_packet
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _Partition_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix
);
/* /*
* @brief Partition_MP_Send_object_was_deleted * @brief Partition_MP_Send_object_was_deleted
* *

View File

@@ -94,16 +94,6 @@ rtems_status_code _Semaphore_MP_Obtain(
*/ */
rtems_status_code _Semaphore_MP_Release( rtems_id id ); rtems_status_code _Semaphore_MP_Release( rtems_id id );
/**
* @brief Semaphore MP Process Packet
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _Semaphore_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix
);
/** /**
* @brief Semaphore MP Send Object was Deleted * @brief Semaphore MP Send Object was Deleted
* *

View File

@@ -86,16 +86,6 @@ rtems_status_code _RTEMS_tasks_MP_Suspend( rtems_id id );
*/ */
rtems_status_code _RTEMS_tasks_MP_Resume( rtems_id id ); rtems_status_code _RTEMS_tasks_MP_Resume( rtems_id id );
/**
* @brief _RTEMS_tasks_MP_Process_packet
*
* This routine performs the actions specific to this package for
* the request from another node.
*/
void _RTEMS_tasks_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix
);
/** /**
* @brief _RTEMS_tasks_MP_Send_object_was_deleted * @brief _RTEMS_tasks_MP_Send_object_was_deleted
* *

View File

@@ -36,12 +36,16 @@ extern "C" {
#define RTEMS_SYSINIT_MP 000800 #define RTEMS_SYSINIT_MP 000800
#define RTEMS_SYSINIT_USER_EXTENSIONS 000900 #define RTEMS_SYSINIT_USER_EXTENSIONS 000900
#define RTEMS_SYSINIT_CLASSIC_TASKS 000a00 #define RTEMS_SYSINIT_CLASSIC_TASKS 000a00
#define RTEMS_SYSINIT_CLASSIC_TASKS_MP 000a80
#define RTEMS_SYSINIT_CLASSIC_TIMER 000b00 #define RTEMS_SYSINIT_CLASSIC_TIMER 000b00
#define RTEMS_SYSINIT_CLASSIC_SIGNAL 000c00 #define RTEMS_SYSINIT_CLASSIC_SIGNAL_MP 000c00
#define RTEMS_SYSINIT_CLASSIC_EVENT 000d00 #define RTEMS_SYSINIT_CLASSIC_EVENT_MP 000d00
#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE 000e00 #define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE 000e00
#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP 000e80
#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE 000f00 #define RTEMS_SYSINIT_CLASSIC_SEMAPHORE 000f00
#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP 000f80
#define RTEMS_SYSINIT_CLASSIC_PARTITION 001000 #define RTEMS_SYSINIT_CLASSIC_PARTITION 001000
#define RTEMS_SYSINIT_CLASSIC_PARTITION_MP 001080
#define RTEMS_SYSINIT_CLASSIC_REGION 001100 #define RTEMS_SYSINIT_CLASSIC_REGION 001100
#define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200 #define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200
#define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 001300 #define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 001300

View File

@@ -101,14 +101,14 @@ rtems_status_code _Event_Seize(
} }
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
static void _Event_Manager_initialization( void ) static void _Event_MP_Initialize( void )
{ {
_MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet ); _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(
_Event_Manager_initialization, _Event_MP_Initialize,
RTEMS_SYSINIT_CLASSIC_EVENT, RTEMS_SYSINIT_CLASSIC_EVENT_MP,
RTEMS_SYSINIT_ORDER_MIDDLE RTEMS_SYSINIT_ORDER_MIDDLE
); );
#endif #endif

View File

@@ -24,6 +24,7 @@
#include <rtems/score/coremsgimpl.h> #include <rtems/score/coremsgimpl.h>
#include <rtems/score/statesimpl.h> #include <rtems/score/statesimpl.h>
#include <rtems/score/threadimpl.h> #include <rtems/score/threadimpl.h>
#include <rtems/sysinit.h>
RTEMS_STATIC_ASSERT( RTEMS_STATIC_ASSERT(
MESSAGE_QUEUE_MP_PACKET_SIZE <= MP_PACKET_MINIMUM_PACKET_SIZE, MESSAGE_QUEUE_MP_PACKET_SIZE <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -361,13 +362,7 @@ static void _Message_queue_MP_Send_response_packet (
} }
} }
/* static void _Message_queue_MP_Process_packet (
*
* _Message_queue_MP_Process_packet
*
*/
void _Message_queue_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix rtems_packet_prefix *the_packet_prefix
) )
{ {
@@ -590,4 +585,16 @@ void _Message_queue_Core_message_queue_mp_support(
); );
} }
/* end of file */ static void _Message_queue_MP_Initialize( void )
{
_MPCI_Register_packet_processor(
MP_PACKET_MESSAGE_QUEUE,
_Message_queue_MP_Process_packet
);
}
RTEMS_SYSINIT_ITEM(
_Message_queue_MP_Initialize,
RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP,
RTEMS_SYSINIT_ORDER_MIDDLE
);

View File

@@ -147,18 +147,6 @@ rtems_status_code rtems_message_queue_create(
static void _Message_queue_Manager_initialization( void ) static void _Message_queue_Manager_initialization( void )
{ {
_Objects_Initialize_information( &_Message_queue_Information); _Objects_Initialize_information( &_Message_queue_Information);
/*
* Register the MP Process Packet routine.
*/
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor(
MP_PACKET_MESSAGE_QUEUE,
_Message_queue_MP_Process_packet
);
#endif
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(

View File

@@ -119,18 +119,6 @@ rtems_status_code rtems_partition_create(
static void _Partition_Manager_initialization( void ) static void _Partition_Manager_initialization( void )
{ {
_Objects_Initialize_information( &_Partition_Information ); _Objects_Initialize_information( &_Partition_Information );
/*
* Register the MP Process Packet routine.
*/
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor(
MP_PACKET_PARTITION,
_Partition_MP_Process_packet
);
#endif
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(

View File

@@ -23,6 +23,7 @@
#include <rtems/score/statesimpl.h> #include <rtems/score/statesimpl.h>
#include <rtems/score/threadimpl.h> #include <rtems/score/threadimpl.h>
#include <rtems/score/threadqimpl.h> #include <rtems/score/threadqimpl.h>
#include <rtems/sysinit.h>
RTEMS_STATIC_ASSERT( RTEMS_STATIC_ASSERT(
sizeof(Partition_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, sizeof(Partition_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -206,13 +207,7 @@ static void _Partition_MP_Send_response_packet (
} }
} }
/* static void _Partition_MP_Process_packet(
*
* _Partition_MP_Process_packet
*
*/
void _Partition_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix rtems_packet_prefix *the_packet_prefix
) )
{ {
@@ -326,4 +321,16 @@ void _Partition_MP_Send_extract_proxy (
} }
/* end of file */ static void _Partition_MP_Initialize( void )
{
_MPCI_Register_packet_processor(
MP_PACKET_PARTITION,
_Partition_MP_Process_packet
);
}
RTEMS_SYSINIT_ITEM(
_Partition_MP_Initialize,
RTEMS_SYSINIT_CLASSIC_PARTITION_MP,
RTEMS_SYSINIT_ORDER_MIDDLE
);

View File

@@ -270,13 +270,6 @@ rtems_status_code rtems_semaphore_create(
static void _Semaphore_Manager_initialization( void ) static void _Semaphore_Manager_initialization( void )
{ {
_Objects_Initialize_information( &_Semaphore_Information ); _Objects_Initialize_information( &_Semaphore_Information );
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor(
MP_PACKET_SEMAPHORE,
_Semaphore_MP_Process_packet
);
#endif
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(

View File

@@ -21,6 +21,7 @@
#include <rtems/rtems/semimpl.h> #include <rtems/rtems/semimpl.h>
#include <rtems/rtems/optionsimpl.h> #include <rtems/rtems/optionsimpl.h>
#include <rtems/rtems/statusimpl.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/sysinit.h>
RTEMS_STATIC_ASSERT( RTEMS_STATIC_ASSERT(
sizeof(Semaphore_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, sizeof(Semaphore_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -187,7 +188,7 @@ static void _Semaphore_MP_Send_response_packet (
} }
} }
void _Semaphore_MP_Process_packet ( static void _Semaphore_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix rtems_packet_prefix *the_packet_prefix
) )
{ {
@@ -295,7 +296,6 @@ void _Semaphore_MP_Send_extract_proxy (
} }
#if defined(RTEMS_MULTIPROCESSING)
void _Semaphore_Core_mutex_mp_support ( void _Semaphore_Core_mutex_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,
Objects_Id id Objects_Id id
@@ -309,9 +309,7 @@ void _Semaphore_Core_mutex_mp_support (
the_thread the_thread
); );
} }
#endif
#if defined(RTEMS_MULTIPROCESSING)
void _Semaphore_Core_semaphore_mp_support ( void _Semaphore_Core_semaphore_mp_support (
Thread_Control *the_thread, Thread_Control *the_thread,
Objects_Id id Objects_Id id
@@ -325,5 +323,17 @@ void _Semaphore_Core_semaphore_mp_support (
the_thread the_thread
); );
} }
#endif
/* end of file */ static void _Semaphore_MP_Initialize( void )
{
_MPCI_Register_packet_processor(
MP_PACKET_SEMAPHORE,
_Semaphore_MP_Process_packet
);
}
RTEMS_SYSINIT_ITEM(
_Semaphore_MP_Initialize,
RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP,
RTEMS_SYSINIT_ORDER_MIDDLE
);

View File

@@ -89,7 +89,7 @@ rtems_status_code rtems_signal_catch(
} }
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
static void _Signal_Manager_initialization( void ) static void _Signal_MP_Initialize( void )
{ {
_MPCI_Register_packet_processor( _MPCI_Register_packet_processor(
MP_PACKET_SIGNAL, MP_PACKET_SIGNAL,
@@ -98,8 +98,8 @@ static void _Signal_Manager_initialization( void )
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(
_Signal_Manager_initialization, _Signal_MP_Initialize,
RTEMS_SYSINIT_CLASSIC_SIGNAL, RTEMS_SYSINIT_CLASSIC_SIGNAL_MP,
RTEMS_SYSINIT_ORDER_MIDDLE RTEMS_SYSINIT_ORDER_MIDDLE
); );
#endif #endif

View File

@@ -246,13 +246,6 @@ static void _RTEMS_tasks_Manager_initialization(void)
{ {
_Thread_Initialize_information( &_RTEMS_tasks_Information ); _Thread_Initialize_information( &_RTEMS_tasks_Information );
_User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions ); _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
#if defined(RTEMS_MULTIPROCESSING)
_MPCI_Register_packet_processor(
MP_PACKET_TASKS,
_RTEMS_tasks_MP_Process_packet
);
#endif
} }
RTEMS_SYSINIT_ITEM( RTEMS_SYSINIT_ITEM(

View File

@@ -24,6 +24,7 @@
#include <rtems/score/statesimpl.h> #include <rtems/score/statesimpl.h>
#include <rtems/score/threadimpl.h> #include <rtems/score/threadimpl.h>
#include <rtems/score/threadqimpl.h> #include <rtems/score/threadqimpl.h>
#include <rtems/sysinit.h>
/** /**
* The following data structure defines the packet used to perform * The following data structure defines the packet used to perform
@@ -221,7 +222,7 @@ static void _RTEMS_tasks_MP_Send_response_packet (
* *
*/ */
void _RTEMS_tasks_MP_Process_packet ( static void _RTEMS_tasks_MP_Process_packet (
rtems_packet_prefix *the_packet_prefix rtems_packet_prefix *the_packet_prefix
) )
{ {
@@ -312,20 +313,16 @@ void _RTEMS_tasks_MP_Process_packet (
} }
} }
/* static void _RTEMS_tasks_MP_Initialize( void )
* _RTEMS_tasks_MP_Send_object_was_deleted {
* _MPCI_Register_packet_processor(
* This routine is not neededby the Tasks since a task MP_PACKET_TASKS,
* cannot be globally deleted. _RTEMS_tasks_MP_Process_packet
* );
*/ }
/* RTEMS_SYSINIT_ITEM(
* _RTEMS_tasks_MP_Send_extract_proxy _RTEMS_tasks_MP_Initialize,
* RTEMS_SYSINIT_CLASSIC_TASKS_MP,
* This routine is not neededby the Tasks since a task RTEMS_SYSINIT_ORDER_MIDDLE
* cannot be globally deleted. );
*
*/
/* end of file */

View File

@@ -87,10 +87,6 @@ typedef enum {
CLASSIC_TASKS_POST, CLASSIC_TASKS_POST,
CLASSIC_TIMER_PRE, CLASSIC_TIMER_PRE,
CLASSIC_TIMER_POST, CLASSIC_TIMER_POST,
CLASSIC_SIGNAL_PRE,
CLASSIC_SIGNAL_POST,
CLASSIC_EVENT_PRE,
CLASSIC_EVENT_POST,
CLASSIC_MESSAGE_QUEUE_PRE, CLASSIC_MESSAGE_QUEUE_PRE,
CLASSIC_MESSAGE_QUEUE_POST, CLASSIC_MESSAGE_QUEUE_POST,
CLASSIC_SEMAPHORE_PRE, CLASSIC_SEMAPHORE_PRE,
@@ -310,28 +306,6 @@ LAST(RTEMS_SYSINIT_CLASSIC_TIMER)
next_step(CLASSIC_TIMER_POST); next_step(CLASSIC_TIMER_POST);
} }
FIRST(RTEMS_SYSINIT_CLASSIC_SIGNAL)
{
/* There is nothing to do in case RTEMS_MULTIPROCESSING is not defined */
next_step(CLASSIC_SIGNAL_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_SIGNAL)
{
next_step(CLASSIC_SIGNAL_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_EVENT)
{
/* There is nothing to do in case RTEMS_MULTIPROCESSING is not defined */
next_step(CLASSIC_EVENT_PRE);
}
LAST(RTEMS_SYSINIT_CLASSIC_EVENT)
{
next_step(CLASSIC_EVENT_POST);
}
FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE) FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
{ {
assert(info_not_init(&_Message_queue_Information)); assert(info_not_init(&_Message_queue_Information));