Changeset 3a5dbdc in rtems for cpukit/rtems


Ignore:
Timestamp:
Jul 31, 1995, 10:22:38 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
4a6e64d
Parents:
0ea07c0
Message:

Switched to events for mp receive server and eliminated the special
blocking mechanism for it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/mp.c

    r0ea07c0 r3a5dbdc  
    5656void rtems_multiprocessing_announce ( void )
    5757{
    58   _Thread_MP_Ready();
     58  _Thread_Disable_dispatch();
     59  _Event_sets_Post(
     60    RTEMS_EVENT_0,
     61    &_Internal_threads_System_initialization_thread->pending_events
     62  );
     63  _Event_Surrender( _Internal_threads_System_initialization_thread );
     64  _Thread_Enable_dispatch();
    5965}
    6066
     
    6571 */
    6672
     73typedef void (*packet_processor)( rtems_packet_prefix * );
     74
     75packet_processor _Multiprocessor_Packet_processors[] = {
     76  _Internal_threads_MP_Process_packet, /* RTEMS_MP_PACKET_INTERNAL_THREADS */
     77  _RTEMS_tasks_MP_Process_packet,      /* RTEMS_MP_PACKET_TASKS */
     78  _Message_queue_MP_Process_packet,    /* RTEMS_MP_PACKET_MESSAGE_QUEUE */
     79  _Semaphore_MP_Process_packet,        /* RTEMS_MP_PACKET_SEMAPHORE */
     80  _Partition_MP_Process_packet,        /* RTEMS_MP_PACKET_PARTITION */
     81  0,                                   /* RTEMS_MP_PACKET_REGION */
     82  _Event_MP_Process_packet,            /* RTEMS_MP_PACKET_EVENT */
     83  _Signal_MP_Process_packet            /* RTEMS_MP_PACKET_SIGNAL */
     84};
     85
    6786Thread _Multiprocessing_Receive_server (
    6887  Thread_Argument ignored
     
    7190
    7291  rtems_packet_prefix *the_packet;
    73 
    74   _Thread_Dispatch_disable_level = 1;
     92  packet_processor     the_function;
    7593
    7694  for ( ; ; ) {
    7795
    78     _Internal_threads_System_initialization_thread->Notepads[ 0 ] = 1;
     96    _Thread_Disable_dispatch();
     97    _Event_Seize( RTEMS_EVENT_0, RTEMS_DEFAULT_OPTIONS, RTEMS_NO_TIMEOUT );
     98    _Thread_Enable_dispatch();
    7999
    80     the_packet = _MPCI_Receive_packet();
     100    for ( ; ; ) {
     101      the_packet = _MPCI_Receive_packet();
    81102
    82     if ( ! the_packet ) {
    83       _Thread_MP_Block();
    84       _Thread_Dispatch_disable_level = 1;
    85     }
    86     else {
     103      if ( !the_packet )
     104        break;
    87105
    88106      _Thread_Executing->receive_packet = the_packet;
    89107
     108      if ( !_Mp_packet_Is_valid_packet_class ( the_packet->the_class ) )
     109        break;
     110
     111      the_function = _Multiprocessor_Packet_processors[ the_packet->the_class ];
     112   
     113      if ( !the_function )
     114        break;
     115
     116      (*the_function)( the_packet );
     117#if 0
    90118      switch ( the_packet->the_class ) {
    91 
     119 
    92120        case RTEMS_MP_PACKET_INTERNAL_THREADS:
    93121          _Internal_threads_MP_Process_packet( the_packet );
    94122          break;
    95 
     123 
    96124        case RTEMS_MP_PACKET_TASKS:
    97125          _RTEMS_tasks_MP_Process_packet( the_packet );
    98126          break;
    99 
     127 
    100128        case RTEMS_MP_PACKET_MESSAGE_QUEUE:
    101129          _Message_queue_MP_Process_packet( the_packet );
    102130          break;
    103 
     131 
    104132        case RTEMS_MP_PACKET_SEMAPHORE:
    105133          _Semaphore_MP_Process_packet( the_packet );
    106134          break;
    107 
     135 
    108136        case RTEMS_MP_PACKET_PARTITION:
    109137          _Partition_MP_Process_packet( the_packet );
    110138          break;
    111 
     139 
    112140        case RTEMS_MP_PACKET_REGION:
    113141          /* Global regions are unsupported at this time */
    114142          break;
    115 
     143 
    116144        case RTEMS_MP_PACKET_EVENT:
    117145          _Event_MP_Process_packet( the_packet );
    118146          break;
    119 
     147 
    120148        case RTEMS_MP_PACKET_SIGNAL:
    121149          _Signal_MP_Process_packet( the_packet );
    122150          break;
    123151      }
     152#endif
     153
     154
    124155    }
    125156  }
Note: See TracChangeset for help on using the changeset viewer.