30009358 <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 30009358: e59f3120 ldr r3, [pc, #288] ; 30009480 <_CORE_mutex_Seize_interrupt_trylock+0x128> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 3000935c: e3a02000 mov r2, #0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 30009360: e5933000 ldr r3, [r3] #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 30009364: e52de004 push {lr} ; (str lr, [sp, #-4]!) executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 30009368: e5832034 str r2, [r3, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 3000936c: e590c050 ldr ip, [r0, #80] ; 0x50 30009370: e15c0002 cmp ip, r2 30009374: 0a00002c beq 3000942c <_CORE_mutex_Seize_interrupt_trylock+0xd4> the_mutex->lock = CORE_MUTEX_LOCKED; 30009378: e5802050 str r2, [r0, #80] ; 0x50 the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 3000937c: e593c008 ldr ip, [r3, #8] */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 30009380: e5902048 ldr r2, [r0, #72] ; 0x48 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; 30009384: e580c060 str ip, [r0, #96] ; 0x60 the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 30009388: e3520002 cmp r2, #2 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; the_mutex->nest_count = 1; 3000938c: e3a0c001 mov ip, #1 30009390: e580c054 str ip, [r0, #84] ; 0x54 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; 30009394: e580305c str r3, [r0, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 30009398: 0a000001 beq 300093a4 <_CORE_mutex_Seize_interrupt_trylock+0x4c> 3000939c: e3520003 cmp r2, #3 300093a0: 1a000004 bne 300093b8 <_CORE_mutex_Seize_interrupt_trylock+0x60> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 300093a4: e593c01c ldr ip, [r3, #28] } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 300093a8: e3520003 cmp r2, #3 _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 300093ac: e28c2001 add r2, ip, #1 300093b0: e583201c str r2, [r3, #28] } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 300093b4: 0a000000 beq 300093bc <_CORE_mutex_Seize_interrupt_trylock+0x64> _ISR_Enable( *level_p ); 300093b8: ea00002a b 30009468 <_CORE_mutex_Seize_interrupt_trylock+0x110> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 300093bc: e590204c ldr r2, [r0, #76] ; 0x4c current = executing->current_priority; 300093c0: e593c014 ldr ip, [r3, #20] if ( current == ceiling ) { 300093c4: e15c0002 cmp ip, r2 300093c8: 1a000000 bne 300093d0 <_CORE_mutex_Seize_interrupt_trylock+0x78> _ISR_Enable( *level_p ); 300093cc: ea000025 b 30009468 <_CORE_mutex_Seize_interrupt_trylock+0x110> return 0; } if ( current > ceiling ) { 300093d0: 9a00000b bls 30009404 <_CORE_mutex_Seize_interrupt_trylock+0xac> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 300093d4: e59f30a8 ldr r3, [pc, #168] ; 30009484 <_CORE_mutex_Seize_interrupt_trylock+0x12c> 300093d8: e5932000 ldr r2, [r3] 300093dc: e2822001 add r2, r2, #1 300093e0: e5832000 str r2, [r3] 300093e4: e5913000 ldr r3, [r1] 300093e8: e129f003 msr CPSR_fc, r3 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( 300093ec: e3a02000 mov r2, #0 300093f0: e590104c ldr r1, [r0, #76] ; 0x4c 300093f4: e590005c ldr r0, [r0, #92] ; 0x5c 300093f8: ebfff1e5 bl 30005b94 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 300093fc: ebfff345 bl 30006118 <_Thread_Enable_dispatch> 30009400: ea00001a b 30009470 <_CORE_mutex_Seize_interrupt_trylock+0x118> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 30009404: e3a02006 mov r2, #6 30009408: e5832034 str r2, [r3, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 3000940c: e3a02000 mov r2, #0 30009410: e5802054 str r2, [r0, #84] ; 0x54 _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 30009414: e2822001 add r2, r2, #1 30009418: e5802050 str r2, [r0, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 3000941c: e593201c ldr r2, [r3, #28] 30009420: e2422001 sub r2, r2, #1 30009424: e583201c str r2, [r3, #28] _ISR_Enable( *level_p ); 30009428: ea00000e b 30009468 <_CORE_mutex_Seize_interrupt_trylock+0x110> /* * 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 ) ) { 3000942c: e590205c ldr r2, [r0, #92] ; 0x5c 30009430: e1520003 cmp r2, r3 30009434: 1a00000f bne 30009478 <_CORE_mutex_Seize_interrupt_trylock+0x120> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 30009438: e5903040 ldr r3, [r0, #64] ; 0x40 3000943c: e3530000 cmp r3, #0 30009440: 0a000002 beq 30009450 <_CORE_mutex_Seize_interrupt_trylock+0xf8> 30009444: e3530001 cmp r3, #1 30009448: 1a00000a bne 30009478 <_CORE_mutex_Seize_interrupt_trylock+0x120> 3000944c: ea000003 b 30009460 <_CORE_mutex_Seize_interrupt_trylock+0x108> <== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 30009450: e5903054 ldr r3, [r0, #84] ; 0x54 30009454: e2833001 add r3, r3, #1 30009458: e5803054 str r3, [r0, #84] ; 0x54 _ISR_Enable( *level_p ); 3000945c: ea000001 b 30009468 <_CORE_mutex_Seize_interrupt_trylock+0x110> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 30009460: e3a03002 mov r3, #2 <== NOT EXECUTED 30009464: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED 30009468: e5913000 ldr r3, [r1] 3000946c: e129f003 msr CPSR_fc, r3 30009470: e3a00000 mov r0, #0 30009474: e49df004 pop {pc} ; (ldr pc, [sp], #4) 30009478: e3a00001 mov r0, #1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 3000947c: e49df004 pop {pc} ; (ldr pc, [sp], #4) 30009480: 300187e0 .word 0x300187e0 30009484: 3001872c .word 0x3001872c 30006674 <_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 ) { 30006674: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 30006678: e5913014 ldr r3, [r1, #20] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 3000667c: e281503c add r5, r1, #60 ; 0x3c 30006680: e5815038 str r5, [r1, #56] ; 0x38 the_chain->permanent_null = NULL; 30006684: e3a05000 mov r5, #0 the_chain->last = _Chain_Head(the_chain); 30006688: e281c038 add ip, r1, #56 ; 0x38 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 3000668c: e3130020 tst r3, #32 _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 ]; 30006690: e1a04323 lsr r4, r3, #6 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 30006694: e581503c str r5, [r1, #60] ; 0x3c 30006698: e285500c add r5, r5, #12 the_chain->last = _Chain_Head(the_chain); 3000669c: e581c040 str ip, [r1, #64] ; 0x40 block_state = the_thread_queue->state; 300066a0: e5907038 ldr r7, [r0, #56] ; 0x38 _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 ]; 300066a4: e02c0495 mla ip, r5, r4, r0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 300066a8: 159f8154 ldrne r8, [pc, #340] ; 30006804 <_Thread_queue_Enqueue_priority+0x190> priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 300066ac: 1a000023 bne 30006740 <_Thread_queue_Enqueue_priority+0xcc> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 300066b0: e28c8004 add r8, ip, #4 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 300066b4: e10f5000 mrs r5, CPSR 300066b8: e3854080 orr r4, r5, #128 ; 0x80 300066bc: e129f004 msr CPSR_fc, r4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; 300066c0: e3e06000 mvn r6, #0 300066c4: e59c4000 ldr r4, [ip] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 300066c8: ea00000b b 300066fc <_Thread_queue_Enqueue_priority+0x88> search_priority = search_thread->current_priority; 300066cc: e5946014 ldr r6, [r4, #20] if ( priority <= search_priority ) 300066d0: e1530006 cmp r3, r6 300066d4: 9a00000a bls 30006704 <_Thread_queue_Enqueue_priority+0x90> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 300066d8: e10fa000 mrs sl, CPSR 300066dc: e129f005 msr CPSR_fc, r5 300066e0: e129f00a msr CPSR_fc, sl search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 300066e4: e594a010 ldr sl, [r4, #16] 300066e8: e117000a tst r7, sl 300066ec: 1a000001 bne 300066f8 <_Thread_queue_Enqueue_priority+0x84> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 300066f0: e129f005 msr CPSR_fc, r5 <== NOT EXECUTED 300066f4: eaffffee b 300066b4 <_Thread_queue_Enqueue_priority+0x40> <== NOT EXECUTED _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 300066f8: e5944000 ldr r4, [r4] 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 ) ) { 300066fc: e1540008 cmp r4, r8 30006700: 1afffff1 bne 300066cc <_Thread_queue_Enqueue_priority+0x58> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 30006704: e5907030 ldr r7, [r0, #48] ; 0x30 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 ) ) { 30006708: e1a0c005 mov ip, r5 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 3000670c: e3570001 cmp r7, #1 30006710: 1a000038 bne 300067f8 <_Thread_queue_Enqueue_priority+0x184> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 30006714: e1530006 cmp r3, r6 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 30006718: e3a03000 mov r3, #0 3000671c: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 30006720: 0a00002a beq 300067d0 <_Thread_queue_Enqueue_priority+0x15c> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 30006724: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 30006728: e5814000 str r4, [r1] the_node->previous = previous_node; 3000672c: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 30006730: e5810044 str r0, [r1, #68] ; 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; 30006734: e5831000 str r1, [r3] search_node->previous = the_node; 30006738: e5841004 str r1, [r4, #4] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 3000673c: ea000021 b 300067c8 <_Thread_queue_Enqueue_priority+0x154> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 30006740: e5d86000 ldrb r6, [r8] 30006744: e2866001 add r6, r6, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 30006748: e10f5000 mrs r5, CPSR 3000674c: e3854080 orr r4, r5, #128 ; 0x80 30006750: e129f004 msr CPSR_fc, r4 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; 30006754: e59c4008 ldr r4, [ip, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 30006758: ea00000b b 3000678c <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 3000675c: e5946014 ldr r6, [r4, #20] if ( priority >= search_priority ) 30006760: e1530006 cmp r3, r6 30006764: 2a00000a bcs 30006794 <_Thread_queue_Enqueue_priority+0x120> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( 30006768: e10fa000 mrs sl, CPSR 3000676c: e129f005 msr CPSR_fc, r5 30006770: e129f00a msr CPSR_fc, sl search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 30006774: e594a010 ldr sl, [r4, #16] 30006778: e117000a tst r7, sl 3000677c: 1a000001 bne 30006788 <_Thread_queue_Enqueue_priority+0x114> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 30006780: e129f005 msr CPSR_fc, r5 <== NOT EXECUTED 30006784: eaffffed b 30006740 <_Thread_queue_Enqueue_priority+0xcc> <== NOT EXECUTED _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 30006788: e5944004 ldr r4, [r4, #4] 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 ) ) { 3000678c: e154000c cmp r4, ip 30006790: 1afffff1 bne 3000675c <_Thread_queue_Enqueue_priority+0xe8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 30006794: e5907030 ldr r7, [r0, #48] ; 0x30 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 ) ) { 30006798: e1a0c005 mov ip, r5 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 3000679c: e3570001 cmp r7, #1 300067a0: 1a000014 bne 300067f8 <_Thread_queue_Enqueue_priority+0x184> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 300067a4: e1530006 cmp r3, r6 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 300067a8: e3a03000 mov r3, #0 300067ac: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 300067b0: 0a000006 beq 300067d0 <_Thread_queue_Enqueue_priority+0x15c> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 300067b4: e5943000 ldr r3, [r4] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 300067b8: e8810018 stm r1, {r3, r4} search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 300067bc: e5810044 str r0, [r1, #68] ; 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; 300067c0: e5841000 str r1, [r4] next_node->previous = the_node; 300067c4: e5831004 str r1, [r3, #4] 300067c8: e129f005 msr CPSR_fc, r5 300067cc: ea000007 b 300067f0 <_Thread_queue_Enqueue_priority+0x17c> 300067d0: e284403c add r4, r4, #60 ; 0x3c _ISR_Enable( level ); 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; 300067d4: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 300067d8: e5814000 str r4, [r1] the_node->previous = previous_node; 300067dc: e5813004 str r3, [r1, #4] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 300067e0: e5810044 str r0, [r1, #68] ; 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; 300067e4: e5831000 str r1, [r3] search_node->previous = the_node; 300067e8: e5841004 str r1, [r4, #4] 300067ec: e129f00c msr CPSR_fc, ip 300067f0: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 300067f4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; 300067f8: e5900030 ldr r0, [r0, #48] ; 0x30 * 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; 300067fc: e582c000 str ip, [r2] return the_thread_queue->sync_state; } 30006800: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} 30006804: 30017d4c .word 0x30017d4c 30013d98 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 30013d98: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 30013d9c: e24dd020 sub sp, sp, #32 30013da0: e28d3014 add r3, sp, #20 30013da4: e28d5008 add r5, sp, #8 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 30013da8: e3a09000 mov r9, #0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 30013dac: e283a004 add sl, r3, #4 30013db0: e2858004 add r8, r5, #4 Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 30013db4: e58d301c str r3, [sp, #28] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 30013db8: e2802008 add r2, r0, #8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 30013dbc: e2803040 add r3, r0, #64 ; 0x40 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 30013dc0: e1a04000 mov r4, r0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 30013dc4: e58da014 str sl, [sp, #20] the_chain->permanent_null = NULL; 30013dc8: e58d9018 str r9, [sp, #24] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 30013dcc: e58d8008 str r8, [sp, #8] the_chain->permanent_null = NULL; 30013dd0: e58d900c str r9, [sp, #12] the_chain->last = _Chain_Head(the_chain); 30013dd4: e58d5010 str r5, [sp, #16] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 30013dd8: e280b030 add fp, r0, #48 ; 0x30 /* * 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 ); 30013ddc: e2807068 add r7, r0, #104 ; 0x68 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 30013de0: e58d2004 str r2, [sp, #4] static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 30013de4: e58d3000 str r3, [sp] { /* * 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; 30013de8: e28d2014 add r2, sp, #20 30013dec: e5842078 str r2, [r4, #120] ; 0x78 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 30013df0: e59f2168 ldr r2, [pc, #360] ; 30013f60 <_Timer_server_Body+0x1c8> */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 30013df4: e1a0000b mov r0, fp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 30013df8: e5923000 ldr r3, [r2] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 30013dfc: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 30013e00: e1a02005 mov r2, r5 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 30013e04: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 30013e08: e0611003 rsb r1, r1, r3 30013e0c: eb000fde bl 30017d8c <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 30013e10: e59f314c ldr r3, [pc, #332] ; 30013f64 <_Timer_server_Body+0x1cc> Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 30013e14: e5942074 ldr r2, [r4, #116] ; 0x74 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 30013e18: e5936000 ldr r6, [r3] /* * 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 ) { 30013e1c: e1560002 cmp r6, r2 30013e20: 9a000004 bls 30013e38 <_Timer_server_Body+0xa0> /* * 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 ); 30013e24: e0621006 rsb r1, r2, r6 30013e28: e1a00007 mov r0, r7 30013e2c: e1a02005 mov r2, r5 30013e30: eb000fd5 bl 30017d8c <_Watchdog_Adjust_to_chain> 30013e34: ea000003 b 30013e48 <_Timer_server_Body+0xb0> /* * 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 ); 30013e38: 30662002 rsbcc r2, r6, r2 30013e3c: 31a00007 movcc r0, r7 30013e40: 33a01001 movcc r1, #1 30013e44: 3b000fa8 blcc 30017cec <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 30013e48: e5846074 str r6, [r4, #116] ; 0x74 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 30013e4c: e5940078 ldr r0, [r4, #120] ; 0x78 30013e50: eb000229 bl 300146fc <_Chain_Get> if ( timer == NULL ) { 30013e54: e2501000 subs r1, r0, #0 30013e58: 0a00000a beq 30013e88 <_Timer_server_Body+0xf0> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 30013e5c: e5913038 ldr r3, [r1, #56] ; 0x38 30013e60: e3530001 cmp r3, #1 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 30013e64: 02811010 addeq r1, r1, #16 30013e68: 01a0000b moveq r0, fp static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 30013e6c: 0a000003 beq 30013e80 <_Timer_server_Body+0xe8> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 30013e70: e3530003 cmp r3, #3 30013e74: 1afffff4 bne 30013e4c <_Timer_server_Body+0xb4> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 30013e78: e2811010 add r1, r1, #16 30013e7c: e1a00007 mov r0, r7 30013e80: eb000fee bl 30017e40 <_Watchdog_Insert> 30013e84: eafffff0 b 30013e4c <_Timer_server_Body+0xb4> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 30013e88: e10f3000 mrs r3, CPSR 30013e8c: e3832080 orr r2, r3, #128 ; 0x80 30013e90: e129f002 msr CPSR_fc, r2 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { 30013e94: e59d2014 ldr r2, [sp, #20] 30013e98: e152000a cmp r2, sl 30013e9c: 1a000005 bne 30013eb8 <_Timer_server_Body+0x120> ts->insert_chain = NULL; 30013ea0: e5841078 str r1, [r4, #120] ; 0x78 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 30013ea4: e129f003 msr CPSR_fc, r3 _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 ) ) { 30013ea8: e59d3008 ldr r3, [sp, #8] 30013eac: e1530008 cmp r3, r8 30013eb0: 1a000002 bne 30013ec0 <_Timer_server_Body+0x128> 30013eb4: ea000015 b 30013f10 <_Timer_server_Body+0x178> 30013eb8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED 30013ebc: eaffffcb b 30013df0 <_Timer_server_Body+0x58> <== NOT EXECUTED static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( 30013ec0: e10f2000 mrs r2, CPSR 30013ec4: e3823080 orr r3, r2, #128 ; 0x80 30013ec8: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 30013ecc: e59d3008 ldr r3, [sp, #8] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 30013ed0: e1530008 cmp r3, r8 30013ed4: 0a00000b beq 30013f08 <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 30013ed8: e5931000 ldr r1, [r3] * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 30013edc: e3530000 cmp r3, #0 the_chain->first = new_first; 30013ee0: e58d1008 str r1, [sp, #8] new_first->previous = _Chain_Head(the_chain); 30013ee4: e5815004 str r5, [r1, #4] 30013ee8: 0a000006 beq 30013f08 <_Timer_server_Body+0x170> watchdog->state = WATCHDOG_INACTIVE; 30013eec: e5839008 str r9, [r3, #8] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( 30013ef0: e129f002 msr CPSR_fc, r2 /* * 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 ); 30013ef4: e5930020 ldr r0, [r3, #32] 30013ef8: e5931024 ldr r1, [r3, #36] ; 0x24 30013efc: e1a0e00f mov lr, pc 30013f00: e593f01c ldr pc, [r3, #28] } 30013f04: eaffffed b 30013ec0 <_Timer_server_Body+0x128> 30013f08: e129f002 msr CPSR_fc, r2 30013f0c: eaffffb5 b 30013de8 <_Timer_server_Body+0x50> 30013f10: e59f3050 ldr r3, [pc, #80] ; 30013f68 <_Timer_server_Body+0x1d0> } else { ts->active = false; 30013f14: e5c4907c strb r9, [r4, #124] ; 0x7c 30013f18: e5932000 ldr r2, [r3] 30013f1c: e2822001 add r2, r2, #1 30013f20: e5832000 str r2, [r3] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 30013f24: e3a01008 mov r1, #8 30013f28: e5940000 ldr r0, [r4] 30013f2c: eb000d21 bl 300173b8 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 30013f30: e1a00004 mov r0, r4 30013f34: ebffff6b bl 30013ce8 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 30013f38: e1a00004 mov r0, r4 30013f3c: ebffff7f bl 30013d40 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 30013f40: eb000a8d bl 3001697c <_Thread_Enable_dispatch> ts->active = true; 30013f44: e3a03001 mov r3, #1 30013f48: e5c4307c strb r3, [r4, #124] ; 0x7c static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 30013f4c: e59d0004 ldr r0, [sp, #4] 30013f50: eb001013 bl 30017fa4 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 30013f54: e59d0000 ldr r0, [sp] 30013f58: eb001011 bl 30017fa4 <_Watchdog_Remove> 30013f5c: eaffffa1 b 30013de8 <_Timer_server_Body+0x50> 30013f60: 30037c44 .word 0x30037c44 30013f64: 30037b74 .word 0x30037b74 30013f68: 30037aec .word 0x30037aec