Changeset 0bb4dd03 in rtems
- Timestamp:
- 09/01/05 16:31:22 (19 years ago)
- Children:
- 58cfecc
- Parents:
- feedcdc
- Location:
- cpukit/score
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/score/ChangeLog
rfeedcdc r0bb4dd03 1 2005-09-01 Joel Sherrill <joel@OARcorp.com> 2 3 PR 820/rtems 4 * inline/rtems/score/coremsg.inl, macros/rtems/score/coremsg.inl, 5 src/coremsginsert.c: Increment of pending message count should be 6 atomic with insertion on the pending message chain. Determination of 7 the need to call the notification handler should also be in this 8 atomic section of code. 9 1 10 2005-08-17 Andrew Sinclair <Andrew.Sinclair@elprotech.com> 2 11 -
cpukit/score/inline/rtems/score/coremsg.inl
rfeedcdc r0bb4dd03 183 183 /*PAGE 184 184 * 185 * _CORE_message_queue_Append 185 * _CORE_message_queue_Append_unprotected 186 186 * 187 187 * DESCRIPTION: … … 191 191 */ 192 192 193 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append (193 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append_unprotected ( 194 194 CORE_message_queue_Control *the_message_queue, 195 195 CORE_message_queue_Buffer_control *the_message 196 196 ) 197 197 { 198 _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node ); 199 } 200 201 /*PAGE 202 * 203 * _CORE_message_queue_Prepend 198 _Chain_Append_unprotected( 199 &the_message_queue->Pending_messages, 200 &the_message->Node 201 ); 202 } 203 204 /*PAGE 205 * 206 * _CORE_message_queue_Prepend_unprotected 204 207 * 205 208 * DESCRIPTION: … … 209 212 */ 210 213 211 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend (214 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend_unprotected ( 212 215 CORE_message_queue_Control *the_message_queue, 213 216 CORE_message_queue_Buffer_control *the_message 214 217 ) 215 218 { 216 _Chain_Prepend (219 _Chain_Prepend_unprotected( 217 220 &the_message_queue->Pending_messages, 218 221 &the_message->Node -
cpukit/score/macros/rtems/score/coremsg.inl
rfeedcdc r0bb4dd03 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
rfeedcdc r0bb4dd03 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 * … … 55 55 ) 56 56 { 57 the_message_queue->number_of_pending_messages += 1; 57 ISR_Level level; 58 boolean notify = FALSE; 58 59 59 60 the_message->priority = submit_type; … … 61 62 switch ( submit_type ) { 62 63 case CORE_MESSAGE_QUEUE_SEND_REQUEST: 63 _CORE_message_queue_Append( the_message_queue, the_message ); 64 _ISR_Disable( level ); 65 if ( the_message_queue->number_of_pending_messages++ == 0 ) 66 notify = TRUE; 67 _CORE_message_queue_Append_unprotected(the_message_queue, the_message); 68 _ISR_Enable( level ); 64 69 break; 65 70 case CORE_MESSAGE_QUEUE_URGENT_REQUEST: 66 _CORE_message_queue_Prepend( the_message_queue, the_message ); 71 _ISR_Disable( level ); 72 if ( the_message_queue->number_of_pending_messages++ == 0 ) 73 notify = TRUE; 74 _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); 75 _ISR_Enable( level ); 67 76 break; 68 77 default: 69 /* XXX interrupt critical section needs to be addressed */70 78 { 71 79 CORE_message_queue_Buffer_control *this_message; … … 86 94 break; 87 95 } 88 _Chain_Insert( the_node->previous, &the_message->Node ); 96 _ISR_Disable( level ); 97 if ( the_message_queue->number_of_pending_messages++ == 0 ) 98 notify = TRUE; 99 _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); 100 _ISR_Enable( level ); 89 101 } 90 102 break; … … 97 109 */ 98 110 99 if ( the_message_queue->number_of_pending_messages == 1 && 100 the_message_queue->notify_handler ) 111 if ( notify && the_message_queue->notify_handler ) 101 112 (*the_message_queue->notify_handler)( the_message_queue->notify_argument ); 102 113 }
Note: See TracChangeset
for help on using the changeset viewer.