From adf98bd423cabd47466b13d3432284da0d532176 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 21 Feb 1996 14:44:11 +0000 Subject: Removed the internal thread objects and dispersed its contents to the thread handler (IDLE), MPCI object (SYSI now MP Receive) and initialize_executive_early (IO initialization). The SYSI task no longer exists in a single processor configuration. This reduces single processor Workspace requirements by a TCB and a stack which is often larger than the minimum stack size. Moving the IO initialization plus accompanying BSP hooks eliminated an initialization ordering problem in which a global task could be created before the MPCI was initialized. --- cpukit/score/include/rtems/score/mpci.h | 133 +++++++++++++++++++++++++++- cpukit/score/include/rtems/score/mppkt.h | 4 +- cpukit/score/include/rtems/score/object.h | 2 +- cpukit/score/include/rtems/score/sysstate.h | 2 +- cpukit/score/include/rtems/score/thread.h | 70 +++++++++++++++ 5 files changed, 206 insertions(+), 5 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/mpci.h b/cpukit/score/include/rtems/score/mpci.h index 8f115e8fba..25d7ac4094 100644 --- a/cpukit/score/include/rtems/score/mpci.h +++ b/cpukit/score/include/rtems/score/mpci.h @@ -29,6 +29,17 @@ extern "C" { #include #include +/* + * The following constants define the stack size requirements for + * the system threads. + */ + +#define MPCI_RECEIVE_SERVER_STACK_SIZE \ + ( STACK_MINIMUM_SIZE + \ + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \ + _CPU_Table.extra_mpci_receive_server_stack \ + ) + /* * The following defines the node number used when a broadcast is desired. */ @@ -91,6 +102,27 @@ typedef struct { typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * ); +/* + * The following enumerated type defines the list of + * internal MP operations. + */ + +typedef enum { + MPCI_PACKETS_SYSTEM_VERIFY = 0 +} MPCI_Internal_Remote_operations; + +/* + * The following data structure defines the packet used to perform + * remote event operations. + */ + +typedef struct { + MP_packet_Prefix Prefix; + MPCI_Internal_Remote_operations operation; + unsigned32 maximum_nodes; + unsigned32 maximum_global_objects; +} MPCI_Internal_packet; + /* * This is the core semaphore which the MPCI Receive Server blocks on. */ @@ -136,6 +168,16 @@ void _MPCI_Handler_initialization( unsigned32 timeout_status ); +/* + * _MPCI_Create_server + * + * DESCRIPTION: + * + * This routine creates the packet receive server used in MP systems. + */ + +void _MPCI_Create_server( void ); + /* * _MPCI_Initialization * @@ -259,7 +301,9 @@ Thread_Control *_MPCI_Process_response ( * */ -void _MPCI_Receive_server( void ); +Thread _MPCI_Receive_server( + unsigned32 ignored +); /*PAGE * @@ -272,6 +316,93 @@ void _MPCI_Receive_server( void ); void _MPCI_Announce ( void ); +/* + * _MPCI_Internal_packets_Send_process_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * process operation can be performed on another node. + */ + +void _MPCI_Internal_packets_Send_process_packet ( + MPCI_Internal_Remote_operations operation +); + +/* + * _MPCI_Internal_packets_Send_request_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive operation can be initiated on another node. + * + * This routine is not needed since there are no request + * packets to be sent by this manager. + */ + +/* + * _MPCI_Internal_packets_Send_response_packet + * + * DESCRIPTION: + * + * This routine performs a remote procedure call so that a + * directive can be performed on another node. + * + * This routine is not needed since there are no response + * packets to be sent by this manager. + */ + +/* + * + * _MPCI_Internal_packets_Process_packet + * + * DESCRIPTION: + * + * This routine performs the actions specific to this package for + * the request from another node. + */ + +void _MPCI_Internal_packets_Process_packet ( + MP_packet_Prefix *the_packet_prefix +); + +/* + * _MPCI_Internal_packets_Send_object_was_deleted + * + * DESCRIPTION: + * + * This routine is invoked indirectly by the thread queue + * when a proxy has been removed from the thread queue and + * the remote node must be informed of this. + * + * This routine is not needed since there are no objects + * deleted by this manager. + */ + +/* + * _MPCI_Internal_packets_Send_extract_proxy + * + * DESCRIPTION: + * + * This routine is invoked when a task is deleted and it + * has a proxy which must be removed from a thread queue and + * the remote node must be informed of this. + * + * This routine is not needed since there are no objects + * deleted by this manager. + */ + +/* + * _MPCI_Internal_packets_Get_packet + * + * DESCRIPTION: + * + * This routine is used to obtain a internal threads mp packet. + */ + + MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ); + #ifdef __cplusplus } #endif diff --git a/cpukit/score/include/rtems/score/mppkt.h b/cpukit/score/include/rtems/score/mppkt.h index 8ed1ab1fab..37469d93b8 100644 --- a/cpukit/score/include/rtems/score/mppkt.h +++ b/cpukit/score/include/rtems/score/mppkt.h @@ -38,7 +38,7 @@ extern "C" { */ typedef enum { - MP_PACKET_INTERNAL_THREADS = 0, + MP_PACKET_MPCI_INTERNAL = 0, MP_PACKET_TASKS = 1, MP_PACKET_MESSAGE_QUEUE = 2, MP_PACKET_SEMAPHORE = 3, @@ -48,7 +48,7 @@ typedef enum { MP_PACKET_SIGNAL = 7 } MP_packet_Classes; -#define MP_PACKET_CLASSES_FIRST MP_PACKET_INTERNAL_THREADS +#define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL /* diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 2337a8e13a..2c93a44379 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -100,7 +100,7 @@ typedef enum { #define OBJECTS_CLASSES_FIRST OBJECTS_NO_CLASS #define OBJECTS_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES -#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_INTERNAL_THREADS +#define OBJECTS_CLASSES_FIRST_THREAD_CLASS OBJECTS_MPCI_PACKETS #define OBJECTS_CLASSES_LAST_THREAD_CLASS OBJECTS_POSIX_THREADS /* diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h index 11b5018705..c5d8562001 100644 --- a/cpukit/score/include/rtems/score/sysstate.h +++ b/cpukit/score/include/rtems/score/sysstate.h @@ -31,7 +31,7 @@ extern "C" { typedef enum { SYSTEM_STATE_BEFORE_INITIALIZATION, /* start -> end of 1st init part */ SYSTEM_STATE_BEFORE_MULTITASKING, /* end of 1st -> beginning of 2nd */ - SYSTEM_STATE_BEGIN_MULTITASKING, /* beginning of 2nd -> end of SYSI */ + SYSTEM_STATE_BEGIN_MULTITASKING, /* just before multitasking starts */ SYSTEM_STATE_UP, /* normal operation */ SYSTEM_STATE_FAILED /* fatal error occurred */ } System_state_Codes; diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 654dddc825..d904df439b 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -160,6 +160,28 @@ typedef struct { void **extensions; } Thread_Control; +/* + * The following constants define the stack size requirements for + * the idle thread. + */ + + +#define THREAD_IDLE_STACK_SIZE STACK_MINIMUM_SIZE + +/* + * The following defines the information control block used to + * manage this class of objects. + */ + +EXTERN Objects_Information _Thread_Internal_information; + +/* + * The following define the thread control pointers used to access + * and manipulate the idle thread. + */ + +EXTERN Thread_Control *_Thread_Idle; + /* * The following context area contains the context of the "thread" * which invoked the start multitasking routine. This context is @@ -237,6 +259,18 @@ void _Thread_Handler_initialization ( unsigned32 maximum_proxies ); +/* + * _Thread_Create_idle + * + * DESCRIPTION: + * + * This routine creates the idle thread. + * + * WARNING!! No thread should be created before this one. + */ + +void _Thread_Create_idle( void ); + /* * _Thread_Start_multitasking * @@ -756,6 +790,42 @@ STATIC INLINE boolean _Thread_Is_proxy_blocking ( unsigned32 code ); +/* + * _Thread_Internal_allocate + * + * DESCRIPTION: + * + * This routine allocates an internal thread. + */ + +STATIC INLINE Thread_Control *_Thread_Internal_allocate( void ); + +/* + * _Thread_Internal_free + * + * DESCRIPTION: + * + * This routine frees an internal thread. + */ + +STATIC INLINE void _Thread_Internal_free ( + Thread_Control *the_task +); + +/* + * _Thread_Idle_body + * + * DESCRIPTION: + * + * This routine is the body of the system idle thread. + */ + +#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE) +Thread _Thread_Idle_body( + unsigned32 ignored +); +#endif + #include #include -- cgit v1.2.3