Changeset adf98bd in rtems


Ignore:
Timestamp:
Feb 21, 1996, 2:44:11 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
8cbbe312
Parents:
75f09e5
Message:

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.

Files:
25 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/headers/mpci.h

    r75f09e5 radf98bd  
    2929#include <rtems/score/watchdog.h>
    3030#include <rtems/score/coresem.h>
     31
     32/*
     33 *  The following constants define the stack size requirements for
     34 *  the system threads.
     35 */
     36 
     37#define MPCI_RECEIVE_SERVER_STACK_SIZE \
     38  ( STACK_MINIMUM_SIZE + \
     39    CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
     40    _CPU_Table.extra_mpci_receive_server_stack \
     41  )
    3142
    3243/*
     
    93104 
    94105/*
     106 *  The following enumerated type defines the list of
     107 *  internal MP operations.
     108 */
     109 
     110typedef enum {
     111  MPCI_PACKETS_SYSTEM_VERIFY  =  0
     112}   MPCI_Internal_Remote_operations;
     113 
     114/*
     115 *  The following data structure defines the packet used to perform
     116 *  remote event operations.
     117 */
     118 
     119typedef struct {
     120  MP_packet_Prefix                 Prefix;
     121  MPCI_Internal_Remote_operations  operation;
     122  unsigned32                       maximum_nodes;
     123  unsigned32                       maximum_global_objects;
     124}    MPCI_Internal_packet;
     125
     126/*
    95127 *  This is the core semaphore which the MPCI Receive Server blocks on.
    96128 */
     
    136168  unsigned32               timeout_status
    137169);
     170
     171/*
     172 *  _MPCI_Create_server
     173 *
     174 *  DESCRIPTION:
     175 * 
     176 *  This routine creates the packet receive server used in MP systems.
     177 */
     178
     179void _MPCI_Create_server( void );
    138180
    139181/*
     
    260302 */
    261303 
    262 void _MPCI_Receive_server( void );
     304Thread _MPCI_Receive_server(
     305  unsigned32 ignored
     306);
    263307
    264308/*PAGE
     
    272316 
    273317void _MPCI_Announce ( void );
     318
     319/*
     320 *  _MPCI_Internal_packets_Send_process_packet
     321 *
     322 *  DESCRIPTION:
     323 *
     324 *  This routine performs a remote procedure call so that a
     325 *  process operation can be performed on another node.
     326 */
     327 
     328void _MPCI_Internal_packets_Send_process_packet (
     329   MPCI_Internal_Remote_operations operation
     330);
     331 
     332/*
     333 *  _MPCI_Internal_packets_Send_request_packet
     334 *
     335 *  DESCRIPTION:
     336 *
     337 *  This routine performs a remote procedure call so that a
     338 *  directive operation can be initiated on another node.
     339 *
     340 *  This routine is not needed since there are no request
     341 *  packets to be sent by this manager.
     342 */
     343 
     344/*
     345 *  _MPCI_Internal_packets_Send_response_packet
     346 *
     347 *  DESCRIPTION:
     348 *
     349 *  This routine performs a remote procedure call so that a
     350 *  directive can be performed on another node.
     351 *
     352 *  This routine is not needed since there are no response
     353 *  packets to be sent by this manager.
     354 */
     355 
     356/*
     357 *
     358 *  _MPCI_Internal_packets_Process_packet
     359 *
     360 *  DESCRIPTION:
     361 *
     362 *  This routine performs the actions specific to this package for
     363 *  the request from another node.
     364 */
     365 
     366void _MPCI_Internal_packets_Process_packet (
     367  MP_packet_Prefix *the_packet_prefix
     368);
     369 
     370/*
     371 *  _MPCI_Internal_packets_Send_object_was_deleted
     372 *
     373 *  DESCRIPTION:
     374 *
     375 *  This routine is invoked indirectly by the thread queue
     376 *  when a proxy has been removed from the thread queue and
     377 *  the remote node must be informed of this.
     378 *
     379 *  This routine is not needed since there are no objects
     380 *  deleted by this manager.
     381 */
     382 
     383/*
     384 *  _MPCI_Internal_packets_Send_extract_proxy
     385 *
     386 *  DESCRIPTION:
     387 *
     388 *  This routine is invoked when a task is deleted and it
     389 *  has a proxy which must be removed from a thread queue and
     390 *  the remote node must be informed of this.
     391 *
     392 *  This routine is not needed since there are no objects
     393 *  deleted by this manager.
     394 */
     395 
     396/*
     397 *  _MPCI_Internal_packets_Get_packet
     398 *
     399 *  DESCRIPTION:
     400 *
     401 *  This routine is used to obtain a internal threads mp packet.
     402 */
     403 
     404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
    274405
    275406#ifdef __cplusplus
  • c/src/exec/score/headers/mppkt.h

    r75f09e5 radf98bd  
    3939
    4040typedef enum {
    41   MP_PACKET_INTERNAL_THREADS = 0,
     41  MP_PACKET_MPCI_INTERNAL    = 0,
    4242  MP_PACKET_TASKS            = 1,
    4343  MP_PACKET_MESSAGE_QUEUE    = 2,
     
    4949}   MP_packet_Classes;
    5050
    51 #define MP_PACKET_CLASSES_FIRST  MP_PACKET_INTERNAL_THREADS
     51#define MP_PACKET_CLASSES_FIRST  MP_PACKET_MPCI_INTERNAL
    5252#define MP_PACKET_CLASSES_LAST   MP_PACKET_SIGNAL
    5353
  • c/src/exec/score/headers/object.h

    r75f09e5 radf98bd  
    101101#define OBJECTS_CLASSES_FIRST               OBJECTS_NO_CLASS
    102102#define OBJECTS_CLASSES_LAST                OBJECTS_POSIX_CONDITION_VARIABLES
    103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_INTERNAL_THREADS
     103#define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_MPCI_PACKETS
    104104#define OBJECTS_CLASSES_LAST_THREAD_CLASS   OBJECTS_POSIX_THREADS
    105105
  • c/src/exec/score/headers/sysstate.h

    r75f09e5 radf98bd  
    3232  SYSTEM_STATE_BEFORE_INITIALIZATION,   /* start -> end of 1st init part */
    3333  SYSTEM_STATE_BEFORE_MULTITASKING,     /* end of 1st -> beginning of 2nd */
    34   SYSTEM_STATE_BEGIN_MULTITASKING,      /* beginning of 2nd -> end of SYSI */
     34  SYSTEM_STATE_BEGIN_MULTITASKING,      /* just before multitasking starts */
    3535  SYSTEM_STATE_UP,                      /* normal operation */
    3636  SYSTEM_STATE_FAILED                   /* fatal error occurred */
  • c/src/exec/score/headers/thread.h

    r75f09e5 radf98bd  
    162162
    163163/*
     164 *  The following constants define the stack size requirements for
     165 *  the idle thread.
     166 */
     167 
     168 
     169#define THREAD_IDLE_STACK_SIZE  STACK_MINIMUM_SIZE
     170 
     171/*
     172 *  The following defines the information control block used to
     173 *  manage this class of objects.
     174 */
     175 
     176EXTERN Objects_Information _Thread_Internal_information;
     177 
     178/*
     179 *  The following define the thread control pointers used to access
     180 *  and manipulate the idle thread.
     181 */
     182 
     183EXTERN Thread_Control *_Thread_Idle;
     184
     185/*
    164186 *  The following context area contains the context of the "thread"
    165187 *  which invoked the start multitasking routine.  This context is
     
    237259  unsigned32   maximum_proxies
    238260);
     261
     262/*
     263 *  _Thread_Create_idle
     264 *
     265 *  DESCRIPTION:
     266 *
     267 *  This routine creates the idle thread.
     268 *
     269 *  WARNING!! No thread should be created before this one.
     270 */
     271 
     272void _Thread_Create_idle( void );
    239273
    240274/*
     
    757791);
    758792
     793/*
     794 *  _Thread_Internal_allocate
     795 *
     796 *  DESCRIPTION:
     797 *
     798 *  This routine allocates an internal thread.
     799 */
     800 
     801STATIC INLINE Thread_Control *_Thread_Internal_allocate( void );
     802 
     803/*
     804 *  _Thread_Internal_free
     805 *
     806 *  DESCRIPTION:
     807 *
     808 *  This routine frees an internal thread.
     809 */
     810 
     811STATIC INLINE void _Thread_Internal_free (
     812  Thread_Control *the_task
     813);
     814
     815/*
     816 *  _Thread_Idle_body
     817 *
     818 *  DESCRIPTION:
     819 *
     820 *  This routine is the body of the system idle thread.
     821 */
     822 
     823#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
     824Thread _Thread_Idle_body(
     825  unsigned32 ignored
     826);
     827#endif
     828
    759829#include <rtems/score/thread.inl>
    760830#include <rtems/score/threadmp.h>
  • c/src/exec/score/include/rtems/score/mpci.h

    r75f09e5 radf98bd  
    2929#include <rtems/score/watchdog.h>
    3030#include <rtems/score/coresem.h>
     31
     32/*
     33 *  The following constants define the stack size requirements for
     34 *  the system threads.
     35 */
     36 
     37#define MPCI_RECEIVE_SERVER_STACK_SIZE \
     38  ( STACK_MINIMUM_SIZE + \
     39    CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
     40    _CPU_Table.extra_mpci_receive_server_stack \
     41  )
    3142
    3243/*
     
    93104 
    94105/*
     106 *  The following enumerated type defines the list of
     107 *  internal MP operations.
     108 */
     109 
     110typedef enum {
     111  MPCI_PACKETS_SYSTEM_VERIFY  =  0
     112}   MPCI_Internal_Remote_operations;
     113 
     114/*
     115 *  The following data structure defines the packet used to perform
     116 *  remote event operations.
     117 */
     118 
     119typedef struct {
     120  MP_packet_Prefix                 Prefix;
     121  MPCI_Internal_Remote_operations  operation;
     122  unsigned32                       maximum_nodes;
     123  unsigned32                       maximum_global_objects;
     124}    MPCI_Internal_packet;
     125
     126/*
    95127 *  This is the core semaphore which the MPCI Receive Server blocks on.
    96128 */
     
    136168  unsigned32               timeout_status
    137169);
     170
     171/*
     172 *  _MPCI_Create_server
     173 *
     174 *  DESCRIPTION:
     175 * 
     176 *  This routine creates the packet receive server used in MP systems.
     177 */
     178
     179void _MPCI_Create_server( void );
    138180
    139181/*
     
    260302 */
    261303 
    262 void _MPCI_Receive_server( void );
     304Thread _MPCI_Receive_server(
     305  unsigned32 ignored
     306);
    263307
    264308/*PAGE
     
    272316 
    273317void _MPCI_Announce ( void );
     318
     319/*
     320 *  _MPCI_Internal_packets_Send_process_packet
     321 *
     322 *  DESCRIPTION:
     323 *
     324 *  This routine performs a remote procedure call so that a
     325 *  process operation can be performed on another node.
     326 */
     327 
     328void _MPCI_Internal_packets_Send_process_packet (
     329   MPCI_Internal_Remote_operations operation
     330);
     331 
     332/*
     333 *  _MPCI_Internal_packets_Send_request_packet
     334 *
     335 *  DESCRIPTION:
     336 *
     337 *  This routine performs a remote procedure call so that a
     338 *  directive operation can be initiated on another node.
     339 *
     340 *  This routine is not needed since there are no request
     341 *  packets to be sent by this manager.
     342 */
     343 
     344/*
     345 *  _MPCI_Internal_packets_Send_response_packet
     346 *
     347 *  DESCRIPTION:
     348 *
     349 *  This routine performs a remote procedure call so that a
     350 *  directive can be performed on another node.
     351 *
     352 *  This routine is not needed since there are no response
     353 *  packets to be sent by this manager.
     354 */
     355 
     356/*
     357 *
     358 *  _MPCI_Internal_packets_Process_packet
     359 *
     360 *  DESCRIPTION:
     361 *
     362 *  This routine performs the actions specific to this package for
     363 *  the request from another node.
     364 */
     365 
     366void _MPCI_Internal_packets_Process_packet (
     367  MP_packet_Prefix *the_packet_prefix
     368);
     369 
     370/*
     371 *  _MPCI_Internal_packets_Send_object_was_deleted
     372 *
     373 *  DESCRIPTION:
     374 *
     375 *  This routine is invoked indirectly by the thread queue
     376 *  when a proxy has been removed from the thread queue and
     377 *  the remote node must be informed of this.
     378 *
     379 *  This routine is not needed since there are no objects
     380 *  deleted by this manager.
     381 */
     382 
     383/*
     384 *  _MPCI_Internal_packets_Send_extract_proxy
     385 *
     386 *  DESCRIPTION:
     387 *
     388 *  This routine is invoked when a task is deleted and it
     389 *  has a proxy which must be removed from a thread queue and
     390 *  the remote node must be informed of this.
     391 *
     392 *  This routine is not needed since there are no objects
     393 *  deleted by this manager.
     394 */
     395 
     396/*
     397 *  _MPCI_Internal_packets_Get_packet
     398 *
     399 *  DESCRIPTION:
     400 *
     401 *  This routine is used to obtain a internal threads mp packet.
     402 */
     403 
     404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
    274405
    275406#ifdef __cplusplus
  • c/src/exec/score/include/rtems/score/mppkt.h

    r75f09e5 radf98bd  
    3939
    4040typedef enum {
    41   MP_PACKET_INTERNAL_THREADS = 0,
     41  MP_PACKET_MPCI_INTERNAL    = 0,
    4242  MP_PACKET_TASKS            = 1,
    4343  MP_PACKET_MESSAGE_QUEUE    = 2,
     
    4949}   MP_packet_Classes;
    5050
    51 #define MP_PACKET_CLASSES_FIRST  MP_PACKET_INTERNAL_THREADS
     51#define MP_PACKET_CLASSES_FIRST  MP_PACKET_MPCI_INTERNAL
    5252#define MP_PACKET_CLASSES_LAST   MP_PACKET_SIGNAL
    5353
  • c/src/exec/score/include/rtems/score/object.h

    r75f09e5 radf98bd  
    101101#define OBJECTS_CLASSES_FIRST               OBJECTS_NO_CLASS
    102102#define OBJECTS_CLASSES_LAST                OBJECTS_POSIX_CONDITION_VARIABLES
    103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_INTERNAL_THREADS
     103#define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_MPCI_PACKETS
    104104#define OBJECTS_CLASSES_LAST_THREAD_CLASS   OBJECTS_POSIX_THREADS
    105105
  • c/src/exec/score/include/rtems/score/sysstate.h

    r75f09e5 radf98bd  
    3232  SYSTEM_STATE_BEFORE_INITIALIZATION,   /* start -> end of 1st init part */
    3333  SYSTEM_STATE_BEFORE_MULTITASKING,     /* end of 1st -> beginning of 2nd */
    34   SYSTEM_STATE_BEGIN_MULTITASKING,      /* beginning of 2nd -> end of SYSI */
     34  SYSTEM_STATE_BEGIN_MULTITASKING,      /* just before multitasking starts */
    3535  SYSTEM_STATE_UP,                      /* normal operation */
    3636  SYSTEM_STATE_FAILED                   /* fatal error occurred */
  • c/src/exec/score/include/rtems/score/thread.h

    r75f09e5 radf98bd  
    162162
    163163/*
     164 *  The following constants define the stack size requirements for
     165 *  the idle thread.
     166 */
     167 
     168 
     169#define THREAD_IDLE_STACK_SIZE  STACK_MINIMUM_SIZE
     170 
     171/*
     172 *  The following defines the information control block used to
     173 *  manage this class of objects.
     174 */
     175 
     176EXTERN Objects_Information _Thread_Internal_information;
     177 
     178/*
     179 *  The following define the thread control pointers used to access
     180 *  and manipulate the idle thread.
     181 */
     182 
     183EXTERN Thread_Control *_Thread_Idle;
     184
     185/*
    164186 *  The following context area contains the context of the "thread"
    165187 *  which invoked the start multitasking routine.  This context is
     
    237259  unsigned32   maximum_proxies
    238260);
     261
     262/*
     263 *  _Thread_Create_idle
     264 *
     265 *  DESCRIPTION:
     266 *
     267 *  This routine creates the idle thread.
     268 *
     269 *  WARNING!! No thread should be created before this one.
     270 */
     271 
     272void _Thread_Create_idle( void );
    239273
    240274/*
     
    757791);
    758792
     793/*
     794 *  _Thread_Internal_allocate
     795 *
     796 *  DESCRIPTION:
     797 *
     798 *  This routine allocates an internal thread.
     799 */
     800 
     801STATIC INLINE Thread_Control *_Thread_Internal_allocate( void );
     802 
     803/*
     804 *  _Thread_Internal_free
     805 *
     806 *  DESCRIPTION:
     807 *
     808 *  This routine frees an internal thread.
     809 */
     810 
     811STATIC INLINE void _Thread_Internal_free (
     812  Thread_Control *the_task
     813);
     814
     815/*
     816 *  _Thread_Idle_body
     817 *
     818 *  DESCRIPTION:
     819 *
     820 *  This routine is the body of the system idle thread.
     821 */
     822 
     823#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
     824Thread _Thread_Idle_body(
     825  unsigned32 ignored
     826);
     827#endif
     828
    759829#include <rtems/score/thread.inl>
    760830#include <rtems/score/threadmp.h>
  • c/src/exec/score/inline/rtems/score/thread.inl

    r75f09e5 radf98bd  
    284284}
    285285
     286/*PAGE
     287 *
     288 *  _Thread_Internal_allocate
     289 *
     290 */
     291 
     292STATIC INLINE Thread_Control *_Thread_Internal_allocate( void )
     293{
     294  return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
     295}
     296 
     297/*PAGE
     298 *
     299 *  _Thread_Internal_free
     300 *
     301 */
     302 
     303STATIC INLINE void _Thread_Internal_free (
     304  Thread_Control *the_task
     305)
     306{
     307  _Objects_Free( &_Thread_Internal_information, &the_task->Object );
     308}
     309
    286310#endif
    287311/* end of include file */
  • c/src/exec/score/inline/thread.inl

    r75f09e5 radf98bd  
    284284}
    285285
     286/*PAGE
     287 *
     288 *  _Thread_Internal_allocate
     289 *
     290 */
     291 
     292STATIC INLINE Thread_Control *_Thread_Internal_allocate( void )
     293{
     294  return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
     295}
     296 
     297/*PAGE
     298 *
     299 *  _Thread_Internal_free
     300 *
     301 */
     302 
     303STATIC INLINE void _Thread_Internal_free (
     304  Thread_Control *the_task
     305)
     306{
     307  _Objects_Free( &_Thread_Internal_information, &the_task->Object );
     308}
     309
    286310#endif
    287311/* end of include file */
  • c/src/exec/score/macros/rtems/score/thread.inl

    r75f09e5 radf98bd  
    198198  ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
    199199
     200/*
     201 *  _Thread_Internal_allocate
     202 *
     203 */
     204 
     205#define _Thread_Internal_allocate() \
     206  ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
     207 
     208/*
     209 *  _Thread_Internal_free
     210 *
     211 */
     212 
     213#define _Thread_Internal_free( _the_task ) \
     214  _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
     215
    200216#endif
    201217/* end of include file */
  • c/src/exec/score/macros/thread.inl

    r75f09e5 radf98bd  
    198198  ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
    199199
     200/*
     201 *  _Thread_Internal_allocate
     202 *
     203 */
     204 
     205#define _Thread_Internal_allocate() \
     206  ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
     207 
     208/*
     209 *  _Thread_Internal_free
     210 *
     211 */
     212 
     213#define _Thread_Internal_free( _the_task ) \
     214  _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
     215
    200216#endif
    201217/* end of include file */
  • c/src/exec/score/src/mpci.c

    r75f09e5 radf98bd  
    5151  _MPCI_table = users_mpci_table;
    5252
     53  if ( !_System_state_Is_multiprocessing )
     54    return;
     55
     56  /*
     57   *  Register the MP Process Packet routine.
     58   */
     59 
     60  _MPCI_Register_packet_processor(
     61    MP_PACKET_MPCI_INTERNAL,
     62    _MPCI_Internal_packets_Process_packet
     63  );
     64
     65  /*
     66   *  Create the counting semaphore used by the MPCI Receive Server.
     67   */
     68
    5369  attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
    5470
     
    6884    NULL,
    6985    timeout_status
     86  );
     87}
     88
     89/*PAGE
     90 *
     91 *  _MPCI_Create_server
     92 *
     93 *  This subprogram creates the MPCI receive server.
     94 */
     95
     96char *_MPCI_Internal_name = "MPCI";
     97
     98void _MPCI_Create_server( void )
     99{
     100
     101  if ( !_System_state_Is_multiprocessing )
     102    return;
     103
     104  /*
     105   *  Initialize the MPCI Receive Server
     106   */
     107
     108  _MPCI_Receive_server_tcb = _Thread_Internal_allocate();
     109 
     110  _Thread_Initialize(
     111    &_Thread_Internal_information,
     112    _MPCI_Receive_server_tcb,
     113    NULL,        /* allocate the stack */
     114    MPCI_RECEIVE_SERVER_STACK_SIZE,
     115    CPU_ALL_TASKS_ARE_FP,
     116    PRIORITY_MINIMUM,
     117    FALSE,       /* no preempt */
     118    FALSE,       /* not timesliced */
     119    0,           /* all interrupts enabled */
     120    _MPCI_Internal_name
     121  );
     122 
     123  _Thread_Start(
     124    _MPCI_Receive_server_tcb,
     125    THREAD_START_NUMERIC,
     126    _MPCI_Receive_server,
     127    NULL,
     128    0
    70129  );
    71130}
     
    287346 */
    288347
    289 void _MPCI_Receive_server( void )
     348Thread _MPCI_Receive_server(
     349  unsigned32 ignored
     350)
    290351{
    291352 
     
    295356 
    296357  executing = _Thread_Executing;
    297   _MPCI_Receive_server_tcb = executing;
    298358
    299359  for ( ; ; ) {
     
    343403}
    344404
     405/*PAGE
     406 *
     407 *  _MPCI_Internal_packets_Send_process_packet
     408 *
     409 */
     410 
     411void _MPCI_Internal_packets_Send_process_packet (
     412   MPCI_Internal_Remote_operations operation
     413)
     414{
     415  MPCI_Internal_packet *the_packet;
     416 
     417  switch ( operation ) {
     418 
     419    case MPCI_PACKETS_SYSTEM_VERIFY:
     420 
     421      the_packet                    = _MPCI_Internal_packets_Get_packet();
     422      the_packet->Prefix.the_class  = MP_PACKET_MPCI_INTERNAL;
     423      the_packet->Prefix.length     = sizeof ( MPCI_Internal_packet );
     424      the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet );
     425      the_packet->operation         = operation;
     426 
     427      the_packet->maximum_nodes = _Objects_Maximum_nodes;
     428 
     429      the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects;
     430 
     431      _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
     432      break;
     433  }
     434}
     435 
     436/*PAGE
     437 *
     438 *  _MPCI_Internal_packets_Send_request_packet
     439 *
     440 *  This subprogram is not needed since there are no request
     441 *  packets to be sent by this manager.
     442 *
     443 */
     444 
     445/*PAGE
     446 *
     447 *  _MPCI_Internal_packets_Send_response_packet
     448 *
     449 *  This subprogram is not needed since there are no response
     450 *  packets to be sent by this manager.
     451 *
     452 */
     453 
     454/*PAGE
     455 *
     456 *
     457 *  _MPCI_Internal_packets_Process_packet
     458 *
     459 */
     460 
     461void _MPCI_Internal_packets_Process_packet (
     462  MP_packet_Prefix  *the_packet_prefix
     463)
     464{
     465  MPCI_Internal_packet *the_packet;
     466  unsigned32                  maximum_nodes;
     467  unsigned32                  maximum_global_objects;
     468 
     469  the_packet = (MPCI_Internal_packet *) the_packet_prefix;
     470 
     471  switch ( the_packet->operation ) {
     472 
     473    case MPCI_PACKETS_SYSTEM_VERIFY:
     474 
     475      maximum_nodes          = the_packet->maximum_nodes;
     476      maximum_global_objects = the_packet->maximum_global_objects;
     477      if ( maximum_nodes != _Objects_Maximum_nodes ||
     478           maximum_global_objects != _Objects_MP_Maximum_global_objects ) {
     479 
     480        _MPCI_Return_packet( the_packet_prefix );
     481 
     482        _Internal_error_Occurred(
     483          INTERNAL_ERROR_CORE,
     484          TRUE,
     485          INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION
     486        );
     487      }
     488 
     489      _MPCI_Return_packet( the_packet_prefix );
     490 
     491      break;
     492  }
     493}
     494 
     495/*PAGE
     496 *
     497 *  _MPCI_Internal_packets_Send_object_was_deleted
     498 *
     499 *  This subprogram is not needed since there are no objects
     500 *  deleted by this manager.
     501 *
     502 */
     503 
     504/*PAGE
     505 *
     506 *  _MPCI_Internal_packets_Send_extract_proxy
     507 *
     508 *  This subprogram is not needed since there are no objects
     509 *  deleted by this manager.
     510 *
     511 */
     512 
     513/*PAGE
     514 *
     515 *  _MPCI_Internal_packets_Get_packet
     516 *
     517 */
     518 
     519MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
     520{
     521  return ( (MPCI_Internal_packet *) _MPCI_Get_packet() );
     522}
     523
    345524/* end of file */
  • c/src/exec/score/src/thread.c

    r75f09e5 radf98bd  
    4141 */
    4242
     43char *_Thread_Idle_name = "IDLE";
     44
    4345void _Thread_Handler_initialization(
    4446  unsigned32   ticks_per_timeslice,
     
    4749)
    4850{
    49   unsigned32 index;
     51  unsigned32      index;
    5052
    5153  _Context_Switch_necessary = FALSE;
     
    6769
    6870  _Thread_MP_Handler_initialization( maximum_proxies );
     71
     72  /*
     73   *  Initialize this class of objects.
     74   */
     75 
     76  _Objects_Initialize_information(
     77    &_Thread_Internal_information,
     78    OBJECTS_INTERNAL_THREADS,
     79    FALSE,
     80    ( _System_state_Is_multiprocessing ) ?  2 : 1,
     81    sizeof( Thread_Control ),
     82    TRUE,
     83    8,
     84    TRUE
     85  );
     86
     87}
     88
     89/*PAGE
     90 *
     91 *  _Thread_Create_idle
     92 */
     93
     94void _Thread_Create_idle( void )
     95{
     96  Thread (*idle);
     97
     98  /*
     99   *  The entire workspace is zeroed during its initialization.  Thus, all
     100   *  fields not explicitly assigned were explicitly zeroed by
     101   *  _Workspace_Initialization.
     102   */
     103 
     104  _Thread_Idle = _Thread_Internal_allocate();
     105 
     106  /*
     107   *  Initialize the IDLE task.
     108   */
     109 
     110#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
     111  idle = _CPU_Thread_Idle_body;
     112#else
     113  idle = _Thread_Idle_body;
     114#endif
     115 
     116  if ( _CPU_Table.idle_task )
     117    idle = _CPU_Table.idle_task;
     118 
     119  _Thread_Initialize(
     120    &_Thread_Internal_information,
     121    _Thread_Idle,
     122    NULL,        /* allocate the stack */
     123    THREAD_IDLE_STACK_SIZE,
     124    CPU_IDLE_TASK_IS_FP,
     125    PRIORITY_MAXIMUM,
     126    TRUE,        /* preemptable */
     127    FALSE,       /* not timesliced */
     128    0,           /* all interrupts enabled */
     129    _Thread_Idle_name
     130  );
     131 
     132  /*
     133   *  WARNING!!! This is necessary to "kick" start the system and
     134   *             MUST be done before _Thread_Start is invoked.
     135   */
     136 
     137  _Thread_Heir      =
     138  _Thread_Executing = _Thread_Idle;
     139 
     140  _Thread_Start(
     141    _Thread_Idle,
     142    THREAD_START_NUMERIC,
     143    idle,
     144    NULL,
     145    0
     146  );
     147 
    69148}
    70149
     
    90169 */
    91170
    92 void _Thread_Start_multitasking(
    93   Thread_Control *system_thread,
    94   Thread_Control *idle_thread
    95 )
     171void _Thread_Start_multitasking( void )
    96172{
    97173  /*
     
    10691145  return (Thread_Control *) _Objects_Get( information, id, location );
    10701146}
     1147
     1148/*PAGE
     1149 *
     1150 *  _Thread_Idle_body
     1151 *
     1152 *  This kernel routine is the idle thread.  The idle thread runs any time
     1153 *  no other thread is ready to run.  This thread loops forever with
     1154 *  interrupts enabled.
     1155 *
     1156 *  Input parameters:
     1157 *    ignored - this parameter is ignored
     1158 *
     1159 *  Output parameters:  NONE
     1160 */
     1161 
     1162#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
     1163Thread _Thread_Idle_body(
     1164  unsigned32 ignored
     1165)
     1166{
     1167  for( ; ; ) ;
     1168}
    10711169#endif
     1170
     1171#endif
  • cpukit/score/include/rtems/score/mpci.h

    r75f09e5 radf98bd  
    2929#include <rtems/score/watchdog.h>
    3030#include <rtems/score/coresem.h>
     31
     32/*
     33 *  The following constants define the stack size requirements for
     34 *  the system threads.
     35 */
     36 
     37#define MPCI_RECEIVE_SERVER_STACK_SIZE \
     38  ( STACK_MINIMUM_SIZE + \
     39    CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
     40    _CPU_Table.extra_mpci_receive_server_stack \
     41  )
    3142
    3243/*
     
    93104 
    94105/*
     106 *  The following enumerated type defines the list of
     107 *  internal MP operations.
     108 */
     109 
     110typedef enum {
     111  MPCI_PACKETS_SYSTEM_VERIFY  =  0
     112}   MPCI_Internal_Remote_operations;
     113 
     114/*
     115 *  The following data structure defines the packet used to perform
     116 *  remote event operations.
     117 */
     118 
     119typedef struct {
     120  MP_packet_Prefix                 Prefix;
     121  MPCI_Internal_Remote_operations  operation;
     122  unsigned32                       maximum_nodes;
     123  unsigned32                       maximum_global_objects;
     124}    MPCI_Internal_packet;
     125
     126/*
    95127 *  This is the core semaphore which the MPCI Receive Server blocks on.
    96128 */
     
    136168  unsigned32               timeout_status
    137169);
     170
     171/*
     172 *  _MPCI_Create_server
     173 *
     174 *  DESCRIPTION:
     175 * 
     176 *  This routine creates the packet receive server used in MP systems.
     177 */
     178
     179void _MPCI_Create_server( void );
    138180
    139181/*
     
    260302 */
    261303 
    262 void _MPCI_Receive_server( void );
     304Thread _MPCI_Receive_server(
     305  unsigned32 ignored
     306);
    263307
    264308/*PAGE
     
    272316 
    273317void _MPCI_Announce ( void );
     318
     319/*
     320 *  _MPCI_Internal_packets_Send_process_packet
     321 *
     322 *  DESCRIPTION:
     323 *
     324 *  This routine performs a remote procedure call so that a
     325 *  process operation can be performed on another node.
     326 */
     327 
     328void _MPCI_Internal_packets_Send_process_packet (
     329   MPCI_Internal_Remote_operations operation
     330);
     331 
     332/*
     333 *  _MPCI_Internal_packets_Send_request_packet
     334 *
     335 *  DESCRIPTION:
     336 *
     337 *  This routine performs a remote procedure call so that a
     338 *  directive operation can be initiated on another node.
     339 *
     340 *  This routine is not needed since there are no request
     341 *  packets to be sent by this manager.
     342 */
     343 
     344/*
     345 *  _MPCI_Internal_packets_Send_response_packet
     346 *
     347 *  DESCRIPTION:
     348 *
     349 *  This routine performs a remote procedure call so that a
     350 *  directive can be performed on another node.
     351 *
     352 *  This routine is not needed since there are no response
     353 *  packets to be sent by this manager.
     354 */
     355 
     356/*
     357 *
     358 *  _MPCI_Internal_packets_Process_packet
     359 *
     360 *  DESCRIPTION:
     361 *
     362 *  This routine performs the actions specific to this package for
     363 *  the request from another node.
     364 */
     365 
     366void _MPCI_Internal_packets_Process_packet (
     367  MP_packet_Prefix *the_packet_prefix
     368);
     369 
     370/*
     371 *  _MPCI_Internal_packets_Send_object_was_deleted
     372 *
     373 *  DESCRIPTION:
     374 *
     375 *  This routine is invoked indirectly by the thread queue
     376 *  when a proxy has been removed from the thread queue and
     377 *  the remote node must be informed of this.
     378 *
     379 *  This routine is not needed since there are no objects
     380 *  deleted by this manager.
     381 */
     382 
     383/*
     384 *  _MPCI_Internal_packets_Send_extract_proxy
     385 *
     386 *  DESCRIPTION:
     387 *
     388 *  This routine is invoked when a task is deleted and it
     389 *  has a proxy which must be removed from a thread queue and
     390 *  the remote node must be informed of this.
     391 *
     392 *  This routine is not needed since there are no objects
     393 *  deleted by this manager.
     394 */
     395 
     396/*
     397 *  _MPCI_Internal_packets_Get_packet
     398 *
     399 *  DESCRIPTION:
     400 *
     401 *  This routine is used to obtain a internal threads mp packet.
     402 */
     403 
     404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
    274405
    275406#ifdef __cplusplus
  • cpukit/score/include/rtems/score/mppkt.h

    r75f09e5 radf98bd  
    3939
    4040typedef enum {
    41   MP_PACKET_INTERNAL_THREADS = 0,
     41  MP_PACKET_MPCI_INTERNAL    = 0,
    4242  MP_PACKET_TASKS            = 1,
    4343  MP_PACKET_MESSAGE_QUEUE    = 2,
     
    4949}   MP_packet_Classes;
    5050
    51 #define MP_PACKET_CLASSES_FIRST  MP_PACKET_INTERNAL_THREADS
     51#define MP_PACKET_CLASSES_FIRST  MP_PACKET_MPCI_INTERNAL
    5252#define MP_PACKET_CLASSES_LAST   MP_PACKET_SIGNAL
    5353
  • cpukit/score/include/rtems/score/object.h

    r75f09e5 radf98bd  
    101101#define OBJECTS_CLASSES_FIRST               OBJECTS_NO_CLASS
    102102#define OBJECTS_CLASSES_LAST                OBJECTS_POSIX_CONDITION_VARIABLES
    103 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_INTERNAL_THREADS
     103#define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_MPCI_PACKETS
    104104#define OBJECTS_CLASSES_LAST_THREAD_CLASS   OBJECTS_POSIX_THREADS
    105105
  • cpukit/score/include/rtems/score/sysstate.h

    r75f09e5 radf98bd  
    3232  SYSTEM_STATE_BEFORE_INITIALIZATION,   /* start -> end of 1st init part */
    3333  SYSTEM_STATE_BEFORE_MULTITASKING,     /* end of 1st -> beginning of 2nd */
    34   SYSTEM_STATE_BEGIN_MULTITASKING,      /* beginning of 2nd -> end of SYSI */
     34  SYSTEM_STATE_BEGIN_MULTITASKING,      /* just before multitasking starts */
    3535  SYSTEM_STATE_UP,                      /* normal operation */
    3636  SYSTEM_STATE_FAILED                   /* fatal error occurred */
  • cpukit/score/include/rtems/score/thread.h

    r75f09e5 radf98bd  
    162162
    163163/*
     164 *  The following constants define the stack size requirements for
     165 *  the idle thread.
     166 */
     167 
     168 
     169#define THREAD_IDLE_STACK_SIZE  STACK_MINIMUM_SIZE
     170 
     171/*
     172 *  The following defines the information control block used to
     173 *  manage this class of objects.
     174 */
     175 
     176EXTERN Objects_Information _Thread_Internal_information;
     177 
     178/*
     179 *  The following define the thread control pointers used to access
     180 *  and manipulate the idle thread.
     181 */
     182 
     183EXTERN Thread_Control *_Thread_Idle;
     184
     185/*
    164186 *  The following context area contains the context of the "thread"
    165187 *  which invoked the start multitasking routine.  This context is
     
    237259  unsigned32   maximum_proxies
    238260);
     261
     262/*
     263 *  _Thread_Create_idle
     264 *
     265 *  DESCRIPTION:
     266 *
     267 *  This routine creates the idle thread.
     268 *
     269 *  WARNING!! No thread should be created before this one.
     270 */
     271 
     272void _Thread_Create_idle( void );
    239273
    240274/*
     
    757791);
    758792
     793/*
     794 *  _Thread_Internal_allocate
     795 *
     796 *  DESCRIPTION:
     797 *
     798 *  This routine allocates an internal thread.
     799 */
     800 
     801STATIC INLINE Thread_Control *_Thread_Internal_allocate( void );
     802 
     803/*
     804 *  _Thread_Internal_free
     805 *
     806 *  DESCRIPTION:
     807 *
     808 *  This routine frees an internal thread.
     809 */
     810 
     811STATIC INLINE void _Thread_Internal_free (
     812  Thread_Control *the_task
     813);
     814
     815/*
     816 *  _Thread_Idle_body
     817 *
     818 *  DESCRIPTION:
     819 *
     820 *  This routine is the body of the system idle thread.
     821 */
     822 
     823#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
     824Thread _Thread_Idle_body(
     825  unsigned32 ignored
     826);
     827#endif
     828
    759829#include <rtems/score/thread.inl>
    760830#include <rtems/score/threadmp.h>
  • cpukit/score/inline/rtems/score/thread.inl

    r75f09e5 radf98bd  
    284284}
    285285
     286/*PAGE
     287 *
     288 *  _Thread_Internal_allocate
     289 *
     290 */
     291 
     292STATIC INLINE Thread_Control *_Thread_Internal_allocate( void )
     293{
     294  return (Thread_Control *) _Objects_Allocate( &_Thread_Internal_information );
     295}
     296 
     297/*PAGE
     298 *
     299 *  _Thread_Internal_free
     300 *
     301 */
     302 
     303STATIC INLINE void _Thread_Internal_free (
     304  Thread_Control *the_task
     305)
     306{
     307  _Objects_Free( &_Thread_Internal_information, &the_task->Object );
     308}
     309
    286310#endif
    287311/* end of include file */
  • cpukit/score/macros/rtems/score/thread.inl

    r75f09e5 radf98bd  
    198198  ( (_code) == THREAD_STATUS_PROXY_BLOCKING )
    199199
     200/*
     201 *  _Thread_Internal_allocate
     202 *
     203 */
     204 
     205#define _Thread_Internal_allocate() \
     206  ((Thread_Control *) _Objects_Allocate( &_Thread_Internal_information ))
     207 
     208/*
     209 *  _Thread_Internal_free
     210 *
     211 */
     212 
     213#define _Thread_Internal_free( _the_task ) \
     214  _Objects_Free( &_Thread_Internal_information, &(_the_task)->Object )
     215
    200216#endif
    201217/* end of include file */
  • cpukit/score/src/mpci.c

    r75f09e5 radf98bd  
    5151  _MPCI_table = users_mpci_table;
    5252
     53  if ( !_System_state_Is_multiprocessing )
     54    return;
     55
     56  /*
     57   *  Register the MP Process Packet routine.
     58   */
     59 
     60  _MPCI_Register_packet_processor(
     61    MP_PACKET_MPCI_INTERNAL,
     62    _MPCI_Internal_packets_Process_packet
     63  );
     64
     65  /*
     66   *  Create the counting semaphore used by the MPCI Receive Server.
     67   */
     68
    5369  attributes.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
    5470
     
    6884    NULL,
    6985    timeout_status
     86  );
     87}
     88
     89/*PAGE
     90 *
     91 *  _MPCI_Create_server
     92 *
     93 *  This subprogram creates the MPCI receive server.
     94 */
     95
     96char *_MPCI_Internal_name = "MPCI";
     97
     98void _MPCI_Create_server( void )
     99{
     100
     101  if ( !_System_state_Is_multiprocessing )
     102    return;
     103
     104  /*
     105   *  Initialize the MPCI Receive Server
     106   */
     107
     108  _MPCI_Receive_server_tcb = _Thread_Internal_allocate();
     109 
     110  _Thread_Initialize(
     111    &_Thread_Internal_information,
     112    _MPCI_Receive_server_tcb,
     113    NULL,        /* allocate the stack */
     114    MPCI_RECEIVE_SERVER_STACK_SIZE,
     115    CPU_ALL_TASKS_ARE_FP,
     116    PRIORITY_MINIMUM,
     117    FALSE,       /* no preempt */
     118    FALSE,       /* not timesliced */
     119    0,           /* all interrupts enabled */
     120    _MPCI_Internal_name
     121  );
     122 
     123  _Thread_Start(
     124    _MPCI_Receive_server_tcb,
     125    THREAD_START_NUMERIC,
     126    _MPCI_Receive_server,
     127    NULL,
     128    0
    70129  );
    71130}
     
    287346 */
    288347
    289 void _MPCI_Receive_server( void )
     348Thread _MPCI_Receive_server(
     349  unsigned32 ignored
     350)
    290351{
    291352 
     
    295356 
    296357  executing = _Thread_Executing;
    297   _MPCI_Receive_server_tcb = executing;
    298358
    299359  for ( ; ; ) {
     
    343403}
    344404
     405/*PAGE
     406 *
     407 *  _MPCI_Internal_packets_Send_process_packet
     408 *
     409 */
     410 
     411void _MPCI_Internal_packets_Send_process_packet (
     412   MPCI_Internal_Remote_operations operation
     413)
     414{
     415  MPCI_Internal_packet *the_packet;
     416 
     417  switch ( operation ) {
     418 
     419    case MPCI_PACKETS_SYSTEM_VERIFY:
     420 
     421      the_packet                    = _MPCI_Internal_packets_Get_packet();
     422      the_packet->Prefix.the_class  = MP_PACKET_MPCI_INTERNAL;
     423      the_packet->Prefix.length     = sizeof ( MPCI_Internal_packet );
     424      the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet );
     425      the_packet->operation         = operation;
     426 
     427      the_packet->maximum_nodes = _Objects_Maximum_nodes;
     428 
     429      the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects;
     430 
     431      _MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
     432      break;
     433  }
     434}
     435 
     436/*PAGE
     437 *
     438 *  _MPCI_Internal_packets_Send_request_packet
     439 *
     440 *  This subprogram is not needed since there are no request
     441 *  packets to be sent by this manager.
     442 *
     443 */
     444 
     445/*PAGE
     446 *
     447 *  _MPCI_Internal_packets_Send_response_packet
     448 *
     449 *  This subprogram is not needed since there are no response
     450 *  packets to be sent by this manager.
     451 *
     452 */
     453 
     454/*PAGE
     455 *
     456 *
     457 *  _MPCI_Internal_packets_Process_packet
     458 *
     459 */
     460 
     461void _MPCI_Internal_packets_Process_packet (
     462  MP_packet_Prefix  *the_packet_prefix
     463)
     464{
     465  MPCI_Internal_packet *the_packet;
     466  unsigned32                  maximum_nodes;
     467  unsigned32                  maximum_global_objects;
     468 
     469  the_packet = (MPCI_Internal_packet *) the_packet_prefix;
     470 
     471  switch ( the_packet->operation ) {
     472 
     473    case MPCI_PACKETS_SYSTEM_VERIFY:
     474 
     475      maximum_nodes          = the_packet->maximum_nodes;
     476      maximum_global_objects = the_packet->maximum_global_objects;
     477      if ( maximum_nodes != _Objects_Maximum_nodes ||
     478           maximum_global_objects != _Objects_MP_Maximum_global_objects ) {
     479 
     480        _MPCI_Return_packet( the_packet_prefix );
     481 
     482        _Internal_error_Occurred(
     483          INTERNAL_ERROR_CORE,
     484          TRUE,
     485          INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION
     486        );
     487      }
     488 
     489      _MPCI_Return_packet( the_packet_prefix );
     490 
     491      break;
     492  }
     493}
     494 
     495/*PAGE
     496 *
     497 *  _MPCI_Internal_packets_Send_object_was_deleted
     498 *
     499 *  This subprogram is not needed since there are no objects
     500 *  deleted by this manager.
     501 *
     502 */
     503 
     504/*PAGE
     505 *
     506 *  _MPCI_Internal_packets_Send_extract_proxy
     507 *
     508 *  This subprogram is not needed since there are no objects
     509 *  deleted by this manager.
     510 *
     511 */
     512 
     513/*PAGE
     514 *
     515 *  _MPCI_Internal_packets_Get_packet
     516 *
     517 */
     518 
     519MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
     520{
     521  return ( (MPCI_Internal_packet *) _MPCI_Get_packet() );
     522}
     523
    345524/* end of file */
  • cpukit/score/src/thread.c

    r75f09e5 radf98bd  
    4141 */
    4242
     43char *_Thread_Idle_name = "IDLE";
     44
    4345void _Thread_Handler_initialization(
    4446  unsigned32   ticks_per_timeslice,
     
    4749)
    4850{
    49   unsigned32 index;
     51  unsigned32      index;
    5052
    5153  _Context_Switch_necessary = FALSE;
     
    6769
    6870  _Thread_MP_Handler_initialization( maximum_proxies );
     71
     72  /*
     73   *  Initialize this class of objects.
     74   */
     75 
     76  _Objects_Initialize_information(
     77    &_Thread_Internal_information,
     78    OBJECTS_INTERNAL_THREADS,
     79    FALSE,
     80    ( _System_state_Is_multiprocessing ) ?  2 : 1,
     81    sizeof( Thread_Control ),
     82    TRUE,
     83    8,
     84    TRUE
     85  );
     86
     87}
     88
     89/*PAGE
     90 *
     91 *  _Thread_Create_idle
     92 */
     93
     94void _Thread_Create_idle( void )
     95{
     96  Thread (*idle);
     97
     98  /*
     99   *  The entire workspace is zeroed during its initialization.  Thus, all
     100   *  fields not explicitly assigned were explicitly zeroed by
     101   *  _Workspace_Initialization.
     102   */
     103 
     104  _Thread_Idle = _Thread_Internal_allocate();
     105 
     106  /*
     107   *  Initialize the IDLE task.
     108   */
     109 
     110#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
     111  idle = _CPU_Thread_Idle_body;
     112#else
     113  idle = _Thread_Idle_body;
     114#endif
     115 
     116  if ( _CPU_Table.idle_task )
     117    idle = _CPU_Table.idle_task;
     118 
     119  _Thread_Initialize(
     120    &_Thread_Internal_information,
     121    _Thread_Idle,
     122    NULL,        /* allocate the stack */
     123    THREAD_IDLE_STACK_SIZE,
     124    CPU_IDLE_TASK_IS_FP,
     125    PRIORITY_MAXIMUM,
     126    TRUE,        /* preemptable */
     127    FALSE,       /* not timesliced */
     128    0,           /* all interrupts enabled */
     129    _Thread_Idle_name
     130  );
     131 
     132  /*
     133   *  WARNING!!! This is necessary to "kick" start the system and
     134   *             MUST be done before _Thread_Start is invoked.
     135   */
     136 
     137  _Thread_Heir      =
     138  _Thread_Executing = _Thread_Idle;
     139 
     140  _Thread_Start(
     141    _Thread_Idle,
     142    THREAD_START_NUMERIC,
     143    idle,
     144    NULL,
     145    0
     146  );
     147 
    69148}
    70149
     
    90169 */
    91170
    92 void _Thread_Start_multitasking(
    93   Thread_Control *system_thread,
    94   Thread_Control *idle_thread
    95 )
     171void _Thread_Start_multitasking( void )
    96172{
    97173  /*
     
    10691145  return (Thread_Control *) _Objects_Get( information, id, location );
    10701146}
     1147
     1148/*PAGE
     1149 *
     1150 *  _Thread_Idle_body
     1151 *
     1152 *  This kernel routine is the idle thread.  The idle thread runs any time
     1153 *  no other thread is ready to run.  This thread loops forever with
     1154 *  interrupts enabled.
     1155 *
     1156 *  Input parameters:
     1157 *    ignored - this parameter is ignored
     1158 *
     1159 *  Output parameters:  NONE
     1160 */
     1161 
     1162#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
     1163Thread _Thread_Idle_body(
     1164  unsigned32 ignored
     1165)
     1166{
     1167  for( ; ; ) ;
     1168}
    10711169#endif
     1170
     1171#endif
Note: See TracChangeset for help on using the changeset viewer.