Changeset 3a5dbdc in rtems for cpukit/rtems/src
- Timestamp:
- 07/31/95 22:22:38 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 4a6e64d
- Parents:
- 0ea07c0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/rtems/src/mp.c
r0ea07c0 r3a5dbdc 56 56 void rtems_multiprocessing_announce ( void ) 57 57 { 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(); 59 65 } 60 66 … … 65 71 */ 66 72 73 typedef void (*packet_processor)( rtems_packet_prefix * ); 74 75 packet_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 67 86 Thread _Multiprocessing_Receive_server ( 68 87 Thread_Argument ignored … … 71 90 72 91 rtems_packet_prefix *the_packet; 73 74 _Thread_Dispatch_disable_level = 1; 92 packet_processor the_function; 75 93 76 94 for ( ; ; ) { 77 95 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(); 79 99 80 the_packet = _MPCI_Receive_packet(); 100 for ( ; ; ) { 101 the_packet = _MPCI_Receive_packet(); 81 102 82 if ( ! the_packet ) { 83 _Thread_MP_Block(); 84 _Thread_Dispatch_disable_level = 1; 85 } 86 else { 103 if ( !the_packet ) 104 break; 87 105 88 106 _Thread_Executing->receive_packet = the_packet; 89 107 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 90 118 switch ( the_packet->the_class ) { 91 119 92 120 case RTEMS_MP_PACKET_INTERNAL_THREADS: 93 121 _Internal_threads_MP_Process_packet( the_packet ); 94 122 break; 95 123 96 124 case RTEMS_MP_PACKET_TASKS: 97 125 _RTEMS_tasks_MP_Process_packet( the_packet ); 98 126 break; 99 127 100 128 case RTEMS_MP_PACKET_MESSAGE_QUEUE: 101 129 _Message_queue_MP_Process_packet( the_packet ); 102 130 break; 103 131 104 132 case RTEMS_MP_PACKET_SEMAPHORE: 105 133 _Semaphore_MP_Process_packet( the_packet ); 106 134 break; 107 135 108 136 case RTEMS_MP_PACKET_PARTITION: 109 137 _Partition_MP_Process_packet( the_packet ); 110 138 break; 111 139 112 140 case RTEMS_MP_PACKET_REGION: 113 141 /* Global regions are unsupported at this time */ 114 142 break; 115 143 116 144 case RTEMS_MP_PACKET_EVENT: 117 145 _Event_MP_Process_packet( the_packet ); 118 146 break; 119 147 120 148 case RTEMS_MP_PACKET_SIGNAL: 121 149 _Signal_MP_Process_packet( the_packet ); 122 150 break; 123 151 } 152 #endif 153 154 124 155 } 125 156 }
Note: See TracChangeset
for help on using the changeset viewer.