Changeset 3a5dbdc in rtems
- 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
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/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 } -
c/src/exec/score/headers/mppkt.h
r0ea07c0 r3a5dbdc 39 39 typedef enum { 40 40 RTEMS_MP_PACKET_INTERNAL_THREADS = 0, 41 RTEMS_MP_PACKET_TASKS = 1,41 RTEMS_MP_PACKET_TASKS = 1, 42 42 RTEMS_MP_PACKET_MESSAGE_QUEUE = 2, 43 43 RTEMS_MP_PACKET_SEMAPHORE = 3, -
c/src/exec/score/headers/threadmp.h
r0ea07c0 r3a5dbdc 91 91 92 92 /* 93 * _Thread_MP_Block94 *95 * DESCRIPTION:96 *97 * This routine blocks the MP Receive server thread.98 */99 100 void _Thread_MP_Block( void );101 102 /*103 * _Thread_MP_Ready104 *105 * DESCRIPTION:106 *107 * This routine readies the MP Receive server thread.108 */109 110 void _Thread_MP_Ready( void );111 112 /*113 93 * The following is used to determine when the multiprocessing receive 114 94 * thread is executing so that a proxy can be allocated instead of -
c/src/exec/score/include/rtems/score/mppkt.h
r0ea07c0 r3a5dbdc 39 39 typedef enum { 40 40 RTEMS_MP_PACKET_INTERNAL_THREADS = 0, 41 RTEMS_MP_PACKET_TASKS = 1,41 RTEMS_MP_PACKET_TASKS = 1, 42 42 RTEMS_MP_PACKET_MESSAGE_QUEUE = 2, 43 43 RTEMS_MP_PACKET_SEMAPHORE = 3, -
c/src/exec/score/include/rtems/score/threadmp.h
r0ea07c0 r3a5dbdc 91 91 92 92 /* 93 * _Thread_MP_Block94 *95 * DESCRIPTION:96 *97 * This routine blocks the MP Receive server thread.98 */99 100 void _Thread_MP_Block( void );101 102 /*103 * _Thread_MP_Ready104 *105 * DESCRIPTION:106 *107 * This routine readies the MP Receive server thread.108 */109 110 void _Thread_MP_Ready( void );111 112 /*113 93 * The following is used to determine when the multiprocessing receive 114 94 * thread is executing so that a proxy can be allocated instead of -
c/src/exec/score/src/thread.c
r0ea07c0 r3a5dbdc 317 317 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 318 318 _Thread_Heir = the_thread; 319 if ( _Modes_Is_preempt( _Thread_Executing->current_modes ) ) 319 if ( _Modes_Is_preempt( _Thread_Executing->current_modes ) || 320 the_thread->current_priority == 0 ) 320 321 _Context_Switch_necessary = TRUE; 321 322 } -
c/src/exec/score/src/threadmp.c
r0ea07c0 r3a5dbdc 158 158 return NULL; 159 159 } 160 161 /*PAGE162 *163 * _Thread_MP_Block164 *165 */166 167 void _Thread_MP_Block( void )168 {169 ISR_Level level;170 171 _ISR_Disable( level );172 173 if ( _Thread_MP_Receive->Notepads[ 0 ] != 0 ) {174 _Priority_Remove_from_bit_map( &_Thread_MP_Receive->Priority_map );175 176 _Thread_MP_Receive->current_state = STATES_SUSPENDED;177 178 _ISR_Flash( level );179 180 _Thread_Calculate_heir();181 182 _Context_Switch_necessary = TRUE;183 184 _ISR_Enable( level );185 186 _Thread_Dispatch_disable_level = 0;187 188 _Thread_Dispatch();189 190 return;191 192 }193 _ISR_Enable( level );194 195 }196 197 /*PAGE198 *199 * _Thread_MP_Ready200 *201 */202 203 void _Thread_MP_Ready( void )204 {205 ISR_Level level;206 207 _ISR_Disable( level );208 209 if ( _States_Is_suspended( _Thread_MP_Receive->current_state ) ) {210 _Priority_Add_to_bit_map( &_Thread_MP_Receive->Priority_map );211 212 _Thread_MP_Receive->current_state = STATES_READY;213 214 _Thread_Heir = _Thread_MP_Receive;215 216 _Context_Switch_necessary = TRUE;217 218 _ISR_Enable( level );219 220 if ( _Thread_Is_dispatching_enabled() )221 _Thread_Dispatch();222 223 } else {224 225 _Thread_MP_Receive->Notepads[ 0 ] = 0;226 _ISR_Enable( level );227 228 }229 } -
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 } -
cpukit/score/include/rtems/score/mppkt.h
r0ea07c0 r3a5dbdc 39 39 typedef enum { 40 40 RTEMS_MP_PACKET_INTERNAL_THREADS = 0, 41 RTEMS_MP_PACKET_TASKS = 1,41 RTEMS_MP_PACKET_TASKS = 1, 42 42 RTEMS_MP_PACKET_MESSAGE_QUEUE = 2, 43 43 RTEMS_MP_PACKET_SEMAPHORE = 3, -
cpukit/score/include/rtems/score/threadmp.h
r0ea07c0 r3a5dbdc 91 91 92 92 /* 93 * _Thread_MP_Block94 *95 * DESCRIPTION:96 *97 * This routine blocks the MP Receive server thread.98 */99 100 void _Thread_MP_Block( void );101 102 /*103 * _Thread_MP_Ready104 *105 * DESCRIPTION:106 *107 * This routine readies the MP Receive server thread.108 */109 110 void _Thread_MP_Ready( void );111 112 /*113 93 * The following is used to determine when the multiprocessing receive 114 94 * thread is executing so that a proxy can be allocated instead of -
cpukit/score/src/thread.c
r0ea07c0 r3a5dbdc 317 317 if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 318 318 _Thread_Heir = the_thread; 319 if ( _Modes_Is_preempt( _Thread_Executing->current_modes ) ) 319 if ( _Modes_Is_preempt( _Thread_Executing->current_modes ) || 320 the_thread->current_priority == 0 ) 320 321 _Context_Switch_necessary = TRUE; 321 322 } -
cpukit/score/src/threadmp.c
r0ea07c0 r3a5dbdc 158 158 return NULL; 159 159 } 160 161 /*PAGE162 *163 * _Thread_MP_Block164 *165 */166 167 void _Thread_MP_Block( void )168 {169 ISR_Level level;170 171 _ISR_Disable( level );172 173 if ( _Thread_MP_Receive->Notepads[ 0 ] != 0 ) {174 _Priority_Remove_from_bit_map( &_Thread_MP_Receive->Priority_map );175 176 _Thread_MP_Receive->current_state = STATES_SUSPENDED;177 178 _ISR_Flash( level );179 180 _Thread_Calculate_heir();181 182 _Context_Switch_necessary = TRUE;183 184 _ISR_Enable( level );185 186 _Thread_Dispatch_disable_level = 0;187 188 _Thread_Dispatch();189 190 return;191 192 }193 _ISR_Enable( level );194 195 }196 197 /*PAGE198 *199 * _Thread_MP_Ready200 *201 */202 203 void _Thread_MP_Ready( void )204 {205 ISR_Level level;206 207 _ISR_Disable( level );208 209 if ( _States_Is_suspended( _Thread_MP_Receive->current_state ) ) {210 _Priority_Add_to_bit_map( &_Thread_MP_Receive->Priority_map );211 212 _Thread_MP_Receive->current_state = STATES_READY;213 214 _Thread_Heir = _Thread_MP_Receive;215 216 _Context_Switch_necessary = TRUE;217 218 _ISR_Enable( level );219 220 if ( _Thread_Is_dispatching_enabled() )221 _Thread_Dispatch();222 223 } else {224 225 _Thread_MP_Receive->Notepads[ 0 ] = 0;226 _ISR_Enable( level );227 228 }229 }
Note: See TracChangeset
for help on using the changeset viewer.