4000bbe0 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 4000bbe0: 9d e3 bf a0 save %sp, -96, %sp { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4000bbe4: 03 10 00 70 sethi %hi(0x4001c000), %g1 4000bbe8: c2 00 63 8c ld [ %g1 + 0x38c ], %g1 ! 4001c38c <_Thread_Executing> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4000bbec: c0 20 60 34 clr [ %g1 + 0x34 ] if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4000bbf0: c4 06 20 50 ld [ %i0 + 0x50 ], %g2 4000bbf4: 80 a0 a0 00 cmp %g2, 0 4000bbf8: 22 80 00 31 be,a 4000bcbc <_CORE_mutex_Seize_interrupt_trylock+0xdc> 4000bbfc: c4 06 20 5c ld [ %i0 + 0x5c ], %g2 the_mutex->lock = CORE_MUTEX_LOCKED; 4000bc00: c0 26 20 50 clr [ %i0 + 0x50 ] the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 4000bc04: c6 00 60 08 ld [ %g1 + 8 ], %g3 */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 4000bc08: c4 06 20 48 ld [ %i0 + 0x48 ], %g2 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 4000bc0c: c6 26 20 60 st %g3, [ %i0 + 0x60 ] executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 4000bc10: c2 26 20 5c st %g1, [ %i0 + 0x5c ] the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4000bc14: 86 10 20 01 mov 1, %g3 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4000bc18: 80 a0 a0 02 cmp %g2, 2 4000bc1c: 02 80 00 05 be 4000bc30 <_CORE_mutex_Seize_interrupt_trylock+0x50> 4000bc20: c6 26 20 54 st %g3, [ %i0 + 0x54 ] 4000bc24: 80 a0 a0 03 cmp %g2, 3 4000bc28: 12 80 00 07 bne 4000bc44 <_CORE_mutex_Seize_interrupt_trylock+0x64> 4000bc2c: 01 00 00 00 nop _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4000bc30: c6 00 60 1c ld [ %g1 + 0x1c ], %g3 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 4000bc34: 80 a0 a0 03 cmp %g2, 3 _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4000bc38: 84 00 e0 01 add %g3, 1, %g2 } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 4000bc3c: 02 80 00 03 be 4000bc48 <_CORE_mutex_Seize_interrupt_trylock+0x68> 4000bc40: c4 20 60 1c st %g2, [ %g1 + 0x1c ] _ISR_Enable( *level_p ); 4000bc44: 30 80 00 2d b,a 4000bcf8 <_CORE_mutex_Seize_interrupt_trylock+0x118> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4000bc48: c4 06 20 4c ld [ %i0 + 0x4c ], %g2 current = executing->current_priority; 4000bc4c: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 if ( current == ceiling ) { 4000bc50: 80 a0 c0 02 cmp %g3, %g2 4000bc54: 12 80 00 03 bne 4000bc60 <_CORE_mutex_Seize_interrupt_trylock+0x80> 4000bc58: 01 00 00 00 nop _ISR_Enable( *level_p ); 4000bc5c: 30 80 00 27 b,a 4000bcf8 <_CORE_mutex_Seize_interrupt_trylock+0x118> return 0; } if ( current > ceiling ) { 4000bc60: 08 80 00 0f bleu 4000bc9c <_CORE_mutex_Seize_interrupt_trylock+0xbc> 4000bc64: 84 10 20 06 mov 6, %g2 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4000bc68: 03 10 00 70 sethi %hi(0x4001c000), %g1 4000bc6c: c4 00 62 d0 ld [ %g1 + 0x2d0 ], %g2 ! 4001c2d0 <_Thread_Dispatch_disable_level> 4000bc70: 84 00 a0 01 inc %g2 4000bc74: c4 20 62 d0 st %g2, [ %g1 + 0x2d0 ] _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 4000bc78: 7f ff d8 39 call 40001d5c 4000bc7c: d0 06 40 00 ld [ %i1 ], %o0 _Thread_Change_priority( 4000bc80: d2 06 20 4c ld [ %i0 + 0x4c ], %o1 4000bc84: d0 06 20 5c ld [ %i0 + 0x5c ], %o0 4000bc88: 7f ff f0 d8 call 40007fe8 <_Thread_Change_priority> 4000bc8c: 94 10 20 00 clr %o2 the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 4000bc90: 7f ff f2 46 call 400085a8 <_Thread_Enable_dispatch> 4000bc94: b0 10 20 00 clr %i0 4000bc98: 30 80 00 1b b,a 4000bd04 <_CORE_mutex_Seize_interrupt_trylock+0x124> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4000bc9c: c4 20 60 34 st %g2, [ %g1 + 0x34 ] the_mutex->lock = CORE_MUTEX_UNLOCKED; 4000bca0: 84 10 20 01 mov 1, %g2 the_mutex->nest_count = 0; /* undo locking above */ 4000bca4: c0 26 20 54 clr [ %i0 + 0x54 ] _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 4000bca8: c4 26 20 50 st %g2, [ %i0 + 0x50 ] the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 4000bcac: c4 00 60 1c ld [ %g1 + 0x1c ], %g2 4000bcb0: 84 00 bf ff add %g2, -1, %g2 4000bcb4: c4 20 60 1c st %g2, [ %g1 + 0x1c ] _ISR_Enable( *level_p ); 4000bcb8: 30 80 00 10 b,a 4000bcf8 <_CORE_mutex_Seize_interrupt_trylock+0x118> /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 4000bcbc: 80 a0 80 01 cmp %g2, %g1 4000bcc0: 12 80 00 13 bne 4000bd0c <_CORE_mutex_Seize_interrupt_trylock+0x12c> 4000bcc4: 01 00 00 00 nop switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4000bcc8: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000bccc: 80 a0 60 00 cmp %g1, 0 4000bcd0: 22 80 00 07 be,a 4000bcec <_CORE_mutex_Seize_interrupt_trylock+0x10c> 4000bcd4: c2 06 20 54 ld [ %i0 + 0x54 ], %g1 4000bcd8: 80 a0 60 01 cmp %g1, 1 4000bcdc: 12 80 00 0c bne 4000bd0c <_CORE_mutex_Seize_interrupt_trylock+0x12c> 4000bce0: 82 10 20 02 mov 2, %g1 case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 4000bce4: 10 80 00 05 b 4000bcf8 <_CORE_mutex_Seize_interrupt_trylock+0x118> <== NOT EXECUTED 4000bce8: c2 20 a0 34 st %g1, [ %g2 + 0x34 ] <== NOT EXECUTED * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 4000bcec: 82 00 60 01 inc %g1 4000bcf0: c2 26 20 54 st %g1, [ %i0 + 0x54 ] _ISR_Enable( *level_p ); 4000bcf4: 30 80 00 01 b,a 4000bcf8 <_CORE_mutex_Seize_interrupt_trylock+0x118> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; _ISR_Enable( *level_p ); 4000bcf8: 7f ff d8 19 call 40001d5c 4000bcfc: d0 06 40 00 ld [ %i1 ], %o0 4000bd00: b0 10 20 00 clr %i0 4000bd04: 81 c7 e0 08 ret 4000bd08: 81 e8 00 00 restore return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 4000bd0c: 81 c7 e0 08 ret 4000bd10: 91 e8 20 01 restore %g0, 1, %o0 40008b38 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 40008b38: 9d e3 bf a0 save %sp, -96, %sp Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 40008b3c: e0 06 60 14 ld [ %i1 + 0x14 ], %l0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008b40: 82 06 60 3c add %i1, 0x3c, %g1 the_chain->permanent_null = NULL; 40008b44: c0 26 60 3c clr [ %i1 + 0x3c ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008b48: c2 26 60 38 st %g1, [ %i1 + 0x38 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40008b4c: 82 06 60 38 add %i1, 0x38, %g1 40008b50: c2 26 60 40 st %g1, [ %i1 + 0x40 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008b54: 2d 10 00 6e sethi %hi(0x4001b800), %l6 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008b58: 83 34 20 06 srl %l0, 6, %g1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40008b5c: 80 8c 20 20 btst 0x20, %l0 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008b60: a7 28 60 04 sll %g1, 4, %l3 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008b64: ac 15 a0 94 or %l6, 0x94, %l6 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008b68: 83 28 60 02 sll %g1, 2, %g1 block_state = the_thread_queue->state; 40008b6c: ea 06 20 38 ld [ %i0 + 0x38 ], %l5 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008b70: a6 24 c0 01 sub %l3, %g1, %l3 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40008b74: 12 80 00 28 bne 40008c14 <_Thread_queue_Enqueue_priority+0xdc> 40008b78: a6 06 00 13 add %i0, %l3, %l3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 40008b7c: ac 04 e0 04 add %l3, 4, %l6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 40008b80: 7f ff e4 73 call 40001d4c 40008b84: 01 00 00 00 nop 40008b88: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->first; 40008b8c: a8 10 3f ff mov -1, %l4 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 40008b90: 10 80 00 10 b 40008bd0 <_Thread_queue_Enqueue_priority+0x98> 40008b94: e2 04 c0 00 ld [ %l3 ], %l1 search_priority = search_thread->current_priority; if ( priority <= search_priority ) 40008b98: 80 a4 00 14 cmp %l0, %l4 40008b9c: 28 80 00 11 bleu,a 40008be0 <_Thread_queue_Enqueue_priority+0xa8> 40008ba0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 40008ba4: 7f ff e4 6e call 40001d5c 40008ba8: 90 10 00 12 mov %l2, %o0 40008bac: 7f ff e4 68 call 40001d4c 40008bb0: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 40008bb4: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40008bb8: 80 8d 40 01 btst %l5, %g1 40008bbc: 32 80 00 05 bne,a 40008bd0 <_Thread_queue_Enqueue_priority+0x98> 40008bc0: e2 04 40 00 ld [ %l1 ], %l1 _ISR_Enable( level ); 40008bc4: 7f ff e4 66 call 40001d5c <== NOT EXECUTED 40008bc8: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED goto restart_forward_search; 40008bcc: 30 bf ff ed b,a 40008b80 <_Thread_queue_Enqueue_priority+0x48> <== NOT EXECUTED restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 40008bd0: 80 a4 40 16 cmp %l1, %l6 40008bd4: 32 bf ff f1 bne,a 40008b98 <_Thread_queue_Enqueue_priority+0x60> 40008bd8: e8 04 60 14 ld [ %l1 + 0x14 ], %l4 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 40008bdc: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40008be0: 80 a0 60 01 cmp %g1, 1 40008be4: 12 80 00 3c bne 40008cd4 <_Thread_queue_Enqueue_priority+0x19c> 40008be8: 90 10 00 12 mov %l2, %o0 THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 40008bec: 80 a4 00 14 cmp %l0, %l4 40008bf0: 02 80 00 2e be 40008ca8 <_Thread_queue_Enqueue_priority+0x170> 40008bf4: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 40008bf8: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008bfc: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40008c00: c2 26 60 04 st %g1, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008c04: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 40008c08: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40008c0c: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008c10: 30 80 00 2d b,a 40008cc4 <_Thread_queue_Enqueue_priority+0x18c> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 40008c14: 7f ff e4 4e call 40001d4c 40008c18: e8 0d 80 00 ldub [ %l6 ], %l4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008c1c: a8 05 20 01 inc %l4 _ISR_Disable( level ); 40008c20: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 40008c24: 10 80 00 10 b 40008c64 <_Thread_queue_Enqueue_priority+0x12c> 40008c28: e2 04 e0 08 ld [ %l3 + 8 ], %l1 search_priority = search_thread->current_priority; if ( priority >= search_priority ) 40008c2c: 80 a4 00 14 cmp %l0, %l4 40008c30: 3a 80 00 11 bcc,a 40008c74 <_Thread_queue_Enqueue_priority+0x13c> 40008c34: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 40008c38: 7f ff e4 49 call 40001d5c 40008c3c: 90 10 00 12 mov %l2, %o0 40008c40: 7f ff e4 43 call 40001d4c 40008c44: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 40008c48: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40008c4c: 80 8d 40 01 btst %l5, %g1 40008c50: 32 80 00 05 bne,a 40008c64 <_Thread_queue_Enqueue_priority+0x12c> 40008c54: e2 04 60 04 ld [ %l1 + 4 ], %l1 _ISR_Enable( level ); 40008c58: 7f ff e4 41 call 40001d5c 40008c5c: 90 10 00 12 mov %l2, %o0 goto restart_reverse_search; 40008c60: 30 bf ff ed b,a 40008c14 <_Thread_queue_Enqueue_priority+0xdc> restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 40008c64: 80 a4 40 13 cmp %l1, %l3 40008c68: 32 bf ff f1 bne,a 40008c2c <_Thread_queue_Enqueue_priority+0xf4> 40008c6c: e8 04 60 14 ld [ %l1 + 0x14 ], %l4 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 40008c70: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40008c74: 80 a0 60 01 cmp %g1, 1 40008c78: 12 80 00 17 bne 40008cd4 <_Thread_queue_Enqueue_priority+0x19c> 40008c7c: 90 10 00 12 mov %l2, %o0 THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 40008c80: 80 a4 00 14 cmp %l0, %l4 40008c84: 02 80 00 09 be 40008ca8 <_Thread_queue_Enqueue_priority+0x170> 40008c88: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 40008c8c: c2 04 40 00 ld [ %l1 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 40008c90: e2 26 60 04 st %l1, [ %i1 + 4 ] search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 40008c94: c2 26 40 00 st %g1, [ %i1 ] the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008c98: f0 26 60 44 st %i0, [ %i1 + 0x44 ] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 40008c9c: f2 24 40 00 st %i1, [ %l1 ] next_node->previous = the_node; 40008ca0: f2 20 60 04 st %i1, [ %g1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008ca4: 30 80 00 08 b,a 40008cc4 <_Thread_queue_Enqueue_priority+0x18c> 40008ca8: a2 04 60 3c add %l1, 0x3c, %l1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 40008cac: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008cb0: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40008cb4: c2 26 60 04 st %g1, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008cb8: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 40008cbc: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40008cc0: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008cc4: 7f ff e4 26 call 40001d5c 40008cc8: b0 10 20 01 mov 1, %i0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40008ccc: 81 c7 e0 08 ret 40008cd0: 81 e8 00 00 restore * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; 40008cd4: f0 06 20 30 ld [ %i0 + 0x30 ], %i0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 40008cd8: d0 26 80 00 st %o0, [ %i2 ] return the_thread_queue->sync_state; } 40008cdc: 81 c7 e0 08 ret 40008ce0: 81 e8 00 00 restore 40015aec <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40015aec: 9d e3 bf 88 save %sp, -120, %sp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40015af0: 35 10 00 ef sethi %hi(0x4003bc00), %i2 40015af4: b2 07 bf f4 add %fp, -12, %i1 40015af8: ac 07 bf f8 add %fp, -8, %l6 40015afc: a2 07 bf e8 add %fp, -24, %l1 40015b00: a6 07 bf ec add %fp, -20, %l3 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015b04: 37 10 00 ef sethi %hi(0x4003bc00), %i3 40015b08: 2b 10 00 ef sethi %hi(0x4003bc00), %l5 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 40015b0c: c0 27 bf f8 clr [ %fp + -8 ] 40015b10: c0 27 bf ec clr [ %fp + -20 ] the_chain->last = _Chain_Head(the_chain); 40015b14: f2 27 bf fc st %i1, [ %fp + -4 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40015b18: ec 27 bf f4 st %l6, [ %fp + -12 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40015b1c: e2 27 bf f0 st %l1, [ %fp + -16 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40015b20: e6 27 bf e8 st %l3, [ %fp + -24 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40015b24: b4 16 a1 b4 or %i2, 0x1b4, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015b28: b6 16 e0 f0 or %i3, 0xf0, %i3 40015b2c: aa 15 60 60 or %l5, 0x60, %l5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b30: a8 06 20 30 add %i0, 0x30, %l4 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b34: a4 06 20 68 add %i0, 0x68, %l2 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015b38: b8 06 20 08 add %i0, 8, %i4 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40015b3c: ba 06 20 40 add %i0, 0x40, %i5 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 40015b40: ae 10 20 01 mov 1, %l7 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 40015b44: f2 26 20 78 st %i1, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40015b48: c2 06 80 00 ld [ %i2 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40015b4c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b50: 94 10 00 11 mov %l1, %o2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40015b54: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b58: 92 20 40 09 sub %g1, %o1, %o1 40015b5c: 40 00 10 e6 call 40019ef4 <_Watchdog_Adjust_to_chain> 40015b60: 90 10 00 14 mov %l4, %o0 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40015b64: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015b68: e0 06 c0 00 ld [ %i3 ], %l0 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 40015b6c: 80 a4 00 0a cmp %l0, %o2 40015b70: 08 80 00 06 bleu 40015b88 <_Timer_server_Body+0x9c> 40015b74: 92 24 00 0a sub %l0, %o2, %o1 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40015b78: 90 10 00 12 mov %l2, %o0 40015b7c: 40 00 10 de call 40019ef4 <_Watchdog_Adjust_to_chain> 40015b80: 94 10 00 11 mov %l1, %o2 40015b84: 30 80 00 06 b,a 40015b9c <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 40015b88: 1a 80 00 05 bcc 40015b9c <_Timer_server_Body+0xb0> 40015b8c: 94 22 80 10 sub %o2, %l0, %o2 /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 40015b90: 90 10 00 12 mov %l2, %o0 40015b94: 40 00 10 b1 call 40019e58 <_Watchdog_Adjust> 40015b98: 92 10 20 01 mov 1, %o1 } watchdogs->last_snapshot = snapshot; 40015b9c: e0 26 20 74 st %l0, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40015ba0: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40015ba4: 40 00 02 61 call 40016528 <_Chain_Get> 40015ba8: 01 00 00 00 nop if ( timer == NULL ) { 40015bac: 80 a2 20 00 cmp %o0, 0 40015bb0: 02 80 00 0f be 40015bec <_Timer_server_Body+0x100> 40015bb4: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40015bb8: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40015bbc: 80 a0 60 01 cmp %g1, 1 40015bc0: 12 80 00 05 bne 40015bd4 <_Timer_server_Body+0xe8> 40015bc4: 80 a0 60 03 cmp %g1, 3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40015bc8: 92 02 20 10 add %o0, 0x10, %o1 40015bcc: 10 80 00 05 b 40015be0 <_Timer_server_Body+0xf4> 40015bd0: 90 10 00 14 mov %l4, %o0 } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40015bd4: 12 bf ff f3 bne 40015ba0 <_Timer_server_Body+0xb4> 40015bd8: 92 02 20 10 add %o0, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40015bdc: 90 10 00 12 mov %l2, %o0 40015be0: 40 00 10 fa call 40019fc8 <_Watchdog_Insert> 40015be4: 01 00 00 00 nop 40015be8: 30 bf ff ee b,a 40015ba0 <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 40015bec: 7f ff e1 4c call 4000e11c 40015bf0: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40015bf4: c2 07 bf f4 ld [ %fp + -12 ], %g1 40015bf8: 80 a0 40 16 cmp %g1, %l6 40015bfc: 12 80 00 0a bne 40015c24 <_Timer_server_Body+0x138> 40015c00: 01 00 00 00 nop ts->insert_chain = NULL; 40015c04: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40015c08: 7f ff e1 49 call 4000e12c 40015c0c: 01 00 00 00 nop _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 40015c10: c2 07 bf e8 ld [ %fp + -24 ], %g1 40015c14: 80 a0 40 13 cmp %g1, %l3 40015c18: 12 80 00 06 bne 40015c30 <_Timer_server_Body+0x144> 40015c1c: 01 00 00 00 nop 40015c20: 30 80 00 1a b,a 40015c88 <_Timer_server_Body+0x19c> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40015c24: 7f ff e1 42 call 4000e12c <== NOT EXECUTED 40015c28: 01 00 00 00 nop <== NOT EXECUTED 40015c2c: 30 bf ff c7 b,a 40015b48 <_Timer_server_Body+0x5c> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 40015c30: 7f ff e1 3b call 4000e11c 40015c34: 01 00 00 00 nop 40015c38: 84 10 00 08 mov %o0, %g2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 40015c3c: e0 07 bf e8 ld [ %fp + -24 ], %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40015c40: 80 a4 00 13 cmp %l0, %l3 40015c44: 02 80 00 0e be 40015c7c <_Timer_server_Body+0x190> 40015c48: 80 a4 20 00 cmp %l0, 0 { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 40015c4c: c2 04 00 00 ld [ %l0 ], %g1 the_chain->first = new_first; 40015c50: c2 27 bf e8 st %g1, [ %fp + -24 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 40015c54: 02 80 00 0a be 40015c7c <_Timer_server_Body+0x190> 40015c58: e2 20 60 04 st %l1, [ %g1 + 4 ] watchdog->state = WATCHDOG_INACTIVE; 40015c5c: c0 24 20 08 clr [ %l0 + 8 ] _ISR_Enable( level ); 40015c60: 7f ff e1 33 call 4000e12c 40015c64: 01 00 00 00 nop /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 40015c68: d2 04 20 24 ld [ %l0 + 0x24 ], %o1 40015c6c: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 40015c70: 9f c0 40 00 call %g1 40015c74: d0 04 20 20 ld [ %l0 + 0x20 ], %o0 } 40015c78: 30 bf ff ee b,a 40015c30 <_Timer_server_Body+0x144> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40015c7c: 7f ff e1 2c call 4000e12c 40015c80: 90 10 00 02 mov %g2, %o0 40015c84: 30 bf ff b0 b,a 40015b44 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40015c88: c0 2e 20 7c clrb [ %i0 + 0x7c ] 40015c8c: c2 05 40 00 ld [ %l5 ], %g1 40015c90: 82 00 60 01 inc %g1 40015c94: c2 25 40 00 st %g1, [ %l5 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40015c98: d0 06 00 00 ld [ %i0 ], %o0 40015c9c: 40 00 0d e5 call 40019430 <_Thread_Set_state> 40015ca0: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40015ca4: 7f ff ff 68 call 40015a44 <_Timer_server_Reset_interval_system_watchdog> 40015ca8: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40015cac: 7f ff ff 7b call 40015a98 <_Timer_server_Reset_tod_system_watchdog> 40015cb0: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40015cb4: 40 00 0b 38 call 40018994 <_Thread_Enable_dispatch> 40015cb8: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015cbc: 90 10 00 1c mov %i4, %o0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 40015cc0: ee 2e 20 7c stb %l7, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40015cc4: 40 00 11 1e call 4001a13c <_Watchdog_Remove> 40015cc8: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40015ccc: 40 00 11 1c call 4001a13c <_Watchdog_Remove> 40015cd0: 90 10 00 1d mov %i5, %o0 40015cd4: 30 bf ff 9c b,a 40015b44 <_Timer_server_Body+0x58>