Changeset 2bbe78a2 in rtems
- Timestamp:
- 09/01/05 16:32:06 (19 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- fe7541a2
- Parents:
- a98ea87
- Location:
- cpukit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
ra98ea87 r2bbe78a2 1 2005-09-01 Joel Sherrill <joel@OARcorp.com> 2 3 PR 820/rtems 4 * score/inline/rtems/score/coremsg.inl, 5 score/macros/rtems/score/coremsg.inl, score/src/coremsginsert.c: 6 Increment of pending message count should be atomic with insertion on 7 the pending message chain. Determination of the need to call the 8 notification handler should also be in this atomic section of code. 9 1 10 2005-09-01 Joel Sherrill <joel@OARcorp.com> 2 11 -
cpukit/score/inline/rtems/score/coremsg.inl
ra98ea87 r2bbe78a2 159 159 */ 160 160 161 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (161 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append_unprotected ( 162 162 CORE_message_queue_Control *the_message_queue, 163 163 CORE_message_queue_Buffer_control *the_message 164 164 ) 165 165 { 166 _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node ); 166 _Chain_Append_unprotected( 167 &the_message_queue->Pending_messages, 168 &the_message->Node 169 ); 167 170 } 168 171 … … 172 175 */ 173 176 174 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (177 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend_unprotected ( 175 178 CORE_message_queue_Control *the_message_queue, 176 179 CORE_message_queue_Buffer_control *the_message 177 180 ) 178 181 { 179 _Chain_Prepend (182 _Chain_Prepend_unprotected( 180 183 &the_message_queue->Pending_messages, 181 184 &the_message->Node -
cpukit/score/macros/rtems/score/coremsg.inl
ra98ea87 r2bbe78a2 98 98 */ 99 99 100 #define _CORE_message_queue_Append( _the_message_queue, _the_message ) \ 101 _Chain_Append( &(_the_message_queue)->Pending_messages, \ 100 #define _CORE_message_queue_Append_unprotected( \ 101 _the_message_queue, _the_message ) \ 102 _Chain_Append_unprotected( &(_the_message_queue)->Pending_messages, \ 102 103 &(_the_message)->Node ) 103 104 … … 108 109 */ 109 110 110 #define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \ 111 _Chain_Prepend( &(_the_message_queue)->Pending_messages, \ 111 #define _CORE_message_queue_Prepend_unprotected( \ 112 _the_message_queue, _the_message ) \ 113 _Chain_Prepend_unprotected( &(_the_message_queue)->Pending_messages, \ 112 114 &(_the_message)->Node ) 113 115 -
cpukit/score/src/coremsginsert.c
ra98ea87 r2bbe78a2 8 8 * via messages passed to queue objects. 9 9 * 10 * COPYRIGHT (c) 1989- 1999.10 * COPYRIGHT (c) 1989-2005. 11 11 * On-Line Applications Research Corporation (OAR). 12 12 * … … 59 59 ) 60 60 { 61 the_message_queue->number_of_pending_messages += 1; 61 ISR_Level level; 62 boolean notify = FALSE; 62 63 63 64 the_message->priority = submit_type; … … 65 66 switch ( submit_type ) { 66 67 case CORE_MESSAGE_QUEUE_SEND_REQUEST: 67 _CORE_message_queue_Append( the_message_queue, the_message ); 68 _ISR_Disable( level ); 69 if ( the_message_queue->number_of_pending_messages++ == 0 ) 70 notify = TRUE; 71 _CORE_message_queue_Append_unprotected(the_message_queue, the_message); 72 _ISR_Enable( level ); 68 73 break; 69 74 case CORE_MESSAGE_QUEUE_URGENT_REQUEST: 70 _CORE_message_queue_Prepend( the_message_queue, the_message ); 75 _ISR_Disable( level ); 76 if ( the_message_queue->number_of_pending_messages++ == 0 ) 77 notify = TRUE; 78 _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); 79 _ISR_Enable( level ); 71 80 break; 72 81 default: 73 /* XXX interrupt critical section needs to be addressed */74 82 { 75 83 CORE_message_queue_Buffer_control *this_message; … … 90 98 break; 91 99 } 92 _Chain_Insert( the_node->previous, &the_message->Node ); 100 _ISR_Disable( level ); 101 if ( the_message_queue->number_of_pending_messages++ == 0 ) 102 notify = TRUE; 103 _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); 104 _ISR_Enable( level ); 93 105 } 94 106 break; … … 101 113 */ 102 114 103 if ( the_message_queue->number_of_pending_messages == 1 && 104 the_message_queue->notify_handler ) 115 if ( notify && the_message_queue->notify_handler ) 105 116 (*the_message_queue->notify_handler)( the_message_queue->notify_argument ); 106 117 }
Note: See TracChangeset
for help on using the changeset viewer.