a0015d64 <_CORE_message_queue_Broadcast>: { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { a0015d64: e590304c ldr r3, [r0, #76] ; 0x4c Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { a0015d68: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { a0015d6c: e1530002 cmp r3, r2 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { a0015d70: e1a07000 mov r7, r0 a0015d74: e1a05002 mov r5, r2 a0015d78: e1a08001 mov r8, r1 a0015d7c: e59da020 ldr sl, [sp, #32] Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { a0015d80: 3a000013 bcc a0015dd4 <_CORE_message_queue_Broadcast+0x70> * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { a0015d84: e5906048 ldr r6, [r0, #72] ; 0x48 a0015d88: e3560000 cmp r6, #0 a0015d8c: 0a000009 beq a0015db8 <_CORE_message_queue_Broadcast+0x54> *count = 0; a0015d90: e3a00000 mov r0, #0 a0015d94: e58a0000 str r0, [sl] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; a0015d98: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} const void *source, void *destination, size_t size ) { memcpy(destination, source, size); a0015d9c: e594002c ldr r0, [r4, #44] ; 0x2c a0015da0: e1a01008 mov r1, r8 a0015da4: e1a02005 mov r2, r5 a0015da8: eb00217b bl a001e39c buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; a0015dac: e5943028 ldr r3, [r4, #40] ; 0x28 */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; a0015db0: e2866001 add r6, r6, #1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; a0015db4: e5835000 str r5, [r3] * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { a0015db8: e1a00007 mov r0, r7 a0015dbc: eb0009b2 bl a001848c <_Thread_queue_Dequeue> /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = a0015dc0: e2504000 subs r4, r0, #0 a0015dc4: 1afffff4 bne a0015d9c <_CORE_message_queue_Broadcast+0x38> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; a0015dc8: e58a6000 str r6, [sl] a0015dcc: e1a00004 mov r0, r4 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } a0015dd0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { a0015dd4: e3a00001 mov r0, #1 <== NOT EXECUTED a0015dd8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED a0009b6c <_CORE_mutex_Seize_interrupt_trylock>: { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; a0009b6c: e59f2154 ldr r2, [pc, #340] ; a0009cc8 <_CORE_mutex_Seize_interrupt_trylock+0x15c> executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; a0009b70: e3a03000 mov r3, #0 #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { a0009b74: e92d4070 push {r4, r5, r6, lr} { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; a0009b78: e5922000 ldr r2, [r2] executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; a0009b7c: e5823034 str r3, [r2, #52] ; 0x34 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { a0009b80: e590c050 ldr ip, [r0, #80] ; 0x50 a0009b84: e15c0003 cmp ip, r3 a0009b88: 0a00000e beq a0009bc8 <_CORE_mutex_Seize_interrupt_trylock+0x5c> the_mutex->lock = CORE_MUTEX_LOCKED; a0009b8c: e5803050 str r3, [r0, #80] ; 0x50 */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; a0009b90: e590c048 ldr ip, [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; a0009b94: e5925008 ldr r5, [r2, #8] the_mutex->nest_count = 1; a0009b98: e3a04001 mov r4, #1 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || a0009b9c: e35c0002 cmp ip, #2 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; a0009ba0: e5805060 str r5, [r0, #96] ; 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; a0009ba4: e580205c str r2, [r0, #92] ; 0x5c the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; a0009ba8: e5804054 str r4, [r0, #84] ; 0x54 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || a0009bac: 0a00000a beq a0009bdc <_CORE_mutex_Seize_interrupt_trylock+0x70> a0009bb0: e35c0003 cmp ip, #3 a0009bb4: 0a000019 beq a0009c20 <_CORE_mutex_Seize_interrupt_trylock+0xb4> a0009bb8: e5913000 ldr r3, [r1] a0009bbc: e129f003 msr CPSR_fc, r3 a0009bc0: e3a00000 mov r0, #0 a0009bc4: e8bd8070 pop {r4, r5, r6, pc} /* * 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 ) ) { a0009bc8: e590305c ldr r3, [r0, #92] ; 0x5c a0009bcc: e1520003 cmp r2, r3 a0009bd0: 0a000008 beq a0009bf8 <_CORE_mutex_Seize_interrupt_trylock+0x8c> a0009bd4: e3a00001 mov r0, #1 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } a0009bd8: e8bd8070 pop {r4, r5, r6, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; a0009bdc: e592301c ldr r3, [r2, #28] a0009be0: e2833001 add r3, r3, #1 a0009be4: e582301c str r3, [r2, #28] a0009be8: e5913000 ldr r3, [r1] a0009bec: e129f003 msr CPSR_fc, r3 a0009bf0: e3a00000 mov r0, #0 a0009bf4: e8bd8070 pop {r4, r5, r6, pc} * 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 ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { a0009bf8: e5903040 ldr r3, [r0, #64] ; 0x40 a0009bfc: e3530000 cmp r3, #0 a0009c00: 1a000017 bne a0009c64 <_CORE_mutex_Seize_interrupt_trylock+0xf8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; a0009c04: e5903054 ldr r3, [r0, #84] ; 0x54 a0009c08: e2833001 add r3, r3, #1 a0009c0c: e5803054 str r3, [r0, #84] ; 0x54 a0009c10: e5913000 ldr r3, [r1] a0009c14: e129f003 msr CPSR_fc, r3 a0009c18: e3a00000 mov r0, #0 a0009c1c: e8bd8070 pop {r4, r5, r6, pc} _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; a0009c20: e592c01c ldr ip, [r2, #28] { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; a0009c24: e5925014 ldr r5, [r2, #20] _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; a0009c28: e08c6004 add r6, ip, r4 a0009c2c: e582601c str r6, [r2, #28] */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; a0009c30: e590604c ldr r6, [r0, #76] ; 0x4c current = executing->current_priority; if ( current == ceiling ) { a0009c34: e1560005 cmp r6, r5 a0009c38: 0a00001e beq a0009cb8 <_CORE_mutex_Seize_interrupt_trylock+0x14c> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { a0009c3c: 3a000010 bcc a0009c84 <_CORE_mutex_Seize_interrupt_trylock+0x118> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; a0009c40: e3a05006 mov r5, #6 a0009c44: e5825034 str r5, [r2, #52] ; 0x34 the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ a0009c48: e5803054 str r3, [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; a0009c4c: e5804050 str r4, [r0, #80] ; 0x50 the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ a0009c50: e582c01c str ip, [r2, #28] a0009c54: e5913000 ldr r3, [r1] a0009c58: e129f003 msr CPSR_fc, r3 a0009c5c: e3a00000 mov r0, #0 a0009c60: e8bd8070 pop {r4, r5, r6, pc} * 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 ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { a0009c64: e3530001 cmp r3, #1 a0009c68: 1affffd9 bne a0009bd4 <_CORE_mutex_Seize_interrupt_trylock+0x68> 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; a0009c6c: e3a03002 mov r3, #2 <== NOT EXECUTED a0009c70: e5823034 str r3, [r2, #52] ; 0x34 <== NOT EXECUTED a0009c74: e5913000 ldr r3, [r1] <== NOT EXECUTED a0009c78: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED a0009c7c: e3a00000 mov r0, #0 <== NOT EXECUTED a0009c80: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; a0009c84: e59f3040 ldr r3, [pc, #64] ; a0009ccc <_CORE_mutex_Seize_interrupt_trylock+0x160> a0009c88: e5932000 ldr r2, [r3] a0009c8c: e2822001 add r2, r2, #1 a0009c90: e5832000 str r2, [r3] a0009c94: e5913000 ldr r3, [r1] a0009c98: e129f003 msr CPSR_fc, r3 } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); _Thread_Change_priority( a0009c9c: e3a02000 mov r2, #0 a0009ca0: e590104c ldr r1, [r0, #76] ; 0x4c a0009ca4: e590005c ldr r0, [r0, #92] ; 0x5c a0009ca8: ebfff0da bl a0006018 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); a0009cac: ebfff247 bl a00065d0 <_Thread_Enable_dispatch> a0009cb0: e3a00000 mov r0, #0 a0009cb4: e8bd8070 pop {r4, r5, r6, pc} a0009cb8: e5913000 ldr r3, [r1] a0009cbc: e129f003 msr CPSR_fc, r3 a0009cc0: e3a00000 mov r0, #0 a0009cc4: e8bd8070 pop {r4, r5, r6, pc} a0009cc8: a00192c0 .word 0xa00192c0 a0009ccc: a001920c .word 0xa001920c a00041d0 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { a00041d0: e92d40f0 push {r4, r5, r6, r7, lr} rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; a00041d4: e5901100 ldr r1, [r0, #256] ; 0x100 option_set = (rtems_option) the_thread->Wait.option; a00041d8: e5905030 ldr r5, [r0, #48] ; 0x30 */ void _Event_Surrender( Thread_Control *the_thread ) { a00041dc: e1a04000 mov r4, r0 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a00041e0: e10f0000 mrs r0, CPSR a00041e4: e3803080 orr r3, r0, #128 ; 0x80 a00041e8: e129f003 msr CPSR_fc, r3 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; a00041ec: e5912000 ldr r2, [r1] event_condition = (rtems_event_set) the_thread->Wait.count; a00041f0: e5943024 ldr r3, [r4, #36] ; 0x24 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { a00041f4: e013c002 ands ip, r3, r2 a00041f8: 0a000021 beq a0004284 <_Event_Surrender+0xb4> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && a00041fc: e59f6100 ldr r6, [pc, #256] ; a0004304 <_Event_Surrender+0x134> a0004200: e5966000 ldr r6, [r6] a0004204: e3560000 cmp r6, #0 a0004208: 0a000003 beq a000421c <_Event_Surrender+0x4c> a000420c: e59f60f4 ldr r6, [pc, #244] ; a0004308 <_Event_Surrender+0x138> a0004210: e5966000 ldr r6, [r6] a0004214: e1540006 cmp r4, r6 a0004218: 0a000024 beq a00042b0 <_Event_Surrender+0xe0> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { a000421c: e5946010 ldr r6, [r4, #16] a0004220: e3160c01 tst r6, #256 ; 0x100 a0004224: 0a000014 beq a000427c <_Event_Surrender+0xac> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { a0004228: e153000c cmp r3, ip a000422c: 0a000001 beq a0004238 <_Event_Surrender+0x68> a0004230: e3150002 tst r5, #2 a0004234: 0a000010 beq a000427c <_Event_Surrender+0xac> api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; a0004238: e5943028 ldr r3, [r4, #40] ; 0x28 /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); a000423c: e1c2200c bic r2, r2, ip a0004240: e5812000 str r2, [r1] the_thread->Wait.count = 0; a0004244: e3a02000 mov r2, #0 a0004248: e5842024 str r2, [r4, #36] ; 0x24 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; a000424c: e583c000 str ip, [r3] static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( a0004250: e10f3000 mrs r3, CPSR a0004254: e129f000 msr CPSR_fc, r0 a0004258: e129f003 msr CPSR_fc, r3 _ISR_Flash( level ); if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { a000425c: e5943050 ldr r3, [r4, #80] ; 0x50 a0004260: e3530002 cmp r3, #2 a0004264: 0a000008 beq a000428c <_Event_Surrender+0xbc> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0004268: e129f000 msr CPSR_fc, r0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); a000426c: e59f1098 ldr r1, [pc, #152] ; a000430c <_Event_Surrender+0x13c> a0004270: e1a00004 mov r0, r4 } return; } } _ISR_Enable( level ); } a0004274: e8bd40f0 pop {r4, r5, r6, r7, lr} a0004278: ea0007d1 b a00061c4 <_Thread_Clear_state> a000427c: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED a0004280: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED a0004284: e129f000 msr CPSR_fc, r0 a0004288: e8bd80f0 pop {r4, r5, r6, r7, pc} RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; a000428c: e3a03003 mov r3, #3 a0004290: e5843050 str r3, [r4, #80] ; 0x50 a0004294: e129f000 msr CPSR_fc, r0 _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); a0004298: e2840048 add r0, r4, #72 ; 0x48 a000429c: eb000d65 bl a0007838 <_Watchdog_Remove> a00042a0: e59f1064 ldr r1, [pc, #100] ; a000430c <_Event_Surrender+0x13c> a00042a4: e1a00004 mov r0, r4 } return; } } _ISR_Enable( level ); } a00042a8: e8bd40f0 pop {r4, r5, r6, r7, lr} a00042ac: ea0007c4 b a00061c4 <_Thread_Clear_state> * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || a00042b0: e59f6058 ldr r6, [pc, #88] ; a0004310 <_Event_Surrender+0x140> a00042b4: e5967000 ldr r7, [r6] /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && a00042b8: e3570002 cmp r7, #2 a00042bc: 0a000002 beq a00042cc <_Event_Surrender+0xfc> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { a00042c0: e5967000 ldr r7, [r6] /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && a00042c4: e3570001 cmp r7, #1 a00042c8: 1affffd3 bne a000421c <_Event_Surrender+0x4c> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { a00042cc: e153000c cmp r3, ip a00042d0: 0a000001 beq a00042dc <_Event_Surrender+0x10c> a00042d4: e3150002 tst r5, #2 a00042d8: 0a000007 beq a00042fc <_Event_Surrender+0x12c> api->pending_events = _Event_sets_Clear( pending_events,seized_events ); a00042dc: e1c2200c bic r2, r2, ip the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; a00042e0: e5943028 ldr r3, [r4, #40] ; 0x28 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); a00042e4: e5812000 str r2, [r1] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; a00042e8: e3a02003 mov r2, #3 a00042ec: e5862000 str r2, [r6] _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; a00042f0: e3a02000 mov r2, #0 a00042f4: e5842024 str r2, [r4, #36] ; 0x24 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; a00042f8: e583c000 str ip, [r3] a00042fc: e129f000 msr CPSR_fc, r0 a0004300: e8bd80f0 pop {r4, r5, r6, r7, pc} a0004304: a001929c .word 0xa001929c a0004308: a00192c0 .word 0xa00192c0 a000430c: 1003fff8 .word 0x1003fff8 a0004310: a001940c .word 0xa001940c a0009db0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a0009db0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a0009db4: e1a08002 mov r8, r2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; a0009db8: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a0009dbc: e24dd01c sub sp, sp, #28 a0009dc0: e1a05001 mov r5, r1 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { a0009dc4: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a0009dc8: e1a07000 mov r7, r0 - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { a0009dcc: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { a0009dd0: e1a0b003 mov fp, r3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; a0009dd4: e590a008 ldr sl, [r0, #8] Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; a0009dd8: e58d200c str r2, [sp, #12] uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { a0009ddc: 2a000074 bcs a0009fb4 <_Heap_Allocate_aligned_with_boundary+0x204> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { a0009de0: e3530000 cmp r3, #0 a0009de4: 1a000070 bne a0009fac <_Heap_Allocate_aligned_with_boundary+0x1fc> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a0009de8: e157000a cmp r7, sl a0009dec: 03a06000 moveq r6, #0 a0009df0: 0a000072 beq a0009fc0 <_Heap_Allocate_aligned_with_boundary+0x210> uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; a0009df4: e59d300c ldr r3, [sp, #12] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a0009df8: e2651004 rsb r1, r5, #4 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a0009dfc: e3a06000 mov r6, #0 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; a0009e00: e2833007 add r3, r3, #7 a0009e04: e58d3010 str r3, [sp, #16] uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a0009e08: e58d1014 str r1, [sp, #20] a0009e0c: ea000004 b a0009e24 <_Heap_Allocate_aligned_with_boundary+0x74> boundary ); } } if ( alloc_begin != 0 ) { a0009e10: e3540000 cmp r4, #0 a0009e14: 1a000057 bne a0009f78 <_Heap_Allocate_aligned_with_boundary+0x1c8> break; } block = block->next; a0009e18: e59aa008 ldr sl, [sl, #8] if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a0009e1c: e157000a cmp r7, sl a0009e20: 0a000066 beq a0009fc0 <_Heap_Allocate_aligned_with_boundary+0x210> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { a0009e24: e59a9004 ldr r9, [sl, #4] a0009e28: e59d2000 ldr r2, [sp] while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; a0009e2c: e2866001 add r6, r6, #1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { a0009e30: e1520009 cmp r2, r9 a0009e34: 2afffff7 bcs a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) { a0009e38: e3580000 cmp r8, #0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; a0009e3c: 028a4008 addeq r4, sl, #8 a0009e40: 0afffff2 beq a0009e10 <_Heap_Allocate_aligned_with_boundary+0x60> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a0009e44: e59d1014 ldr r1, [sp, #20] uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; a0009e48: e5973014 ldr r3, [r7, #20] uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; a0009e4c: e59d2010 ldr r2, [sp, #16] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; a0009e50: e3c99001 bic r9, r9, #1 a0009e54: e08a9009 add r9, sl, r9 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; a0009e58: e0814009 add r4, r1, r9 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; a0009e5c: e58d3004 str r3, [sp, #4] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a0009e60: e1a00004 mov r0, r4 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; a0009e64: e0633002 rsb r3, r3, r2 a0009e68: e1a01008 mov r1, r8 a0009e6c: e0839009 add r9, r3, r9 a0009e70: eb002e7a bl a0015860 <__umodsi3> a0009e74: e0604004 rsb r4, r0, r4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; a0009e78: e28a3008 add r3, sl, #8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { a0009e7c: e1590004 cmp r9, r4 a0009e80: e58d3008 str r3, [sp, #8] a0009e84: 2a000003 bcs a0009e98 <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a0009e88: e1a00009 mov r0, r9 a0009e8c: e1a01008 mov r1, r8 a0009e90: eb002e72 bl a0015860 <__umodsi3> a0009e94: e0604009 rsb r4, r0, r9 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { a0009e98: e35b0000 cmp fp, #0 a0009e9c: 0a000025 beq a0009f38 <_Heap_Allocate_aligned_with_boundary+0x188> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; a0009ea0: e0849005 add r9, r4, r5 a0009ea4: e1a00009 mov r0, r9 a0009ea8: e1a0100b mov r1, fp a0009eac: eb002e6b bl a0015860 <__umodsi3> a0009eb0: e0600009 rsb r0, r0, r9 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { a0009eb4: e1590000 cmp r9, r0 a0009eb8: 93a03000 movls r3, #0 a0009ebc: 83a03001 movhi r3, #1 a0009ec0: e1540000 cmp r4, r0 a0009ec4: 23a03000 movcs r3, #0 a0009ec8: e3530000 cmp r3, #0 a0009ecc: 0a000019 beq a0009f38 <_Heap_Allocate_aligned_with_boundary+0x188> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; a0009ed0: e59d1008 ldr r1, [sp, #8] a0009ed4: e0819005 add r9, r1, r5 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { a0009ed8: e1590000 cmp r9, r0 a0009edc: 958d6018 strls r6, [sp, #24] a0009ee0: 9a000002 bls a0009ef0 <_Heap_Allocate_aligned_with_boundary+0x140> a0009ee4: eaffffcb b a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> a0009ee8: e1590000 cmp r9, r0 a0009eec: 8a000035 bhi a0009fc8 <_Heap_Allocate_aligned_with_boundary+0x218> return 0; } alloc_begin = boundary_line - alloc_size; a0009ef0: e0654000 rsb r4, r5, r0 a0009ef4: e1a01008 mov r1, r8 a0009ef8: e1a00004 mov r0, r4 a0009efc: eb002e57 bl a0015860 <__umodsi3> a0009f00: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; a0009f04: e0846005 add r6, r4, r5 a0009f08: e1a00006 mov r0, r6 a0009f0c: e1a0100b mov r1, fp a0009f10: eb002e52 bl a0015860 <__umodsi3> a0009f14: e0600006 rsb r0, r0, r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { a0009f18: e1560000 cmp r6, r0 a0009f1c: 93a03000 movls r3, #0 a0009f20: 83a03001 movhi r3, #1 a0009f24: e1540000 cmp r4, r0 a0009f28: 23a03000 movcs r3, #0 a0009f2c: e3530000 cmp r3, #0 a0009f30: 1affffec bne a0009ee8 <_Heap_Allocate_aligned_with_boundary+0x138> a0009f34: e59d6018 ldr r6, [sp, #24] boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { a0009f38: e59d2008 ldr r2, [sp, #8] a0009f3c: e1520004 cmp r2, r4 a0009f40: 8affffb4 bhi a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; a0009f44: e59d100c ldr r1, [sp, #12] a0009f48: e1a00004 mov r0, r4 a0009f4c: eb002e43 bl a0015860 <__umodsi3> a0009f50: e3e09007 mvn r9, #7 a0009f54: e06a9009 rsb r9, sl, r9 if ( free_size >= min_block_size || free_size == 0 ) { a0009f58: e59d1004 ldr r1, [sp, #4] /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; a0009f5c: e0899004 add r9, r9, r4 if ( free_size >= min_block_size || free_size == 0 ) { a0009f60: e0603009 rsb r3, r0, r9 a0009f64: e1590000 cmp r9, r0 a0009f68: 11510003 cmpne r1, r3 a0009f6c: 8affffa9 bhi a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> boundary ); } } if ( alloc_begin != 0 ) { a0009f70: e3540000 cmp r4, #0 a0009f74: 0affffa7 beq a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; a0009f78: e597204c ldr r2, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); a0009f7c: e1a0100a mov r1, sl a0009f80: e1a03005 mov r3, r5 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; a0009f84: e0822006 add r2, r2, r6 a0009f88: e587204c str r2, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); a0009f8c: e1a00007 mov r0, r7 a0009f90: e1a02004 mov r2, r4 a0009f94: ebffedb8 bl a000567c <_Heap_Block_allocate> a0009f98: e1a00004 mov r0, r4 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; a0009f9c: e5973044 ldr r3, [r7, #68] ; 0x44 a0009fa0: e1530006 cmp r3, r6 ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; a0009fa4: 35876044 strcc r6, [r7, #68] ; 0x44 a0009fa8: ea000002 b a0009fb8 <_Heap_Allocate_aligned_with_boundary+0x208> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { a0009fac: e1550003 cmp r5, r3 a0009fb0: 9a000006 bls a0009fd0 <_Heap_Allocate_aligned_with_boundary+0x220> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; a0009fb4: e3a00000 mov r0, #0 } return (void *) alloc_begin; } a0009fb8: e28dd01c add sp, sp, #28 a0009fbc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { a0009fc0: e3a00000 mov r0, #0 a0009fc4: eafffff4 b a0009f9c <_Heap_Allocate_aligned_with_boundary+0x1ec> a0009fc8: e59d6018 ldr r6, [sp, #24] <== NOT EXECUTED a0009fcc: eaffff91 b a0009e18 <_Heap_Allocate_aligned_with_boundary+0x68> <== NOT EXECUTED if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { a0009fd0: e3580000 cmp r8, #0 a0009fd4: 01a08002 moveq r8, r2 a0009fd8: eaffff82 b a0009de8 <_Heap_Allocate_aligned_with_boundary+0x38> a000f11c <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { a000f11c: e92d41f0 push {r4, r5, r6, r7, r8, lr} Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; a000f120: e590c01c ldr ip, [r0, #28] Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { a000f124: e1a04000 mov r4, r0 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; a000f128: e5900018 ldr r0, [r0, #24] a000f12c: e151000c cmp r1, ip a000f130: 23a05000 movcs r5, #0 a000f134: 33a05001 movcc r5, #1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { a000f138: e1a07003 mov r7, r3 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; a000f13c: e1510000 cmp r1, r0 a000f140: 33a05000 movcc r5, #0 a000f144: e3550000 cmp r5, #0 uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; a000f148: e5946024 ldr r6, [r4, #36] ; 0x24 uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; a000f14c: 1a000012 bne a000f19c <_Heap_Extend+0x80> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { a000f150: e151000c cmp r1, ip a000f154: 0a000001 beq a000f160 <_Heap_Extend+0x44> a000f158: e3a00002 mov r0, #2 a000f15c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end a000f160: e3e08007 mvn r8, #7 { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; a000f164: e0811002 add r1, r1, r2 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end a000f168: e0668008 rsb r8, r6, r8 a000f16c: e0888001 add r8, r8, r1 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; a000f170: e584101c str r1, [r4, #28] RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); a000f174: e1a00008 mov r0, r8 a000f178: e5941010 ldr r1, [r4, #16] a000f17c: ebffcfec bl a0003134 <__umodsi3> a000f180: e0600008 rsb r0, r0, r8 extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; a000f184: e5870000 str r0, [r7] if( extend_size >= heap->min_block_size ) { a000f188: e5943014 ldr r3, [r4, #20] a000f18c: e1530000 cmp r3, r0 a000f190: 9a000003 bls a000f1a4 <_Heap_Extend+0x88> a000f194: e1a00005 mov r0, r5 <== NOT EXECUTED a000f198: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; a000f19c: e3a00001 mov r0, #1 a000f1a0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; a000f1a4: e5961004 ldr r1, [r6, #4] if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = a000f1a8: e5942020 ldr r2, [r4, #32] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); a000f1ac: e0803006 add r3, r0, r6 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; a000f1b0: e2011001 and r1, r1, #1 a000f1b4: e0632002 rsb r2, r3, r2 a000f1b8: e1801001 orr r1, r0, r1 a000f1bc: e3822001 orr r2, r2, #1 a000f1c0: e5861004 str r1, [r6, #4] a000f1c4: e5832004 str r2, [r3, #4] | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; a000f1c8: e594802c ldr r8, [r4, #44] ; 0x2c ++stats->used_blocks; a000f1cc: e5941040 ldr r1, [r4, #64] ; 0x40 --stats->frees; /* Do not count subsequent call as actual free() */ a000f1d0: e5942050 ldr r2, [r4, #80] ; 0x50 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; a000f1d4: e0880000 add r0, r8, r0 ++stats->used_blocks; a000f1d8: e2811001 add r1, r1, #1 --stats->frees; /* Do not count subsequent call as actual free() */ a000f1dc: e2422001 sub r2, r2, #1 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; a000f1e0: e584002c str r0, [r4, #44] ; 0x2c ++stats->used_blocks; a000f1e4: e5841040 str r1, [r4, #64] ; 0x40 new_last_block->size_and_flag = ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; a000f1e8: e5843024 str r3, [r4, #36] ; 0x24 /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ a000f1ec: e5842050 str r2, [r4, #80] ; 0x50 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); a000f1f0: e1a00004 mov r0, r4 a000f1f4: e2861008 add r1, r6, #8 a000f1f8: ebffead1 bl a0009d44 <_Heap_Free> a000f1fc: e1a00005 mov r0, r5 } return HEAP_EXTEND_SUCCESSFUL; } a000f200: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} a00063fc <_Heap_Walk>: Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { a00063fc: e59f357c ldr r3, [pc, #1404] ; a0006980 <_Heap_Walk+0x584> bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { a0006400: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; a0006404: e31200ff tst r2, #255 ; 0xff if ( !_System_state_Is_up( _System_state_Get() ) ) { a0006408: e5933000 ldr r3, [r3] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; a000640c: e59f2570 ldr r2, [pc, #1392] ; a0006984 <_Heap_Walk+0x588> a0006410: e59fa570 ldr sl, [pc, #1392] ; a0006988 <_Heap_Walk+0x58c> bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { a0006414: e24dd038 sub sp, sp, #56 ; 0x38 a0006418: e1a04000 mov r4, r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; a000641c: 01a0a002 moveq sl, r2 if ( !_System_state_Is_up( _System_state_Get() ) ) { a0006420: e3530003 cmp r3, #3 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; a0006424: e5902010 ldr r2, [r0, #16] uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; a0006428: e5903024 ldr r3, [r0, #36] ; 0x24 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { a000642c: e1a08001 mov r8, r1 uintptr_t const page_size = heap->page_size; a0006430: e58d2020 str r2, [sp, #32] uintptr_t const min_block_size = heap->min_block_size; a0006434: e590b014 ldr fp, [r0, #20] Heap_Block *const last_block = heap->last_block; a0006438: e58d3024 str r3, [sp, #36] ; 0x24 Heap_Block *block = heap->first_block; a000643c: e5905020 ldr r5, [r0, #32] Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { a0006440: 0a000002 beq a0006450 <_Heap_Walk+0x54> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { a0006444: e3a00001 mov r0, #1 block = next_block; } return true; } a0006448: e28dd038 add sp, sp, #56 ; 0x38 a000644c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( a0006450: e5900018 ldr r0, [r0, #24] a0006454: e594101c ldr r1, [r4, #28] a0006458: e5942008 ldr r2, [r4, #8] a000645c: e594300c ldr r3, [r4, #12] a0006460: e59dc024 ldr ip, [sp, #36] ; 0x24 a0006464: e98d0003 stmib sp, {r0, r1} a0006468: e58d2014 str r2, [sp, #20] a000646c: e58d3018 str r3, [sp, #24] a0006470: e59f2514 ldr r2, [pc, #1300] ; a000698c <_Heap_Walk+0x590> a0006474: e58db000 str fp, [sp] a0006478: e58d500c str r5, [sp, #12] a000647c: e58dc010 str ip, [sp, #16] a0006480: e1a00008 mov r0, r8 a0006484: e3a01000 mov r1, #0 a0006488: e59d3020 ldr r3, [sp, #32] a000648c: e12fff3a blx sl heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { a0006490: e59d2020 ldr r2, [sp, #32] a0006494: e3520000 cmp r2, #0 a0006498: 0a000030 beq a0006560 <_Heap_Walk+0x164> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { a000649c: e59d3020 ldr r3, [sp, #32] a00064a0: e2139003 ands r9, r3, #3 a00064a4: 1a000033 bne a0006578 <_Heap_Walk+0x17c> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { a00064a8: e1a0000b mov r0, fp a00064ac: e59d1020 ldr r1, [sp, #32] a00064b0: ebffe98b bl a0000ae4 <__umodsi3> a00064b4: e2506000 subs r6, r0, #0 a00064b8: 1a000034 bne a0006590 <_Heap_Walk+0x194> ); return false; } if ( a00064bc: e2850008 add r0, r5, #8 a00064c0: e59d1020 ldr r1, [sp, #32] a00064c4: ebffe986 bl a0000ae4 <__umodsi3> a00064c8: e2509000 subs r9, r0, #0 a00064cc: 1a000036 bne a00065ac <_Heap_Walk+0x1b0> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; a00064d0: e5957004 ldr r7, [r5, #4] ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { a00064d4: e2176001 ands r6, r7, #1 a00064d8: 0a00003a beq a00065c8 <_Heap_Walk+0x1cc> ); return false; } if ( first_block->prev_size != page_size ) { a00064dc: e5953000 ldr r3, [r5] a00064e0: e59dc020 ldr ip, [sp, #32] a00064e4: e15c0003 cmp ip, r3 a00064e8: 1a000015 bne a0006544 <_Heap_Walk+0x148> ); return false; } if ( _Heap_Is_free( last_block ) ) { a00064ec: e59d2024 ldr r2, [sp, #36] ; 0x24 a00064f0: e5923004 ldr r3, [r2, #4] a00064f4: e3c33001 bic r3, r3, #1 a00064f8: e0823003 add r3, r2, r3 a00064fc: e5939004 ldr r9, [r3, #4] a0006500: e2199001 ands r9, r9, #1 a0006504: 0a000101 beq a0006910 <_Heap_Walk+0x514> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; a0006508: e5949008 ldr r9, [r4, #8] int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; a000650c: e5943010 ldr r3, [r4, #16] const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { a0006510: e1540009 cmp r4, r9 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; a0006514: e58d3028 str r3, [sp, #40] ; 0x28 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { a0006518: 0a000065 beq a00066b4 <_Heap_Walk+0x2b8> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; a000651c: e594c020 ldr ip, [r4, #32] RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block a0006520: e15c0009 cmp ip, r9 a0006524: 9a00002d bls a00065e0 <_Heap_Walk+0x1e4> if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { (*printer)( a0006528: e1a00008 mov r0, r8 a000652c: e1a03009 mov r3, r9 a0006530: e3a01001 mov r1, #1 a0006534: e59f2454 ldr r2, [pc, #1108] ; a0006990 <_Heap_Walk+0x594> a0006538: e12fff3a blx sl a000653c: e3a00000 mov r0, #0 a0006540: eaffffc0 b a0006448 <_Heap_Walk+0x4c> return false; } if ( first_block->prev_size != page_size ) { (*printer)( a0006544: e1a00008 mov r0, r8 a0006548: e58dc000 str ip, [sp] a000654c: e3a01001 mov r1, #1 a0006550: e59f243c ldr r2, [pc, #1084] ; a0006994 <_Heap_Walk+0x598> a0006554: e12fff3a blx sl a0006558: e1a00009 mov r0, r9 a000655c: eaffffb9 b a0006448 <_Heap_Walk+0x4c> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); a0006560: e1a00008 mov r0, r8 a0006564: e3a01001 mov r1, #1 a0006568: e59f2428 ldr r2, [pc, #1064] ; a0006998 <_Heap_Walk+0x59c> a000656c: e12fff3a blx sl a0006570: e59d0020 ldr r0, [sp, #32] a0006574: eaffffb3 b a0006448 <_Heap_Walk+0x4c> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( a0006578: e1a00008 mov r0, r8 a000657c: e3a01001 mov r1, #1 a0006580: e59f2414 ldr r2, [pc, #1044] ; a000699c <_Heap_Walk+0x5a0> a0006584: e12fff3a blx sl a0006588: e3a00000 mov r0, #0 a000658c: eaffffad b a0006448 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( a0006590: e1a00008 mov r0, r8 a0006594: e1a0300b mov r3, fp a0006598: e3a01001 mov r1, #1 a000659c: e59f23fc ldr r2, [pc, #1020] ; a00069a0 <_Heap_Walk+0x5a4> a00065a0: e12fff3a blx sl a00065a4: e1a00009 mov r0, r9 a00065a8: eaffffa6 b a0006448 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( a00065ac: e1a00008 mov r0, r8 a00065b0: e1a03005 mov r3, r5 a00065b4: e3a01001 mov r1, #1 a00065b8: e59f23e4 ldr r2, [pc, #996] ; a00069a4 <_Heap_Walk+0x5a8> a00065bc: e12fff3a blx sl a00065c0: e1a00006 mov r0, r6 a00065c4: eaffff9f b a0006448 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( a00065c8: e1a00008 mov r0, r8 a00065cc: e3a01001 mov r1, #1 a00065d0: e59f23d0 ldr r2, [pc, #976] ; a00069a8 <_Heap_Walk+0x5ac> a00065d4: e12fff3a blx sl a00065d8: e1a00006 mov r0, r6 a00065dc: eaffff99 b a0006448 <_Heap_Walk+0x4c> && (uintptr_t) block <= (uintptr_t) heap->last_block; a00065e0: e5942024 ldr r2, [r4, #36] ; 0x24 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block a00065e4: e1520009 cmp r2, r9 && (uintptr_t) block <= (uintptr_t) heap->last_block; a00065e8: e58d202c str r2, [sp, #44] ; 0x2c RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block a00065ec: 3affffcd bcc a0006528 <_Heap_Walk+0x12c> ); return false; } if ( a00065f0: e2890008 add r0, r9, #8 a00065f4: e1a01003 mov r1, r3 a00065f8: e58dc01c str ip, [sp, #28] a00065fc: ebffe938 bl a0000ae4 <__umodsi3> a0006600: e3500000 cmp r0, #0 a0006604: e59dc01c ldr ip, [sp, #28] a0006608: 1a0000c6 bne a0006928 <_Heap_Walk+0x52c> ); return false; } if ( _Heap_Is_used( free_block ) ) { a000660c: e5993004 ldr r3, [r9, #4] a0006610: e3c33001 bic r3, r3, #1 a0006614: e0893003 add r3, r9, r3 a0006618: e5933004 ldr r3, [r3, #4] a000661c: e3130001 tst r3, #1 a0006620: 1a0000cf bne a0006964 <_Heap_Walk+0x568> ); return false; } if ( free_block->prev != prev_block ) { a0006624: e599200c ldr r2, [r9, #12] a0006628: e1540002 cmp r4, r2 a000662c: 1a0000c4 bne a0006944 <_Heap_Walk+0x548> a0006630: e58d7030 str r7, [sp, #48] ; 0x30 a0006634: e58db034 str fp, [sp, #52] ; 0x34 a0006638: e59d702c ldr r7, [sp, #44] ; 0x2c a000663c: e59db028 ldr fp, [sp, #40] ; 0x28 a0006640: e58d502c str r5, [sp, #44] ; 0x2c a0006644: e58d6028 str r6, [sp, #40] ; 0x28 a0006648: e1a0600c mov r6, ip a000664c: ea000011 b a0006698 <_Heap_Walk+0x29c> a0006650: e1590006 cmp r9, r6 a0006654: 3affffb3 bcc a0006528 <_Heap_Walk+0x12c> a0006658: e1570009 cmp r7, r9 ); return false; } if ( a000665c: e2890008 add r0, r9, #8 a0006660: e1a0100b mov r1, fp a0006664: 3affffaf bcc a0006528 <_Heap_Walk+0x12c> a0006668: ebffe91d bl a0000ae4 <__umodsi3> a000666c: e3500000 cmp r0, #0 a0006670: 1a0000ac bne a0006928 <_Heap_Walk+0x52c> ); return false; } if ( _Heap_Is_used( free_block ) ) { a0006674: e5993004 ldr r3, [r9, #4] a0006678: e3c33001 bic r3, r3, #1 a000667c: e0833009 add r3, r3, r9 a0006680: e5933004 ldr r3, [r3, #4] a0006684: e3130001 tst r3, #1 a0006688: 1a0000b5 bne a0006964 <_Heap_Walk+0x568> ); return false; } if ( free_block->prev != prev_block ) { a000668c: e599200c ldr r2, [r9, #12] a0006690: e1520005 cmp r2, r5 a0006694: 1a0000aa bne a0006944 <_Heap_Walk+0x548> (*printer)( a0006698: e1a05009 mov r5, r9 return false; } prev_block = free_block; free_block = free_block->next; a000669c: e5999008 ldr r9, [r9, #8] const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { a00066a0: e1540009 cmp r4, r9 a00066a4: 1affffe9 bne a0006650 <_Heap_Walk+0x254> a00066a8: e28d502c add r5, sp, #44 ; 0x2c a00066ac: e89508a0 ldm r5, {r5, r7, fp} a00066b0: e59d6028 ldr r6, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { a00066b4: e59d3024 ldr r3, [sp, #36] ; 0x24 a00066b8: e1530005 cmp r3, r5 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), a00066bc: 158db028 strne fp, [sp, #40] ; 0x28 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { a00066c0: 0affff5f beq a0006444 <_Heap_Walk+0x48> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; a00066c4: e3c77001 bic r7, r7, #1 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { a00066c8: e21610ff ands r1, r6, #255 ; 0xff RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); a00066cc: e0876005 add r6, r7, r5 a00066d0: 0a000010 beq a0006718 <_Heap_Walk+0x31c> (*printer)( a00066d4: e1a03005 mov r3, r5 a00066d8: e58d7000 str r7, [sp] a00066dc: e1a00008 mov r0, r8 a00066e0: e3a01000 mov r1, #0 a00066e4: e59f22c0 ldr r2, [pc, #704] ; a00069ac <_Heap_Walk+0x5b0> a00066e8: e12fff3a blx sl RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block a00066ec: e5943020 ldr r3, [r4, #32] a00066f0: e1530006 cmp r3, r6 a00066f4: 9a000011 bls a0006740 <_Heap_Walk+0x344> block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( a00066f8: e1a00008 mov r0, r8 a00066fc: e58d6000 str r6, [sp] a0006700: e1a03005 mov r3, r5 a0006704: e3a01001 mov r1, #1 a0006708: e59f22a0 ldr r2, [pc, #672] ; a00069b0 <_Heap_Walk+0x5b4> a000670c: e12fff3a blx sl a0006710: e3a00000 mov r0, #0 "block 0x%08x: next block 0x%08x not in heap\n", block, next_block ); return false; a0006714: eaffff4b b a0006448 <_Heap_Walk+0x4c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( a0006718: e58d7000 str r7, [sp] a000671c: e5953000 ldr r3, [r5] a0006720: e1a00008 mov r0, r8 a0006724: e59f2288 ldr r2, [pc, #648] ; a00069b4 <_Heap_Walk+0x5b8> a0006728: e58d3004 str r3, [sp, #4] a000672c: e1a03005 mov r3, r5 a0006730: e12fff3a blx sl a0006734: e5943020 ldr r3, [r4, #32] a0006738: e1530006 cmp r3, r6 a000673c: 8affffed bhi a00066f8 <_Heap_Walk+0x2fc> a0006740: e5943024 ldr r3, [r4, #36] ; 0x24 a0006744: e1530006 cmp r3, r6 a0006748: 3affffea bcc a00066f8 <_Heap_Walk+0x2fc> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { a000674c: e1a00007 mov r0, r7 a0006750: e59d1020 ldr r1, [sp, #32] a0006754: ebffe8e2 bl a0000ae4 <__umodsi3> a0006758: e2509000 subs r9, r0, #0 a000675c: 1a000051 bne a00068a8 <_Heap_Walk+0x4ac> ); return false; } if ( block_size < min_block_size ) { a0006760: e59d3028 ldr r3, [sp, #40] ; 0x28 a0006764: e1530007 cmp r3, r7 a0006768: 8a000056 bhi a00068c8 <_Heap_Walk+0x4cc> ); return false; } if ( next_block_begin <= block_begin ) { a000676c: e1550006 cmp r5, r6 a0006770: 2a00005e bcs a00068f0 <_Heap_Walk+0x4f4> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { a0006774: e5963004 ldr r3, [r6, #4] a0006778: e3130001 tst r3, #1 a000677c: 1a000034 bne a0006854 <_Heap_Walk+0x458> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; a0006780: e595b004 ldr fp, [r5, #4] Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( a0006784: e595200c ldr r2, [r5, #12] return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; a0006788: e5943008 ldr r3, [r4, #8] - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; a000678c: e3cb7001 bic r7, fp, #1 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; a0006790: e594100c ldr r1, [r4, #12] return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; a0006794: e1530002 cmp r3, r2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); a0006798: e0859007 add r9, r5, r7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; a000679c: 059f0214 ldreq r0, [pc, #532] ; a00069b8 <_Heap_Walk+0x5bc> a00067a0: 0a000003 beq a00067b4 <_Heap_Walk+0x3b8> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), a00067a4: e59fc210 ldr ip, [pc, #528] ; a00069bc <_Heap_Walk+0x5c0> a00067a8: e1520004 cmp r2, r4 a00067ac: e59f020c ldr r0, [pc, #524] ; a00069c0 <_Heap_Walk+0x5c4> a00067b0: 11a0000c movne r0, ip Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( a00067b4: e5953008 ldr r3, [r5, #8] a00067b8: e1510003 cmp r1, r3 a00067bc: 059f1200 ldreq r1, [pc, #512] ; a00069c4 <_Heap_Walk+0x5c8> a00067c0: 0a000003 beq a00067d4 <_Heap_Walk+0x3d8> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") a00067c4: e59fc1f0 ldr ip, [pc, #496] ; a00069bc <_Heap_Walk+0x5c0> a00067c8: e1530004 cmp r3, r4 a00067cc: e59f11f4 ldr r1, [pc, #500] ; a00069c8 <_Heap_Walk+0x5cc> a00067d0: 11a0100c movne r1, ip Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( a00067d4: e58d2000 str r2, [sp] a00067d8: e98d0009 stmib sp, {r0, r3} a00067dc: e58d100c str r1, [sp, #12] a00067e0: e1a03005 mov r3, r5 a00067e4: e1a00008 mov r0, r8 a00067e8: e3a01000 mov r1, #0 a00067ec: e59f21d8 ldr r2, [pc, #472] ; a00069cc <_Heap_Walk+0x5d0> a00067f0: e12fff3a blx sl block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { a00067f4: e5993000 ldr r3, [r9] a00067f8: e1570003 cmp r7, r3 a00067fc: 0a000009 beq a0006828 <_Heap_Walk+0x42c> (*printer)( a0006800: e58d3004 str r3, [sp, #4] a0006804: e1a00008 mov r0, r8 a0006808: e58d7000 str r7, [sp] a000680c: e58d9008 str r9, [sp, #8] a0006810: e1a03005 mov r3, r5 a0006814: e3a01001 mov r1, #1 a0006818: e59f21b0 ldr r2, [pc, #432] ; a00069d0 <_Heap_Walk+0x5d4> a000681c: e12fff3a blx sl a0006820: e3a00000 mov r0, #0 a0006824: eaffff07 b a0006448 <_Heap_Walk+0x4c> ); return false; } if ( !prev_used ) { a0006828: e21b9001 ands r9, fp, #1 a000682c: 0a000016 beq a000688c <_Heap_Walk+0x490> a0006830: e5943008 ldr r3, [r4, #8] ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { a0006834: e1530004 cmp r3, r4 a0006838: 1a000003 bne a000684c <_Heap_Walk+0x450> a000683c: ea00000b b a0006870 <_Heap_Walk+0x474> <== NOT EXECUTED if ( free_block == block ) { return true; } free_block = free_block->next; a0006840: e5933008 ldr r3, [r3, #8] ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { a0006844: e1530004 cmp r3, r4 a0006848: 0a000008 beq a0006870 <_Heap_Walk+0x474> if ( free_block == block ) { a000684c: e1530005 cmp r3, r5 a0006850: 1afffffa bne a0006840 <_Heap_Walk+0x444> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { a0006854: e59d2024 ldr r2, [sp, #36] ; 0x24 a0006858: e1520006 cmp r2, r6 a000685c: 0afffef8 beq a0006444 <_Heap_Walk+0x48> const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { a0006860: e5967004 ldr r7, [r6, #4] a0006864: e1a05006 mov r5, r6 a0006868: e2076001 and r6, r7, #1 a000686c: eaffff94 b a00066c4 <_Heap_Walk+0x2c8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( a0006870: e1a00008 mov r0, r8 a0006874: e1a03005 mov r3, r5 a0006878: e3a01001 mov r1, #1 a000687c: e59f2150 ldr r2, [pc, #336] ; a00069d4 <_Heap_Walk+0x5d8> a0006880: e12fff3a blx sl a0006884: e3a00000 mov r0, #0 a0006888: eafffeee b a0006448 <_Heap_Walk+0x4c> return false; } if ( !prev_used ) { (*printer)( a000688c: e1a00008 mov r0, r8 a0006890: e1a03005 mov r3, r5 a0006894: e3a01001 mov r1, #1 a0006898: e59f2138 ldr r2, [pc, #312] ; a00069d8 <_Heap_Walk+0x5dc> a000689c: e12fff3a blx sl a00068a0: e1a00009 mov r0, r9 a00068a4: eafffee7 b a0006448 <_Heap_Walk+0x4c> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( a00068a8: e1a00008 mov r0, r8 a00068ac: e58d7000 str r7, [sp] a00068b0: e1a03005 mov r3, r5 a00068b4: e3a01001 mov r1, #1 a00068b8: e59f211c ldr r2, [pc, #284] ; a00069dc <_Heap_Walk+0x5e0> a00068bc: e12fff3a blx sl a00068c0: e3a00000 mov r0, #0 "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; a00068c4: eafffedf b a0006448 <_Heap_Walk+0x4c> } if ( block_size < min_block_size ) { (*printer)( a00068c8: e58d3004 str r3, [sp, #4] a00068cc: e1a00008 mov r0, r8 a00068d0: e1a0b003 mov fp, r3 a00068d4: e58d7000 str r7, [sp] a00068d8: e1a03005 mov r3, r5 a00068dc: e3a01001 mov r1, #1 a00068e0: e59f20f8 ldr r2, [pc, #248] ; a00069e0 <_Heap_Walk+0x5e4> a00068e4: e12fff3a blx sl a00068e8: e1a00009 mov r0, r9 block, block_size, min_block_size ); return false; a00068ec: eafffed5 b a0006448 <_Heap_Walk+0x4c> } if ( next_block_begin <= block_begin ) { (*printer)( a00068f0: e1a00008 mov r0, r8 a00068f4: e58d6000 str r6, [sp] a00068f8: e1a03005 mov r3, r5 a00068fc: e3a01001 mov r1, #1 a0006900: e59f20dc ldr r2, [pc, #220] ; a00069e4 <_Heap_Walk+0x5e8> a0006904: e12fff3a blx sl a0006908: e1a00009 mov r0, r9 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; a000690c: eafffecd b a0006448 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( a0006910: e1a00008 mov r0, r8 a0006914: e3a01001 mov r1, #1 a0006918: e59f20c8 ldr r2, [pc, #200] ; a00069e8 <_Heap_Walk+0x5ec> a000691c: e12fff3a blx sl a0006920: e1a00009 mov r0, r9 a0006924: eafffec7 b a0006448 <_Heap_Walk+0x4c> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( a0006928: e1a00008 mov r0, r8 a000692c: e1a03009 mov r3, r9 a0006930: e3a01001 mov r1, #1 a0006934: e59f20b0 ldr r2, [pc, #176] ; a00069ec <_Heap_Walk+0x5f0> a0006938: e12fff3a blx sl a000693c: e3a00000 mov r0, #0 a0006940: eafffec0 b a0006448 <_Heap_Walk+0x4c> return false; } if ( free_block->prev != prev_block ) { (*printer)( a0006944: e58d2000 str r2, [sp] a0006948: e1a00008 mov r0, r8 a000694c: e1a03009 mov r3, r9 a0006950: e3a01001 mov r1, #1 a0006954: e59f2094 ldr r2, [pc, #148] ; a00069f0 <_Heap_Walk+0x5f4> a0006958: e12fff3a blx sl a000695c: e3a00000 mov r0, #0 a0006960: eafffeb8 b a0006448 <_Heap_Walk+0x4c> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( a0006964: e1a00008 mov r0, r8 a0006968: e1a03009 mov r3, r9 a000696c: e3a01001 mov r1, #1 a0006970: e59f207c ldr r2, [pc, #124] ; a00069f4 <_Heap_Walk+0x5f8> a0006974: e12fff3a blx sl a0006978: e3a00000 mov r0, #0 a000697c: eafffeb1 b a0006448 <_Heap_Walk+0x4c> a0006980: a001bb70 .word 0xa001bb70 a0006984: a00063f0 .word 0xa00063f0 a0006988: a00069f8 .word 0xa00069f8 a000698c: a0019bc8 .word 0xa0019bc8 a0006990: a0019d70 .word 0xa0019d70 a0006994: a0019d28 .word 0xa0019d28 a0006998: a0019c60 .word 0xa0019c60 a000699c: a0019c78 .word 0xa0019c78 a00069a0: a0019c98 .word 0xa0019c98 a00069a4: a0019cc0 .word 0xa0019cc0 a00069a8: a0019cf8 .word 0xa0019cf8 a00069ac: a0019e18 .word 0xa0019e18 a00069b0: a0019e58 .word 0xa0019e58 a00069b4: a0019e30 .word 0xa0019e30 a00069b8: a0019f20 .word 0xa0019f20 a00069bc: a0019b70 .word 0xa0019b70 a00069c0: a0019f30 .word 0xa0019f30 a00069c4: a0019f40 .word 0xa0019f40 a00069c8: a0019f50 .word 0xa0019f50 a00069cc: a0019f60 .word 0xa0019f60 a00069d0: a0019f90 .word 0xa0019f90 a00069d4: a001a000 .word 0xa001a000 a00069d8: a0019fd0 .word 0xa0019fd0 a00069dc: a0019e88 .word 0xa0019e88 a00069e0: a0019eb8 .word 0xa0019eb8 a00069e4: a0019ee8 .word 0xa0019ee8 a00069e8: a0019d58 .word 0xa0019d58 a00069ec: a0019d90 .word 0xa0019d90 a00069f0: a0019de0 .word 0xa0019de0 a00069f4: a0019dc0 .word 0xa0019dc0 a00058e4 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { a00058e4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) a00058e8: e5908034 ldr r8, [r0, #52] ; 0x34 */ void _Objects_Extend_information( Objects_Information *information ) { a00058ec: e24dd014 sub sp, sp, #20 a00058f0: e1a05000 mov r5, r0 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) a00058f4: e3580000 cmp r8, #0 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); a00058f8: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) a00058fc: 0a00009d beq a0005b78 <_Objects_Extend_information+0x294> block_count = 0; else { block_count = information->maximum / information->allocation_size; a0005900: e1d091b4 ldrh r9, [r0, #20] a0005904: e1d0a1b0 ldrh sl, [r0, #16] a0005908: e1a01009 mov r1, r9 a000590c: e1a0000a mov r0, sl a0005910: eb003f8e bl a0015750 <__aeabi_uidiv> a0005914: e1a03800 lsl r3, r0, #16 for ( ; block < block_count; block++ ) { a0005918: e1b03823 lsrs r3, r3, #16 a000591c: 01a01009 moveq r1, r9 a0005920: 01a06007 moveq r6, r7 a0005924: 01a04003 moveq r4, r3 a0005928: 0a00000f beq a000596c <_Objects_Extend_information+0x88> if ( information->object_blocks[ block ] == NULL ) a000592c: e5984000 ldr r4, [r8] a0005930: e3540000 cmp r4, #0 a0005934: 11a01009 movne r1, r9 a0005938: 11a06007 movne r6, r7 a000593c: 13a04000 movne r4, #0 a0005940: 01a01009 moveq r1, r9 a0005944: 01a06007 moveq r6, r7 a0005948: 1a000003 bne a000595c <_Objects_Extend_information+0x78> a000594c: ea000006 b a000596c <_Objects_Extend_information+0x88> <== NOT EXECUTED a0005950: e7982104 ldr r2, [r8, r4, lsl #2] a0005954: e3520000 cmp r2, #0 a0005958: 0a000003 beq a000596c <_Objects_Extend_information+0x88> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { a000595c: e2844001 add r4, r4, #1 a0005960: e1530004 cmp r3, r4 if ( information->object_blocks[ block ] == NULL ) break; else index_base += information->allocation_size; a0005964: e0866009 add r6, r6, r9 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { a0005968: 8afffff8 bhi a0005950 <_Objects_Extend_information+0x6c> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; a000596c: e08aa001 add sl, sl, r1 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { a0005970: e35a0801 cmp sl, #65536 ; 0x10000 a0005974: 2a000065 bcs a0005b10 <_Objects_Extend_information+0x22c> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { a0005978: e5d50012 ldrb r0, [r5, #18] /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; a000597c: e5952018 ldr r2, [r5, #24] if ( information->auto_extend ) { a0005980: e3500000 cmp r0, #0 /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; a0005984: e0000192 mul r0, r2, r1 if ( information->auto_extend ) { a0005988: 1a000062 bne a0005b18 <_Objects_Extend_information+0x234> new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); a000598c: e58d3000 str r3, [sp] a0005990: eb0007f9 bl a000797c <_Workspace_Allocate_or_fatal_error> a0005994: e59d3000 ldr r3, [sp] a0005998: e1a09000 mov r9, r0 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { a000599c: e1d521b0 ldrh r2, [r5, #16] a00059a0: e1560002 cmp r6, r2 a00059a4: 3a000039 bcc a0005a90 <_Objects_Extend_information+0x1ac> */ /* * Up the block count and maximum */ block_count++; a00059a8: e283c001 add ip, r3, #1 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); a00059ac: e08c008c add r0, ip, ip, lsl #1 a00059b0: e08a0000 add r0, sl, r0 a00059b4: e0800007 add r0, r0, r7 a00059b8: e1a00100 lsl r0, r0, #2 a00059bc: e88d1008 stm sp, {r3, ip} a00059c0: eb0007f9 bl a00079ac <_Workspace_Allocate> if ( !object_blocks ) { a00059c4: e250b000 subs fp, r0, #0 a00059c8: e89d1008 ldm sp, {r3, ip} a00059cc: 0a00006f beq a0005b90 <_Objects_Extend_information+0x2ac> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { a00059d0: e1d521b0 ldrh r2, [r5, #16] RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); a00059d4: e08b818c add r8, fp, ip, lsl #3 a00059d8: e08bc10c add ip, fp, ip, lsl #2 a00059dc: e1570002 cmp r7, r2 a00059e0: 3a000052 bcc a0005b30 <_Objects_Extend_information+0x24c> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { a00059e4: e3570000 cmp r7, #0 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, a00059e8: 13a02000 movne r2, #0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; a00059ec: 11a01002 movne r1, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { a00059f0: 0a000003 beq a0005a04 <_Objects_Extend_information+0x120> local_table[ index ] = NULL; a00059f4: e7881102 str r1, [r8, r2, lsl #2] } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { a00059f8: e2822001 add r2, r2, #1 a00059fc: e1570002 cmp r7, r2 a0005a00: 8afffffb bhi a00059f4 <_Objects_Extend_information+0x110> a0005a04: e1a03103 lsl r3, r3, #2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); a0005a08: e1d511b4 ldrh r1, [r5, #20] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; a0005a0c: e3a00000 mov r0, #0 inactive_per_block[block_count] = 0; a0005a10: e78c0003 str r0, [ip, r3] for ( index=index_base ; index < ( information->allocation_size + index_base ); a0005a14: e0861001 add r1, r6, r1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; a0005a18: e1560001 cmp r6, r1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; a0005a1c: e78b0003 str r0, [fp, r3] inactive_per_block[block_count] = 0; for ( index=index_base ; a0005a20: 2a000005 bcs a0005a3c <_Objects_Extend_information+0x158> a0005a24: e0882106 add r2, r8, r6, lsl #2 a0005a28: e1a03006 mov r3, r6 index < ( information->allocation_size + index_base ); index++ ) { a0005a2c: e2833001 add r3, r3, #1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; a0005a30: e1530001 cmp r3, r1 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; a0005a34: e4820004 str r0, [r2], #4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; a0005a38: 3afffffb bcc a0005a2c <_Objects_Extend_information+0x148> a0005a3c: e10f3000 mrs r3, CPSR a0005a40: e3832080 orr r2, r3, #128 ; 0x80 a0005a44: e129f002 msr CPSR_fc, r2 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( a0005a48: e5952000 ldr r2, [r5] a0005a4c: e1d510b4 ldrh r1, [r5, #4] old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; a0005a50: e1a0a80a lsl sl, sl, #16 information->maximum_id = _Objects_Build_id( a0005a54: e1a02c02 lsl r2, r2, #24 a0005a58: e3822801 orr r2, r2, #65536 ; 0x10000 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; a0005a5c: e1a0a82a lsr sl, sl, #16 information->maximum_id = _Objects_Build_id( a0005a60: e1822d81 orr r2, r2, r1, lsl #27 a0005a64: e182200a orr r2, r2, sl local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; a0005a68: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; a0005a6c: e585c030 str ip, [r5, #48] ; 0x30 information->local_table = local_table; a0005a70: e585801c str r8, [r5, #28] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( a0005a74: e585200c str r2, [r5, #12] old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; a0005a78: e1c5a1b0 strh sl, [r5, #16] _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; a0005a7c: e585b034 str fp, [r5, #52] ; 0x34 static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0005a80: e129f003 msr CPSR_fc, r3 information->maximum ); _ISR_Enable( level ); if ( old_tables ) a0005a84: e3500000 cmp r0, #0 a0005a88: 0a000000 beq a0005a90 <_Objects_Extend_information+0x1ac> _Workspace_Free( old_tables ); a0005a8c: eb0007cc bl a00079c4 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; a0005a90: e5953034 ldr r3, [r5, #52] ; 0x34 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( a0005a94: e28d7008 add r7, sp, #8 a0005a98: e1a01009 mov r1, r9 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; a0005a9c: e7839104 str r9, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( a0005aa0: e1a00007 mov r0, r7 a0005aa4: e1d521b4 ldrh r2, [r5, #20] a0005aa8: e5953018 ldr r3, [r5, #24] a0005aac: eb00101f bl a0009b30 <_Chain_Initialize> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; a0005ab0: e1a04104 lsl r4, r4, #2 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); a0005ab4: e2858020 add r8, r5, #32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { a0005ab8: ea000008 b a0005ae0 <_Objects_Extend_information+0x1fc> the_object->id = _Objects_Build_id( a0005abc: e5952000 ldr r2, [r5] a0005ac0: e1d5c0b4 ldrh ip, [r5, #4] a0005ac4: e1a02c02 lsl r2, r2, #24 a0005ac8: e3822801 orr r2, r2, #65536 ; 0x10000 a0005acc: e1822d8c orr r2, r2, ip, lsl #27 a0005ad0: e1822006 orr r2, r2, r6 a0005ad4: e5832008 str r2, [r3, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); a0005ad8: ebfffd22 bl a0004f68 <_Chain_Append> index++; a0005adc: e2866001 add r6, r6, #1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { a0005ae0: e1a00007 mov r0, r7 a0005ae4: eb001004 bl a0009afc <_Chain_Get> a0005ae8: e2503000 subs r3, r0, #0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); a0005aec: e1a01003 mov r1, r3 a0005af0: e1a00008 mov r0, r8 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { a0005af4: 1afffff0 bne a0005abc <_Objects_Extend_information+0x1d8> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; a0005af8: e1d531b4 ldrh r3, [r5, #20] information->inactive = a0005afc: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; a0005b00: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = a0005b04: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; a0005b08: e7813004 str r3, [r1, r4] information->inactive = a0005b0c: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } a0005b10: e28dd014 add sp, sp, #20 a0005b14: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); a0005b18: e58d3000 str r3, [sp] a0005b1c: eb0007a2 bl a00079ac <_Workspace_Allocate> if ( !new_object_block ) a0005b20: e2509000 subs r9, r0, #0 a0005b24: e59d3000 ldr r3, [sp] a0005b28: 1affff9b bne a000599c <_Objects_Extend_information+0xb8> a0005b2c: eafffff7 b a0005b10 <_Objects_Extend_information+0x22c> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, a0005b30: e1a03103 lsl r3, r3, #2 a0005b34: e1a02003 mov r2, r3 a0005b38: e5951034 ldr r1, [r5, #52] ; 0x34 a0005b3c: e88d1008 stm sp, {r3, ip} a0005b40: eb001b9d bl a000c9bc information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, a0005b44: e89d1008 ldm sp, {r3, ip} a0005b48: e5951030 ldr r1, [r5, #48] ; 0x30 a0005b4c: e1a0000c mov r0, ip a0005b50: e1a02003 mov r2, r3 a0005b54: eb001b98 bl a000c9bc information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, a0005b58: e1d521b0 ldrh r2, [r5, #16] a0005b5c: e1a00008 mov r0, r8 a0005b60: e595101c ldr r1, [r5, #28] a0005b64: e0872002 add r2, r7, r2 a0005b68: e1a02102 lsl r2, r2, #2 a0005b6c: eb001b92 bl a000c9bc a0005b70: e89d1008 ldm sp, {r3, ip} a0005b74: eaffffa3 b a0005a08 <_Objects_Extend_information+0x124> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) a0005b78: e1a04008 mov r4, r8 a0005b7c: e1d0a1b0 ldrh sl, [r0, #16] a0005b80: e1d011b4 ldrh r1, [r0, #20] a0005b84: e1a06007 mov r6, r7 a0005b88: e1a03008 mov r3, r8 a0005b8c: eaffff76 b a000596c <_Objects_Extend_information+0x88> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); a0005b90: e1a00009 mov r0, r9 a0005b94: eb00078a bl a00079c4 <_Workspace_Free> return; a0005b98: eaffffdc b a0005b10 <_Objects_Extend_information+0x22c> a0006b50 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; a0006b50: e5913014 ldr r3, [r1, #20] Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { a0006b54: e92d05f0 push {r4, r5, r6, r7, r8, sl} */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); a0006b58: e281503c add r5, r1, #60 ; 0x3c a0006b5c: e5815038 str r5, [r1, #56] ; 0x38 the_chain->permanent_null = NULL; a0006b60: e3a05000 mov r5, #0 the_chain->last = _Chain_Head(the_chain); a0006b64: e281c038 add ip, r1, #56 ; 0x38 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 ) ) a0006b68: 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 ]; a0006b6c: 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; a0006b70: e581503c str r5, [r1, #60] ; 0x3c a0006b74: e3a0500c mov r5, #12 the_chain->last = _Chain_Head(the_chain); a0006b78: e581c040 str ip, [r1, #64] ; 0x40 block_state = the_thread_queue->state; a0006b7c: e5906038 ldr r6, [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 ]; a0006b80: e02c0495 mla ip, r5, r4, r0 a0006b84: 159fa17c ldrne sl, [pc, #380] ; a0006d08 <_Thread_queue_Enqueue_priority+0x1b8> block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) a0006b88: 1a00001c bne a0006c00 <_Thread_queue_Enqueue_priority+0xb0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; a0006b8c: e28ca004 add sl, ip, #4 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a0006b90: e10f8000 mrs r8, CPSR a0006b94: e3884080 orr r4, r8, #128 ; 0x80 a0006b98: 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; a0006b9c: e59c4000 ldr r4, [ip] while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { a0006ba0: e154000a cmp r4, sl a0006ba4: 1a000009 bne a0006bd0 <_Thread_queue_Enqueue_priority+0x80> a0006ba8: ea000053 b a0006cfc <_Thread_queue_Enqueue_priority+0x1ac> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( a0006bac: e10f7000 mrs r7, CPSR a0006bb0: e129f008 msr CPSR_fc, r8 a0006bb4: e129f007 msr CPSR_fc, r7 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) ) { a0006bb8: e5947010 ldr r7, [r4, #16] a0006bbc: e1160007 tst r6, r7 a0006bc0: 0a000034 beq a0006c98 <_Thread_queue_Enqueue_priority+0x148> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; a0006bc4: 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 ) ) { a0006bc8: e154000a cmp r4, sl a0006bcc: 0a000002 beq a0006bdc <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; a0006bd0: e5945014 ldr r5, [r4, #20] if ( priority <= search_priority ) a0006bd4: e1530005 cmp r3, r5 a0006bd8: 8afffff3 bhi a0006bac <_Thread_queue_Enqueue_priority+0x5c> 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 ) ) { a0006bdc: e1a06008 mov r6, r8 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != a0006be0: e590c030 ldr ip, [r0, #48] ; 0x30 a0006be4: e35c0001 cmp ip, #1 a0006be8: 0a00002c beq a0006ca0 <_Thread_queue_Enqueue_priority+0x150> * 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; a0006bec: e5826000 str r6, [r2] return the_thread_queue->sync_state; a0006bf0: e1a0000c mov r0, ip } a0006bf4: e8bd05f0 pop {r4, r5, r6, r7, r8, sl} a0006bf8: e12fff1e bx lr static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0006bfc: e129f008 msr CPSR_fc, r8 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; a0006c00: e5da5000 ldrb r5, [sl] a0006c04: e2855001 add r5, r5, #1 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a0006c08: e10f8000 mrs r8, CPSR a0006c0c: e3884080 orr r4, r8, #128 ; 0x80 a0006c10: e129f004 msr CPSR_fc, r4 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; a0006c14: e59c4008 ldr r4, [ip, #8] while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { a0006c18: e154000c cmp r4, ip a0006c1c: 1a000009 bne a0006c48 <_Thread_queue_Enqueue_priority+0xf8> a0006c20: ea00000b b a0006c54 <_Thread_queue_Enqueue_priority+0x104> static inline void arm_interrupt_flash( uint32_t level ) { uint32_t arm_switch_reg; asm volatile ( a0006c24: e10f7000 mrs r7, CPSR a0006c28: e129f008 msr CPSR_fc, r8 a0006c2c: e129f007 msr CPSR_fc, r7 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) ) { a0006c30: e5947010 ldr r7, [r4, #16] a0006c34: e1160007 tst r6, r7 a0006c38: 0affffef beq a0006bfc <_Thread_queue_Enqueue_priority+0xac> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) a0006c3c: 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 ) ) { a0006c40: e154000c cmp r4, ip a0006c44: 0a000002 beq a0006c54 <_Thread_queue_Enqueue_priority+0x104> search_priority = search_thread->current_priority; a0006c48: e5945014 ldr r5, [r4, #20] if ( priority >= search_priority ) a0006c4c: e1530005 cmp r3, r5 a0006c50: 3afffff3 bcc a0006c24 <_Thread_queue_Enqueue_priority+0xd4> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != a0006c54: e590c030 ldr ip, [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 ) ) { a0006c58: e1a06008 mov r6, r8 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != a0006c5c: e35c0001 cmp ip, #1 a0006c60: 1affffe1 bne a0006bec <_Thread_queue_Enqueue_priority+0x9c> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) a0006c64: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; a0006c68: e3a03000 mov r3, #0 a0006c6c: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) a0006c70: 0a000017 beq a0006cd4 <_Thread_queue_Enqueue_priority+0x184> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; a0006c74: e5943000 ldr r3, [r4] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; a0006c78: e5814004 str r4, [r1, #4] search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; a0006c7c: e5810044 str r0, [r1, #68] ; 0x44 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; a0006c80: e5813000 str r3, [r1] the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; a0006c84: e5831004 str r1, [r3, #4] 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; a0006c88: e5841000 str r1, [r4] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0006c8c: e129f008 msr CPSR_fc, r8 a0006c90: e3a00001 mov r0, #1 next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; a0006c94: eaffffd6 b a0006bf4 <_Thread_queue_Enqueue_priority+0xa4> a0006c98: e129f008 msr CPSR_fc, r8 <== NOT EXECUTED a0006c9c: eaffffbb b a0006b90 <_Thread_queue_Enqueue_priority+0x40> <== NOT EXECUTED THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) a0006ca0: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; a0006ca4: e3a03000 mov r3, #0 a0006ca8: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) a0006cac: 0a000008 beq a0006cd4 <_Thread_queue_Enqueue_priority+0x184> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; a0006cb0: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; a0006cb4: e5814000 str r4, [r1] the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; a0006cb8: e5810044 str r0, [r1, #68] ; 0x44 search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; a0006cbc: e5813004 str r3, [r1, #4] previous_node->next = the_node; a0006cc0: e5831000 str r1, [r3] search_node->previous = the_node; a0006cc4: e5841004 str r1, [r4, #4] a0006cc8: e129f008 msr CPSR_fc, r8 a0006ccc: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; a0006cd0: eaffffc7 b a0006bf4 <_Thread_queue_Enqueue_priority+0xa4> a0006cd4: 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; a0006cd8: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; a0006cdc: e5814000 str r4, [r1] the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; a0006ce0: e5810044 str r0, [r1, #68] ; 0x44 search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; a0006ce4: e5813004 str r3, [r1, #4] previous_node->next = the_node; a0006ce8: e5831000 str r1, [r3] search_node->previous = the_node; a0006cec: e5841004 str r1, [r4, #4] a0006cf0: e129f006 msr CPSR_fc, r6 a0006cf4: e3a00001 mov r0, #1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; a0006cf8: eaffffbd b a0006bf4 <_Thread_queue_Enqueue_priority+0xa4> 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 ) ) { a0006cfc: e1a06008 mov r6, r8 a0006d00: e3e05000 mvn r5, #0 a0006d04: eaffffb5 b a0006be0 <_Thread_queue_Enqueue_priority+0x90> a0006d08: a0017960 .word 0xa0017960 a001532c <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { a001532c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a0015330: e24dd024 sub sp, sp, #36 ; 0x24 a0015334: e1a04000 mov r4, r0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; a0015338: e3a03000 mov r3, #0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; a001533c: e28d0018 add r0, sp, #24 a0015340: e28d700c add r7, sp, #12 a0015344: e59f91c8 ldr r9, [pc, #456] ; a0015514 <_Timer_server_Body+0x1e8> a0015348: e59fb1c8 ldr fp, [pc, #456] ; a0015518 <_Timer_server_Body+0x1ec> a001534c: e280a004 add sl, r0, #4 a0015350: e2872004 add r2, r7, #4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; a0015354: e58d301c str r3, [sp, #28] the_chain->last = _Chain_Head(the_chain); a0015358: e58d0020 str r0, [sp, #32] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; a001535c: e58d3010 str r3, [sp, #16] static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); a0015360: e2840040 add r0, r4, #64 ; 0x40 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); a0015364: e2843008 add r3, r4, #8 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; a0015368: e58d2000 str r2, [sp] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); a001536c: e58da018 str sl, [sp, #24] a0015370: e58d200c str r2, [sp, #12] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); a0015374: e58d7014 str r7, [sp, #20] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); a0015378: e2846030 add r6, r4, #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 ); a001537c: e2848068 add r8, r4, #104 ; 0x68 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); a0015380: e98d0009 stmib sp, {r0, r3} { /* * 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; a0015384: e28d2018 add r2, sp, #24 a0015388: 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; a001538c: e5993000 ldr r3, [r9] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; a0015390: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); a0015394: e1a00006 mov r0, r6 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; a0015398: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); a001539c: e0611003 rsb r1, r1, r3 a00153a0: e1a02007 mov r2, r7 a00153a4: eb001093 bl a00195f8 <_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(); a00153a8: e59b5000 ldr r5, [fp] Watchdog_Interval last_snapshot = watchdogs->last_snapshot; a00153ac: e5941074 ldr r1, [r4, #116] ; 0x74 /* * 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 ) { a00153b0: e1550001 cmp r5, r1 a00153b4: 8a000022 bhi a0015444 <_Timer_server_Body+0x118> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { a00153b8: 3a000018 bcc a0015420 <_Timer_server_Body+0xf4> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; a00153bc: e5845074 str r5, [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 ); a00153c0: e5940078 ldr r0, [r4, #120] ; 0x78 a00153c4: eb00024a bl a0015cf4 <_Chain_Get> if ( timer == NULL ) { a00153c8: e3500000 cmp r0, #0 a00153cc: 0a00000b beq a0015400 <_Timer_server_Body+0xd4> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { a00153d0: e5903038 ldr r3, [r0, #56] ; 0x38 a00153d4: e3530001 cmp r3, #1 a00153d8: 0a000015 beq a0015434 <_Timer_server_Body+0x108> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { a00153dc: e3530003 cmp r3, #3 a00153e0: 1afffff6 bne a00153c0 <_Timer_server_Body+0x94> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); a00153e4: e2801010 add r1, r0, #16 a00153e8: e1a00008 mov r0, r8 a00153ec: eb0010b0 bl a00196b4 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); a00153f0: e5940078 ldr r0, [r4, #120] ; 0x78 a00153f4: eb00023e bl a0015cf4 <_Chain_Get> if ( timer == NULL ) { a00153f8: e3500000 cmp r0, #0 a00153fc: 1afffff3 bne a00153d0 <_Timer_server_Body+0xa4> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a0015400: e10f2000 mrs r2, CPSR a0015404: e3823080 orr r3, r2, #128 ; 0x80 a0015408: e129f003 msr CPSR_fc, r3 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { a001540c: e59d3018 ldr r3, [sp, #24] a0015410: e15a0003 cmp sl, r3 a0015414: 0a00000f beq a0015458 <_Timer_server_Body+0x12c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0015418: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED a001541c: eaffffda b a001538c <_Timer_server_Body+0x60> <== NOT EXECUTED /* * 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 ); a0015420: e0652001 rsb r2, r5, r1 a0015424: e1a00008 mov r0, r8 a0015428: e3a01001 mov r1, #1 a001542c: eb001042 bl a001953c <_Watchdog_Adjust> a0015430: eaffffe1 b a00153bc <_Timer_server_Body+0x90> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); a0015434: e2801010 add r1, r0, #16 a0015438: e1a00006 mov r0, r6 a001543c: eb00109c bl a00196b4 <_Watchdog_Insert> a0015440: eaffffde b a00153c0 <_Timer_server_Body+0x94> /* * 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 ); a0015444: e0611005 rsb r1, r1, r5 a0015448: e1a00008 mov r0, r8 a001544c: e1a02007 mov r2, r7 a0015450: eb001068 bl a00195f8 <_Watchdog_Adjust_to_chain> a0015454: eaffffd8 b a00153bc <_Timer_server_Body+0x90> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; a0015458: e5840078 str r0, [r4, #120] ; 0x78 a001545c: e129f002 msr CPSR_fc, r2 _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 ) ) { a0015460: e59d300c ldr r3, [sp, #12] a0015464: e59d0000 ldr r0, [sp] a0015468: e1500003 cmp r0, r3 a001546c: 159d5000 ldrne r5, [sp] a0015470: 1a00000a bne a00154a0 <_Timer_server_Body+0x174> a0015474: ea000011 b a00154c0 <_Timer_server_Body+0x194> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; a0015478: e5932000 ldr r2, [r3] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; a001547c: e3a00000 mov r0, #0 a0015480: e5830008 str r0, [r3, #8] the_chain->first = new_first; a0015484: e58d200c str r2, [sp, #12] new_first->previous = _Chain_Head(the_chain); a0015488: e5827004 str r7, [r2, #4] a001548c: e129f001 msr CPSR_fc, r1 /* * 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 ); a0015490: e5930020 ldr r0, [r3, #32] a0015494: e5931024 ldr r1, [r3, #36] ; 0x24 a0015498: e1a0e00f mov lr, pc a001549c: e593f01c ldr pc, [r3, #28] static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a00154a0: e10f1000 mrs r1, CPSR a00154a4: e3813080 orr r3, r1, #128 ; 0x80 a00154a8: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); a00154ac: e59d300c ldr r3, [sp, #12] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) a00154b0: e1550003 cmp r5, r3 a00154b4: 1affffef bne a0015478 <_Timer_server_Body+0x14c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a00154b8: e129f001 msr CPSR_fc, r1 a00154bc: eaffffb0 b a0015384 <_Timer_server_Body+0x58> a00154c0: e59f0054 ldr r0, [pc, #84] ; a001551c <_Timer_server_Body+0x1f0> } } else { ts->active = false; a00154c4: e3a02000 mov r2, #0 a00154c8: e5c4207c strb r2, [r4, #124] ; 0x7c a00154cc: e5903000 ldr r3, [r0] a00154d0: e2833001 add r3, r3, #1 a00154d4: e5803000 str r3, [r0] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); a00154d8: e3a01008 mov r1, #8 a00154dc: e5940000 ldr r0, [r4] a00154e0: eb000da7 bl a0018b84 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); a00154e4: e1a00004 mov r0, r4 a00154e8: ebffff63 bl a001527c <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); a00154ec: e1a00004 mov r0, r4 a00154f0: ebffff77 bl a00152d4 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); a00154f4: eb000af4 bl a00180cc <_Thread_Enable_dispatch> ts->active = true; a00154f8: e3a02001 mov r2, #1 a00154fc: e5c4207c strb r2, [r4, #124] ; 0x7c static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); a0015500: e59d0008 ldr r0, [sp, #8] a0015504: eb0010d7 bl a0019868 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); a0015508: e59d0004 ldr r0, [sp, #4] a001550c: eb0010d5 bl a0019868 <_Watchdog_Remove> a0015510: eaffff9b b a0015384 <_Timer_server_Body+0x58> a0015514: a003a404 .word 0xa003a404 a0015518: a003a334 .word 0xa003a334 a001551c: a003a2ac .word 0xa003a2ac a00095ac <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { a00095ac: e92d41f0 push {r4, r5, r6, r7, r8, lr} a00095b0: e1a04000 mov r4, r0 a00095b4: e1a05002 mov r5, r2 static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a00095b8: e10f3000 mrs r3, CPSR a00095bc: e3832080 orr r2, r3, #128 ; 0x80 a00095c0: e129f002 msr CPSR_fc, r2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); a00095c4: e1a07000 mov r7, r0 a00095c8: e4972004 ldr r2, [r7], #4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { a00095cc: e1520007 cmp r2, r7 a00095d0: 0a000018 beq a0009638 <_Watchdog_Adjust+0x8c> switch ( direction ) { a00095d4: e3510000 cmp r1, #0 a00095d8: 1a000018 bne a0009640 <_Watchdog_Adjust+0x94> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a00095dc: e3550000 cmp r5, #0 a00095e0: 0a000014 beq a0009638 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a00095e4: e5926010 ldr r6, [r2, #16] a00095e8: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a00095ec: 23a08001 movcs r8, #1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { a00095f0: 2a000005 bcs a000960c <_Watchdog_Adjust+0x60> a00095f4: ea000018 b a000965c <_Watchdog_Adjust+0xb0> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { a00095f8: e0555006 subs r5, r5, r6 a00095fc: 0a00000d beq a0009638 <_Watchdog_Adjust+0x8c> if ( units < _Watchdog_First( header )->delta_interval ) { a0009600: e5926010 ldr r6, [r2, #16] a0009604: e1560005 cmp r6, r5 a0009608: 8a000013 bhi a000965c <_Watchdog_Adjust+0xb0> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; a000960c: e5828010 str r8, [r2, #16] static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0009610: e129f003 msr CPSR_fc, r3 _ISR_Enable( level ); _Watchdog_Tickle( header ); a0009614: e1a00004 mov r0, r4 a0009618: eb0000aa bl a00098c8 <_Watchdog_Tickle> static inline uint32_t arm_interrupt_disable( void ) { uint32_t arm_switch_reg; uint32_t level; asm volatile ( a000961c: e10f3000 mrs r3, CPSR a0009620: e3832080 orr r2, r3, #128 ; 0x80 a0009624: e129f002 msr CPSR_fc, r2 a0009628: e5941000 ldr r1, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) a000962c: e1570001 cmp r7, r1 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); a0009630: e1a02001 mov r2, r1 a0009634: 1affffef bne a00095f8 <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { ARM_SWITCH_REGISTERS; asm volatile ( a0009638: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a000963c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { a0009640: e3510001 cmp r1, #1 a0009644: 1afffffb bne a0009638 <_Watchdog_Adjust+0x8c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; a0009648: e5921010 ldr r1, [r2, #16] a000964c: e0815005 add r5, r1, r5 a0009650: e5825010 str r5, [r2, #16] a0009654: e129f003 msr CPSR_fc, r3 } } _ISR_Enable( level ); } a0009658: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; a000965c: e0655006 rsb r5, r5, r6 a0009660: e5825010 str r5, [r2, #16] break; a0009664: eafffff3 b a0009638 <_Watchdog_Adjust+0x8c> a0006960 : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { a0006960: e92d4010 push {r4, lr} a0006964: e1a04000 mov r4, r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) a0006968: e59f0148 ldr r0, [pc, #328] ; a0006ab8 rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; a000696c: e59f3148 ldr r3, [pc, #328] ; a0006abc if ( rtems_interrupt_is_in_progress() ) a0006970: e5900000 ldr r0, [r0] a0006974: e3500000 cmp r0, #0 rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; a0006978: e5930000 ldr r0, [r3] if ( rtems_interrupt_is_in_progress() ) a000697c: 1a000032 bne a0006a4c return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) a0006980: e3520000 cmp r2, #0 a0006984: 0a000040 beq a0006a8c return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) a0006988: e3510000 cmp r1, #0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; a000698c: e5820000 str r0, [r2] if ( driver_table == NULL ) a0006990: 0a00003d beq a0006a8c static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a0006994: e591c000 ldr ip, [r1] a0006998: e35c0000 cmp ip, #0 a000699c: 0a000037 beq a0006a80 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) a00069a0: e1500004 cmp r0, r4 a00069a4: 9a000026 bls a0006a44 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; a00069a8: e59f0110 ldr r0, [pc, #272] ; a0006ac0 a00069ac: e590c000 ldr ip, [r0] a00069b0: e28cc001 add ip, ip, #1 a00069b4: e580c000 str ip, [r0] return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { a00069b8: e3540000 cmp r4, #0 a00069bc: 1a000024 bne a0006a54 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; a00069c0: e593c000 ldr ip, [r3] rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { a00069c4: e35c0000 cmp ip, #0 a00069c8: 0a000031 beq a0006a94 a00069cc: e59f30f0 ldr r3, [pc, #240] ; a0006ac4 a00069d0: e593e000 ldr lr, [r3] a00069d4: e1a0300e mov r3, lr a00069d8: ea000003 b a00069ec a00069dc: e2844001 add r4, r4, #1 a00069e0: e15c0004 cmp ip, r4 a00069e4: e2833018 add r3, r3, #24 a00069e8: 9a000005 bls a0006a04 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a00069ec: e5930000 ldr r0, [r3] a00069f0: e3500000 cmp r0, #0 a00069f4: 1afffff8 bne a00069dc a00069f8: e5930004 ldr r0, [r3, #4] a00069fc: e3500000 cmp r0, #0 a0006a00: 1afffff5 bne a00069dc } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) a0006a04: e15c0004 cmp ip, r4 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; a0006a08: e5824000 str r4, [r2] if ( m != n ) a0006a0c: 0a000021 beq a0006a98 a0006a10: e3a03018 mov r3, #24 a0006a14: e02ce493 mla ip, r3, r4, lr } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; a0006a18: e1a0e001 mov lr, r1 a0006a1c: e8be000f ldm lr!, {r0, r1, r2, r3} a0006a20: e8ac000f stmia ip!, {r0, r1, r2, r3} a0006a24: e89e0003 ldm lr, {r0, r1} a0006a28: e88c0003 stm ip, {r0, r1} _Thread_Enable_dispatch(); a0006a2c: eb000691 bl a0008478 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); a0006a30: e3a01000 mov r1, #0 a0006a34: e1a00004 mov r0, r4 a0006a38: e1a02001 mov r2, r1 } a0006a3c: e8bd4010 pop {r4, lr} _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); a0006a40: ea002184 b a000f058 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) a0006a44: e3a0000a mov r0, #10 a0006a48: e8bd8010 pop {r4, pc} rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) a0006a4c: e3a00012 mov r0, #18 a0006a50: e8bd8010 pop {r4, pc} _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; a0006a54: e3a00018 mov r0, #24 a0006a58: e0030490 mul r3, r0, r4 a0006a5c: e59f0060 ldr r0, [pc, #96] ; a0006ac4 a0006a60: e590c000 ldr ip, [r0] static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a0006a64: e79c0003 ldr r0, [ip, r3] _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; a0006a68: e08cc003 add ip, ip, r3 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a0006a6c: e3500000 cmp r0, #0 a0006a70: 0a00000b beq a0006aa4 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); a0006a74: eb00067f bl a0008478 <_Thread_Enable_dispatch> a0006a78: e3a0000c mov r0, #12 return RTEMS_RESOURCE_IN_USE; a0006a7c: e8bd8010 pop {r4, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a0006a80: e591c004 ldr ip, [r1, #4] a0006a84: e35c0000 cmp ip, #0 a0006a88: 1affffc4 bne a00069a0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); a0006a8c: e3a00009 mov r0, #9 } a0006a90: e8bd8010 pop {r4, pc} if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; a0006a94: e5824000 str r4, [r2] <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); a0006a98: eb000676 bl a0008478 <_Thread_Enable_dispatch> a0006a9c: e3a00005 mov r0, #5 return sc; a0006aa0: e8bd8010 pop {r4, pc} static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; a0006aa4: e59c3004 ldr r3, [ip, #4] a0006aa8: e3530000 cmp r3, #0 a0006aac: 1afffff0 bne a0006a74 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; a0006ab0: e5824000 str r4, [r2] a0006ab4: eaffffd7 b a0006a18 a0006ab8: a001f2dc .word 0xa001f2dc a0006abc: a001f4c4 .word 0xa001f4c4 a0006ac0: a001f24c .word 0xa001f24c a0006ac4: a001f4c8 .word 0xa001f4c8