=============================================================================== 0004af20 : * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); ticks = microseconds / microseconds_per_tick; 4af20: 41f9 0006 0b18 lea 60b18 ,%a0 #include uint32_t TOD_MICROSECONDS_TO_TICKS( uint32_t microseconds ) { 4af26: 4e56 0000 linkw %fp,#0 * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); ticks = microseconds / microseconds_per_tick; 4af2a: 202e 0008 movel %fp@(8),%d0 4af2e: 4c50 0001 remul %a0@,%d1,%d0 4af32: 4c50 0000 remul %a0@,%d0,%d0 if ( (microseconds % microseconds_per_tick) != 0 ) 4af36: 4a81 tstl %d1 4af38: 6702 beqs 4af3c <== ALWAYS TAKEN ticks += 1; 4af3a: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 4af3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046db0 : #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 46db0: 4e56 0000 linkw %fp,#0 /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); 46db4: 2039 0005 cde8 movel 5cde8 ,%d0 #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 46dba: 2f02 movel %d2,%sp@- /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); 46dbc: 243c 0000 03e8 movel #1000,%d2 46dc2: 4c42 0000 remul %d2,%d0,%d0 ticks = milliseconds / milliseconds_per_tick; 46dc6: 242e 0008 movel %fp@(8),%d2 46dca: 4c40 2001 remul %d0,%d1,%d2 46dce: 4c40 2002 remul %d0,%d2,%d2 46dd2: 2002 movel %d2,%d0 if ( (milliseconds % milliseconds_per_tick) != 0 ) 46dd4: 4a81 tstl %d1 46dd6: 6702 beqs 46dda <== ALWAYS TAKEN ticks += 1; 46dd8: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 46dda: 241f movel %sp@+,%d2 46ddc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004cd80 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4cd80: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4cd86: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4cd8a: 2279 0005 fa10 moveal 5fa10 <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4cd90: 48d7 001c moveml %d2-%d4,%sp@ 4cd94: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4cd98: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4cd9c: 242e 000c movel %fp@(12),%d2 4cda0: 262e 0014 movel %fp@(20),%d3 4cda4: 282e 0018 movel %fp@(24),%d4 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4cda8: 40c1 movew %sr,%d1 4cdaa: 8081 orl %d1,%d0 4cdac: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4cdae: 2028 0048 movel %a0@(72),%d0 4cdb2: 5280 addql #1,%d0 4cdb4: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4cdb8: 4aa8 0040 tstl %a0@(64) 4cdbc: 6626 bnes 4cde4 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 4cdbe: b0a8 0044 cmpl %a0@(68),%d0 4cdc2: 6620 bnes 4cde4 <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4cdc4: 7001 moveq #1,%d0 4cdc6: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4cdca: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4cdcc: 2d44 0010 movel %d4,%fp@(16) 4cdd0: 2d42 000c movel %d2,%fp@(12) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 4cdd4: 4cd7 001c moveml %sp@,%d2-%d4 if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4cdd8: 2d48 0008 movel %a0,%fp@(8) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 4cddc: 4e5e unlk %fp if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4cdde: 4ef9 0004 cd4c jmp 4cd4c <_CORE_barrier_Release> 4cde4: 7001 moveq #1,%d0 4cde6: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4cdea: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 4cdee: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 4cdf2: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4cdf4: 2d43 000c movel %d3,%fp@(12) 4cdf8: 203c 0004 9eac movel #302764,%d0 4cdfe: 2d48 0008 movel %a0,%fp@(8) } 4ce02: 4cd7 001c moveml %sp@,%d2-%d4 _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4ce06: 2d40 0010 movel %d0,%fp@(16) } 4ce0a: 4e5e unlk %fp _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4ce0c: 4ef9 0004 9bb4 jmp 49bb4 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 0004e140 <_CORE_message_queue_Seize>: CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4e140: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e146: 4e56 ffe4 linkw %fp,#-28 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4e14a: 2079 0006 62b4 moveal 662b4 <_Per_CPU_Information+0xc>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e150: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 4e154: 246e 0008 moveal %fp@(8),%a2 4e158: 282e 000c movel %fp@(12),%d4 4e15c: 242e 0010 movel %fp@(16),%d2 4e160: 226e 0014 moveal %fp@(20),%a1 4e164: 262e 001c movel %fp@(28),%d3 4e168: 1a2e 001b moveb %fp@(27),%d5 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e16c: 42a8 0034 clrl %a0@(52) _ISR_Disable( level ); 4e170: 40c0 movew %sr,%d0 4e172: 8280 orl %d0,%d1 4e174: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4e176: 220a movel %a2,%d1 4e178: 2c0a movel %a2,%d6 4e17a: 0681 0000 0050 addil #80,%d1 4e180: 0686 0000 0054 addil #84,%d6 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4e186: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 4e18a: bc8b cmpl %a3,%d6 4e18c: 674a beqs 4e1d8 <_CORE_message_queue_Seize+0x98> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 4e18e: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e190: 2141 0004 movel %d1,%a0@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; 4e194: 53aa 0048 subql #1,%a2@(72) Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 4e198: 2548 0050 movel %a0,%a2@(80) _ISR_Enable( level ); 4e19c: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; 4e19e: 22ab 0008 movel %a3@(8),%a1@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4e1a2: 45ea 0060 lea %a2@(96),%a2 _Thread_Executing->Wait.count = 4e1a6: 2079 0006 62b4 moveal 662b4 <_Per_CPU_Information+0xc>,%a0 4e1ac: 42a8 0024 clrl %a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e1b0: 2f11 movel %a1@,%sp@- 4e1b2: 486b 000c pea %a3@(12) 4e1b6: 2f02 movel %d2,%sp@- 4e1b8: 4eb9 0005 4810 jsr 54810 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4e1be: 4fef 000c lea %sp@(12),%sp 4e1c2: 2d4b 000c movel %a3,%fp@(12) 4e1c6: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e1ca: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 4e1d0: 4e5e unlk %fp 4e1d2: 4ef9 0004 dfb8 jmp 4dfb8 <_Chain_Append> return; } #endif } if ( !wait ) { 4e1d8: 4a05 tstb %d5 4e1da: 6612 bnes 4e1ee <_CORE_message_queue_Seize+0xae> _ISR_Enable( level ); 4e1dc: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e1de: 7004 moveq #4,%d0 executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e1e0: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e1e6: 2140 0034 movel %d0,%a0@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e1ea: 4e5e unlk %fp 4e1ec: 4e75 rts RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4e1ee: 7201 moveq #1,%d1 4e1f0: 2541 0030 movel %d1,%a2@(48) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4e1f4: 2142 002c movel %d2,%a0@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4e1f8: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; 4e1fc: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4e200: 2149 0028 movel %a1,%a0@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4e204: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e206: 2d43 000c movel %d3,%fp@(12) 4e20a: 203c 0005 032c movel #328492,%d0 4e210: 2d4a 0008 movel %a2,%fp@(8) } 4e214: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e21a: 2d40 0010 movel %d0,%fp@(16) } 4e21e: 4e5e unlk %fp executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e220: 4ef9 0005 0034 jmp 50034 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 000463fc <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 463fc: 4e56 fff4 linkw %fp,#-12 46400: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 46404: 4878 000e pea e CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 46408: 266e 000c moveal %fp@(12),%a3 4640c: 246e 0008 moveal %fp@(8),%a2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 46410: 2f0b movel %a3,%sp@- 46412: 486a 0040 pea %a2@(64) CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 46416: 242e 0010 movel %fp@(16),%d2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 4641a: 4eb9 0004 c854 jsr 4c854 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { 46420: 4fef 000c lea %sp@(12),%sp rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; 46424: 2542 004e movel %d2,%a2@(78) the_mutex->blocked_count = 0; 46428: 42aa 0056 clrl %a2@(86) if ( initial_lock == CORE_MUTEX_LOCKED ) { 4642c: 4a82 tstl %d2 4642e: 6638 bnes 46468 <_CORE_mutex_Initialize+0x6c> the_mutex->nest_count = 1; 46430: 7001 moveq #1,%d0 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46432: 7202 moveq #2,%d1 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 46434: 2079 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a0 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 4643a: 2540 0052 movel %d0,%a2@(82) the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; 4643e: 2568 0008 005e movel %a0@(8),%a2@(94) STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 46444: 202a 0046 movel %a2@(70),%d0 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 46448: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4644c: b280 cmpl %d0,%d1 4644e: 6708 beqs 46458 <_CORE_mutex_Initialize+0x5c> 46450: 123c 0003 moveb #3,%d1 46454: b280 cmpl %d0,%d1 46456: 661c bnes 46474 <_CORE_mutex_Initialize+0x78> _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < 46458: 202a 004a movel %a2@(74),%d0 4645c: b0a8 0014 cmpl %a0@(20),%d0 46460: 6236 bhis 46498 <_CORE_mutex_Initialize+0x9c> <== NEVER TAKEN _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 46462: 52a8 001c addql #1,%a0@(28) 46466: 600c bras 46474 <_CORE_mutex_Initialize+0x78> } } else { the_mutex->nest_count = 0; 46468: 42aa 0052 clrl %a2@(82) the_mutex->holder = NULL; 4646c: 42aa 005a clrl %a2@(90) the_mutex->holder_id = 0; 46470: 42aa 005e clrl %a2@(94) } _Thread_queue_Initialize( 46474: 4878 0004 pea 4 46478: 4878 0400 pea 400 4647c: 4aab 0006 tstl %a3@(6) 46480: 56c0 sne %d0 46482: 49c0 extbl %d0 46484: 4480 negl %d0 46486: 2f00 movel %d0,%sp@- 46488: 2f0a movel %a2,%sp@- 4648a: 4eb9 0004 8304 jsr 48304 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 46490: 4fef 0010 lea %sp@(16),%sp 46494: 4280 clrl %d0 46496: 6002 bras 4649a <_CORE_mutex_Initialize+0x9e> if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) return CORE_MUTEX_STATUS_CEILING_VIOLATED; 46498: 7005 moveq #5,%d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 4649a: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 464a0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046704 <_CORE_semaphore_Surrender>: CORE_semaphore_Status _CORE_semaphore_Surrender( CORE_semaphore_Control *the_semaphore, Objects_Id id, CORE_semaphore_API_mp_support_callout api_semaphore_mp_support ) { 46704: 4e56 0000 linkw %fp,#0 46708: 2f0a movel %a2,%sp@- 4670a: 246e 0008 moveal %fp@(8),%a2 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 4670e: 2f0a movel %a2,%sp@- 46710: 4eb9 0004 7f98 jsr 47f98 <_Thread_queue_Dequeue> 46716: 588f addql #4,%sp 46718: 4a80 tstl %d0 4671a: 6624 bnes 46740 <_CORE_semaphore_Surrender+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 4671c: 303c 0700 movew #1792,%d0 46720: 40c1 movew %sr,%d1 46722: 8081 orl %d1,%d0 46724: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46726: 202a 0048 movel %a2@(72),%d0 4672a: b0aa 0040 cmpl %a2@(64),%d0 4672e: 640a bccs 4673a <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 46730: 5280 addql #1,%d0 46732: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 46736: 4280 clrl %d0 46738: 6002 bras 4673c <_CORE_semaphore_Surrender+0x38> } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 4673a: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 4673c: 46c1 movew %d1,%sr 4673e: 6002 bras 46742 <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 46740: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46742: 246e fffc moveal %fp@(-4),%a2 46746: 4e5e unlk %fp ... =============================================================================== 000455d8 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 455d8: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 455de: 4e56 ffec linkw %fp,#-20 455e2: 48d7 043c moveml %d2-%d5/%a2,%sp@ 455e6: 246e 0008 moveal %fp@(8),%a2 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 ]; 455ea: 206a 00fc moveal %a2@(252),%a0 option_set = (rtems_option) the_thread->Wait.option; 455ee: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 455f2: 40c1 movew %sr,%d1 455f4: 8081 orl %d1,%d0 455f6: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 455f8: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 455fc: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 455fe: 2410 movel %a0@,%d2 45600: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 45602: 6700 00ca beqw 456ce <_Event_Surrender+0xf6> /* * 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() && 45606: 4ab9 0005 d9b8 tstl 5d9b8 <_Per_CPU_Information+0x8> 4560c: 674a beqs 45658 <_Event_Surrender+0x80> 4560e: b5f9 0005 d9bc cmpal 5d9bc <_Per_CPU_Information+0xc>,%a2 45614: 6642 bnes 45658 <_Event_Surrender+0x80> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45616: 2279 0005 d9f8 moveal 5d9f8 <_Event_Sync_state>,%a1 /* * 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 ) && 4561c: 7a02 moveq #2,%d5 4561e: ba89 cmpl %a1,%d5 45620: 670e beqs 45630 <_Event_Surrender+0x58> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 45622: 2279 0005 d9f8 moveal 5d9f8 <_Event_Sync_state>,%a1 * 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) || 45628: 1a3c 0001 moveb #1,%d5 4562c: ba89 cmpl %a1,%d5 4562e: 6628 bnes 45658 <_Event_Surrender+0x80> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 45630: b680 cmpl %d0,%d3 45632: 6708 beqs 4563c <_Event_Surrender+0x64> 45634: 0804 0001 btst #1,%d4 45638: 6700 0094 beqw 456ce <_Event_Surrender+0xf6> RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 4563c: 2600 movel %d0,%d3 4563e: 4683 notl %d3 45640: c682 andl %d2,%d3 45642: 2083 movel %d3,%a0@ 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; 45644: 206a 0028 moveal %a2@(40),%a0 _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; 45648: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4564c: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 4564e: 7003 moveq #3,%d0 45650: 23c0 0005 d9f8 movel %d0,5d9f8 <_Event_Sync_state> 45656: 6076 bras 456ce <_Event_Surrender+0xf6> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 45658: 2a2a 0010 movel %a2@(16),%d5 4565c: 0285 0000 0100 andil #256,%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 45662: 676a beqs 456ce <_Event_Surrender+0xf6> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 45664: b680 cmpl %d0,%d3 45666: 6706 beqs 4566e <_Event_Surrender+0x96> 45668: 0804 0001 btst #1,%d4 4566c: 6760 beqs 456ce <_Event_Surrender+0xf6> <== NEVER TAKEN 4566e: 2600 movel %d0,%d3 45670: 4683 notl %d3 45672: c682 andl %d2,%d3 45674: 2083 movel %d3,%a0@ 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; 45676: 206a 0028 moveal %a2@(40),%a0 * 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 ); the_thread->Wait.count = 0; 4567a: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4567e: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45680: 203c 0000 0700 movel #1792,%d0 45686: 46c1 movew %d1,%sr 45688: 8081 orl %d1,%d0 4568a: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4568c: 7a02 moveq #2,%d5 4568e: baaa 0050 cmpl %a2@(80),%d5 45692: 6714 beqs 456a8 <_Event_Surrender+0xd0> _ISR_Enable( level ); 45694: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45696: 2f3c 1003 fff8 movel #268697592,%sp@- 4569c: 2f0a movel %a2,%sp@- 4569e: 4eb9 0004 7954 jsr 47954 <_Thread_Clear_state> 456a4: 508f addql #8,%sp 456a6: 6028 bras 456d0 <_Event_Surrender+0xf8> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 456a8: 7003 moveq #3,%d0 456aa: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 456ae: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 456b0: 486a 0048 pea %a2@(72) 456b4: 4eb9 0004 89c8 jsr 489c8 <_Watchdog_Remove> 456ba: 2f3c 1003 fff8 movel #268697592,%sp@- 456c0: 2f0a movel %a2,%sp@- 456c2: 4eb9 0004 7954 jsr 47954 <_Thread_Clear_state> 456c8: 4fef 000c lea %sp@(12),%sp 456cc: 6002 bras 456d0 <_Event_Surrender+0xf8> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 456ce: 46c1 movew %d1,%sr } 456d0: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 456d6: 4e5e unlk %fp ... =============================================================================== 000456dc <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 456dc: 4e56 fffc linkw %fp,#-4 456e0: 2f03 movel %d3,%sp@- 456e2: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 456e4: 486e fffc pea %fp@(-4) 456e8: 2f2e 0008 movel %fp@(8),%sp@- 456ec: 4eb9 0004 7cf0 jsr 47cf0 <_Thread_Get> switch ( location ) { 456f2: 508f addql #8,%sp 456f4: 4aae fffc tstl %fp@(-4) 456f8: 665c bnes 45756 <_Event_Timeout+0x7a> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 456fa: 223c 0000 0700 movel #1792,%d1 45700: 40c2 movew %sr,%d2 45702: 8282 orl %d2,%d1 45704: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 45706: 2040 moveal %d0,%a0 45708: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 4570c: b0b9 0005 d9bc cmpl 5d9bc <_Per_CPU_Information+0xc>,%d0 45712: 6614 bnes 45728 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45714: 2239 0005 d9f8 movel 5d9f8 <_Event_Sync_state>,%d1 4571a: 7601 moveq #1,%d3 4571c: b681 cmpl %d1,%d3 4571e: 6608 bnes 45728 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45720: 7202 moveq #2,%d1 45722: 23c1 0005 d9f8 movel %d1,5d9f8 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45728: 7606 moveq #6,%d3 4572a: 2040 moveal %d0,%a0 4572c: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 45730: 46c2 movew %d2,%sr 45732: 2f3c 1003 fff8 movel #268697592,%sp@- 45738: 2f00 movel %d0,%sp@- 4573a: 4eb9 0004 7954 jsr 47954 <_Thread_Clear_state> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 45740: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 45742: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 45748: 5380 subql #1,%d0 4574a: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 45750: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 45756: 242e fff4 movel %fp@(-12),%d2 4575a: 262e fff8 movel %fp@(-8),%d3 4575e: 4e5e unlk %fp ... =============================================================================== 0004a8e8 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 4a8e8: 4e56 ffcc linkw %fp,#-52 4a8ec: 202e 0010 movel %fp@(16),%d0 4a8f0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4a8f4: 246e 0008 moveal %fp@(8),%a2 4a8f8: 262e 000c movel %fp@(12),%d3 Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4a8fc: 2403 movel %d3,%d2 4a8fe: d480 addl %d0,%d2 uintptr_t const free_size = stats->free_size; 4a900: 206a 0030 moveal %a2@(48),%a0 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4a904: 282a 0020 movel %a2@(32),%d4 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4a908: 2a2a 0010 movel %a2@(16),%d5 uintptr_t const min_block_size = heap->min_block_size; 4a90c: 222a 0014 movel %a2@(20),%d1 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4a910: 42ae fff8 clrl %fp@(-8) Heap_Block *extend_last_block = NULL; 4a914: 42ae fffc clrl %fp@(-4) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 4a918: 2d48 fff4 movel %a0,%fp@(-12) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4a91c: b682 cmpl %d2,%d3 4a91e: 6200 01a6 bhiw 4aac6 <_Heap_Extend+0x1de> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 4a922: 486e fffc pea %fp@(-4) 4a926: 486e fff8 pea %fp@(-8) 4a92a: 2f01 movel %d1,%sp@- 4a92c: 2f05 movel %d5,%sp@- 4a92e: 2f00 movel %d0,%sp@- 4a930: 2f03 movel %d3,%sp@- 4a932: 4eb9 0004 698e jsr 4698e <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4a938: 4fef 0018 lea %sp@(24),%sp 4a93c: 4a00 tstb %d0 4a93e: 6700 0186 beqw 4aac6 <_Heap_Extend+0x1de> 4a942: 2044 moveal %d4,%a0 4a944: 9bcd subal %a5,%a5 4a946: 4281 clrl %d1 4a948: 97cb subal %a3,%a3 4a94a: 99cc subal %a4,%a4 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4a94c: b888 cmpl %a0,%d4 4a94e: 6704 beqs 4a954 <_Heap_Extend+0x6c> 4a950: 2248 moveal %a0,%a1 4a952: 6004 bras 4a958 <_Heap_Extend+0x70> 4a954: 226a 0018 moveal %a2@(24),%a1 uintptr_t const sub_area_end = start_block->prev_size; 4a958: 2010 movel %a0@,%d0 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4a95a: b680 cmpl %d0,%d3 4a95c: 6406 bccs 4a964 <_Heap_Extend+0x7c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 4a95e: b3c2 cmpal %d2,%a1 4a960: 6500 0164 bcsw 4aac6 <_Heap_Extend+0x1de> ) { return false; } if ( extend_area_end == sub_area_begin ) { 4a964: b3c2 cmpal %d2,%a1 4a966: 6706 beqs 4a96e <_Heap_Extend+0x86> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4a968: b082 cmpl %d2,%d0 4a96a: 6206 bhis 4a972 <_Heap_Extend+0x8a> 4a96c: 6006 bras 4a974 <_Heap_Extend+0x8c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 4a96e: 2848 moveal %a0,%a4 4a970: 6002 bras 4a974 <_Heap_Extend+0x8c> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4a972: 2208 movel %a0,%d1 4a974: 2e00 movel %d0,%d7 4a976: 2240 moveal %d0,%a1 4a978: 5189 subql #8,%a1 4a97a: 4c45 7006 remul %d5,%d6,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4a97e: 93c6 subal %d6,%a1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4a980: b680 cmpl %d0,%d3 4a982: 6606 bnes 4a98a <_Heap_Extend+0xa2> start_block->prev_size = extend_area_end; 4a984: 2082 movel %d2,%a0@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4a986: 2649 moveal %a1,%a3 4a988: 6006 bras 4a990 <_Heap_Extend+0xa8> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4a98a: b680 cmpl %d0,%d3 4a98c: 6302 blss 4a990 <_Heap_Extend+0xa8> 4a98e: 2a49 moveal %a1,%a5 - 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; 4a990: 70fe moveq #-2,%d0 4a992: c0a9 0004 andl %a1@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a996: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4a99a: b888 cmpl %a0,%d4 4a99c: 66ae bnes 4a94c <_Heap_Extend+0x64> if ( extend_area_begin < heap->area_begin ) { 4a99e: b6aa 0018 cmpl %a2@(24),%d3 4a9a2: 6406 bccs 4a9aa <_Heap_Extend+0xc2> heap->area_begin = extend_area_begin; 4a9a4: 2543 0018 movel %d3,%a2@(24) 4a9a8: 600a bras 4a9b4 <_Heap_Extend+0xcc> } else if ( heap->area_end < extend_area_end ) { 4a9aa: b4aa 001c cmpl %a2@(28),%d2 4a9ae: 6304 blss 4a9b4 <_Heap_Extend+0xcc> heap->area_end = extend_area_end; 4a9b0: 2542 001c movel %d2,%a2@(28) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4a9b4: 206e fffc moveal %fp@(-4),%a0 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4a9b8: 2008 movel %a0,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a9ba: 7801 moveq #1,%d4 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4a9bc: 226e fff8 moveal %fp@(-8),%a1 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4a9c0: 9089 subl %a1,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a9c2: 8880 orl %d0,%d4 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 4a9c4: 2282 movel %d2,%a1@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a9c6: 2344 0004 movel %d4,%a1@(4) _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4a9ca: 2080 movel %d0,%a0@ extend_last_block->size_and_flag = 0; 4a9cc: 42a8 0004 clrl %a0@(4) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4a9d0: b3ea 0020 cmpal %a2@(32),%a1 4a9d4: 6406 bccs 4a9dc <_Heap_Extend+0xf4> heap->first_block = extend_first_block; 4a9d6: 2549 0020 movel %a1,%a2@(32) 4a9da: 600a bras 4a9e6 <_Heap_Extend+0xfe> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4a9dc: b1ea 0024 cmpal %a2@(36),%a0 4a9e0: 6304 blss 4a9e6 <_Heap_Extend+0xfe> heap->last_block = extend_last_block; 4a9e2: 2548 0024 movel %a0,%a2@(36) } if ( merge_below_block != NULL ) { 4a9e6: 4a8c tstl %a4 4a9e8: 6732 beqs 4aa1c <_Heap_Extend+0x134> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4a9ea: 202a 0010 movel %a2@(16),%d0 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 4a9ee: 5083 addql #8,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4a9f0: 2803 movel %d3,%d4 4a9f2: 4c40 4001 remul %d0,%d1,%d4 if ( remainder != 0 ) { 4a9f6: 4a81 tstl %d1 4a9f8: 6704 beqs 4a9fe <_Heap_Extend+0x116> return value - remainder + alignment; 4a9fa: d680 addl %d0,%d3 4a9fc: 9681 subl %d1,%d3 uintptr_t const new_first_block_begin = 4a9fe: 2043 moveal %d3,%a0 4aa00: 5188 subql #8,%a0 new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4aa02: 200c movel %a4,%d0 4aa04: 9088 subl %a0,%d0 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4aa06: 7201 moveq #1,%d1 4aa08: 8280 orl %d0,%d1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4aa0a: 2094 movel %a4@,%a0@ new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4aa0c: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, new_first_block ); 4aa10: 2f08 movel %a0,%sp@- 4aa12: 2f0a movel %a2,%sp@- 4aa14: 4eba feb6 jsr %pc@(4a8cc <_Heap_Free_block>) 4aa18: 508f addql #8,%sp 4aa1a: 600e bras 4aa2a <_Heap_Extend+0x142> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4aa1c: 4a81 tstl %d1 4aa1e: 670a beqs 4aa2a <_Heap_Extend+0x142> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4aa20: 9288 subl %a0,%d1 4aa22: 7801 moveq #1,%d4 4aa24: 8881 orl %d1,%d4 4aa26: 2144 0004 movel %d4,%a0@(4) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4aa2a: 4a8b tstl %a3 4aa2c: 6734 beqs 4aa62 <_Heap_Extend+0x17a> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 4aa2e: 5182 subql #8,%d2 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4aa30: 948b subl %a3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4aa32: 2202 movel %d2,%d1 4aa34: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; 4aa3a: 7201 moveq #1,%d1 4aa3c: 9480 subl %d0,%d2 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4aa3e: 202b 0004 movel %a3@(4),%d0 4aa42: 9082 subl %d2,%d0 | HEAP_PREV_BLOCK_USED; 4aa44: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4aa46: 7001 moveq #1,%d0 4aa48: 2781 2804 movel %d1,%a3@(00000004,%d2:l) 4aa4c: c0ab 0004 andl %a3@(4),%d0 block->size_and_flag = size | flag; 4aa50: 8480 orl %d0,%d2 4aa52: 2742 0004 movel %d2,%a3@(4) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4aa56: 2f0b movel %a3,%sp@- 4aa58: 2f0a movel %a2,%sp@- 4aa5a: 4eba fe70 jsr %pc@(4a8cc <_Heap_Free_block>) 4aa5e: 508f addql #8,%sp 4aa60: 6020 bras 4aa82 <_Heap_Extend+0x19a> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4aa62: 4a8d tstl %a5 4aa64: 671c beqs 4aa82 <_Heap_Extend+0x19a> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4aa66: 7201 moveq #1,%d1 uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4aa68: 7801 moveq #1,%d4 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4aa6a: 202e fff8 movel %fp@(-8),%d0 4aa6e: 908d subl %a5,%d0 4aa70: c2ad 0004 andl %a5@(4),%d1 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 4aa74: 206e fffc moveal %fp@(-4),%a0 block->size_and_flag = size | flag; 4aa78: 8280 orl %d0,%d1 4aa7a: 2b41 0004 movel %d1,%a5@(4) uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4aa7e: 89a8 0004 orl %d4,%a0@(4) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4aa82: 4a8c tstl %a4 4aa84: 6610 bnes 4aa96 <_Heap_Extend+0x1ae> 4aa86: 4a8b tstl %a3 4aa88: 660c bnes 4aa96 <_Heap_Extend+0x1ae> _Heap_Free_block( heap, extend_first_block ); 4aa8a: 2f2e fff8 movel %fp@(-8),%sp@- 4aa8e: 2f0a movel %a2,%sp@- 4aa90: 4eba fe3a jsr %pc@(4a8cc <_Heap_Free_block>) 4aa94: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4aa96: 206a 0024 moveal %a2@(36),%a0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4aa9a: 7201 moveq #1,%d1 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4aa9c: 202a 0020 movel %a2@(32),%d0 4aaa0: 9088 subl %a0,%d0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4aaa2: c2a8 0004 andl %a0@(4),%d1 block->size_and_flag = size | flag; 4aaa6: 8280 orl %d0,%d1 4aaa8: 2141 0004 movel %d1,%a0@(4) } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4aaac: 202a 0030 movel %a2@(48),%d0 4aab0: 90ae fff4 subl %fp@(-12),%d0 /* Statistics */ stats->size += extended_size; 4aab4: d1aa 002c addl %d0,%a2@(44) if ( extended_size_ptr != NULL ) 4aab8: 4aae 0014 tstl %fp@(20) 4aabc: 670c beqs 4aaca <_Heap_Extend+0x1e2> <== NEVER TAKEN *extended_size_ptr = extended_size; 4aabe: 206e 0014 moveal %fp@(20),%a0 4aac2: 2080 movel %d0,%a0@ 4aac4: 6004 bras 4aaca <_Heap_Extend+0x1e2> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 4aac6: 4200 clrb %d0 4aac8: 6002 bras 4aacc <_Heap_Extend+0x1e4> stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4aaca: 7001 moveq #1,%d0 } 4aacc: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4aad2: 4e5e unlk %fp ... =============================================================================== 0004a898 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4a898: 4e56 ffe8 linkw %fp,#-24 4a89c: 206e 0008 moveal %fp@(8),%a0 4a8a0: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4a8a4: 202e 000c movel %fp@(12),%d0 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 4a8a8: 6700 014e beqw 4a9f8 <_Heap_Free+0x160> 4a8ac: 2240 moveal %d0,%a1 4a8ae: 5189 subql #8,%a1 4a8b0: 4c68 0001 0010 remul %a0@(16),%d1,%d0 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 4a8b6: 2828 0020 movel %a0@(32),%d4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4a8ba: 93c1 subal %d1,%a1 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; 4a8bc: b889 cmpl %a1,%d4 4a8be: 620c bhis 4a8cc <_Heap_Free+0x34> 4a8c0: b3e8 0024 cmpal %a0@(36),%a1 4a8c4: 53c0 sls %d0 4a8c6: 49c0 extbl %d0 4a8c8: 4480 negl %d0 4a8ca: 6002 bras 4a8ce <_Heap_Free+0x36> 4a8cc: 4280 clrl %d0 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4a8ce: 4a00 tstb %d0 4a8d0: 6700 012a beqw 4a9fc <_Heap_Free+0x164> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a8d4: 2629 0004 movel %a1@(4),%d3 - 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; 4a8d8: 70fe moveq #-2,%d0 4a8da: c083 andl %d3,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a8dc: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 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; 4a8e0: b88a cmpl %a2,%d4 4a8e2: 620c bhis 4a8f0 <_Heap_Free+0x58> <== NEVER TAKEN 4a8e4: b5e8 0024 cmpal %a0@(36),%a2 4a8e8: 53c1 sls %d1 4a8ea: 49c1 extbl %d1 4a8ec: 4481 negl %d1 4a8ee: 6002 bras 4a8f2 <_Heap_Free+0x5a> 4a8f0: 4281 clrl %d1 <== NOT EXECUTED _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4a8f2: 4a01 tstb %d1 4a8f4: 6700 0106 beqw 4a9fc <_Heap_Free+0x164> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a8f8: 242a 0004 movel %a2@(4),%d2 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4a8fc: 0802 0000 btst #0,%d2 4a900: 6700 00fa beqw 4a9fc <_Heap_Free+0x164> - 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; 4a904: 72fe moveq #-2,%d1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4a906: 2668 0024 moveal %a0@(36),%a3 4a90a: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4a90c: b7ca cmpal %a2,%a3 4a90e: 670c beqs 4a91c <_Heap_Free+0x84> 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; 4a910: 7201 moveq #1,%d1 4a912: c2b2 2804 andl %a2@(00000004,%d2:l),%d1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4a916: 5381 subql #1,%d1 4a918: 4481 negl %d1 4a91a: 6002 bras 4a91e <_Heap_Free+0x86> return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4a91c: 4281 clrl %d1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4a91e: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4a920: 0803 0000 btst #0,%d3 4a924: 6660 bnes 4a986 <_Heap_Free+0xee> uintptr_t const prev_size = block->prev_size; 4a926: 2611 movel %a1@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a928: 93c3 subal %d3,%a1 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; 4a92a: b889 cmpl %a1,%d4 4a92c: 620a bhis 4a938 <_Heap_Free+0xa0> <== NEVER TAKEN 4a92e: b3cb cmpal %a3,%a1 4a930: 53c1 sls %d1 4a932: 49c1 extbl %d1 4a934: 4481 negl %d1 4a936: 6002 bras 4a93a <_Heap_Free+0xa2> 4a938: 4281 clrl %d1 <== NOT EXECUTED Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4a93a: 4a01 tstb %d1 4a93c: 6700 00be beqw 4a9fc <_Heap_Free+0x164> 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; 4a940: 7201 moveq #1,%d1 4a942: c2a9 0004 andl %a1@(4),%d1 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 4a946: 6700 00b4 beqw 4a9fc <_Heap_Free+0x164> 4a94a: d680 addl %d0,%d3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4a94c: 4a05 tstb %d5 4a94e: 6724 beqs 4a974 <_Heap_Free+0xdc> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4a950: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4a954: d483 addl %d3,%d2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a956: 7201 moveq #1,%d1 Heap_Block *prev = block->prev; 4a958: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4a95c: 254b 0008 movel %a3,%a2@(8) 4a960: 8282 orl %d2,%d1 next->prev = prev; 4a962: 274a 000c movel %a2,%a3@(12) } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4a966: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4a96a: 2382 2800 movel %d2,%a1@(00000000,%d2:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a96e: 2341 0004 movel %d1,%a1@(4) 4a972: 6078 bras 4a9ec <_Heap_Free+0x154> next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a974: 7401 moveq #1,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a976: 72fe moveq #-2,%d1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a978: 8483 orl %d3,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4a97a: 2483 movel %d3,%a2@ next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a97c: 2342 0004 movel %d2,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a980: c3aa 0004 andl %d1,%a2@(4) 4a984: 6066 bras 4a9ec <_Heap_Free+0x154> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4a986: 4a01 tstb %d1 4a988: 672a beqs 4a9b4 <_Heap_Free+0x11c> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4a98a: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4a98e: 2202 movel %d2,%d1 4a990: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a992: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4a994: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4a998: 234b 0008 movel %a3,%a1@(8) 4a99c: 8481 orl %d1,%d2 new_block->prev = prev; 4a99e: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4a9a2: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4a9a6: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4a9aa: 2549 0008 movel %a1,%a2@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a9ae: 2342 0004 movel %d2,%a1@(4) 4a9b2: 6038 bras 4a9ec <_Heap_Free+0x154> next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4a9b4: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a9b6: 74fe moveq #-2,%d2 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4a9b8: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4a9ba: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4a9be: 2348 000c movel %a0,%a1@(12) 4a9c2: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4a9c6: 2228 0038 movel %a0@(56),%d1 4a9ca: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4a9cc: 234b 0008 movel %a3,%a1@(8) } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a9d0: c5aa 0004 andl %d2,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4a9d4: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4a9d8: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4a9da: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4a9de: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4a9e2: b2a8 003c cmpl %a0@(60),%d1 4a9e6: 6304 blss 4a9ec <_Heap_Free+0x154> stats->max_free_blocks = stats->free_blocks; 4a9e8: 2141 003c movel %d1,%a0@(60) } } /* Statistics */ --stats->used_blocks; 4a9ec: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4a9f0: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4a9f4: d1a8 0030 addl %d0,%a0@(48) * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 4a9f8: 7001 moveq #1,%d0 4a9fa: 6002 bras 4a9fe <_Heap_Free+0x166> /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { _HAssert( false ); return( false ); 4a9fc: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a9fe: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4aa02: 4e5e unlk %fp ... =============================================================================== 0005a070 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5a070: 4e56 0000 linkw %fp,#0 5a074: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5a078: 2040 moveal %d0,%a0 5a07a: 5188 subql #8,%a0 5a07c: 226e 0008 moveal %fp@(8),%a1 5a080: 2f02 movel %d2,%sp@- 5a082: 2400 movel %d0,%d2 5a084: 4c69 2001 0010 remul %a1@(16),%d1,%d2 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 5a08a: 2429 0020 movel %a1@(32),%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5a08e: 91c1 subal %d1,%a0 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; 5a090: b488 cmpl %a0,%d2 5a092: 620c bhis 5a0a0 <_Heap_Size_of_alloc_area+0x30> 5a094: b1e9 0024 cmpal %a1@(36),%a0 5a098: 53c1 sls %d1 5a09a: 49c1 extbl %d1 5a09c: 4481 negl %d1 5a09e: 6002 bras 5a0a2 <_Heap_Size_of_alloc_area+0x32> 5a0a0: 4281 clrl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 5a0a2: 4a01 tstb %d1 5a0a4: 673a beqs 5a0e0 <_Heap_Size_of_alloc_area+0x70> - 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; 5a0a6: 72fe moveq #-2,%d1 5a0a8: c2a8 0004 andl %a0@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5a0ac: 41f0 1800 lea %a0@(00000000,%d1:l),%a0 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; 5a0b0: b488 cmpl %a0,%d2 5a0b2: 620c bhis 5a0c0 <_Heap_Size_of_alloc_area+0x50> <== NEVER TAKEN 5a0b4: b1e9 0024 cmpal %a1@(36),%a0 5a0b8: 53c1 sls %d1 5a0ba: 49c1 extbl %d1 5a0bc: 4481 negl %d1 5a0be: 6002 bras 5a0c2 <_Heap_Size_of_alloc_area+0x52> 5a0c0: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5a0c2: 4a01 tstb %d1 5a0c4: 671a beqs 5a0e0 <_Heap_Size_of_alloc_area+0x70> <== NEVER TAKEN 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; 5a0c6: 7201 moveq #1,%d1 5a0c8: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5a0cc: 6712 beqs 5a0e0 <_Heap_Size_of_alloc_area+0x70> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5a0ce: 7204 moveq #4,%d1 5a0d0: 9280 subl %d0,%d1 5a0d2: 2001 movel %d1,%d0 5a0d4: d088 addl %a0,%d0 5a0d6: 226e 0010 moveal %fp@(16),%a1 5a0da: 2280 movel %d0,%a1@ return true; 5a0dc: 7001 moveq #1,%d0 5a0de: 6002 bras 5a0e2 <_Heap_Size_of_alloc_area+0x72> if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 5a0e0: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 5a0e2: 241f movel %sp@+,%d2 5a0e4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000473be <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 473be: 4e56 ffd0 linkw %fp,#-48 473c2: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 473c6: 266e 0008 moveal %fp@(8),%a3 uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 473ca: 45fa ffac lea %pc@(47378 <_Heap_Walk_print_nothing>),%a2 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 473ce: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 473d2: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 473d6: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 473da: 2c2b 0020 movel %a3@(32),%d6 Heap_Block *const last_block = heap->last_block; 473de: 2e2b 0024 movel %a3@(36),%d7 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 473e2: 4a2e 0013 tstb %fp@(19) 473e6: 6704 beqs 473ec <_Heap_Walk+0x2e> 473e8: 45fa ff96 lea %pc@(47380 <_Heap_Walk_print>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 473ec: 7003 moveq #3,%d0 473ee: b0b9 0005 fae0 cmpl 5fae0 <_System_state_Current>,%d0 473f4: 6600 02fc bnew 476f2 <_Heap_Walk+0x334> 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)( 473f8: 2f2b 000c movel %a3@(12),%sp@- 473fc: 2f2b 0008 movel %a3@(8),%sp@- 47400: 2f07 movel %d7,%sp@- 47402: 2f06 movel %d6,%sp@- 47404: 2f2b 001c movel %a3@(28),%sp@- 47408: 2f2b 0018 movel %a3@(24),%sp@- 4740c: 2f05 movel %d5,%sp@- 4740e: 2f04 movel %d4,%sp@- 47410: 4879 0005 bfa7 pea 5bfa7 <_Status_Object_name_errors_to_status+0x5d> 47416: 42a7 clrl %sp@- 47418: 2f02 movel %d2,%sp@- 4741a: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4741c: 4fef 002c lea %sp@(44),%sp 47420: 4a84 tstl %d4 47422: 6608 bnes 4742c <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 47424: 4879 0005 c038 pea 5c038 <_Status_Object_name_errors_to_status+0xee> 4742a: 606c bras 47498 <_Heap_Walk+0xda> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 4742c: 7003 moveq #3,%d0 4742e: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47430: 670c beqs 4743e <_Heap_Walk+0x80> (*printer)( 47432: 2f04 movel %d4,%sp@- 47434: 4879 0005 c04b pea 5c04b <_Status_Object_name_errors_to_status+0x101> 4743a: 6000 02ca braw 47706 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4743e: 2205 movel %d5,%d1 47440: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47444: 4a80 tstl %d0 47446: 670c beqs 47454 <_Heap_Walk+0x96> (*printer)( 47448: 2f05 movel %d5,%sp@- 4744a: 4879 0005 c069 pea 5c069 <_Status_Object_name_errors_to_status+0x11f> 47450: 6000 02b4 braw 47706 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47454: 2006 movel %d6,%d0 47456: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47458: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 4745c: 4a81 tstl %d1 4745e: 670c beqs 4746c <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47460: 2f06 movel %d6,%sp@- 47462: 4879 0005 c08d pea 5c08d <_Status_Object_name_errors_to_status+0x143> 47468: 6000 029c braw 47706 <_Heap_Walk+0x348> 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; 4746c: 7001 moveq #1,%d0 4746e: 2046 moveal %d6,%a0 47470: c0a8 0004 andl %a0@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47474: 6608 bnes 4747e <_Heap_Walk+0xc0> (*printer)( 47476: 4879 0005 c0be pea 5c0be <_Status_Object_name_errors_to_status+0x174> 4747c: 601a bras 47498 <_Heap_Walk+0xda> - 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; 4747e: 70fe moveq #-2,%d0 47480: 2047 moveal %d7,%a0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47482: 2847 moveal %d7,%a4 - 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; 47484: c0a8 0004 andl %a0@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47488: d9c0 addal %d0,%a4 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; 4748a: 7001 moveq #1,%d0 4748c: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 47490: 6616 bnes 474a8 <_Heap_Walk+0xea> (*printer)( 47492: 4879 0005 c0ec pea 5c0ec <_Status_Object_name_errors_to_status+0x1a2> 47498: 4878 0001 pea 1 4749c: 2f02 movel %d2,%sp@- 4749e: 4e92 jsr %a2@ 474a0: 4fef 000c lea %sp@(12),%sp 474a4: 6000 009e braw 47544 <_Heap_Walk+0x186> ); return false; } if ( 474a8: bc8c cmpl %a4,%d6 474aa: 6708 beqs 474b4 <_Heap_Walk+0xf6> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 474ac: 4879 0005 c101 pea 5c101 <_Status_Object_name_errors_to_status+0x1b7> 474b2: 60e4 bras 47498 <_Heap_Walk+0xda> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 474b4: 262b 0010 movel %a3@(16),%d3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 474b8: 220b movel %a3,%d1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 474ba: 206b 0008 moveal %a3@(8),%a0 474be: 2d44 fff8 movel %d4,%fp@(-8) 474c2: 2d43 fffc movel %d3,%fp@(-4) 474c6: 6000 0088 braw 47550 <_Heap_Walk+0x192> 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; 474ca: b1eb 0020 cmpal %a3@(32),%a0 474ce: 650c bcss 474dc <_Heap_Walk+0x11e> 474d0: b1eb 0024 cmpal %a3@(36),%a0 474d4: 53c0 sls %d0 474d6: 49c0 extbl %d0 474d8: 4480 negl %d0 474da: 6002 bras 474de <_Heap_Walk+0x120> 474dc: 4280 clrl %d0 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 ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 474de: 4a00 tstb %d0 474e0: 660c bnes 474ee <_Heap_Walk+0x130> (*printer)( 474e2: 2f08 movel %a0,%sp@- 474e4: 4879 0005 c130 pea 5c130 <_Status_Object_name_errors_to_status+0x1e6> 474ea: 6000 021a braw 47706 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 474ee: 4be8 0008 lea %a0@(8),%a5 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 474f2: 200d movel %a5,%d0 474f4: 262e fffc movel %fp@(-4),%d3 474f8: 4c43 0004 remul %d3,%d4,%d0 ); return false; } if ( 474fc: 4a84 tstl %d4 474fe: 670c beqs 4750c <_Heap_Walk+0x14e> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47500: 2f08 movel %a0,%sp@- 47502: 4879 0005 c150 pea 5c150 <_Status_Object_name_errors_to_status+0x206> 47508: 6000 01fc braw 47706 <_Heap_Walk+0x348> - 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; 4750c: 70fe moveq #-2,%d0 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; 4750e: 7601 moveq #1,%d3 - 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; 47510: c0a8 0004 andl %a0@(4),%d0 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; 47514: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47518: 670c beqs 47526 <_Heap_Walk+0x168> (*printer)( 4751a: 2f08 movel %a0,%sp@- 4751c: 4879 0005 c180 pea 5c180 <_Status_Object_name_errors_to_status+0x236> 47522: 6000 01e2 braw 47706 <_Heap_Walk+0x348> ); return false; } if ( free_block->prev != prev_block ) { 47526: 2028 000c movel %a0@(12),%d0 4752a: b280 cmpl %d0,%d1 4752c: 671c beqs 4754a <_Heap_Walk+0x18c> (*printer)( 4752e: 2f00 movel %d0,%sp@- 47530: 2f08 movel %a0,%sp@- 47532: 4879 0005 c19c pea 5c19c <_Status_Object_name_errors_to_status+0x252> 47538: 4878 0001 pea 1 4753c: 2f02 movel %d2,%sp@- 4753e: 4e92 jsr %a2@ 47540: 4fef 0014 lea %sp@(20),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 47544: 4200 clrb %d0 47546: 6000 01ac braw 476f4 <_Heap_Walk+0x336> return false; } prev_block = free_block; free_block = free_block->next; 4754a: 2208 movel %a0,%d1 4754c: 2068 0008 moveal %a0@(8),%a0 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 ) { 47550: b7c8 cmpal %a0,%a3 47552: 6600 ff76 bnew 474ca <_Heap_Walk+0x10c> 47556: 282e fff8 movel %fp@(-8),%d4 4755a: 6002 bras 4755e <_Heap_Walk+0x1a0> block->prev_size ); } block = next_block; } while ( block != first_block ); 4755c: 284d moveal %a5,%a4 return true; } 4755e: 202c 0004 movel %a4@(4),%d0 - 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; 47562: 76fe moveq #-2,%d3 47564: c680 andl %d0,%d3 47566: 2d40 fffc movel %d0,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4756a: 4bf4 3800 lea %a4@(00000000,%d3:l),%a5 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; 4756e: bbeb 0020 cmpal %a3@(32),%a5 47572: 650c bcss 47580 <_Heap_Walk+0x1c2> <== NEVER TAKEN 47574: bbeb 0024 cmpal %a3@(36),%a5 47578: 53c0 sls %d0 4757a: 49c0 extbl %d0 4757c: 4480 negl %d0 4757e: 6002 bras 47582 <_Heap_Walk+0x1c4> 47580: 4280 clrl %d0 <== NOT EXECUTED 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; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 47582: 4a00 tstb %d0 47584: 660c bnes 47592 <_Heap_Walk+0x1d4> (*printer)( 47586: 2f0d movel %a5,%sp@- 47588: 2f0c movel %a4,%sp@- 4758a: 4879 0005 c1ce pea 5c1ce <_Status_Object_name_errors_to_status+0x284> 47590: 60a6 bras 47538 <_Heap_Walk+0x17a> uintptr_t const block_begin = (uintptr_t) block; 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; bool const is_not_last_block = block != last_block; 47592: be8c cmpl %a4,%d7 47594: 56c0 sne %d0 47596: 2200 movel %d0,%d1 47598: 4481 negl %d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4759a: 2003 movel %d3,%d0 4759c: 1d41 fffb moveb %d1,%fp@(-5) 475a0: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 475a4: 4a81 tstl %d1 475a6: 6714 beqs 475bc <_Heap_Walk+0x1fe> 475a8: 4a2e fffb tstb %fp@(-5) 475ac: 670e beqs 475bc <_Heap_Walk+0x1fe> (*printer)( 475ae: 2f03 movel %d3,%sp@- 475b0: 2f0c movel %a4,%sp@- 475b2: 4879 0005 c1fb pea 5c1fb <_Status_Object_name_errors_to_status+0x2b1> 475b8: 6000 ff7e braw 47538 <_Heap_Walk+0x17a> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 475bc: ba83 cmpl %d3,%d5 475be: 6322 blss 475e2 <_Heap_Walk+0x224> 475c0: 4a2e fffb tstb %fp@(-5) 475c4: 671c beqs 475e2 <_Heap_Walk+0x224> <== NEVER TAKEN (*printer)( 475c6: 2f05 movel %d5,%sp@- 475c8: 2f03 movel %d3,%sp@- 475ca: 2f0c movel %a4,%sp@- 475cc: 4879 0005 c229 pea 5c229 <_Status_Object_name_errors_to_status+0x2df> 475d2: 4878 0001 pea 1 475d6: 2f02 movel %d2,%sp@- 475d8: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 475da: 4fef 0018 lea %sp@(24),%sp 475de: 6000 ff64 braw 47544 <_Heap_Walk+0x186> } if ( next_block_begin <= block_begin && is_not_last_block ) { 475e2: b9cd cmpal %a5,%a4 475e4: 6514 bcss 475fa <_Heap_Walk+0x23c> 475e6: 4a2e fffb tstb %fp@(-5) 475ea: 670e beqs 475fa <_Heap_Walk+0x23c> (*printer)( 475ec: 2f0d movel %a5,%sp@- 475ee: 2f0c movel %a4,%sp@- 475f0: 4879 0005 c254 pea 5c254 <_Status_Object_name_errors_to_status+0x30a> 475f6: 6000 ff40 braw 47538 <_Heap_Walk+0x17a> 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; 475fa: 7001 moveq #1,%d0 475fc: c0ae fffc andl %fp@(-4),%d0 47600: 2d40 fffc movel %d0,%fp@(-4) 47604: 7001 moveq #1,%d0 47606: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4760a: 6600 00ae bnew 476ba <_Heap_Walk+0x2fc> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4760e: 222b 0008 movel %a3@(8),%d1 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)( 47612: 43f9 0005 bf74 lea 5bf74 <_Status_Object_name_errors_to_status+0x2a>,%a1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47618: 206c 0008 moveal %a4@(8),%a0 4761c: 2d41 fff8 movel %d1,%fp@(-8) 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)( 47620: b1eb 000c cmpal %a3@(12),%a0 47624: 6710 beqs 47636 <_Heap_Walk+0x278> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 47626: 43f9 0005 bec0 lea 5bec0 ,%a1 4762c: b7c8 cmpal %a0,%a3 4762e: 6606 bnes 47636 <_Heap_Walk+0x278> 47630: 43f9 0005 bf83 lea 5bf83 <_Status_Object_name_errors_to_status+0x39>,%a1 false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 47636: 202c 000c movel %a4@(12),%d0 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)( 4763a: 223c 0005 bf8d movel #376717,%d1 47640: b0ae fff8 cmpl %fp@(-8),%d0 47644: 6710 beqs 47656 <_Heap_Walk+0x298> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 47646: 223c 0005 bec0 movel #376512,%d1 4764c: b7c0 cmpal %d0,%a3 4764e: 6606 bnes 47656 <_Heap_Walk+0x298> 47650: 223c 0005 bf9d movel #376733,%d1 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)( 47656: 2f09 movel %a1,%sp@- 47658: 2f08 movel %a0,%sp@- 4765a: 2f01 movel %d1,%sp@- 4765c: 2f00 movel %d0,%sp@- 4765e: 2f03 movel %d3,%sp@- 47660: 2f0c movel %a4,%sp@- 47662: 4879 0005 c288 pea 5c288 <_Status_Object_name_errors_to_status+0x33e> 47668: 42a7 clrl %sp@- 4766a: 2f02 movel %d2,%sp@- 4766c: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 4766e: 2015 movel %a5@,%d0 47670: 4fef 0024 lea %sp@(36),%sp 47674: b083 cmpl %d3,%d0 47676: 671e beqs 47696 <_Heap_Walk+0x2d8> (*printer)( 47678: 2f0d movel %a5,%sp@- 4767a: 2f00 movel %d0,%sp@- 4767c: 2f03 movel %d3,%sp@- 4767e: 2f0c movel %a4,%sp@- 47680: 4879 0005 c2bd pea 5c2bd <_Status_Object_name_errors_to_status+0x373> 47686: 4878 0001 pea 1 4768a: 2f02 movel %d2,%sp@- 4768c: 4e92 jsr %a2@ 4768e: 4fef 001c lea %sp@(28),%sp 47692: 6000 feb0 braw 47544 <_Heap_Walk+0x186> ); return false; } if ( !prev_used ) { 47696: 4aae fffc tstl %fp@(-4) 4769a: 660a bnes 476a6 <_Heap_Walk+0x2e8> (*printer)( 4769c: 2f0c movel %a4,%sp@- 4769e: 4879 0005 c2f6 pea 5c2f6 <_Status_Object_name_errors_to_status+0x3ac> 476a4: 6060 bras 47706 <_Heap_Walk+0x348> 476a6: 206b 0008 moveal %a3@(8),%a0 476aa: 6008 bras 476b4 <_Heap_Walk+0x2f6> { 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 ) { if ( free_block == block ) { 476ac: b9c8 cmpal %a0,%a4 476ae: 673c beqs 476ec <_Heap_Walk+0x32e> return true; } free_block = free_block->next; 476b0: 2068 0008 moveal %a0@(8),%a0 ) { 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 ) { 476b4: b7c8 cmpal %a0,%a3 476b6: 66f4 bnes 476ac <_Heap_Walk+0x2ee> 476b8: 6044 bras 476fe <_Heap_Walk+0x340> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 476ba: 4aae fffc tstl %fp@(-4) 476be: 6716 beqs 476d6 <_Heap_Walk+0x318> (*printer)( 476c0: 2f03 movel %d3,%sp@- 476c2: 2f0c movel %a4,%sp@- 476c4: 4879 0005 c325 pea 5c325 <_Status_Object_name_errors_to_status+0x3db> 476ca: 42a7 clrl %sp@- 476cc: 2f02 movel %d2,%sp@- 476ce: 4e92 jsr %a2@ 476d0: 4fef 0014 lea %sp@(20),%sp 476d4: 6016 bras 476ec <_Heap_Walk+0x32e> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 476d6: 2f14 movel %a4@,%sp@- 476d8: 2f03 movel %d3,%sp@- 476da: 2f0c movel %a4,%sp@- 476dc: 4879 0005 c33c pea 5c33c <_Status_Object_name_errors_to_status+0x3f2> 476e2: 42a7 clrl %sp@- 476e4: 2f02 movel %d2,%sp@- 476e6: 4e92 jsr %a2@ 476e8: 4fef 0018 lea %sp@(24),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 476ec: bc8d cmpl %a5,%d6 476ee: 6600 fe6c bnew 4755c <_Heap_Walk+0x19e> Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 476f2: 7001 moveq #1,%d0 block = next_block; } while ( block != first_block ); return true; } 476f4: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 476fa: 4e5e unlk %fp 476fc: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 476fe: 2f0c movel %a4,%sp@- 47700: 4879 0005 c361 pea 5c361 <_Status_Object_name_errors_to_status+0x417> 47706: 4878 0001 pea 1 4770a: 2f02 movel %d2,%sp@- 4770c: 4e92 jsr %a2@ 4770e: 4fef 0010 lea %sp@(16),%sp 47712: 6000 fe30 braw 47544 <_Heap_Walk+0x186> ... =============================================================================== 00046b84 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46b84: 4e56 0000 linkw %fp,#0 46b88: 222e 000c movel %fp@(12),%d1 46b8c: 2f02 movel %d2,%sp@- 46b8e: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46b92: 13c1 0005 d8c2 moveb %d1,5d8c2 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46b98: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46b9a: 202e 0008 movel %fp@(8),%d0 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46b9e: 0281 0000 00ff andil #255,%d1 bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46ba4: 23c0 0005 d8be movel %d0,5d8be <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46baa: 2f01 movel %d1,%sp@- ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46bac: 23c2 0005 d8c4 movel %d2,5d8c4 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 46bb2: 2f00 movel %d0,%sp@- 46bb4: 4eb9 0004 875a jsr 4875a <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46bba: 7005 moveq #5,%d0 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46bbc: 2042 moveal %d2,%a0 46bbe: 243c 0000 0700 movel #1792,%d2 46bc4: 23c0 0005 d968 movel %d0,5d968 <_System_state_Current> 46bca: 40c0 movew %sr,%d0 46bcc: 8082 orl %d2,%d0 46bce: 46c0 movew %d0,%sr 46bd0: 2008 movel %a0,%d0 <== NOT EXECUTED 46bd2: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 46bd8: 4ac8 halt <== NOT EXECUTED 46bda: 4fef 000c lea %sp@(12),%sp 46bde: 60fe bras 46bde <_Internal_error_Occurred+0x5a> =============================================================================== 00046c40 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 46c40: 4e56 fff0 linkw %fp,#-16 46c44: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46c48: 246e 0008 moveal %fp@(8),%a2 * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) 46c4c: 4aaa 0014 tstl %a2@(20) 46c50: 675e beqs 46cb0 <_Objects_Allocate+0x70> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46c52: 240a movel %a2,%d2 46c54: 0682 0000 001c addil #28,%d2 46c5a: 47f9 0004 63bc lea 463bc <_Chain_Get>,%a3 46c60: 2f02 movel %d2,%sp@- 46c62: 4e93 jsr %a3@ if ( information->auto_extend ) { 46c64: 588f addql #4,%sp 46c66: 4a2a 0010 tstb %a2@(16) 46c6a: 6746 beqs 46cb2 <_Objects_Allocate+0x72> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 46c6c: 4a80 tstl %d0 46c6e: 6612 bnes 46c82 <_Objects_Allocate+0x42> _Objects_Extend_information( information ); 46c70: 2f0a movel %a2,%sp@- 46c72: 4eb9 0004 6ce4 jsr 46ce4 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46c78: 2f02 movel %d2,%sp@- 46c7a: 4e93 jsr %a3@ } if ( the_object ) { 46c7c: 508f addql #8,%sp 46c7e: 4a80 tstl %d0 46c80: 6730 beqs 46cb2 <_Objects_Allocate+0x72> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46c82: 2040 moveal %d0,%a0 46c84: 4281 clrl %d1 46c86: 4282 clrl %d2 46c88: 3228 000a movew %a0@(10),%d1 46c8c: 342a 0008 movew %a2@(8),%d2 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46c90: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46c94: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 46c96: 342a 0012 movew %a2@(18),%d2 46c9a: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 46c9e: e589 lsll #2,%d1 46ca0: d1c1 addal %d1,%a0 46ca2: 5390 subql #1,%a0@ information->inactive--; 46ca4: 322a 0028 movew %a2@(40),%d1 46ca8: 5381 subql #1,%d1 46caa: 3541 0028 movew %d1,%a2@(40) 46cae: 6002 bras 46cb2 <_Objects_Allocate+0x72> * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) return NULL; 46cb0: 4280 clrl %d0 <== NOT EXECUTED ); } #endif return the_object; } 46cb2: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46cb8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046cbc <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46cbc: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 46cbe: 4e56 0000 linkw %fp,#0 46cc2: 206e 0008 moveal %fp@(8),%a0 46cc6: 226e 000c moveal %fp@(12),%a1 46cca: 2f0a movel %a2,%sp@- 46ccc: 2468 0018 moveal %a0@(24),%a2 46cd0: 3029 000a movew %a1@(10),%d0 46cd4: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 46cd8: 245f moveal %sp@+,%a2 46cda: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46cdc: 4ef9 0004 71ec jmp 471ec <_Objects_Namespace_remove> ... =============================================================================== 00046fec <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 46fec: 4e56 0000 linkw %fp,#0 46ff0: 2f03 movel %d3,%sp@- 46ff2: 362e 000e movew %fp@(14),%d3 46ff6: 2f02 movel %d2,%sp@- 46ff8: 242e 0008 movel %fp@(8),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46ffc: 4a43 tstw %d3 46ffe: 673a beqs 4703a <_Objects_Get_information+0x4e> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 47000: 2f02 movel %d2,%sp@- 47002: 4eb9 0004 aa08 jsr 4aa08 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 47008: 588f addql #4,%sp 4700a: 4a80 tstl %d0 4700c: 672c beqs 4703a <_Objects_Get_information+0x4e> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 4700e: 0283 0000 ffff andil #65535,%d3 47014: b083 cmpl %d3,%d0 47016: 6522 bcss 4703a <_Objects_Get_information+0x4e> return NULL; if ( !_Objects_Information_table[ the_api ] ) 47018: 41f9 0005 d7e4 lea 5d7e4 <_Objects_Information_table>,%a0 4701e: 2070 2c00 moveal %a0@(00000000,%d2:l:4),%a0 47022: 4a88 tstl %a0 47024: 6714 beqs 4703a <_Objects_Get_information+0x4e> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 47026: 2030 3c00 movel %a0@(00000000,%d3:l:4),%d0 if ( !info ) 4702a: 6710 beqs 4703c <_Objects_Get_information+0x50> <== NEVER TAKEN * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) return NULL; 4702c: 2040 moveal %d0,%a0 4702e: 4a68 000e tstw %a0@(14) 47032: 56c1 sne %d1 47034: 49c1 extbl %d1 47036: c081 andl %d1,%d0 47038: 6002 bras 4703c <_Objects_Get_information+0x50> if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) return NULL; 4703a: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 4703c: 242e fff8 movel %fp@(-8),%d2 47040: 262e fffc movel %fp@(-4),%d3 47044: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00053ce0 <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 53ce0: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 53ce2: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 53ce4: 4e56 0000 linkw %fp,#0 53ce8: 206e 0008 moveal %fp@(8),%a0 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 53cec: 90a8 0006 subl %a0@(6),%d0 53cf0: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 53cf4: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 53cf8: 226e 0010 moveal %fp@(16),%a1 * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; if ( information->maximum >= index ) { 53cfc: b081 cmpl %d1,%d0 53cfe: 620e bhis 53d0e <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 53d00: 2068 0018 moveal %a0@(24),%a0 53d04: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 53d08: 6704 beqs 53d0e <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 53d0a: 4291 clrl %a1@ return the_object; 53d0c: 6006 bras 53d14 <_Objects_Get_no_protection+0x34> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 53d0e: 7001 moveq #1,%d0 53d10: 2280 movel %d0,%a1@ return NULL; 53d12: 4280 clrl %d0 } 53d14: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000477a4 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 477a4: 4e56 fffc linkw %fp,#-4 477a8: 222e 0008 movel %fp@(8),%d1 477ac: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 477ae: 4a81 tstl %d1 477b0: 660a bnes 477bc <_Objects_Id_to_name+0x18> 477b2: 2079 0005 e914 moveal 5e914 <_Per_CPU_Information+0xc>,%a0 477b8: 2228 0008 movel %a0@(8),%d1 477bc: 7418 moveq #24,%d2 477be: 2001 movel %d1,%d0 477c0: e4a8 lsrl %d2,%d0 477c2: 143c 0007 moveb #7,%d2 477c6: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 477c8: 143c 0002 moveb #2,%d2 477cc: 2040 moveal %d0,%a0 477ce: 5388 subql #1,%a0 477d0: b488 cmpl %a0,%d2 477d2: 6538 bcss 4780c <_Objects_Id_to_name+0x68> 477d4: 6040 bras 47816 <_Objects_Id_to_name+0x72> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 477d6: 2001 movel %d1,%d0 477d8: 741b moveq #27,%d2 477da: e4a8 lsrl %d2,%d0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 477dc: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 477e0: 672a beqs 4780c <_Objects_Id_to_name+0x68> <== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 477e2: 486e fffc pea %fp@(-4) 477e6: 2f01 movel %d1,%sp@- 477e8: 2f00 movel %d0,%sp@- 477ea: 4eb9 0004 773c jsr 4773c <_Objects_Get> if ( !the_object ) 477f0: 4fef 000c lea %sp@(12),%sp 477f4: 4a80 tstl %d0 477f6: 6714 beqs 4780c <_Objects_Id_to_name+0x68> return OBJECTS_INVALID_ID; *name = the_object->name; 477f8: 206e 000c moveal %fp@(12),%a0 477fc: 2240 moveal %d0,%a1 477fe: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47802: 4eb9 0004 8374 jsr 48374 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47808: 4280 clrl %d0 4780a: 6002 bras 4780e <_Objects_Id_to_name+0x6a> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; 4780c: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4780e: 242e fff8 movel %fp@(-8),%d2 47812: 4e5e unlk %fp 47814: 4e75 rts the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 47816: 41f9 0005 e73c lea 5e73c <_Objects_Information_table>,%a0 4781c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47820: 4a88 tstl %a0 47822: 66b2 bnes 477d6 <_Objects_Id_to_name+0x32> 47824: 60e6 bras 4780c <_Objects_Id_to_name+0x68> ... =============================================================================== 0004b31e <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4b31e: 4e56 ffec linkw %fp,#-20 4b322: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4b326: 286e 0008 moveal %fp@(8),%a4 4b32a: 246e 000c moveal %fp@(12),%a2 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4b32e: 4a8a tstl %a2 4b330: 6700 0110 beqw 4b442 <_RBTree_Extract_unprotected+0x124> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4b334: b5ec 0008 cmpal %a4@(8),%a2 4b338: 661a bnes 4b354 <_RBTree_Extract_unprotected+0x36> if (the_node->child[RBT_RIGHT]) 4b33a: 202a 0008 movel %a2@(8),%d0 4b33e: 6706 beqs 4b346 <_RBTree_Extract_unprotected+0x28> the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; 4b340: 2940 0008 movel %d0,%a4@(8) 4b344: 600e bras 4b354 <_RBTree_Extract_unprotected+0x36> else { the_rbtree->first[RBT_LEFT] = the_node->parent; 4b346: 2012 movel %a2@,%d0 4b348: 2940 0008 movel %d0,%a4@(8) if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 4b34c: b08c cmpl %a4,%d0 4b34e: 6604 bnes 4b354 <_RBTree_Extract_unprotected+0x36> the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; 4b350: 42ac 0008 clrl %a4@(8) 4b354: 2a6a 0004 moveal %a2@(4),%a5 } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4b358: b5ec 000c cmpal %a4@(12),%a2 4b35c: 6618 bnes 4b376 <_RBTree_Extract_unprotected+0x58> if (the_node->child[RBT_LEFT]) 4b35e: 4a8d tstl %a5 4b360: 6706 beqs 4b368 <_RBTree_Extract_unprotected+0x4a> the_rbtree->first[RBT_RIGHT] = the_node->child[RBT_LEFT]; 4b362: 294d 000c movel %a5,%a4@(12) 4b366: 600e bras 4b376 <_RBTree_Extract_unprotected+0x58> else { the_rbtree->first[RBT_RIGHT] = the_node->parent; 4b368: 2012 movel %a2@,%d0 4b36a: 2940 000c movel %d0,%a4@(12) if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 4b36e: b08c cmpl %a4,%d0 4b370: 6604 bnes 4b376 <_RBTree_Extract_unprotected+0x58> the_rbtree->first[RBT_RIGHT])) the_rbtree->first[RBT_RIGHT] = NULL; 4b372: 42ac 000c clrl %a4@(12) * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4b376: 264d moveal %a5,%a3 4b378: 4a8d tstl %a5 4b37a: 6778 beqs 4b3f4 <_RBTree_Extract_unprotected+0xd6> 4b37c: 4aaa 0008 tstl %a2@(8) 4b380: 6604 bnes 4b386 <_RBTree_Extract_unprotected+0x68> 4b382: 6078 bras 4b3fc <_RBTree_Extract_unprotected+0xde> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 4b384: 2640 moveal %d0,%a3 4b386: 202b 0008 movel %a3@(8),%d0 4b38a: 66f8 bnes 4b384 <_RBTree_Extract_unprotected+0x66> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 4b38c: 2a6b 0004 moveal %a3@(4),%a5 if(leaf) { 4b390: 4a8d tstl %a5 4b392: 6704 beqs 4b398 <_RBTree_Extract_unprotected+0x7a> leaf->parent = target->parent; 4b394: 2a93 movel %a3@,%a5@ 4b396: 600a bras 4b3a2 <_RBTree_Extract_unprotected+0x84> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4b398: 2f0b movel %a3,%sp@- 4b39a: 4eb9 0004 b1d8 jsr 4b1d8 <_RBTree_Extract_validate_unprotected> 4b3a0: 588f addql #4,%sp } victim_color = target->color; dir = target != target->parent->child[0]; 4b3a2: 2053 moveal %a3@,%a0 4b3a4: b7e8 0004 cmpal %a0@(4),%a3 4b3a8: 56c1 sne %d1 target->parent->child[dir] = leaf; 4b3aa: 7401 moveq #1,%d2 } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 4b3ac: 49c1 extbl %d1 target->parent->child[dir] = leaf; 4b3ae: 9481 subl %d1,%d2 4b3b0: 218d 2c00 movel %a5,%a0@(00000000,%d2:l:4) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; 4b3b4: 7401 moveq #1,%d2 victim_color = target->color; dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4b3b6: 2052 moveal %a2@,%a0 4b3b8: b5e8 0004 cmpal %a0@(4),%a2 4b3bc: 56c1 sne %d1 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 4b3be: 202b 000c movel %a3@(12),%d0 dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4b3c2: 49c1 extbl %d1 the_node->parent->child[dir] = target; 4b3c4: 9481 subl %d1,%d2 4b3c6: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 4b3ca: 276a 0008 0008 movel %a2@(8),%a3@(8) if (the_node->child[RBT_RIGHT]) 4b3d0: 206a 0008 moveal %a2@(8),%a0 4b3d4: 4a88 tstl %a0 4b3d6: 6702 beqs 4b3da <_RBTree_Extract_unprotected+0xbc><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 4b3d8: 208b movel %a3,%a0@ target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4b3da: 276a 0004 0004 movel %a2@(4),%a3@(4) if (the_node->child[RBT_LEFT]) 4b3e0: 206a 0004 moveal %a2@(4),%a0 4b3e4: 4a88 tstl %a0 4b3e6: 6702 beqs 4b3ea <_RBTree_Extract_unprotected+0xcc> the_node->child[RBT_LEFT]->parent = target; 4b3e8: 208b movel %a3,%a0@ /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 4b3ea: 2692 movel %a2@,%a3@ target->color = the_node->color; 4b3ec: 276a 000c 000c movel %a2@(12),%a3@(12) 4b3f2: 602c bras 4b420 <_RBTree_Extract_unprotected+0x102> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 4b3f4: 2a6a 0008 moveal %a2@(8),%a5 if( leaf ) { 4b3f8: 4a8d tstl %a5 4b3fa: 6704 beqs 4b400 <_RBTree_Extract_unprotected+0xe2> leaf->parent = the_node->parent; 4b3fc: 2a92 movel %a2@,%a5@ 4b3fe: 600a bras 4b40a <_RBTree_Extract_unprotected+0xec> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4b400: 2f0a movel %a2,%sp@- 4b402: 4eb9 0004 b1d8 jsr 4b1d8 <_RBTree_Extract_validate_unprotected> 4b408: 588f addql #4,%sp } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4b40a: 2052 moveal %a2@,%a0 4b40c: b5e8 0004 cmpal %a0@(4),%a2 4b410: 56c1 sne %d1 the_node->parent->child[dir] = leaf; 4b412: 7401 moveq #1,%d2 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4b414: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4b416: 9481 subl %d1,%d2 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 4b418: 202a 000c movel %a2@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4b41c: 218d 2c00 movel %a5,%a0@(00000000,%d2:l:4) /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 4b420: 4a80 tstl %d0 4b422: 6608 bnes 4b42c <_RBTree_Extract_unprotected+0x10e> if (leaf) { 4b424: 4a8d tstl %a5 4b426: 6704 beqs 4b42c <_RBTree_Extract_unprotected+0x10e> leaf->color = RBT_BLACK; /* case 2 */ 4b428: 42ad 000c clrl %a5@(12) /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 4b42c: 206c 0004 moveal %a4@(4),%a0 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 4b430: 42aa 0008 clrl %a2@(8) 4b434: 42aa 0004 clrl %a2@(4) 4b438: 4292 clrl %a2@ 4b43a: 4a88 tstl %a0 4b43c: 6704 beqs 4b442 <_RBTree_Extract_unprotected+0x124> 4b43e: 42a8 000c clrl %a0@(12) } 4b442: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b448: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b1d8 <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 4b1d8: 4e56 ffe8 linkw %fp,#-24 4b1dc: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4b1e0: 266e 0008 moveal %fp@(8),%a3 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 4b1e4: 2453 moveal %a3@,%a2 if(!parent->parent) return; 4b1e6: 4a92 tstl %a2@ 4b1e8: 6700 012a beqw 4b314 <_RBTree_Extract_validate_unprotected+0x13c> sibling = _RBTree_Sibling(the_node); 4b1ec: 2f0b movel %a3,%sp@- 4b1ee: 49fa ff6c lea %pc@(4b15c <_RBTree_Sibling>),%a4 4b1f2: 4e94 jsr %a4@ 4b1f4: 588f addql #4,%sp */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; _RBTree_Rotate(parent, dir); 4b1f6: 4bfa ff8e lea %pc@(4b186 <_RBTree_Rotate>),%a5 RBTree_Direction dir; parent = the_node->parent; if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); 4b1fa: 2040 moveal %d0,%a0 /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 4b1fc: 6000 00ec braw 4b2ea <_RBTree_Extract_validate_unprotected+0x112> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4b200: 4a88 tstl %a0 4b202: 6730 beqs 4b234 <_RBTree_Extract_validate_unprotected+0x5c><== NEVER TAKEN 4b204: 7001 moveq #1,%d0 4b206: b0a8 000c cmpl %a0@(12),%d0 4b20a: 6628 bnes 4b234 <_RBTree_Extract_validate_unprotected+0x5c> * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 4b20c: b7ea 0004 cmpal %a2@(4),%a3 4b210: 56c2 sne %d2 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 4b212: 2540 000c movel %d0,%a2@(12) sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 4b216: 49c2 extbl %d2 4b218: 4482 negl %d2 * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; 4b21a: 42a8 000c clrl %a0@(12) dir = the_node != parent->child[0]; _RBTree_Rotate(parent, dir); 4b21e: 2f02 movel %d2,%sp@- 4b220: 2f0a movel %a2,%sp@- 4b222: 4e95 jsr %a5@ sibling = parent->child[!dir]; 4b224: 508f addql #8,%sp 4b226: 4a82 tstl %d2 4b228: 57c0 seq %d0 4b22a: 7201 moveq #1,%d1 4b22c: 49c0 extbl %d0 4b22e: 9280 subl %d0,%d1 4b230: 2072 1c00 moveal %a2@(00000000,%d1:l:4),%a0 } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 4b234: 2268 0008 moveal %a0@(8),%a1 4b238: 4a89 tstl %a1 4b23a: 670e beqs 4b24a <_RBTree_Extract_validate_unprotected+0x72> * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ void _RBTree_Extract_validate_unprotected( 4b23c: 7001 moveq #1,%d0 4b23e: b0a9 000c cmpl %a1@(12),%d0 4b242: 57c0 seq %d0 4b244: 49c0 extbl %d0 4b246: 4480 negl %d0 4b248: 6002 bras 4b24c <_RBTree_Extract_validate_unprotected+0x74> 4b24a: 4280 clrl %d0 _RBTree_Rotate(parent, dir); sibling = parent->child[!dir]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 4b24c: 4a00 tstb %d0 4b24e: 6630 bnes 4b280 <_RBTree_Extract_validate_unprotected+0xa8> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 4b250: 2268 0004 moveal %a0@(4),%a1 4b254: 4a89 tstl %a1 4b256: 670e beqs 4b266 <_RBTree_Extract_validate_unprotected+0x8e> * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ void _RBTree_Extract_validate_unprotected( 4b258: 7201 moveq #1,%d1 4b25a: b2a9 000c cmpl %a1@(12),%d1 4b25e: 57c0 seq %d0 4b260: 49c0 extbl %d0 4b262: 4480 negl %d0 4b264: 6002 bras 4b268 <_RBTree_Extract_validate_unprotected+0x90> 4b266: 4280 clrl %d0 _RBTree_Rotate(parent, dir); sibling = parent->child[!dir]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 4b268: 4a00 tstb %d0 4b26a: 6614 bnes 4b280 <_RBTree_Extract_validate_unprotected+0xa8> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; 4b26c: 7001 moveq #1,%d0 4b26e: 2140 000c movel %d0,%a0@(12) 4b272: b0aa 000c cmpl %a2@(12),%d0 4b276: 6600 008c bnew 4b304 <_RBTree_Extract_validate_unprotected+0x12c> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 4b27a: 42aa 000c clrl %a2@(12) break; 4b27e: 6078 bras 4b2f8 <_RBTree_Extract_validate_unprotected+0x120> * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 4b280: b7ea 0004 cmpal %a2@(4),%a3 4b284: 56c2 sne %d2 4b286: 49c2 extbl %d2 4b288: 4482 negl %d2 if (!_RBTree_Is_red(sibling->child[!dir])) { 4b28a: 57c3 seq %d3 4b28c: 49c3 extbl %d3 4b28e: 4483 negl %d3 4b290: 2270 3c04 moveal %a0@(00000004,%d3:l:4),%a1 4b294: 4a89 tstl %a1 4b296: 670e beqs 4b2a6 <_RBTree_Extract_validate_unprotected+0xce> * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ void _RBTree_Extract_validate_unprotected( 4b298: 7201 moveq #1,%d1 4b29a: b2a9 000c cmpl %a1@(12),%d1 4b29e: 57c0 seq %d0 4b2a0: 49c0 extbl %d0 4b2a2: 4480 negl %d0 4b2a4: 6002 bras 4b2a8 <_RBTree_Extract_validate_unprotected+0xd0> 4b2a6: 4280 clrl %d0 * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { 4b2a8: 4a00 tstb %d0 4b2aa: 6620 bnes 4b2cc <_RBTree_Extract_validate_unprotected+0xf4> sibling->color = RBT_RED; 4b2ac: 7001 moveq #1,%d0 sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); 4b2ae: 7201 moveq #1,%d1 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 4b2b0: 2270 2c04 moveal %a0@(00000004,%d2:l:4),%a1 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; 4b2b4: 2140 000c movel %d0,%a0@(12) sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); 4b2b8: b581 eorl %d2,%d1 * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 4b2ba: 42a9 000c clrl %a1@(12) _RBTree_Rotate(sibling, !dir); 4b2be: 2f01 movel %d1,%sp@- 4b2c0: 2f08 movel %a0,%sp@- 4b2c2: 4eba fec2 jsr %pc@(4b186 <_RBTree_Rotate>) sibling = parent->child[!dir]; 4b2c6: 508f addql #8,%sp 4b2c8: 2072 3c04 moveal %a2@(00000004,%d3:l:4),%a0 } sibling->color = parent->color; 4b2cc: 216a 000c 000c movel %a2@(12),%a0@(12) parent->color = RBT_BLACK; sibling->child[!dir]->color = RBT_BLACK; 4b2d2: 2070 3c04 moveal %a0@(00000004,%d3:l:4),%a0 sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); sibling = parent->child[!dir]; } sibling->color = parent->color; parent->color = RBT_BLACK; 4b2d6: 42aa 000c clrl %a2@(12) sibling->child[!dir]->color = RBT_BLACK; 4b2da: 42a8 000c clrl %a0@(12) _RBTree_Rotate(parent, dir); 4b2de: 2f02 movel %d2,%sp@- 4b2e0: 2f0a movel %a2,%sp@- 4b2e2: 4eba fea2 jsr %pc@(4b186 <_RBTree_Rotate>) break; /* done */ 4b2e6: 508f addql #8,%sp 4b2e8: 600e bras 4b2f8 <_RBTree_Extract_validate_unprotected+0x120> if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 4b2ea: 7001 moveq #1,%d0 4b2ec: b0ab 000c cmpl %a3@(12),%d0 4b2f0: 6706 beqs 4b2f8 <_RBTree_Extract_validate_unprotected+0x120> 4b2f2: 4a92 tstl %a2@ 4b2f4: 6600 ff0a bnew 4b200 <_RBTree_Extract_validate_unprotected+0x28> sibling->child[!dir]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4b2f8: 2053 moveal %a3@,%a0 4b2fa: 4a90 tstl %a0@ 4b2fc: 6616 bnes 4b314 <_RBTree_Extract_validate_unprotected+0x13c> 4b2fe: 42ab 000c clrl %a3@(12) 4b302: 6010 bras 4b314 <_RBTree_Extract_validate_unprotected+0x13c> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 4b304: 2412 movel %a2@,%d2 sibling = _RBTree_Sibling(the_node); 4b306: 264a moveal %a2,%a3 4b308: 2f0a movel %a2,%sp@- if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 4b30a: 2442 moveal %d2,%a2 sibling = _RBTree_Sibling(the_node); 4b30c: 4e94 jsr %a4@ 4b30e: 588f addql #4,%sp 4b310: 2040 moveal %d0,%a0 4b312: 60d6 bras 4b2ea <_RBTree_Extract_validate_unprotected+0x112> _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; } 4b314: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4b31a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048a58 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 48a58: 4e56 ffec linkw %fp,#-20 48a5c: 202e 001c movel %fp@(28),%d0 48a60: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 48a64: 246e 0008 moveal %fp@(8),%a2 48a68: 262e 0014 movel %fp@(20),%d3 48a6c: 282e 0018 movel %fp@(24),%d4 size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 48a70: 4a8a tstl %a2 48a72: 6734 beqs 48aa8 <_RBTree_Initialize+0x50> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 48a74: 4292 clrl %a2@ the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 48a76: 256e 000c 0010 movel %fp@(12),%a2@(16) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 48a7c: 242e 0010 movel %fp@(16),%d2 RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; 48a80: 42aa 0004 clrl %a2@(4) while ( count-- ) { _RBTree_Insert(the_rbtree, next); 48a84: 47f9 0004 8a2c lea 48a2c <_RBTree_Insert>,%a3 the_rbtree->first[0] = NULL; 48a8a: 42aa 0008 clrl %a2@(8) the_rbtree->first[1] = NULL; 48a8e: 42aa 000c clrl %a2@(12) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; 48a92: 1540 0014 moveb %d0,%a2@(20) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 48a96: 600c bras 48aa4 <_RBTree_Initialize+0x4c> _RBTree_Insert(the_rbtree, next); 48a98: 2f02 movel %d2,%sp@- * node_size - size of node in bytes * * Output parameters: NONE */ void _RBTree_Initialize( 48a9a: d484 addl %d4,%d2 48a9c: 5383 subql #1,%d3 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert(the_rbtree, next); 48a9e: 2f0a movel %a2,%sp@- 48aa0: 4e93 jsr %a3@ * node_size - size of node in bytes * * Output parameters: NONE */ void _RBTree_Initialize( 48aa2: 508f addql #8,%sp /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 48aa4: 4a83 tstl %d3 48aa6: 66f0 bnes 48a98 <_RBTree_Initialize+0x40> _RBTree_Insert(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 48aa8: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 48aae: 4e5e unlk %fp ... =============================================================================== 0004b15c <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { 4b15c: 4e56 0000 linkw %fp,#0 4b160: 226e 0008 moveal %fp@(8),%a1 if(!the_node) return NULL; 4b164: 4a89 tstl %a1 4b166: 6718 beqs 4b180 <_RBTree_Sibling+0x24> if(!(the_node->parent)) return NULL; 4b168: 2051 moveal %a1@,%a0 4b16a: 4a88 tstl %a0 4b16c: 6712 beqs 4b180 <_RBTree_Sibling+0x24> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 4b16e: 4a90 tstl %a0@ 4b170: 670e beqs 4b180 <_RBTree_Sibling+0x24> if(the_node == the_node->parent->child[RBT_LEFT]) 4b172: 2028 0004 movel %a0@(4),%d0 4b176: b089 cmpl %a1,%d0 4b178: 6608 bnes 4b182 <_RBTree_Sibling+0x26> return the_node->parent->child[RBT_RIGHT]; 4b17a: 2028 0008 movel %a0@(8),%d0 4b17e: 6002 bras 4b182 <_RBTree_Sibling+0x26> RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 4b180: 4280 clrl %d0 if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 4b182: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b4ca <_RBTree_Validate_insert_unprotected>: * append operation. */ void _RBTree_Validate_insert_unprotected( RBTree_Node *the_node ) { 4b4ca: 4e56 fff0 linkw %fp,#-16 4b4ce: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4b4d2: 266e 0008 moveal %fp@(8),%a3 } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4b4d6: 49fa ffa0 lea %pc@(4b478 <_RBTree_Rotate>),%a4 RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 4b4da: 604e bras 4b52a <_RBTree_Validate_insert_unprotected+0x60> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 4b4dc: 4a92 tstl %a2@ 4b4de: 6762 beqs 4b542 <_RBTree_Validate_insert_unprotected+0x78><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 4b4e0: 226a 0004 moveal %a2@(4),%a1 4b4e4: b3c8 cmpal %a0,%a1 4b4e6: 6604 bnes 4b4ec <_RBTree_Validate_insert_unprotected+0x22> return the_node->parent->child[RBT_RIGHT]; 4b4e8: 226a 0008 moveal %a2@(8),%a1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4b4ec: 4a89 tstl %a1 4b4ee: 6752 beqs 4b542 <_RBTree_Validate_insert_unprotected+0x78> 4b4f0: 7001 moveq #1,%d0 4b4f2: b0a9 000c cmpl %a1@(12),%d0 4b4f6: 664a bnes 4b542 <_RBTree_Validate_insert_unprotected+0x78> u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 4b4f8: 42a8 000c clrl %a0@(12) u->color = RBT_BLACK; g->color = RBT_RED; 4b4fc: 264a moveal %a2,%a3 g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; 4b4fe: 42a9 000c clrl %a1@(12) g->color = RBT_RED; 4b502: 2540 000c movel %d0,%a2@(12) 4b506: 6022 bras 4b52a <_RBTree_Validate_insert_unprotected+0x60> RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); 4b508: 2f02 movel %d2,%sp@- 4b50a: 2f08 movel %a0,%sp@- 4b50c: 4e94 jsr %a4@ the_node = the_node->child[pdir]; 4b50e: 508f addql #8,%sp 4b510: 2673 2c04 moveal %a3@(00000004,%d2:l:4),%a3 } the_node->parent->color = RBT_BLACK; 4b514: 2053 moveal %a3@,%a0 g->color = RBT_RED; 4b516: 7001 moveq #1,%d0 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 4b518: 42a8 000c clrl %a0@(12) g->color = RBT_RED; 4b51c: 2540 000c movel %d0,%a2@(12) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4b520: 9082 subl %d2,%d0 4b522: 2f00 movel %d0,%sp@- 4b524: 2f0a movel %a2,%sp@- 4b526: 4e94 jsr %a4@ 4b528: 508f addql #8,%sp ISR_Level level; _ISR_Disable( level ); return _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 4b52a: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4b52c: 2450 moveal %a0@,%a2 4b52e: 4a8a tstl %a2 4b530: 670a beqs 4b53c <_RBTree_Validate_insert_unprotected+0x72> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4b532: 7001 moveq #1,%d0 4b534: b0a8 000c cmpl %a0@(12),%d0 4b538: 6622 bnes 4b55c <_RBTree_Validate_insert_unprotected+0x92> 4b53a: 60a0 bras 4b4dc <_RBTree_Validate_insert_unprotected+0x12> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4b53c: 42ab 000c clrl %a3@(12) 4b540: 601a bras 4b55c <_RBTree_Validate_insert_unprotected+0x92> u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 4b542: b1ea 0004 cmpal %a2@(4),%a0 4b546: 56c2 sne %d2 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4b548: b7e8 0004 cmpal %a0@(4),%a3 4b54c: 56c0 sne %d0 RBTree_Direction pdir = the_node->parent != g->child[0]; 4b54e: 49c2 extbl %d2 4b550: 4482 negl %d2 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4b552: 49c0 extbl %d0 4b554: 4480 negl %d0 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4b556: b480 cmpl %d0,%d2 4b558: 66ae bnes 4b508 <_RBTree_Validate_insert_unprotected+0x3e> 4b55a: 60b8 bras 4b514 <_RBTree_Validate_insert_unprotected+0x4a> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; } 4b55c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4b562: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a35c <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4a35c: 4e56 ffec linkw %fp,#-20 RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4a360: 206e 0008 moveal %fp@(8),%a0 */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4a364: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4a368: 2468 00fc moveal %a0@(252),%a2 if ( !api ) 4a36c: 4a8a tstl %a2 4a36e: 6754 beqs 4a3c4 <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4a370: 203c 0000 0700 movel #1792,%d0 4a376: 40c1 movew %sr,%d1 4a378: 8081 orl %d1,%d0 4a37a: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 4a37c: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 4a380: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4a384: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4a386: 4a83 tstl %d3 4a388: 673a beqs 4a3c4 <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 4a38a: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4a38e: 240e movel %fp,%d2 4a390: 5982 subql #4,%d2 4a392: 47f9 0004 bc34 lea 4bc34 ,%a3 4a398: 2f02 movel %d2,%sp@- 4a39a: 2f3c 0000 ffff movel #65535,%sp@- 4a3a0: 2f2a 000e movel %a2@(14),%sp@- 4a3a4: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 4a3a6: 2f03 movel %d3,%sp@- 4a3a8: 206a 000a moveal %a2@(10),%a0 4a3ac: 4e90 jsr %a0@ asr->nest_level -= 1; 4a3ae: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4a3b2: 2f02 movel %d2,%sp@- 4a3b4: 2f3c 0000 ffff movel #65535,%sp@- 4a3ba: 2f2e fffc movel %fp@(-4),%sp@- 4a3be: 4e93 jsr %a3@ 4a3c0: 4fef 001c lea %sp@(28),%sp } 4a3c4: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4a3ca: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047a84 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 47a84: 4e56 0000 linkw %fp,#0 47a88: 2f0a movel %a2,%sp@- void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 47a8a: 4878 0018 pea 18 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 47a8e: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 47a92: 4eb9 0004 924c jsr 4924c <_Workspace_Allocate> if ( sched ) { 47a98: 588f addql #4,%sp 47a9a: 4a80 tstl %d0 47a9c: 670e beqs 47aac <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN the_thread->scheduler_info = sched; 47a9e: 2540 008a movel %d0,%a2@(138) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 47aa2: 2040 moveal %d0,%a0 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 47aa4: 7202 moveq #2,%d1 sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 47aa6: 208a movel %a2,%a0@ schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 47aa8: 2141 0014 movel %d1,%a0@(20) } return sched; } 47aac: 246e fffc moveal %fp@(-4),%a2 47ab0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047ab4 <_Scheduler_EDF_Block>: #include void _Scheduler_EDF_Block( Thread_Control *the_thread ) { 47ab4: 4e56 0000 linkw %fp,#0 47ab8: 2f02 movel %d2,%sp@- 47aba: 242e 0008 movel %fp@(8),%d2 _Scheduler_EDF_Extract( the_thread ); 47abe: 2f02 movel %d2,%sp@- 47ac0: 4eb9 0004 7b2c jsr 47b2c <_Scheduler_EDF_Extract> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 47ac6: 588f addql #4,%sp 47ac8: b4b9 0005 ee58 cmpl 5ee58 <_Per_CPU_Information+0x10>,%d2 47ace: 6606 bnes 47ad6 <_Scheduler_EDF_Block+0x22> <== NEVER TAKEN _Scheduler_EDF_Schedule(); 47ad0: 4eb9 0004 7c4c jsr 47c4c <_Scheduler_EDF_Schedule> if ( _Thread_Is_executing( the_thread ) ) 47ad6: b4b9 0005 ee54 cmpl 5ee54 <_Per_CPU_Information+0xc>,%d2 47adc: 6608 bnes 47ae6 <_Scheduler_EDF_Block+0x32> <== NEVER TAKEN _Thread_Dispatch_necessary = true; 47ade: 7001 moveq #1,%d0 47ae0: 13c0 0005 ee60 moveb %d0,5ee60 <_Per_CPU_Information+0x18> } 47ae6: 242e fffc movel %fp@(-4),%d2 47aea: 4e5e unlk %fp ... =============================================================================== 00047b58 <_Scheduler_EDF_Free>: #include void _Scheduler_EDF_Free( Thread_Control *the_thread ) { 47b58: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 47b5c: 206e 0008 moveal %fp@(8),%a0 47b60: 2d68 008a 0008 movel %a0@(138),%fp@(8) } 47b66: 4e5e unlk %fp void _Scheduler_EDF_Free( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 47b68: 4ef9 0004 9268 jmp 49268 <_Workspace_Free> ... =============================================================================== 00047c10 <_Scheduler_EDF_Release_job>: void _Scheduler_EDF_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 47c10: 4e56 0000 linkw %fp,#0 47c14: 206e 0008 moveal %fp@(8),%a0 47c18: 202e 000c movel %fp@(12),%d0 Priority_Control new_priority; if (deadline) { 47c1c: 670e beqs 47c2c <_Scheduler_EDF_Release_job+0x1c><== NEVER TAKEN /* Initializing or shifting deadline. */ new_priority = (_Watchdog_Ticks_since_boot + deadline) 47c1e: 2239 0005 edc0 movel 5edc0 <_Watchdog_Ticks_since_boot>,%d1 47c24: d081 addl %d1,%d0 47c26: 0880 001f bclr #31,%d0 47c2a: 6004 bras 47c30 <_Scheduler_EDF_Release_job+0x20> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 47c2c: 2028 00ac movel %a0@(172),%d0 <== NOT EXECUTED } the_thread->real_priority = new_priority; 47c30: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 47c34: 4878 0001 pea 1 47c38: 2f00 movel %d0,%sp@- 47c3a: 2f08 movel %a0,%sp@- 47c3c: 4eb9 0004 7f24 jsr 47f24 <_Thread_Change_priority> 47c42: 4fef 000c lea %sp@(12),%sp } 47c46: 4e5e unlk %fp ... =============================================================================== 00047c70 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 47c70: 4e56 0000 linkw %fp,#0 47c74: 2f0a movel %a2,%sp@- 47c76: 246e 0008 moveal %fp@(8),%a2 _Scheduler_EDF_Enqueue(the_thread); 47c7a: 2f0a movel %a2,%sp@- 47c7c: 4eb9 0004 7afc jsr 47afc <_Scheduler_EDF_Enqueue> 47c82: 2f2a 0014 movel %a2@(20),%sp@- * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 47c86: 2079 0005 ee58 moveal 5ee58 <_Per_CPU_Information+0x10>,%a0 47c8c: 2f28 0014 movel %a0@(20),%sp@- 47c90: 2079 0005 d40e moveal 5d40e <_Scheduler+0x30>,%a0 47c96: 4e90 jsr %a0@ 47c98: 4fef 000c lea %sp@(12),%sp 47c9c: 4a80 tstl %d0 47c9e: 6c20 bges 47cc0 <_Scheduler_EDF_Unblock+0x50> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 47ca0: 2079 0005 ee54 moveal 5ee54 <_Per_CPU_Information+0xc>,%a0 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 47ca6: 23ca 0005 ee58 movel %a2,5ee58 <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 47cac: 4a28 0074 tstb %a0@(116) 47cb0: 6606 bnes 47cb8 <_Scheduler_EDF_Unblock+0x48> <== ALWAYS TAKEN 47cb2: 4aaa 0014 tstl %a2@(20) <== NOT EXECUTED 47cb6: 6608 bnes 47cc0 <_Scheduler_EDF_Unblock+0x50> <== NOT EXECUTED the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 47cb8: 7001 moveq #1,%d0 47cba: 13c0 0005 ee60 moveb %d0,5ee60 <_Per_CPU_Information+0x18> } } 47cc0: 246e fffc moveal %fp@(-4),%a2 47cc4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047cc8 <_Scheduler_EDF_Update>: { Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 47cc8: 7002 moveq #2,%d0 #include void _Scheduler_EDF_Update( Thread_Control *the_thread ) { 47cca: 4e56 0000 linkw %fp,#0 47cce: 2f0a movel %a2,%sp@- 47cd0: 246e 0008 moveal %fp@(8),%a2 Scheduler_EDF_Per_thread *sched_info = 47cd4: 206a 008a moveal %a2@(138),%a0 #include void _Scheduler_EDF_Update( Thread_Control *the_thread ) { 47cd8: 2f02 movel %d2,%sp@- Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 47cda: b0a8 0014 cmpl %a0@(20),%d0 47cde: 6618 bnes 47cf8 <_Scheduler_EDF_Update+0x30> /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); 47ce0: 202a 00ac movel %a2@(172),%d0 47ce4: 08c0 001f bset #31,%d0 47ce8: 2540 00ac movel %d0,%a2@(172) the_thread->real_priority = the_thread->Start.initial_priority; 47cec: 2540 0018 movel %d0,%a2@(24) the_thread->current_priority = the_thread->Start.initial_priority; 47cf0: 2540 0014 movel %d0,%a2@(20) sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; 47cf4: 42a8 0014 clrl %a0@(20) } if ( sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_YES ) { 47cf8: 7001 moveq #1,%d0 47cfa: b0a8 0014 cmpl %a0@(20),%d0 47cfe: 664c bnes 47d4c <_Scheduler_EDF_Update+0x84> <== ALWAYS TAKEN Thread_Control *the_thread ) { Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); 47d00: 2408 movel %a0,%d2 <== NOT EXECUTED 47d02: 5882 addql #4,%d2 <== NOT EXECUTED the_thread->current_priority = the_thread->Start.initial_priority; sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; } if ( sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_YES ) { _RBTree_Extract(&_Scheduler_EDF_Ready_queue, the_node); 47d04: 2f02 movel %d2,%sp@- <== NOT EXECUTED 47d06: 4879 0005 ee6a pea 5ee6a <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 47d0c: 4eb9 0004 b44c jsr 4b44c <_RBTree_Extract> <== NOT EXECUTED _RBTree_Insert(&_Scheduler_EDF_Ready_queue, the_node); 47d12: 2f02 movel %d2,%sp@- <== NOT EXECUTED 47d14: 4879 0005 ee6a pea 5ee6a <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 47d1a: 4eb9 0004 b610 jsr 4b610 <_RBTree_Insert> <== NOT EXECUTED _Scheduler_EDF_Schedule(); 47d20: 4eb9 0004 7c4c jsr 47c4c <_Scheduler_EDF_Schedule> <== NOT EXECUTED if ( _Thread_Executing != _Thread_Heir ) { 47d26: 2079 0005 ee54 moveal 5ee54 <_Per_CPU_Information+0xc>,%a0 <== NOT EXECUTED 47d2c: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 47d30: b1f9 0005 ee58 cmpal 5ee58 <_Per_CPU_Information+0x10>,%a0 <== NOT EXECUTED 47d36: 6714 beqs 47d4c <_Scheduler_EDF_Update+0x84> <== NOT EXECUTED if ( _Thread_Executing->is_preemptible || 47d38: 4a28 0074 tstb %a0@(116) <== NOT EXECUTED 47d3c: 6606 bnes 47d44 <_Scheduler_EDF_Update+0x7c> <== NOT EXECUTED 47d3e: 4aaa 0014 tstl %a2@(20) <== NOT EXECUTED 47d42: 6608 bnes 47d4c <_Scheduler_EDF_Update+0x84> <== NOT EXECUTED the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 47d44: 7001 moveq #1,%d0 <== NOT EXECUTED 47d46: 13c0 0005 ee60 moveb %d0,5ee60 <_Per_CPU_Information+0x18> <== NOT EXECUTED } } } 47d4c: 242e fff8 movel %fp@(-8),%d2 47d50: 246e fffc moveal %fp@(-4),%a2 47d54: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d58 <_Scheduler_EDF_Yield>: Thread_Control *executing = _Thread_Executing; Scheduler_EDF_Per_thread *executing_info = (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); _ISR_Disable( level ); 47d58: 203c 0000 0700 movel #1792,%d0 <== NOT EXECUTED #include #include #include void _Scheduler_EDF_Yield(void) { 47d5e: 4e56 fff4 linkw %fp,#-12 <== NOT EXECUTED 47d62: 48d7 040c moveml %d2-%d3/%a2,%sp@ <== NOT EXECUTED Scheduler_EDF_Per_thread *first_info; RBTree_Node *first_node; ISR_Level level; Thread_Control *executing = _Thread_Executing; 47d66: 2479 0005 ee54 moveal 5ee54 <_Per_CPU_Information+0xc>,%a2 <== NOT EXECUTED Scheduler_EDF_Per_thread *executing_info = 47d6c: 262a 008a movel %a2@(138),%d3 <== NOT EXECUTED (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); _ISR_Disable( level ); 47d70: 40c2 movew %sr,%d2 <== NOT EXECUTED 47d72: 8082 orl %d2,%d0 <== NOT EXECUTED 47d74: 46c0 movew %d0,%sr <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _RBTree_Has_only_one_node( const RBTree_Control *the_rbtree ) { if(!the_rbtree) return NULL; /* TODO: expected behavior? */ return (the_rbtree->root->child[RBT_LEFT] == NULL && the_rbtree->root->child[RBT_RIGHT] == NULL); 47d76: 2079 0005 ee6e moveal 5ee6e <_Scheduler_EDF_Ready_queue+0x4>,%a0<== NOT EXECUTED 47d7c: 4aa8 0004 tstl %a0@(4) <== NOT EXECUTED 47d80: 660c bnes 47d8e <_Scheduler_EDF_Yield+0x36> <== NOT EXECUTED #include #include #include #include void _Scheduler_EDF_Yield(void) 47d82: 4aa8 0008 tstl %a0@(8) <== NOT EXECUTED 47d86: 57c0 seq %d0 <== NOT EXECUTED 47d88: 49c0 extbl %d0 <== NOT EXECUTED 47d8a: 4480 negl %d0 <== NOT EXECUTED 47d8c: 6002 bras 47d90 <_Scheduler_EDF_Yield+0x38> <== NOT EXECUTED 47d8e: 4280 clrl %d0 <== NOT EXECUTED (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); _ISR_Disable( level ); if ( !_RBTree_Has_only_one_node(&_Scheduler_EDF_Ready_queue) ) { 47d90: 4a00 tstb %d0 <== NOT EXECUTED 47d92: 6652 bnes 47de6 <_Scheduler_EDF_Yield+0x8e> <== NOT EXECUTED ISR_Level level; Thread_Control *executing = _Thread_Executing; Scheduler_EDF_Per_thread *executing_info = (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); 47d94: 5883 addql #4,%d3 <== NOT EXECUTED if ( !_RBTree_Has_only_one_node(&_Scheduler_EDF_Ready_queue) ) { /* * The RBTree has more than one node, enqueue behind the tasks * with the same priority in case there are such ones. */ _RBTree_Extract( &_Scheduler_EDF_Ready_queue, executing_node ); 47d96: 2f03 movel %d3,%sp@- <== NOT EXECUTED 47d98: 4879 0005 ee6a pea 5ee6a <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 47d9e: 4eb9 0004 b44c jsr 4b44c <_RBTree_Extract> <== NOT EXECUTED _RBTree_Insert( &_Scheduler_EDF_Ready_queue, executing_node ); 47da4: 2f03 movel %d3,%sp@- <== NOT EXECUTED 47da6: 4879 0005 ee6a pea 5ee6a <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 47dac: 4eb9 0004 b610 jsr 4b610 <_RBTree_Insert> <== NOT EXECUTED _ISR_Flash( level ); 47db2: 203c 0000 0700 movel #1792,%d0 <== NOT EXECUTED 47db8: 46c2 movew %d2,%sr <== NOT EXECUTED 47dba: 8082 orl %d2,%d0 <== NOT EXECUTED 47dbc: 46c0 movew %d0,%sr <== NOT EXECUTED if ( _Thread_Is_heir( executing ) ) { 47dbe: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 47dc2: b5f9 0005 ee58 cmpal 5ee58 <_Per_CPU_Information+0x10>,%a2 <== NOT EXECUTED 47dc8: 6624 bnes 47dee <_Scheduler_EDF_Yield+0x96> <== NOT EXECUTED first_node = _RBTree_Peek( &_Scheduler_EDF_Ready_queue, RBT_LEFT ); 47dca: 42a7 clrl %sp@- <== NOT EXECUTED 47dcc: 4879 0005 ee6a pea 5ee6a <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 47dd2: 4eb9 0004 b63c jsr 4b63c <_RBTree_Peek> <== NOT EXECUTED first_info = _RBTree_Container_of(first_node, Scheduler_EDF_Per_thread, Node); _Thread_Heir = first_info->thread; 47dd8: 508f addql #8,%sp <== NOT EXECUTED 47dda: 2040 moveal %d0,%a0 <== NOT EXECUTED 47ddc: 5988 subql #4,%a0 <== NOT EXECUTED 47dde: 23d0 0005 ee58 movel %a0@,5ee58 <_Per_CPU_Information+0x10><== NOT EXECUTED 47de4: 6008 bras 47dee <_Scheduler_EDF_Yield+0x96> <== NOT EXECUTED } _Thread_Dispatch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 47de6: b5f9 0005 ee58 cmpal 5ee58 <_Per_CPU_Information+0x10>,%a2 <== NOT EXECUTED 47dec: 6708 beqs 47df6 <_Scheduler_EDF_Yield+0x9e> <== NOT EXECUTED _Thread_Dispatch_necessary = true; 47dee: 7001 moveq #1,%d0 <== NOT EXECUTED 47df0: 13c0 0005 ee60 moveb %d0,5ee60 <_Per_CPU_Information+0x18> <== NOT EXECUTED _ISR_Enable( level ); 47df6: 46c2 movew %d2,%sr <== NOT EXECUTED } 47df8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED 47dfe: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000473a8 <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 473a8: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 473ac: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 473ae: 2279 0005 bfb2 moveal 5bfb2 <_Scheduler+0x4>,%a1 473b4: 4ed1 jmp %a1@ ... =============================================================================== 00047580 <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 47580: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 47584: 206e 0008 moveal %fp@(8),%a0 47588: 2d68 008a 0008 movel %a0@(138),%fp@(8) } 4758e: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 47590: 4ef9 0004 8b3c jmp 48b3c <_Workspace_Free> ... =============================================================================== 000461e4 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 461e4: 4e56 0000 linkw %fp,#0 461e8: 206e 0008 moveal %fp@(8),%a0 461ec: 2f03 movel %d3,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 461ee: 2039 0005 dcd8 movel 5dcd8 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 461f4: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 461f6: 4a88 tstl %a0 461f8: 6762 beqs 4625c <_TOD_Validate+0x78> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 461fa: 243c 000f 4240 movel #1000000,%d2 46200: 4c40 2002 remul %d0,%d2,%d2 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46204: b4a8 0018 cmpl %a0@(24),%d2 46208: 6352 blss 4625c <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 4620a: 763b moveq #59,%d3 4620c: b6a8 0014 cmpl %a0@(20),%d3 46210: 654a bcss 4625c <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46212: b6a8 0010 cmpl %a0@(16),%d3 46216: 6544 bcss 4625c <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 46218: 7017 moveq #23,%d0 4621a: b0a8 000c cmpl %a0@(12),%d0 4621e: 653c bcss 4625c <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 46220: 2028 0004 movel %a0@(4),%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 46224: 6736 beqs 4625c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 46226: 720c moveq #12,%d1 46228: b280 cmpl %d0,%d1 4622a: 6530 bcss 4625c <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 4622c: 2410 movel %a0@,%d2 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 4622e: 0c82 0000 07c3 cmpil #1987,%d2 46234: 6326 blss 4625c <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 46236: 2228 0008 movel %a0@(8),%d1 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 4623a: 6720 beqs 4625c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 4623c: 163c 0003 moveb #3,%d3 46240: 41f9 0005 cf28 lea 5cf28 <_TOD_Days_per_month>,%a0 46246: c483 andl %d3,%d2 46248: 6606 bnes 46250 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4624a: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 4624e: 6004 bras 46254 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 46250: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 46254: b081 cmpl %d1,%d0 46256: 54c0 scc %d0 46258: 4480 negl %d0 4625a: 6002 bras 4625e <_TOD_Validate+0x7a> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 4625c: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 4625e: 241f movel %sp@+,%d2 46260: 261f movel %sp@+,%d3 46262: 4e5e unlk %fp ... =============================================================================== 00047878 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 47878: 4e56 fff0 linkw %fp,#-16 4787c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 47880: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 47884: 282a 0010 movel %a2@(16),%d4 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 47888: 242e 000c movel %fp@(12),%d2 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 4788c: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4788e: 162e 0013 moveb %fp@(19),%d3 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 47892: 4eb9 0004 8464 jsr 48464 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 47898: 588f addql #4,%sp 4789a: b4aa 0014 cmpl %a2@(20),%d2 4789e: 670c beqs 478ac <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 478a0: 2f02 movel %d2,%sp@- 478a2: 2f0a movel %a2,%sp@- 478a4: 4eb9 0004 8408 jsr 48408 <_Thread_Set_priority> 478aa: 508f addql #8,%sp _ISR_Disable( level ); 478ac: 203c 0000 0700 movel #1792,%d0 478b2: 40c2 movew %sr,%d2 478b4: 8082 orl %d2,%d0 478b6: 46c0 movew %d0,%sr 478b8: 7204 moveq #4,%d1 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 478ba: 202a 0010 movel %a2@(16),%d0 478be: c284 andl %d4,%d1 if ( state != STATES_TRANSIENT ) { 478c0: 7804 moveq #4,%d4 478c2: b880 cmpl %d0,%d4 478c4: 672e beqs 478f4 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 478c6: 4a81 tstl %d1 478c8: 6608 bnes 478d2 <_Thread_Change_priority+0x5a> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 478ca: 72fb moveq #-5,%d1 478cc: c280 andl %d0,%d1 478ce: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 478d2: 46c2 movew %d2,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 478d4: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 478da: 676c beqs 47948 <_Thread_Change_priority+0xd0> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 478dc: 2d4a 000c movel %a2,%fp@(12) 478e0: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 478e6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 478ec: 4e5e unlk %fp /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 478ee: 4ef9 0004 8368 jmp 48368 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 478f4: 4a81 tstl %d1 478f6: 661e bnes 47916 <_Thread_Change_priority+0x9e> <== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 478f8: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 478fc: 4a03 tstb %d3 478fe: 670a beqs 4790a <_Thread_Change_priority+0x92> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 47900: 2f0a movel %a2,%sp@- 47902: 2079 0005 bfd6 moveal 5bfd6 <_Scheduler+0x28>,%a0 47908: 6008 bras 47912 <_Thread_Change_priority+0x9a> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4790a: 2079 0005 bfd2 moveal 5bfd2 <_Scheduler+0x24>,%a0 47910: 2f0a movel %a2,%sp@- 47912: 4e90 jsr %a0@ 47914: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 47916: 203c 0000 0700 movel #1792,%d0 4791c: 46c2 movew %d2,%sr 4791e: 8082 orl %d2,%d0 47920: 46c0 movew %d0,%sr * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 47922: 2079 0005 bfb6 moveal 5bfb6 <_Scheduler+0x8>,%a0 47928: 4e90 jsr %a0@ * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 4792a: 2079 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a0 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 47930: b1f9 0005 d9c0 cmpal 5d9c0 <_Per_CPU_Information+0x10>,%a0 47936: 670e beqs 47946 <_Thread_Change_priority+0xce> 47938: 4a28 0074 tstb %a0@(116) 4793c: 6708 beqs 47946 <_Thread_Change_priority+0xce> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4793e: 7801 moveq #1,%d4 47940: 13c4 0005 d9c8 moveb %d4,5d9c8 <_Per_CPU_Information+0x18> _ISR_Enable( level ); 47946: 46c2 movew %d2,%sr } 47948: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4794e: 4e5e unlk %fp ... =============================================================================== 00047b2c <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47b2c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47b30: 486e fffc pea %fp@(-4) 47b34: 2f2e 0008 movel %fp@(8),%sp@- 47b38: 4eb9 0004 7cf0 jsr 47cf0 <_Thread_Get> switch ( location ) { 47b3e: 508f addql #8,%sp 47b40: 4aae fffc tstl %fp@(-4) 47b44: 6624 bnes 47b6a <_Thread_Delay_ended+0x3e> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 47b46: 2f3c 1000 0018 movel #268435480,%sp@- 47b4c: 2f00 movel %d0,%sp@- 47b4e: 4eb9 0004 7954 jsr 47954 <_Thread_Clear_state> 47b54: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47b56: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 47b5c: 5380 subql #1,%d0 47b5e: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47b64: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 47b6a: 4e5e unlk %fp ... =============================================================================== 00047b70 <_Thread_Dispatch>: * INTERRUPT LATENCY: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 47b70: 4e56 ffd0 linkw %fp,#-48 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 47b74: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 47b7a: 5280 addql #1,%d0 47b7c: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47b82: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 47b88: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 47b8c: 223c 0000 0700 movel #1792,%d1 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 47b92: 2479 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 47b98: 40c0 movew %sr,%d0 47b9a: 8280 orl %d0,%d1 47b9c: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47b9e: 260e movel %fp,%d3 _Timestamp_Subtract( 47ba0: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47ba2: 0683 ffff fff0 addil #-16,%d3 47ba8: 2a3c 0004 a6c8 movel #304840,%d5 _Timestamp_Subtract( 47bae: 5182 subql #8,%d2 47bb0: 283c 0004 85ec movel #296428,%d4 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47bb6: 4bf9 0004 85b4 lea 485b4 <_Timespec_Add_to>,%a5 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 47bbc: 49f9 0004 886c lea 4886c <_User_extensions_Thread_switch>,%a4 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 47bc2: 6000 00d2 braw 47c96 <_Thread_Dispatch+0x126> heir = _Thread_Heir; 47bc6: 2679 0005 d9c0 moveal 5d9c0 <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_necessary = false; 47bcc: 4201 clrb %d1 _Thread_Executing = heir; 47bce: 23cb 0005 d9bc movel %a3,5d9bc <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_necessary = false; 47bd4: 13c1 0005 d9c8 moveb %d1,5d9c8 <_Per_CPU_Information+0x18> /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 47bda: b5cb cmpal %a3,%a2 47bdc: 6700 00c2 beqw 47ca0 <_Thread_Dispatch+0x130> */ #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 47be0: 7201 moveq #1,%d1 47be2: b2ab 007a cmpl %a3@(122),%d1 47be6: 660a bnes 47bf2 <_Thread_Dispatch+0x82> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 47be8: 41f9 0005 d7e0 lea 5d7e0 <_Thread_Ticks_per_timeslice>,%a0 47bee: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 47bf2: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47bf4: 2f03 movel %d3,%sp@- 47bf6: 2045 moveal %d5,%a0 47bf8: 4e90 jsr %a0@ _Timestamp_Subtract( 47bfa: 2044 moveal %d4,%a0 47bfc: 2f02 movel %d2,%sp@- 47bfe: 2f03 movel %d3,%sp@- 47c00: 4879 0005 d9ca pea 5d9ca <_Per_CPU_Information+0x1a> 47c06: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47c08: 2f02 movel %d2,%sp@- 47c0a: 486a 0082 pea %a2@(130) 47c0e: 4e95 jsr %a5@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47c10: 2079 0005 d8ae moveal 5d8ae <_Thread_libc_reent>,%a0 47c16: 4fef 0018 lea %sp@(24),%sp &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 47c1a: 202e fff0 movel %fp@(-16),%d0 47c1e: 222e fff4 movel %fp@(-12),%d1 47c22: 23c0 0005 d9ca movel %d0,5d9ca <_Per_CPU_Information+0x1a> 47c28: 23c1 0005 d9ce movel %d1,5d9ce <_Per_CPU_Information+0x1e> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47c2e: 4a88 tstl %a0 47c30: 6708 beqs 47c3a <_Thread_Dispatch+0xca> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 47c32: 2550 00f8 movel %a0@,%a2@(248) *_Thread_libc_reent = heir->libc_reent; 47c36: 20ab 00f8 movel %a3@(248),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47c3a: 2f0b movel %a3,%sp@- 47c3c: 2f0a movel %a2,%sp@- 47c3e: 4e94 jsr %a4@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47c40: 486b 00c0 pea %a3@(192) 47c44: 486a 00c0 pea %a2@(192) 47c48: 4eb9 0004 8b8c jsr 48b8c <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 47c4e: 4fef 0010 lea %sp@(16),%sp 47c52: 4aaa 00f4 tstl %a2@(244) 47c56: 672c beqs 47c84 <_Thread_Dispatch+0x114> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 47c58: 2079 0005 d8aa moveal 5d8aa <_Thread_Allocated_fp>,%a0 47c5e: b1ca cmpal %a2,%a0 47c60: 6722 beqs 47c84 <_Thread_Dispatch+0x114> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47c62: 4a88 tstl %a0 47c64: 670c beqs 47c72 <_Thread_Dispatch+0x102> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47c66: 4868 00f4 pea %a0@(244) 47c6a: 4eb9 0004 8cd2 jsr 48cd2 <_CPU_Context_save_fp> 47c70: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 47c72: 486a 00f4 pea %a2@(244) 47c76: 4eb9 0004 8cf4 jsr 48cf4 <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 47c7c: 588f addql #4,%sp 47c7e: 23ca 0005 d8aa movel %a2,5d8aa <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 47c84: 2479 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 47c8a: 223c 0000 0700 movel #1792,%d1 47c90: 40c0 movew %sr,%d0 47c92: 8280 orl %d0,%d1 47c94: 46c1 movew %d1,%sr /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 47c96: 1239 0005 d9c8 moveb 5d9c8 <_Per_CPU_Information+0x18>,%d1 47c9c: 6600 ff28 bnew 47bc6 <_Thread_Dispatch+0x56> _ISR_Disable( level ); } post_switch: _ISR_Enable( level ); 47ca0: 46c0 movew %d0,%sr * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47ca2: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 47ca8: 5380 subql #1,%d0 47caa: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47cb0: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 _Thread_Unnest_dispatch(); _API_extensions_Run_postswitch(); 47cb6: 4eb9 0004 6230 jsr 46230 <_API_extensions_Run_postswitch> } 47cbc: 4cee 3c3c ffd0 moveml %fp@(-48),%d2-%d5/%a2-%a5 47cc2: 4e5e unlk %fp ... =============================================================================== 00047cf0 <_Thread_Get>: */ Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 47cf0: 4e56 0000 linkw %fp,#0 47cf4: 202e 0008 movel %fp@(8),%d0 47cf8: 2f03 movel %d3,%sp@- 47cfa: 206e 000c moveal %fp@(12),%a0 47cfe: 2f02 movel %d2,%sp@- uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 47d00: 4a80 tstl %d0 47d02: 661e bnes 47d22 <_Thread_Get+0x32> * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 47d04: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 47d0a: 5280 addql #1,%d0 47d0c: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47d12: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 47d18: 4290 clrl %a0@ tp = _Thread_Executing; 47d1a: 2039 0005 d9bc movel 5d9bc <_Per_CPU_Information+0xc>,%d0 goto done; 47d20: 6044 bras 47d66 <_Thread_Get+0x76> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47d22: 7418 moveq #24,%d2 47d24: 2200 movel %d0,%d1 47d26: e4a9 lsrl %d2,%d1 47d28: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47d2a: 143c 0002 moveb #2,%d2 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47d2e: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47d30: 2241 moveal %d1,%a1 47d32: 5389 subql #1,%a1 47d34: b489 cmpl %a1,%d2 47d36: 643a bccs 47d72 <_Thread_Get+0x82> 47d38: 6014 bras 47d4e <_Thread_Get+0x5e> if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 47d3a: 43f9 0005 d7e4 lea 5d7e4 <_Objects_Information_table>,%a1 47d40: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 * There is no way for this to happen if POSIX is enabled. But there * is actually a test case in sp43 for this which trips it whether or * not POSIX is enabled. So in the interest of safety, this is left * on in all configurations. */ if ( !api_information ) { 47d44: 4a89 tstl %a1 47d46: 6706 beqs 47d4e <_Thread_Get+0x5e> *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 47d48: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 47d4c: 6608 bnes 47d56 <_Thread_Get+0x66> *location = OBJECTS_ERROR; 47d4e: 7001 moveq #1,%d0 47d50: 2080 movel %d0,%a0@ { uint32_t the_api; uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; 47d52: 4280 clrl %d0 } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; goto done; 47d54: 6010 bras 47d66 <_Thread_Get+0x76> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 47d56: 2f08 movel %a0,%sp@- 47d58: 2f00 movel %d0,%sp@- 47d5a: 2f01 movel %d1,%sp@- 47d5c: 4eb9 0004 70a0 jsr 470a0 <_Objects_Get> 47d62: 4fef 000c lea %sp@(12),%sp done: return tp; } 47d66: 242e fff8 movel %fp@(-8),%d2 47d6a: 262e fffc movel %fp@(-4),%d3 47d6e: 4e5e unlk %fp 47d70: 4e75 rts */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 47d72: 761b moveq #27,%d3 47d74: 2400 movel %d0,%d2 47d76: e6aa lsrl %d3,%d2 *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 47d78: 163c 0001 moveb #1,%d3 47d7c: b682 cmpl %d2,%d3 47d7e: 67ba beqs 47d3a <_Thread_Get+0x4a> 47d80: 60cc bras 47d4e <_Thread_Get+0x5e> ... =============================================================================== 0004beb4 <_Thread_Handler>: * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 4beb4: 4e56 0000 linkw %fp,#0 4beb8: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4beba: 2479 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a2 * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 4bec0: 2f02 movel %d2,%sp@- /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4bec2: 222a 00a8 movel %a2@(168),%d1 _ISR_Set_level(level); 4bec6: 40c0 movew %sr,%d0 4bec8: e189 lsll #8,%d1 4beca: 0280 0000 f8ff andil #63743,%d0 4bed0: 8081 orl %d1,%d0 4bed2: 46c0 movew %d0,%sr && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; doneConstructors = true; 4bed4: 7001 moveq #1,%d0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4bed6: 1439 0005 cfec moveb 5cfec ,%d2 doneConstructors = true; 4bedc: 13c0 0005 cfec moveb %d0,5cfec #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4bee2: 4aaa 00f4 tstl %a2@(244) 4bee6: 6720 beqs 4bf08 <_Thread_Handler+0x54> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 4bee8: 2079 0005 d8aa moveal 5d8aa <_Thread_Allocated_fp>,%a0 4beee: b1ca cmpal %a2,%a0 4bef0: 6716 beqs 4bf08 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4bef2: 4a88 tstl %a0 4bef4: 670c beqs 4bf02 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4bef6: 4868 00f4 pea %a0@(244) 4befa: 4eb9 0004 8cd2 jsr 48cd2 <_CPU_Context_save_fp> 4bf00: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4bf02: 23ca 0005 d8aa movel %a2,5d8aa <_Thread_Allocated_fp> /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 4bf08: 2f0a movel %a2,%sp@- 4bf0a: 4eb9 0004 86e8 jsr 486e8 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4bf10: 4eb9 0004 7cc8 jsr 47cc8 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { 4bf16: 588f addql #4,%sp 4bf18: 4a02 tstb %d2 4bf1a: 6606 bnes 4bf22 <_Thread_Handler+0x6e> INIT_NAME (); 4bf1c: 4eb9 0005 a17c jsr 5a17c <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4bf22: 4aaa 0092 tstl %a2@(146) 4bf26: 6610 bnes 4bf38 <_Thread_Handler+0x84> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4bf28: 2f2a 009a movel %a2@(154),%sp@- 4bf2c: 206a 008e moveal %a2@(142),%a0 4bf30: 4e90 jsr %a0@ #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4bf32: 588f addql #4,%sp 4bf34: 2540 0028 movel %d0,%a2@(40) * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 4bf38: 2f0a movel %a2,%sp@- 4bf3a: 4eb9 0004 8720 jsr 48720 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4bf40: 4878 0005 pea 5 4bf44: 4878 0001 pea 1 4bf48: 42a7 clrl %sp@- 4bf4a: 4eb9 0004 6b84 jsr 46b84 <_Internal_error_Occurred> =============================================================================== 00048a04 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 48a04: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 48a06: 4e56 0000 linkw %fp,#0 48a0a: 2f0a movel %a2,%sp@- 48a0c: 246e 0008 moveal %fp@(8),%a2 48a10: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 48a14: 6664 bnes 48a7a <_Thread_Restart+0x76> _Thread_Set_transient( the_thread ); 48a16: 2f0a movel %a2,%sp@- 48a18: 4eb9 0004 8ae4 jsr 48ae4 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 48a1e: 2f2e 0010 movel %fp@(16),%sp@- 48a22: 2f2e 000c movel %fp@(12),%sp@- 48a26: 2f0a movel %a2,%sp@- 48a28: 4eb9 0004 b3ac jsr 4b3ac <_Thread_Reset> _Thread_Load_environment( the_thread ); 48a2e: 2f0a movel %a2,%sp@- 48a30: 4eb9 0004 b0f0 jsr 4b0f0 <_Thread_Load_environment> _Thread_Ready( the_thread ); 48a36: 2f0a movel %a2,%sp@- 48a38: 4eb9 0004 b37c jsr 4b37c <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 48a3e: 2f0a movel %a2,%sp@- 48a40: 4eb9 0004 8eac jsr 48eac <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 48a46: 4fef 001c lea %sp@(28),%sp 48a4a: b5f9 0005 e2c4 cmpal 5e2c4 <_Per_CPU_Information+0xc>,%a2 48a50: 662c bnes 48a7e <_Thread_Restart+0x7a> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 48a52: 4aaa 00f4 tstl %a2@(244) 48a56: 670c beqs 48a64 <_Thread_Restart+0x60> _Context_Restore_fp( &_Thread_Executing->fp_context ); 48a58: 486a 00f4 pea %a2@(244) 48a5c: 4eb9 0004 93b4 jsr 493b4 <_CPU_Context_restore_fp> 48a62: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 48a64: 2079 0005 e2c4 moveal 5e2c4 <_Per_CPU_Information+0xc>,%a0 48a6a: 41e8 00c0 lea %a0@(192),%a0 48a6e: 2f08 movel %a0,%sp@- 48a70: 4eb9 0004 9262 jsr 49262 <_CPU_Context_Restart_self> 48a76: 588f addql #4,%sp <== NOT EXECUTED 48a78: 6004 bras 48a7e <_Thread_Restart+0x7a> <== NOT EXECUTED _Thread_Restart_self(); return true; } return false; 48a7a: 4200 clrb %d0 48a7c: 6002 bras 48a80 <_Thread_Restart+0x7c> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 48a7e: 7001 moveq #1,%d0 } return false; } 48a80: 246e fffc moveal %fp@(-4),%a2 48a84: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047828 <_Thread_blocking_operation_Cancel>: /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 47828: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 4782a: 4e56 0000 linkw %fp,#0 4782e: 202e 0010 movel %fp@(16),%d0 47832: 2f0a movel %a2,%sp@- 47834: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 47838: 42aa 0044 clrl %a2@(68) /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 4783c: b2aa 0050 cmpl %a2@(80),%d1 47840: 6618 bnes 4785a <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 47842: 123c 0003 moveb #3,%d1 47846: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4784a: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4784c: 486a 0048 pea %a2@(72) 47850: 4eb9 0004 89c8 jsr 489c8 <_Watchdog_Remove> 47856: 588f addql #4,%sp 47858: 6002 bras 4785c <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4785a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4785c: 2d4a 0008 movel %a2,%fp@(8) #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 47860: 246e fffc moveal %fp@(-4),%a2 47864: 203c 1003 fff8 movel #268697592,%d0 4786a: 2d40 000c movel %d0,%fp@(12) 4786e: 4e5e unlk %fp 47870: 4ef9 0004 7954 jmp 47954 <_Thread_Clear_state> ... =============================================================================== 0004bf50 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4bf50: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4bf56: 4e56 0000 linkw %fp,#0 4bf5a: 2f0a movel %a2,%sp@- 4bf5c: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4bf60: 40c0 movew %sr,%d0 4bf62: 8280 orl %d0,%d1 4bf64: 46c1 movew %d1,%sr 4bf66: 222a 0010 movel %a2@(16),%d1 4bf6a: 0281 0003 bee0 andil #245472,%d1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4bf70: 660a bnes 4bf7c <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4bf72: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4bf74: 246e fffc moveal %fp@(-4),%a2 4bf78: 4e5e unlk %fp 4bf7a: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4bf7c: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4bf7e: 7202 moveq #2,%d1 previous = the_node->previous; 4bf80: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4bf84: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4bf88: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4bf8a: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4bf8e: b2aa 0050 cmpl %a2@(80),%d1 4bf92: 6704 beqs 4bf98 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4bf94: 46c0 movew %d0,%sr 4bf96: 6014 bras 4bfac <_Thread_queue_Extract_fifo+0x5c> 4bf98: 7203 moveq #3,%d1 4bf9a: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4bf9e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4bfa0: 486a 0048 pea %a2@(72) 4bfa4: 4eb9 0004 89c8 jsr 489c8 <_Watchdog_Remove> 4bfaa: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4bfac: 2d4a 0008 movel %a2,%fp@(8) #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4bfb0: 246e fffc moveal %fp@(-4),%a2 4bfb4: 203c 1003 fff8 movel #268697592,%d0 4bfba: 2d40 000c movel %d0,%fp@(12) 4bfbe: 4e5e unlk %fp 4bfc0: 4ef9 0004 7954 jmp 47954 <_Thread_Clear_state> ... =============================================================================== 00048368 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 48368: 4e56 fff0 linkw %fp,#-16 4836c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48370: 246e 0008 moveal %fp@(8),%a2 48374: 266e 000c moveal %fp@(12),%a3 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 48378: 4a8a tstl %a2 4837a: 6746 beqs 483c2 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 4837c: 7001 moveq #1,%d0 4837e: b0aa 0034 cmpl %a2@(52),%d0 48382: 663e bnes 483c2 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 48384: 303c 0700 movew #1792,%d0 48388: 40c2 movew %sr,%d2 4838a: 8082 orl %d2,%d0 4838c: 46c0 movew %d0,%sr 4838e: 202b 0010 movel %a3@(16),%d0 48392: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48398: 6726 beqs 483c0 <_Thread_queue_Requeue+0x58> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4839a: 7001 moveq #1,%d0 4839c: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 483a0: 4878 0001 pea 1 483a4: 2f0b movel %a3,%sp@- 483a6: 2f0a movel %a2,%sp@- 483a8: 4eb9 0004 abb4 jsr 4abb4 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 483ae: 486e fffc pea %fp@(-4) 483b2: 2f0b movel %a3,%sp@- 483b4: 2f0a movel %a2,%sp@- 483b6: 4eb9 0004 816c jsr 4816c <_Thread_queue_Enqueue_priority> 483bc: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 483c0: 46c2 movew %d2,%sr } } 483c2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 483c8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000483cc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 483cc: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 483d0: 486e fffc pea %fp@(-4) 483d4: 2f2e 0008 movel %fp@(8),%sp@- 483d8: 4eb9 0004 7cf0 jsr 47cf0 <_Thread_Get> switch ( location ) { 483de: 508f addql #8,%sp 483e0: 4aae fffc tstl %fp@(-4) 483e4: 661e bnes 48404 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 483e6: 2f00 movel %d0,%sp@- 483e8: 4eb9 0004 ac78 jsr 4ac78 <_Thread_queue_Process_timeout> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 483ee: 588f addql #4,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 483f0: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 483f6: 5380 subql #1,%d0 483f8: 23c0 0005 d828 movel %d0,5d828 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 483fe: 2039 0005 d828 movel 5d828 <_Thread_Dispatch_disable_level>,%d0 _Thread_Unnest_dispatch(); break; } } 48404: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000519e0 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 519e0: 4e56 ffc0 linkw %fp,#-64 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 519e4: 200e movel %fp,%d0 519e6: 41ee ffec lea %fp@(-20),%a0 519ea: 5180 subql #8,%d0 519ec: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 519f0: 246e 0008 moveal %fp@(8),%a2 519f4: 2e0e movel %fp,%d7 519f6: 260e movel %fp,%d3 519f8: 0687 ffff ffe8 addil #-24,%d7 519fe: 0683 ffff fff4 addil #-12,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51a04: 2a0a movel %a2,%d5 /* * 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 ); 51a06: 240a movel %a2,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51a08: 0685 0000 0030 addil #48,%d5 /* * 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 ); 51a0e: 0682 0000 0068 addil #104,%d2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 51a14: 2c08 movel %a0,%d6 51a16: 2800 movel %d0,%d4 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 51a18: 2d48 ffe8 movel %a0,%fp@(-24) head->previous = NULL; 51a1c: 42ae ffec clrl %fp@(-20) tail->previous = head; 51a20: 2d47 fff0 movel %d7,%fp@(-16) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 51a24: 2d40 fff4 movel %d0,%fp@(-12) head->previous = NULL; 51a28: 42ae fff8 clrl %fp@(-8) tail->previous = head; 51a2c: 2d43 fffc movel %d3,%fp@(-4) { /* * 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; 51a30: 2547 0078 movel %d7,%a2@(120) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51a34: 47f9 0005 56c0 lea 556c0 <_Watchdog_Adjust_to_chain>,%a3 /* * 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 ); 51a3a: 4bf9 0005 5640 lea 55640 <_Watchdog_Adjust>,%a5 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 51a40: 2039 0007 5764 movel 75764 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 51a46: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 51a4a: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51a4e: 9081 subl %d1,%d0 51a50: 2f03 movel %d3,%sp@- 51a52: 2f00 movel %d0,%sp@- 51a54: 2f05 movel %d5,%sp@- 51a56: 4e93 jsr %a3@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 51a58: 2879 0007 56ee moveal 756ee <_TOD_Now>,%a4 /* * 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 ) { 51a5e: 4fef 000c lea %sp@(12),%sp Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 51a62: 202a 0074 movel %a2@(116),%d0 /* * 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 ) { 51a66: b08c cmpl %a4,%d0 51a68: 640e bccs 51a78 <_Timer_server_Body+0x98> /* * 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 ); 51a6a: 2f03 movel %d3,%sp@- 51a6c: 220c movel %a4,%d1 51a6e: 9280 subl %d0,%d1 51a70: 2f01 movel %d1,%sp@- 51a72: 2f02 movel %d2,%sp@- 51a74: 4e93 jsr %a3@ 51a76: 6010 bras 51a88 <_Timer_server_Body+0xa8> } else if ( snapshot < last_snapshot ) { 51a78: b08c cmpl %a4,%d0 51a7a: 6310 blss 51a8c <_Timer_server_Body+0xac> /* * 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 ); 51a7c: 908c subl %a4,%d0 51a7e: 2f00 movel %d0,%sp@- 51a80: 4878 0001 pea 1 51a84: 2f02 movel %d2,%sp@- 51a86: 4e95 jsr %a5@ 51a88: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 51a8c: 254c 0074 movel %a4,%a2@(116) ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51a90: 49f9 0005 574c lea 5574c <_Watchdog_Insert>,%a4 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 51a96: 202a 0078 movel %a2@(120),%d0 51a9a: 2f00 movel %d0,%sp@- 51a9c: 4eb9 0005 2468 jsr 52468 <_Chain_Get> if ( timer == NULL ) { 51aa2: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 51aa4: 2040 moveal %d0,%a0 if ( timer == NULL ) { 51aa6: 4a80 tstl %d0 51aa8: 6724 beqs 51ace <_Timer_server_Body+0xee> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51aaa: 2028 0038 movel %a0@(56),%d0 51aae: 7201 moveq #1,%d1 51ab0: b280 cmpl %d0,%d1 51ab2: 6608 bnes 51abc <_Timer_server_Body+0xdc> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 51ab4: 4868 0010 pea %a0@(16) 51ab8: 2f05 movel %d5,%sp@- 51aba: 600c bras 51ac8 <_Timer_server_Body+0xe8> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51abc: 7203 moveq #3,%d1 51abe: b280 cmpl %d0,%d1 51ac0: 66d4 bnes 51a96 <_Timer_server_Body+0xb6> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51ac2: 4868 0010 pea %a0@(16) 51ac6: 2f02 movel %d2,%sp@- 51ac8: 4e94 jsr %a4@ 51aca: 508f addql #8,%sp 51acc: 60c8 bras 51a96 <_Timer_server_Body+0xb6> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 51ace: 203c 0000 0700 movel #1792,%d0 51ad4: 40c1 movew %sr,%d1 51ad6: 8081 orl %d1,%d0 51ad8: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 51ada: bcae ffe8 cmpl %fp@(-24),%d6 51ade: 6612 bnes 51af2 <_Timer_server_Body+0x112> <== NEVER TAKEN ts->insert_chain = NULL; 51ae0: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 51ae4: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51ae6: 367c 0700 moveaw #1792,%a3 _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 ) ) { 51aea: b8ae fff4 cmpl %fp@(-12),%d4 51aee: 6608 bnes 51af8 <_Timer_server_Body+0x118> 51af0: 603e bras 51b30 <_Timer_server_Body+0x150> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 51af2: 46c1 movew %d1,%sr <== NOT EXECUTED 51af4: 6000 ff4a braw 51a40 <_Timer_server_Body+0x60> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51af8: 200b movel %a3,%d0 51afa: 40c1 movew %sr,%d1 51afc: 8081 orl %d1,%d0 51afe: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 51b00: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 51b04: b888 cmpl %a0,%d4 51b06: 6722 beqs 51b2a <_Timer_server_Body+0x14a> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 51b08: 2250 moveal %a0@,%a1 head->next = new_first; new_first->previous = head; 51b0a: 2343 0004 movel %d3,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 51b0e: 42a8 0008 clrl %a0@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 51b12: 2d49 fff4 movel %a1,%fp@(-12) _ISR_Enable( level ); 51b16: 46c1 movew %d1,%sr /* * 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 ); 51b18: 2f28 0024 movel %a0@(36),%sp@- 51b1c: 2f28 0020 movel %a0@(32),%sp@- 51b20: 2068 001c moveal %a0@(28),%a0 51b24: 4e90 jsr %a0@ } 51b26: 508f addql #8,%sp 51b28: 60ce bras 51af8 <_Timer_server_Body+0x118> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 51b2a: 46c1 movew %d1,%sr 51b2c: 6000 ff02 braw 51a30 <_Timer_server_Body+0x50> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51b30: 47f9 0005 5870 lea 55870 <_Watchdog_Remove>,%a3 * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 51b36: 4200 clrb %d0 51b38: 1540 007c moveb %d0,%a2@(124) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 51b3c: 4eba fdc2 jsr %pc@(51900 <_Thread_Disable_dispatch>) _Thread_Set_state( ts->thread, STATES_DELAYING ); 51b40: 4878 0008 pea 8 51b44: 2f12 movel %a2@,%sp@- 51b46: 4eb9 0005 511c jsr 5511c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 51b4c: 2f0a movel %a2,%sp@- 51b4e: 4eba fdcc jsr %pc@(5191c <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 51b52: 2f0a movel %a2,%sp@- 51b54: 4eba fe26 jsr %pc@(5197c <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 51b58: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> ts->active = true; 51b5e: 7201 moveq #1,%d1 51b60: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51b64: 486a 0008 pea %a2@(8) 51b68: 4e93 jsr %a3@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51b6a: 486a 0040 pea %a2@(64) 51b6e: 4e93 jsr %a3@ 51b70: 4fef 0018 lea %sp@(24),%sp 51b74: 6000 feba braw 51a30 <_Timer_server_Body+0x50> =============================================================================== 00051b78 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 51b78: 4e56 fff0 linkw %fp,#-16 51b7c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 51b80: 246e 0008 moveal %fp@(8),%a2 51b84: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 51b88: 202a 0078 movel %a2@(120),%d0 51b8c: 6600 00ea bnew 51c78 <_Timer_server_Schedule_operation_method+0x100> * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 51b90: 4eba fd6e jsr %pc@(51900 <_Thread_Disable_dispatch>) if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51b94: 202b 0038 movel %a3@(56),%d0 51b98: 7201 moveq #1,%d1 51b9a: b280 cmpl %d0,%d1 51b9c: 665c bnes 51bfa <_Timer_server_Schedule_operation_method+0x82> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 51b9e: 203c 0000 0700 movel #1792,%d0 51ba4: 40c2 movew %sr,%d2 51ba6: 8082 orl %d2,%d0 51ba8: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 51baa: 2039 0007 5764 movel 75764 <_Watchdog_Ticks_since_boot>,%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 51bb0: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 51bb4: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 51bb8: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 51bbc: b3c8 cmpal %a0,%a1 51bbe: 6716 beqs 51bd6 <_Timer_server_Schedule_operation_method+0x5e> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 51bc0: 2240 moveal %d0,%a1 51bc2: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 51bc4: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 51bc8: b3c1 cmpal %d1,%a1 51bca: 6404 bccs 51bd0 <_Timer_server_Schedule_operation_method+0x58> delta_interval -= delta; 51bcc: 9289 subl %a1,%d1 51bce: 6002 bras 51bd2 <_Timer_server_Schedule_operation_method+0x5a> } else { delta_interval = 0; 51bd0: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 51bd2: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 51bd6: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 51bda: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 51bdc: 486b 0010 pea %a3@(16) 51be0: 486a 0030 pea %a2@(48) 51be4: 4eb9 0005 574c jsr 5574c <_Watchdog_Insert> if ( !ts->active ) { 51bea: 508f addql #8,%sp 51bec: 102a 007c moveb %a2@(124),%d0 51bf0: 6678 bnes 51c6a <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_interval_system_watchdog( ts ); 51bf2: 2f0a movel %a2,%sp@- 51bf4: 4eba fd26 jsr %pc@(5191c <_Timer_server_Reset_interval_system_watchdog>) 51bf8: 606e bras 51c68 <_Timer_server_Schedule_operation_method+0xf0> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51bfa: 7203 moveq #3,%d1 51bfc: b280 cmpl %d0,%d1 51bfe: 666a bnes 51c6a <_Timer_server_Schedule_operation_method+0xf2> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 51c00: 203c 0000 0700 movel #1792,%d0 51c06: 40c2 movew %sr,%d2 51c08: 8082 orl %d2,%d0 51c0a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 51c0c: 200a movel %a2,%d0 51c0e: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 51c14: 2239 0007 56ee movel 756ee <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 51c1a: 226a 0074 moveal %a2@(116),%a1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 51c1e: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 51c22: b088 cmpl %a0,%d0 51c24: 6720 beqs 51c46 <_Timer_server_Schedule_operation_method+0xce> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 51c26: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 51c2a: b3c1 cmpal %d1,%a1 51c2c: 640c bccs 51c3a <_Timer_server_Schedule_operation_method+0xc2> /* * We advanced in time. */ delta = snapshot - last_snapshot; 51c2e: 2841 moveal %d1,%a4 51c30: 99c9 subal %a1,%a4 if (delta_interval > delta) { 51c32: b9c0 cmpal %d0,%a4 51c34: 640a bccs 51c40 <_Timer_server_Schedule_operation_method+0xc8><== NEVER TAKEN delta_interval -= delta; 51c36: 908c subl %a4,%d0 51c38: 6008 bras 51c42 <_Timer_server_Schedule_operation_method+0xca> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 51c3a: d089 addl %a1,%d0 delta_interval += delta; 51c3c: 9081 subl %d1,%d0 51c3e: 6002 bras 51c42 <_Timer_server_Schedule_operation_method+0xca> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 51c40: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 51c42: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 51c46: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 51c4a: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51c4c: 486b 0010 pea %a3@(16) 51c50: 486a 0068 pea %a2@(104) 51c54: 4eb9 0005 574c jsr 5574c <_Watchdog_Insert> if ( !ts->active ) { 51c5a: 508f addql #8,%sp 51c5c: 102a 007c moveb %a2@(124),%d0 51c60: 6608 bnes 51c6a <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_tod_system_watchdog( ts ); 51c62: 2f0a movel %a2,%sp@- 51c64: 4eba fd16 jsr %pc@(5197c <_Timer_server_Reset_tod_system_watchdog>) 51c68: 588f addql #4,%sp * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 51c6a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 51c70: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 51c72: 4ef9 0005 4940 jmp 54940 <_Thread_Enable_dispatch> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 51c78: 202a 0078 movel %a2@(120),%d0 51c7c: 2d4b 000c movel %a3,%fp@(12) } } 51c80: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 51c86: 2d40 0008 movel %d0,%fp@(8) } } 51c8a: 4e5e unlk %fp * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 51c8c: 4ef9 0005 2408 jmp 52408 <_Chain_Append> =============================================================================== 00048634 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 48634: 4e56 ffe8 linkw %fp,#-24 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 48638: 203c 0005 d970 movel #383344,%d0 4863e: 23c0 0005 d96c movel %d0,5d96c <_User_extensions_List> head->previous = NULL; tail->previous = head; 48644: 203c 0005 d96c movel #383340,%d0 4864a: 23c0 0005 d974 movel %d0,5d974 <_User_extensions_List+0x8> ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 48650: 203c 0005 d830 movel #383024,%d0 48656: 23c0 0005 d82c movel %d0,5d82c <_User_extensions_Switches_list> head->previous = NULL; tail->previous = head; 4865c: 203c 0005 d82c movel #383020,%d0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 48662: 42b9 0005 d970 clrl 5d970 <_User_extensions_List+0x4> 48668: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 4866c: 2839 0005 bf02 movel 5bf02 ,%d4 initial_extensions = Configuration.User_extension_table; 48672: 2639 0005 bf06 movel 5bf06 ,%d3 48678: 42b9 0005 d830 clrl 5d830 <_User_extensions_Switches_list+0x4> tail->previous = head; 4867e: 23c0 0005 d834 movel %d0,5d834 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 48684: 4a83 tstl %d3 48686: 6754 beqs 486dc <_User_extensions_Handler_initialization+0xa8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 48688: 7434 moveq #52,%d2 4868a: 4c04 2800 mulsl %d4,%d2 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 4868e: 49f9 0004 c854 lea 4c854 ,%a4 _User_extensions_Add_set( extension ); 48694: 47f9 0004 acec lea 4acec <_User_extensions_Add_set>,%a3 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 4869a: 2f02 movel %d2,%sp@- 4869c: 4eb9 0004 8b56 jsr 48b56 <_Workspace_Allocate_or_fatal_error> 486a2: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 486a4: 2f02 movel %d2,%sp@- extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 486a6: 4282 clrl %d2 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 486a8: 42a7 clrl %sp@- 486aa: 2f00 movel %d0,%sp@- 486ac: 4eb9 0004 c8c4 jsr 4c8c4 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 486b2: 4fef 0010 lea %sp@(16),%sp 486b6: 6020 bras 486d8 <_User_extensions_Handler_initialization+0xa4> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 486b8: 4878 0020 pea 20 486bc: 5282 addql #1,%d2 486be: 2f03 movel %d3,%sp@- 486c0: 486a 0014 pea %a2@(20) 486c4: 0683 0000 0020 addil #32,%d3 486ca: 4e94 jsr %a4@ _User_extensions_Add_set( extension ); 486cc: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 486ce: 45ea 0034 lea %a2@(52),%a2 486d2: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 486d4: 4fef 0010 lea %sp@(16),%sp 486d8: b882 cmpl %d2,%d4 486da: 66dc bnes 486b8 <_User_extensions_Handler_initialization+0x84> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 486dc: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 486e2: 4e5e unlk %fp ... =============================================================================== 00049b64 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49b64: 327c 0700 moveaw #1792,%a1 49b68: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49b6a: 4e56 ffec linkw %fp,#-20 49b6e: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 49b72: 266e 0008 moveal %fp@(8),%a3 49b76: 262e 000c movel %fp@(12),%d3 49b7a: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49b7e: 40c0 movew %sr,%d0 49b80: 8280 orl %d0,%d1 49b82: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 49b84: 244b moveal %a3,%a2 49b86: 205a moveal %a2@+,%a0 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 49b88: b5c8 cmpal %a0,%a2 49b8a: 674c beqs 49bd8 <_Watchdog_Adjust+0x74> switch ( direction ) { 49b8c: 4a83 tstl %d3 49b8e: 673c beqs 49bcc <_Watchdog_Adjust+0x68> 49b90: 7201 moveq #1,%d1 49b92: b283 cmpl %d3,%d1 49b94: 6642 bnes 49bd8 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 49b96: d5a8 0010 addl %d2,%a0@(16) break; 49b9a: 603c bras 49bd8 <_Watchdog_Adjust+0x74> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49b9c: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49b9e: 2228 0010 movel %a0@(16),%d1 49ba2: b282 cmpl %d2,%d1 49ba4: 6308 blss 49bae <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 49ba6: 9282 subl %d2,%d1 49ba8: 2141 0010 movel %d1,%a0@(16) break; 49bac: 602a bras 49bd8 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; 49bae: 9481 subl %d1,%d2 _Watchdog_First( header )->delta_interval = 1; 49bb0: 7201 moveq #1,%d1 49bb2: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 49bb6: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 49bb8: 2f0b movel %a3,%sp@- 49bba: 4e94 jsr %a4@ _ISR_Disable( level ); 49bbc: 2203 movel %d3,%d1 49bbe: 40c0 movew %sr,%d0 49bc0: 8280 orl %d0,%d1 49bc2: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 49bc4: 588f addql #4,%sp 49bc6: b5d3 cmpal %a3@,%a2 49bc8: 660a bnes 49bd4 <_Watchdog_Adjust+0x70> 49bca: 600c bras 49bd8 <_Watchdog_Adjust+0x74> units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49bcc: 49f9 0004 9d84 lea 49d84 <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 49bd2: 2609 movel %a1,%d3 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49bd4: 4a82 tstl %d2 49bd6: 66c4 bnes 49b9c <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49bd8: 46c0 movew %d0,%sr } 49bda: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 49be0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000488a4 <_Watchdog_Insert>: Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 488a4: 327c 0700 moveaw #1792,%a1 488a8: 2009 movel %a1,%d0 void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 488aa: 4e56 ffec linkw %fp,#-20 488ae: 206e 000c moveal %fp@(12),%a0 488b2: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 488b6: 266e 0008 moveal %fp@(8),%a3 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 488ba: 2439 0005 d9b8 movel 5d9b8 <_Per_CPU_Information+0x8>,%d2 _ISR_Disable( level ); 488c0: 40c1 movew %sr,%d1 488c2: 8081 orl %d1,%d0 488c4: 46c0 movew %d0,%sr /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 488c6: 4aa8 0008 tstl %a0@(8) 488ca: 6600 0098 bnew 48964 <_Watchdog_Insert+0xc0> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 488ce: 7001 moveq #1,%d0 break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 488d0: 2449 moveal %a1,%a2 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 488d2: 2140 0008 movel %d0,%a0@(8) _Watchdog_Sync_count++; 488d6: 2039 0005 d924 movel 5d924 <_Watchdog_Sync_count>,%d0 488dc: 5280 addql #1,%d0 488de: 23c0 0005 d924 movel %d0,5d924 <_Watchdog_Sync_count> restart: delta_interval = the_watchdog->initial; 488e4: 2028 000c movel %a0@(12),%d0 488e8: 2253 moveal %a3@,%a1 for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 488ea: 4a80 tstl %d0 488ec: 673c beqs 4892a <_Watchdog_Insert+0x86> 488ee: 4a91 tstl %a1@ 488f0: 6738 beqs 4892a <_Watchdog_Insert+0x86> break; if ( delta_interval < after->delta_interval ) { 488f2: 2629 0010 movel %a1@(16),%d3 488f6: b680 cmpl %d0,%d3 488f8: 6308 blss 48902 <_Watchdog_Insert+0x5e> after->delta_interval -= delta_interval; 488fa: 9680 subl %d0,%d3 488fc: 2343 0010 movel %d3,%a1@(16) break; 48900: 6028 bras 4892a <_Watchdog_Insert+0x86> } delta_interval -= after->delta_interval; _ISR_Flash( level ); 48902: 280a movel %a2,%d4 48904: 46c1 movew %d1,%sr 48906: 8881 orl %d1,%d4 48908: 46c4 movew %d4,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 4890a: 7801 moveq #1,%d4 4890c: b8a8 0008 cmpl %a0@(8),%d4 48910: 663e bnes 48950 <_Watchdog_Insert+0xac> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 48912: 2839 0005 d8cc movel 5d8cc <_Watchdog_Sync_level>,%d4 48918: b484 cmpl %d4,%d2 4891a: 6408 bccs 48924 <_Watchdog_Insert+0x80> _Watchdog_Sync_level = insert_isr_nest_level; 4891c: 23c2 0005 d8cc movel %d2,5d8cc <_Watchdog_Sync_level> goto restart; 48922: 60c0 bras 488e4 <_Watchdog_Insert+0x40> exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 48924: 2251 moveal %a1@,%a1 if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 48926: 9083 subl %d3,%d0 if ( _Watchdog_Sync_level > insert_isr_nest_level ) { _Watchdog_Sync_level = insert_isr_nest_level; goto restart; } } 48928: 60c0 bras 488ea <_Watchdog_Insert+0x46> _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 4892a: 2269 0004 moveal %a1@(4),%a1 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 4892e: 7602 moveq #2,%d3 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 48930: 2451 moveal %a1@,%a2 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 48932: 2140 0010 movel %d0,%a0@(16) _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 48936: 2039 0005 d928 movel 5d928 <_Watchdog_Ticks_since_boot>,%d0 4893c: 2143 0008 movel %d3,%a0@(8) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 48940: 2149 0004 movel %a1,%a0@(4) before_node = after_node->next; after_node->next = the_node; 48944: 2288 movel %a0,%a1@ the_node->next = before_node; before_node->previous = the_node; 48946: 2548 0004 movel %a0,%a2@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 4894a: 208a movel %a2,%a0@ 4894c: 2140 0014 movel %d0,%a0@(20) exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 48950: 23c2 0005 d8cc movel %d2,5d8cc <_Watchdog_Sync_level> _Watchdog_Sync_count--; 48956: 2039 0005 d924 movel 5d924 <_Watchdog_Sync_count>,%d0 4895c: 5380 subql #1,%d0 4895e: 23c0 0005 d924 movel %d0,5d924 <_Watchdog_Sync_count> _ISR_Enable( level ); 48964: 46c1 movew %d1,%sr } 48966: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4896a: 4e5e unlk %fp ... =============================================================================== 000489c8 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 489c8: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 489ce: 4e56 0000 linkw %fp,#0 489d2: 206e 0008 moveal %fp@(8),%a0 489d6: 2f0a movel %a2,%sp@- 489d8: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 489da: 40c1 movew %sr,%d1 489dc: 8081 orl %d1,%d0 489de: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 489e0: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 489e4: 7401 moveq #1,%d2 489e6: b480 cmpl %d0,%d2 489e8: 670c beqs 489f6 <_Watchdog_Remove+0x2e> 489ea: 6242 bhis 48a2e <_Watchdog_Remove+0x66> 489ec: 143c 0003 moveb #3,%d2 489f0: b480 cmpl %d0,%d2 489f2: 653a bcss 48a2e <_Watchdog_Remove+0x66> <== NEVER TAKEN 489f4: 6006 bras 489fc <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 489f6: 42a8 0008 clrl %a0@(8) break; 489fa: 6032 bras 48a2e <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 489fc: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 489fe: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 48a02: 4a91 tstl %a1@ 48a04: 6708 beqs 48a0e <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 48a06: 2428 0010 movel %a0@(16),%d2 48a0a: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 48a0e: 2479 0005 d924 moveal 5d924 <_Watchdog_Sync_count>,%a2 48a14: 4a8a tstl %a2 48a16: 670c beqs 48a24 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 48a18: 45f9 0005 d9b8 lea 5d9b8 <_Per_CPU_Information+0x8>,%a2 48a1e: 23d2 0005 d8cc movel %a2@,5d8cc <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 48a24: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 48a28: 234a 0004 movel %a2,%a1@(4) previous->next = next; 48a2c: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 48a2e: 2279 0005 d928 moveal 5d928 <_Watchdog_Ticks_since_boot>,%a1 48a34: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 48a38: 46c1 movew %d1,%sr return( previous_state ); } 48a3a: 241f movel %sp@+,%d2 48a3c: 245f moveal %sp@+,%a2 48a3e: 4e5e unlk %fp ... =============================================================================== 000463cc : rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node ) { 463cc: 4e56 0000 linkw %fp,#0 463d0: 2f03 movel %d3,%sp@- 463d2: 262e 0010 movel %fp@(16),%d3 463d6: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node ) { return _Chain_Get_with_empty_check( chain, node ); 463d8: 2f2e 0014 movel %fp@(20),%sp@- 463dc: 2f2e 0008 movel %fp@(8),%sp@- 463e0: 242e 000c movel %fp@(12),%d2 463e4: 4eb9 0004 6970 jsr 46970 <_Chain_Get_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { 463ea: 508f addql #8,%sp 463ec: 4a00 tstb %d0 463ee: 6718 beqs 46408 <== NEVER TAKEN sc = rtems_event_send( task, events ); 463f0: 2d43 000c movel %d3,%fp@(12) } return sc; } 463f4: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 463f8: 2d42 0008 movel %d2,%fp@(8) } return sc; } 463fc: 242e fff8 movel %fp@(-8),%d2 46400: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 46402: 4ef9 0004 59f8 jmp 459f8 } return sc; } 46408: 242e fff8 movel %fp@(-8),%d2 4640c: 4280 clrl %d0 4640e: 262e fffc movel %fp@(-4),%d3 46412: 4e5e unlk %fp ... =============================================================================== 00046418 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 46418: 4e56 ffe0 linkw %fp,#-32 4641c: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 46420: 260e movel %fp,%d3 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 46422: 47f9 0004 69b8 lea 469b8 <_Chain_Get>,%a3 46428: 5983 subql #4,%d3 4642a: 45f9 0004 5890 lea 45890 ,%a2 rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 46430: 2c2e 0008 movel %fp@(8),%d6 46434: 2a2e 000c movel %fp@(12),%d5 46438: 282e 0010 movel %fp@(16),%d4 4643c: 6012 bras 46450 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 4643e: 2f03 movel %d3,%sp@- 46440: 2f04 movel %d4,%sp@- 46442: 42a7 clrl %sp@- 46444: 2f05 movel %d5,%sp@- 46446: 4e92 jsr %a2@ ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 46448: 4fef 0010 lea %sp@(16),%sp 4644c: 4a80 tstl %d0 4644e: 660c bnes 4645c <== ALWAYS TAKEN 46450: 2f06 movel %d6,%sp@- 46452: 4e93 jsr %a3@ sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 46454: 588f addql #4,%sp 46456: 2400 movel %d0,%d2 46458: 67e4 beqs 4643e 4645a: 4280 clrl %d0 timeout, &out ); } *node_ptr = node; 4645c: 206e 0014 moveal %fp@(20),%a0 46460: 2082 movel %d2,%a0@ return sc; } 46462: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 46468: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046ff4 : rtems_status_code rtems_extension_create( rtems_name name, const rtems_extensions_table *extension_table, rtems_id *id ) { 46ff4: 4e56 fff4 linkw %fp,#-12 46ff8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 46ffc: 242e 0008 movel %fp@(8),%d2 47000: 266e 0010 moveal %fp@(16),%a3 Extension_Control *the_extension; if ( !id ) 47004: 4a8b tstl %a3 47006: 6778 beqs 47080 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 47008: 4a82 tstl %d2 4700a: 6778 beqs 47084 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 4700c: 2039 0005 f9e8 movel 5f9e8 <_Thread_Dispatch_disable_level>,%d0 47012: 5280 addql #1,%d0 47014: 23c0 0005 f9e8 movel %d0,5f9e8 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 4701a: 2039 0005 f9e8 movel 5f9e8 <_Thread_Dispatch_disable_level>,%d0 #ifndef __EXTENSION_MANAGER_inl #define __EXTENSION_MANAGER_inl RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void ) { return (Extension_Control *) _Objects_Allocate( &_Extension_Information ); 47020: 4879 0005 fb44 pea 5fb44 <_Extension_Information> 47026: 4eb9 0004 7d88 jsr 47d88 <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_extension = _Extension_Allocate(); if ( !the_extension ) { 4702c: 588f addql #4,%sp 4702e: 2440 moveal %d0,%a2 47030: 4a80 tstl %d0 47032: 660a bnes 4703e _Thread_Enable_dispatch(); 47034: 4eb9 0004 8e68 jsr 48e68 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 4703a: 7005 moveq #5,%d0 4703c: 6048 bras 47086 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 4703e: 4878 0020 pea 20 47042: 2f2e 000c movel %fp@(12),%sp@- 47046: 486a 0024 pea %a2@(36) 4704a: 4eb9 0004 d9dc jsr 4d9dc _User_extensions_Add_set( extension ); 47050: 486a 0010 pea %a2@(16) 47054: 4eb9 0004 98b0 jsr 498b0 <_User_extensions_Add_set> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 4705a: 202a 0008 movel %a2@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4705e: 4281 clrl %d1 47060: 2079 0005 fb5c moveal 5fb5c <_Extension_Information+0x18>,%a0 47066: 3200 movew %d0,%d1 47068: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4706c: 2542 000c movel %d2,%a2@(12) &_Extension_Information, &the_extension->Object, (Objects_Name) name ); *id = the_extension->Object.id; 47070: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 47072: 4eb9 0004 8e68 jsr 48e68 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 47078: 4fef 0010 lea %sp@(16),%sp 4707c: 4280 clrl %d0 4707e: 6006 bras 47086 ) { Extension_Control *the_extension; if ( !id ) return RTEMS_INVALID_ADDRESS; 47080: 7009 moveq #9,%d0 47082: 6002 bras 47086 if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 47084: 7003 moveq #3,%d0 ); *id = the_extension->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47086: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 4708c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046e18 : 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 ) { 46e18: 4e56 0000 linkw %fp,#0 46e1c: 206e 000c moveal %fp@(12),%a0 46e20: 2f0a movel %a2,%sp@- 46e22: 226e 0010 moveal %fp@(16),%a1 46e26: 2f02 movel %d2,%sp@- 46e28: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46e2c: 2039 0006 0e4c movel 60e4c <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46e32: 4ab9 0006 0dd0 tstl 60dd0 <_Per_CPU_Information+0x8> 46e38: 6600 00de bnew 46f18 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46e3c: 4a89 tstl %a1 46e3e: 6700 00dc beqw 46f1c return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46e42: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46e44: 4a88 tstl %a0 46e46: 6700 00d4 beqw 46f1c static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e4a: 4a90 tstl %a0@ 46e4c: 6600 00e0 bnew 46f2e 46e50: 4aa8 0004 tstl %a0@(4) 46e54: 6600 00d8 bnew 46f2e 46e58: 6000 00c2 braw 46f1c * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 46e5c: 2039 0006 0c40 movel 60c40 <_Thread_Dispatch_disable_level>,%d0 46e62: 5280 addql #1,%d0 46e64: 23c0 0006 0c40 movel %d0,60c40 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 46e6a: 2039 0006 0c40 movel 60c40 <_Thread_Dispatch_disable_level>,%d0 if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46e70: 4a82 tstl %d2 46e72: 662c bnes 46ea0 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46e74: 2039 0006 0e4c movel 60e4c <_IO_Number_of_drivers>,%d0 46e7a: 2479 0006 0e50 moveal 60e50 <_IO_Driver_address_table>,%a2 46e80: 6010 bras 46e92 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e82: 4a92 tstl %a2@ 46e84: 6600 00b0 bnew 46f36 46e88: 4aaa 0004 tstl %a2@(4) 46e8c: 6600 00a8 bnew 46f36 46e90: 6004 bras 46e96 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 46e92: b082 cmpl %d2,%d0 46e94: 66ec bnes 46e82 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46e96: 2282 movel %d2,%a1@ if ( m != n ) 46e98: b082 cmpl %d2,%d0 46e9a: 6638 bnes 46ed4 46e9c: 6000 00a2 braw 46f40 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46ea0: 2202 movel %d2,%d1 46ea2: 2002 movel %d2,%d0 46ea4: e789 lsll #3,%d1 46ea6: eb88 lsll #5,%d0 46ea8: 2479 0006 0e50 moveal 60e50 <_IO_Driver_address_table>,%a2 46eae: 9081 subl %d1,%d0 46eb0: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46eb2: 4a92 tstl %a2@ 46eb4: 660c bnes 46ec2 return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; } rtems_status_code rtems_io_register_driver( 46eb6: 4aaa 0004 tstl %a2@(4) 46eba: 57c0 seq %d0 46ebc: 49c0 extbl %d0 46ebe: 4480 negl %d0 46ec0: 6002 bras 46ec4 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46ec2: 4280 clrl %d0 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { 46ec4: 4a00 tstb %d0 46ec6: 660a bnes 46ed2 _Thread_Enable_dispatch(); 46ec8: 4eb9 0004 8b0c jsr 48b0c <_Thread_Enable_dispatch> return RTEMS_RESOURCE_IN_USE; 46ece: 700c moveq #12,%d0 46ed0: 6050 bras 46f22 } *registered_major = major; 46ed2: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46ed4: 2202 movel %d2,%d1 46ed6: 2002 movel %d2,%d0 46ed8: 4878 0018 pea 18 46edc: e789 lsll #3,%d1 46ede: eb88 lsll #5,%d0 46ee0: 2f08 movel %a0,%sp@- 46ee2: 9081 subl %d1,%d0 46ee4: d0b9 0006 0e50 addl 60e50 <_IO_Driver_address_table>,%d0 46eea: 2f00 movel %d0,%sp@- 46eec: 4eb9 0004 fe5c jsr 4fe5c _Thread_Enable_dispatch(); 46ef2: 4eb9 0004 8b0c jsr 48b0c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46ef8: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46efc: 4fef 000c lea %sp@(12),%sp 46f00: 2d42 0008 movel %d2,%fp@(8) } 46f04: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46f08: 42ae 0010 clrl %fp@(16) 46f0c: 42ae 000c clrl %fp@(12) } 46f10: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46f12: 4ef9 0004 db1c jmp 4db1c ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 46f18: 7012 moveq #18,%d0 46f1a: 6006 bras 46f22 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 46f1c: 7009 moveq #9,%d0 46f1e: 6002 bras 46f22 if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 46f20: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 46f22: 242e fff8 movel %fp@(-8),%d2 46f26: 246e fffc moveal %fp@(-4),%a2 46f2a: 4e5e unlk %fp 46f2c: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46f2e: b082 cmpl %d2,%d0 46f30: 63ee blss 46f20 46f32: 6000 ff28 braw 46e5c rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 46f36: 5282 addql #1,%d2 46f38: 45ea 0018 lea %a2@(24),%a2 46f3c: 6000 ff54 braw 46e92 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46f40: 4eb9 0004 8b0c jsr 48b0c <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 46f46: 7005 moveq #5,%d0 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); return sc; 46f48: 60d8 bras 46f22 ... =============================================================================== 00047d30 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47d30: 4e56 fff0 linkw %fp,#-16 47d34: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47d38: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47d3c: 4a8c tstl %a4 47d3e: 673c beqs 47d7c <== NEVER TAKEN 47d40: 45f9 0005 f9a8 lea 5f9a8 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) 47d46: 205a moveal %a2@+,%a0 47d48: 4a88 tstl %a0 47d4a: 6728 beqs 47d74 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 47d4c: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47d50: 4a8b tstl %a3 47d52: 6720 beqs 47d74 47d54: 7401 moveq #1,%d2 47d56: 6012 bras 47d6a continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47d58: 206b 0018 moveal %a3@(24),%a0 47d5c: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !the_thread ) 47d60: 6706 beqs 47d68 <== NEVER TAKEN continue; (*routine)(the_thread); 47d62: 2f00 movel %d0,%sp@- 47d64: 4e94 jsr %a4@ 47d66: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47d68: 5282 addql #1,%d2 47d6a: 4280 clrl %d0 47d6c: 302b 000e movew %a3@(14),%d0 47d70: b082 cmpl %d2,%d0 47d72: 64e4 bccs 47d58 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47d74: b5fc 0005 f9b4 cmpal #391604,%a2 47d7a: 66ca bnes 47d46 (*routine)(the_thread); } } } 47d7c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47d82: 4e5e unlk %fp ... =============================================================================== 0004af50 : */ rtems_status_code rtems_message_queue_delete( rtems_id id ) { 4af50: 4e56 fffc linkw %fp,#-4 4af54: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4af56: 486e fffc pea %fp@(-4) 4af5a: 2f2e 0008 movel %fp@(8),%sp@- 4af5e: 4879 0005 fb94 pea 5fb94 <_Message_queue_Information> 4af64: 4eb9 0004 7a20 jsr 47a20 <_Objects_Get> register Message_queue_Control *the_message_queue; Objects_Locations location; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4af6a: 4fef 000c lea %sp@(12),%sp 4af6e: 2440 moveal %d0,%a2 4af70: 4aae fffc tstl %fp@(-4) 4af74: 663a bnes 4afb0 <== NEVER TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, 4af76: 2f00 movel %d0,%sp@- 4af78: 4879 0005 fb94 pea 5fb94 <_Message_queue_Information> 4af7e: 4eb9 0004 763c jsr 4763c <_Objects_Close> &the_message_queue->Object ); _CORE_message_queue_Close( 4af84: 4878 0005 pea 5 4af88: 42a7 clrl %sp@- 4af8a: 486a 0014 pea %a2@(20) 4af8e: 4eb9 0004 b4d0 jsr 4b4d0 <_CORE_message_queue_Close> */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 4af94: 2f0a movel %a2,%sp@- 4af96: 4879 0005 fb94 pea 5fb94 <_Message_queue_Information> 4af9c: 4eb9 0004 78bc jsr 478bc <_Objects_Free> 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 4afa2: 4eb9 0004 85d4 jsr 485d4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4afa8: 4fef 001c lea %sp@(28),%sp 4afac: 4280 clrl %d0 4afae: 6002 bras 4afb2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4afb0: 7004 moveq #4,%d0 } 4afb2: 246e fff8 moveal %fp@(-8),%a2 4afb6: 4e5e unlk %fp ... =============================================================================== 0004f7dc : rtems_status_code rtems_partition_get_buffer( rtems_id id, void **buffer ) { 4f7dc: 4e56 fff0 linkw %fp,#-16 4f7e0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4f7e4: 266e 000c moveal %fp@(12),%a3 register Partition_Control *the_partition; Objects_Locations location; void *the_buffer; if ( !buffer ) 4f7e8: 4a8b tstl %a3 4f7ea: 6748 beqs 4f834 <== NEVER TAKEN RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4f7ec: 486e fffc pea %fp@(-4) 4f7f0: 2f2e 0008 movel %fp@(8),%sp@- 4f7f4: 4879 0007 5504 pea 75504 <_Partition_Information> 4f7fa: 4eb9 0005 3d18 jsr 53d18 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4f800: 4fef 000c lea %sp@(12),%sp 4f804: 2440 moveal %d0,%a2 4f806: 4aae fffc tstl %fp@(-4) 4f80a: 662c bnes 4f838 */ RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer ( Partition_Control *the_partition ) { return _Chain_Get( &the_partition->Memory ); 4f80c: 486a 0024 pea %a2@(36) 4f810: 4eb9 0005 2468 jsr 52468 <_Chain_Get> case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { 4f816: 588f addql #4,%sp 4f818: 41f9 0005 4940 lea 54940 <_Thread_Enable_dispatch>,%a0 4f81e: 2400 movel %d0,%d2 4f820: 670c beqs 4f82e the_partition->number_of_used_blocks += 1; 4f822: 52aa 0020 addql #1,%a2@(32) _Thread_Enable_dispatch(); 4f826: 4e90 jsr %a0@ *buffer = the_buffer; return RTEMS_SUCCESSFUL; 4f828: 4280 clrl %d0 case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { the_partition->number_of_used_blocks += 1; _Thread_Enable_dispatch(); *buffer = the_buffer; 4f82a: 2682 movel %d2,%a3@ return RTEMS_SUCCESSFUL; 4f82c: 600c bras 4f83a } _Thread_Enable_dispatch(); 4f82e: 4e90 jsr %a0@ return RTEMS_UNSATISFIED; 4f830: 700d moveq #13,%d0 4f832: 6006 bras 4f83a register Partition_Control *the_partition; Objects_Locations location; void *the_buffer; if ( !buffer ) return RTEMS_INVALID_ADDRESS; 4f834: 7009 moveq #9,%d0 4f836: 6002 bras 4f83a case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4f838: 7004 moveq #4,%d0 } 4f83a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 4f840: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f870 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4f870: 4e56 fffc linkw %fp,#-4 4f874: 2f0a movel %a2,%sp@- 4f876: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4f878: 486e fffc pea %fp@(-4) 4f87c: 2f2e 0008 movel %fp@(8),%sp@- 4f880: 4879 0007 5504 pea 75504 <_Partition_Information> 4f886: 242e 000c movel %fp@(12),%d2 4f88a: 4eb9 0005 3d18 jsr 53d18 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4f890: 4fef 000c lea %sp@(12),%sp 4f894: 2440 moveal %d0,%a2 4f896: 4aae fffc tstl %fp@(-4) 4f89a: 663e bnes 4f8da ) { void *starting; void *ending; starting = the_partition->starting_address; 4f89c: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4f8a0: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4f8a4: b082 cmpl %d2,%d0 4f8a6: 6240 bhis 4f8e8 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 4f8a8: d280 addl %d0,%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4f8aa: b282 cmpl %d2,%d1 4f8ac: 653a bcss 4f8e8 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 4f8ae: 2202 movel %d2,%d1 4f8b0: 9280 subl %d0,%d1 4f8b2: 2001 movel %d1,%d0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 4f8b4: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 4f8ba: 4a81 tstl %d1 4f8bc: 662a bnes 4f8e8 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4f8be: 2f02 movel %d2,%sp@- 4f8c0: 486a 0024 pea %a2@(36) 4f8c4: 4eb9 0005 2408 jsr 52408 <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4f8ca: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4f8ce: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f8d4: 508f addql #8,%sp 4f8d6: 4280 clrl %d0 4f8d8: 6002 bras 4f8dc case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4f8da: 7004 moveq #4,%d0 } 4f8dc: 242e fff4 movel %fp@(-12),%d2 4f8e0: 246e fff8 moveal %fp@(-8),%a2 4f8e4: 4e5e unlk %fp 4f8e6: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4f8e8: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 4f8ee: 7009 moveq #9,%d0 4f8f0: 60ea bras 4f8dc ... =============================================================================== 0004b79c : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 4b79c: 4e56 fffc linkw %fp,#-4 4b7a0: 2f0a movel %a2,%sp@- 4b7a2: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) 4b7a6: 4a8a tstl %a2 4b7a8: 6700 0096 beqw 4b840 4b7ac: 486e fffc pea %fp@(-4) 4b7b0: 2f2e 0008 movel %fp@(8),%sp@- 4b7b4: 4879 0005 f130 pea 5f130 <_Rate_monotonic_Information> 4b7ba: 4eb9 0004 8510 jsr 48510 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4b7c0: 4fef 000c lea %sp@(12),%sp 4b7c4: 2040 moveal %d0,%a0 4b7c6: 4aae fffc tstl %fp@(-4) 4b7ca: 6678 bnes 4b844 <== NEVER TAKEN case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 4b7cc: 24a8 0054 movel %a0@(84),%a2@ dst->missed_count = src->missed_count; 4b7d0: 2568 0058 0004 movel %a0@(88),%a2@(4) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); 4b7d6: 2028 005c movel %a0@(92),%d0 4b7da: 2228 0060 movel %a0@(96),%d1 4b7de: 2540 0008 movel %d0,%a2@(8) 4b7e2: 2541 000c movel %d1,%a2@(12) _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 4b7e6: 2028 0064 movel %a0@(100),%d0 4b7ea: 2228 0068 movel %a0@(104),%d1 4b7ee: 2540 0010 movel %d0,%a2@(16) 4b7f2: 2541 0014 movel %d1,%a2@(20) _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 4b7f6: 2028 006c movel %a0@(108),%d0 4b7fa: 2228 0070 movel %a0@(112),%d1 4b7fe: 2540 0018 movel %d0,%a2@(24) 4b802: 2541 001c movel %d1,%a2@(28) _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 4b806: 2028 0074 movel %a0@(116),%d0 4b80a: 2228 0078 movel %a0@(120),%d1 4b80e: 2540 0020 movel %d0,%a2@(32) 4b812: 2541 0024 movel %d1,%a2@(36) _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 4b816: 2028 007c movel %a0@(124),%d0 4b81a: 2228 0080 movel %a0@(128),%d1 4b81e: 2540 0028 movel %d0,%a2@(40) 4b822: 2541 002c movel %d1,%a2@(44) _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 4b826: 2028 0084 movel %a0@(132),%d0 4b82a: 2228 0088 movel %a0@(136),%d1 4b82e: 2540 0030 movel %d0,%a2@(48) 4b832: 2541 0034 movel %d1,%a2@(52) dst->min_wall_time = src->min_wall_time; dst->max_wall_time = src->max_wall_time; dst->total_wall_time = src->total_wall_time; #endif _Thread_Enable_dispatch(); 4b836: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4b83c: 4280 clrl %d0 4b83e: 6006 bras 4b846 Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) return RTEMS_INVALID_ADDRESS; 4b840: 7009 moveq #9,%d0 4b842: 6002 bras 4b846 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4b844: 7004 moveq #4,%d0 } 4b846: 246e fff8 moveal %fp@(-8),%a2 4b84a: 4e5e unlk %fp ... =============================================================================== 00046552 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 46552: 4e56 ffec linkw %fp,#-20 46556: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 4655a: 486e fffc pea %fp@(-4) 4655e: 262e 0008 movel %fp@(8),%d3 46562: 2f03 movel %d3,%sp@- 46564: 4879 0005 f130 pea 5f130 <_Rate_monotonic_Information> 4656a: 242e 000c movel %fp@(12),%d2 4656e: 4eb9 0004 8510 jsr 48510 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 46574: 4fef 000c lea %sp@(12),%sp 46578: 2440 moveal %d0,%a2 4657a: 4aae fffc tstl %fp@(-4) 4657e: 6600 015a bnew 466da case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 46582: 2039 0005 f3b4 movel 5f3b4 <_Per_CPU_Information+0xc>,%d0 46588: b0aa 0040 cmpl %a2@(64),%d0 4658c: 670c beqs 4659a _Thread_Enable_dispatch(); 4658e: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 46594: 7417 moveq #23,%d2 46596: 6000 0144 braw 466dc } if ( length == RTEMS_PERIOD_STATUS ) { 4659a: 4a82 tstl %d2 4659c: 6624 bnes 465c2 switch ( the_period->state ) { 4659e: 202a 0038 movel %a2@(56),%d0 465a2: 7204 moveq #4,%d1 465a4: b280 cmpl %d0,%d1 465a6: 650e bcss 465b6 <== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 465a8: 41f9 0005 c9ca lea 5c9ca ,%a0 465ae: 4282 clrl %d2 465b0: 1430 0800 moveb %a0@(00000000,%d0:l),%d2 465b4: 6002 bras 465b8 _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 465b6: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 465b8: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return( return_value ); 465be: 6000 011c braw 466dc } _ISR_Disable( level ); 465c2: 203c 0000 0700 movel #1792,%d0 465c8: 40c4 movew %sr,%d4 465ca: 8084 orl %d4,%d0 465cc: 46c0 movew %d0,%sr if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 465ce: 202a 0038 movel %a2@(56),%d0 465d2: 664a bnes 4661e _ISR_Enable( level ); 465d4: 46c4 movew %d4,%sr the_period->next_length = length; 465d6: 2542 003c movel %d2,%a2@(60) /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 465da: 2f0a movel %a2,%sp@- 465dc: 4eb9 0004 63d6 jsr 463d6 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 465e2: 7002 moveq #2,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 465e4: 223c 0004 692c movel #289068,%d1 465ea: 2540 0038 movel %d0,%a2@(56) 465ee: 2541 002c movel %d1,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 465f2: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; 465f6: 2543 0030 movel %d3,%a2@(48) the_watchdog->user_data = user_data; 465fa: 42aa 0034 clrl %a2@(52) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 465fe: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46602: 486a 0010 pea %a2@(16) 46606: 4879 0005 f2d8 pea 5f2d8 <_Watchdog_Ticks_chain> 4660c: 4eb9 0004 9e04 jsr 49e04 <_Watchdog_Insert> id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 46612: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46618: 4fef 000c lea %sp@(12),%sp 4661c: 606c bras 4668a } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 4661e: 7202 moveq #2,%d1 46620: b280 cmpl %d0,%d1 46622: 666a bnes 4668e /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 46624: 2f0a movel %a2,%sp@- 46626: 4eb9 0004 6460 jsr 46460 <_Rate_monotonic_Update_statistics> /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 4662c: 7001 moveq #1,%d0 the_period->next_length = length; 4662e: 2542 003c movel %d2,%a2@(60) /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 46632: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 46636: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 46638: 2079 0005 f3b4 moveal 5f3b4 <_Per_CPU_Information+0xc>,%a0 4663e: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 46644: 4878 4000 pea 4000 46648: 2f08 movel %a0,%sp@- 4664a: 4eb9 0004 9890 jsr 49890 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 46650: 203c 0000 0700 movel #1792,%d0 46656: 40c1 movew %sr,%d1 46658: 8081 orl %d1,%d0 4665a: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 4665c: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 4665e: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 46662: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 46666: 46c1 movew %d1,%sr /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 46668: 7203 moveq #3,%d1 4666a: 4fef 000c lea %sp@(12),%sp 4666e: b280 cmpl %d0,%d1 46670: 6612 bnes 46684 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 46672: 4878 4000 pea 4000 46676: 2f39 0005 f3b4 movel 5f3b4 <_Per_CPU_Information+0xc>,%sp@- 4667c: 4eb9 0004 8dc4 jsr 48dc4 <_Thread_Clear_state> 46682: 508f addql #8,%sp _Thread_Enable_dispatch(); 46684: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4668a: 4282 clrl %d2 4668c: 604e bras 466dc } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 4668e: 7204 moveq #4,%d1 46690: b280 cmpl %d0,%d1 46692: 6646 bnes 466da <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 46694: 2f0a movel %a2,%sp@- 46696: 4eb9 0004 6460 jsr 46460 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 4669c: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 4669e: 7002 moveq #2,%d0 the_period->next_length = length; 466a0: 2542 003c movel %d2,%a2@(60) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 466a4: 2540 0038 movel %d0,%a2@(56) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 466a8: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 466ac: 486a 0010 pea %a2@(16) the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 466b0: 7406 moveq #6,%d2 466b2: 4879 0005 f2d8 pea 5f2d8 <_Watchdog_Ticks_chain> 466b8: 4eb9 0004 9e04 jsr 49e04 <_Watchdog_Insert> 466be: 2f2a 003c movel %a2@(60),%sp@- 466c2: 2f2a 0040 movel %a2@(64),%sp@- 466c6: 2079 0005 d8f2 moveal 5d8f2 <_Scheduler+0x34>,%a0 466cc: 4e90 jsr %a0@ the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 466ce: 4eb9 0004 9138 jsr 49138 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 466d4: 4fef 0014 lea %sp@(20),%sp 466d8: 6002 bras 466dc #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 466da: 7404 moveq #4,%d2 } 466dc: 2002 movel %d2,%d0 466de: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 466e4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004687c : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 4687c: 4e56 0000 linkw %fp,#0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 46880: 2039 0005 f220 movel 5f220 <_Thread_Dispatch_disable_level>,%d0 46886: 5280 addql #1,%d0 46888: 2f0a movel %a2,%sp@- 4688a: 23c0 0005 f220 movel %d0,5f220 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 46890: 2039 0005 f220 movel 5f220 <_Thread_Dispatch_disable_level>,%d0 46896: 2f02 movel %d2,%sp@- /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 46898: 2439 0005 f136 movel 5f136 <_Rate_monotonic_Information+0x6>,%d2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 4689e: 45f9 0004 68c8 lea 468c8 ,%a2 /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 468a4: 6008 bras 468ae id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 468a6: 2f02 movel %d2,%sp@- * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 468a8: 5282 addql #1,%d2 (void) rtems_rate_monotonic_reset_statistics( id ); 468aa: 4e92 jsr %a2@ * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 468ac: 588f addql #4,%sp /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 468ae: b4b9 0005 f13a cmpl 5f13a <_Rate_monotonic_Information+0xa>,%d2 468b4: 63f0 blss 468a6 /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 468b6: 242e fff8 movel %fp@(-8),%d2 468ba: 246e fffc moveal %fp@(-4),%a2 468be: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 468c0: 4ef9 0004 9138 jmp 49138 <_Thread_Enable_dispatch> ... =============================================================================== 000504a8 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 504a8: 4e56 fffc linkw %fp,#-4 504ac: 2f03 movel %d3,%sp@- 504ae: 262e 0010 movel %fp@(16),%d3 504b2: 2f02 movel %d2,%sp@- 504b4: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 504b8: 6768 beqs 50522 return RTEMS_INVALID_ADDRESS; if ( !size ) 504ba: 4a83 tstl %d3 504bc: 6764 beqs 50522 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 504be: 2f39 0007 5704 movel 75704 <_RTEMS_Allocator_Mutex>,%sp@- 504c4: 4eb9 0005 2370 jsr 52370 <_API_Mutex_Lock> 504ca: 486e fffc pea %fp@(-4) 504ce: 2f2e 0008 movel %fp@(8),%sp@- 504d2: 4879 0007 5574 pea 75574 <_Region_Information> 504d8: 4eb9 0005 3ce0 jsr 53ce0 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 504de: 222e fffc movel %fp@(-4),%d1 504e2: 4fef 0010 lea %sp@(16),%sp 504e6: 6708 beqs 504f0 504e8: 7001 moveq #1,%d0 504ea: b081 cmpl %d1,%d0 504ec: 661a bnes 50508 <== NEVER TAKEN 504ee: 601c bras 5050c case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 504f0: 2f03 movel %d3,%sp@- 504f2: 2040 moveal %d0,%a0 504f4: 2f02 movel %d2,%sp@- 504f6: 4868 0068 pea %a0@(104) 504fa: 4eb9 0005 374c jsr 5374c <_Heap_Size_of_alloc_area> 50500: 4fef 000c lea %sp@(12),%sp 50504: 4a00 tstb %d0 50506: 6708 beqs 50510 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 50508: 4282 clrl %d2 5050a: 6006 bras 50512 case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 5050c: 7404 moveq #4,%d2 5050e: 6002 bras 50512 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) return_status = RTEMS_INVALID_ADDRESS; 50510: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 50512: 2f39 0007 5704 movel 75704 <_RTEMS_Allocator_Mutex>,%sp@- 50518: 4eb9 0005 23d0 jsr 523d0 <_API_Mutex_Unlock> return return_status; 5051e: 588f addql #4,%sp 50520: 6002 bras 50524 if ( !segment ) return RTEMS_INVALID_ADDRESS; if ( !size ) return RTEMS_INVALID_ADDRESS; 50522: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 50524: 2002 movel %d2,%d0 50526: 242e fff4 movel %fp@(-12),%d2 5052a: 262e fff8 movel %fp@(-8),%d3 5052e: 4e5e unlk %fp ... =============================================================================== 0004602c : void rtems_shutdown_executive( uint32_t result ) { if ( _System_state_Is_up( _System_state_Get() ) ) { 4602c: 7003 moveq #3,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 4602e: 4e56 0000 linkw %fp,#0 if ( _System_state_Is_up( _System_state_Get() ) ) { 46032: b0b9 0005 d968 cmpl 5d968 <_System_state_Current>,%d0 46038: 6624 bnes 4605e #if defined(RTEMS_SMP) _SMP_Request_other_cores_to_shutdown(); #endif _Per_CPU_Information[0].idle->Wait.return_code = result; 4603a: 2079 0005 d9c4 moveal 5d9c4 <_Per_CPU_Information+0x14>,%a0 46040: 103c 0004 moveb #4,%d0 46044: 216e 0008 0034 movel %fp@(8),%a0@(52) * if we were running within the same context, it would work. * * And we will not return to this thread, so there is no point of * saving the context. */ _Context_Restart_self( &_Thread_BSP_context ); 4604a: 4879 0005 d7f4 pea 5d7f4 <_Thread_BSP_context> 46050: 23c0 0005 d968 movel %d0,5d968 <_System_state_Current> 46056: 4eb9 0004 8ba2 jsr 48ba2 <_CPU_Context_Restart_self> 4605c: 588f addql #4,%sp <== NOT EXECUTED ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 4605e: 4878 0014 pea 14 46062: 4878 0001 pea 1 46066: 42a7 clrl %sp@- 46068: 4eb9 0004 6b84 jsr 46b84 <_Internal_error_Occurred> ... =============================================================================== 00050b0c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 50b0c: 4e56 fffc linkw %fp,#-4 50b10: 2f03 movel %d3,%sp@- 50b12: 2f02 movel %d2,%sp@- 50b14: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 50b18: 6776 beqs 50b90 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 50b1a: 486e fffc pea %fp@(-4) 50b1e: 2f2e 0008 movel %fp@(8),%sp@- 50b22: 4eb9 0005 4968 jsr 54968 <_Thread_Get> switch ( location ) { 50b28: 508f addql #8,%sp 50b2a: 4aae fffc tstl %fp@(-4) 50b2e: 6664 bnes 50b94 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 50b30: 2240 moveal %d0,%a1 50b32: 2069 00fc moveal %a1@(252),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 50b36: 4aa8 000a tstl %a0@(10) 50b3a: 674a beqs 50b86 50b3c: 223c 0000 0700 movel #1792,%d1 if ( asr->is_enabled ) { 50b42: 4a28 0008 tstb %a0@(8) 50b46: 6726 beqs 50b6e rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50b48: 40c3 movew %sr,%d3 50b4a: 8283 orl %d3,%d1 50b4c: 46c1 movew %d1,%sr *signal_set |= signals; 50b4e: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 50b52: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 50b54: 4ab9 0007 57fc tstl 757fc <_Per_CPU_Information+0x8> 50b5a: 6720 beqs 50b7c 50b5c: b0b9 0007 5800 cmpl 75800 <_Per_CPU_Information+0xc>,%d0 50b62: 6618 bnes 50b7c <== NEVER TAKEN _Thread_Dispatch_necessary = true; 50b64: 7001 moveq #1,%d0 50b66: 13c0 0007 580c moveb %d0,7580c <_Per_CPU_Information+0x18> 50b6c: 600e bras 50b7c rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50b6e: 2001 movel %d1,%d0 50b70: 40c1 movew %sr,%d1 50b72: 8081 orl %d1,%d0 50b74: 46c0 movew %d0,%sr *signal_set |= signals; 50b76: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 50b7a: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 50b7c: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50b82: 4280 clrl %d0 50b84: 6010 bras 50b96 } _Thread_Enable_dispatch(); 50b86: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 50b8c: 700b moveq #11,%d0 50b8e: 6006 bras 50b96 Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 50b90: 700a moveq #10,%d0 50b92: 6002 bras 50b96 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 50b94: 7004 moveq #4,%d0 } 50b96: 242e fff4 movel %fp@(-12),%d2 50b9a: 262e fff8 movel %fp@(-8),%d3 50b9e: 4e5e unlk %fp ... =============================================================================== 0004bc34 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4bc34: 4e56 ffe4 linkw %fp,#-28 4bc38: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4bc3c: 262e 0008 movel %fp@(8),%d3 4bc40: 282e 000c movel %fp@(12),%d4 4bc44: 286e 0010 moveal %fp@(16),%a4 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 4bc48: 4a8c tstl %a4 4bc4a: 6700 0104 beqw 4bd50 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4bc4e: 2679 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a3 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4bc54: 4a2b 0074 tstb %a3@(116) 4bc58: 57c2 seq %d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4bc5a: 246b 00fc moveal %a3@(252),%a2 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4bc5e: 49c2 extbl %d2 4bc60: 0282 0000 0100 andil #256,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4bc66: 4aab 007a tstl %a3@(122) 4bc6a: 6704 beqs 4bc70 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4bc6c: 08c2 0009 bset #9,%d2 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4bc70: 4a2a 0008 tstb %a2@(8) 4bc74: 57c5 seq %d5 old_mode |= _ISR_Get_level(); 4bc76: 4eb9 0004 8c48 jsr 48c48 <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4bc7c: 49c5 extbl %d5 4bc7e: 0285 0000 0400 andil #1024,%d5 4bc84: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); 4bc86: 8082 orl %d2,%d0 4bc88: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4bc8a: 0804 0008 btst #8,%d4 4bc8e: 670c beqs 4bc9c executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4bc90: 0803 0008 btst #8,%d3 4bc94: 57c0 seq %d0 4bc96: 4480 negl %d0 4bc98: 1740 0074 moveb %d0,%a3@(116) if ( mask & RTEMS_TIMESLICE_MASK ) { 4bc9c: 0804 0009 btst #9,%d4 4bca0: 671c beqs 4bcbe if ( _Modes_Is_timeslice(mode_set) ) { 4bca2: 0803 0009 btst #9,%d3 4bca6: 6712 beqs 4bcba executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4bca8: 41f9 0005 d7e0 lea 5d7e0 <_Thread_Ticks_per_timeslice>,%a0 if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4bcae: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4bcb0: 2750 0076 movel %a0@,%a3@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4bcb4: 2740 007a movel %d0,%a3@(122) 4bcb8: 6004 bras 4bcbe executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4bcba: 42ab 007a clrl %a3@(122) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4bcbe: 7007 moveq #7,%d0 4bcc0: c084 andl %d4,%d0 4bcc2: 6712 beqs 4bcd6 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4bcc4: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4bcc6: 7207 moveq #7,%d1 4bcc8: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4bcca: 0280 0000 f8ff andil #63743,%d0 4bcd0: e189 lsll #8,%d1 4bcd2: 8081 orl %d1,%d0 4bcd4: 46c0 movew %d0,%sr * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4bcd6: 0804 000a btst #10,%d4 4bcda: 6740 beqs 4bd1c is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4bcdc: 4281 clrl %d1 4bcde: 122a 0008 moveb %a2@(8),%d1 4bce2: 4282 clrl %d2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4bce4: 0803 000a btst #10,%d3 4bce8: 57c0 seq %d0 4bcea: 4480 negl %d0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4bcec: 1400 moveb %d0,%d2 4bcee: b282 cmpl %d2,%d1 4bcf0: 672a beqs 4bd1c asr->is_enabled = is_asr_enabled; 4bcf2: 1540 0008 moveb %d0,%a2@(8) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4bcf6: 203c 0000 0700 movel #1792,%d0 4bcfc: 40c1 movew %sr,%d1 4bcfe: 8081 orl %d1,%d0 4bd00: 46c0 movew %d0,%sr _signals = information->signals_pending; 4bd02: 202a 0016 movel %a2@(22),%d0 information->signals_pending = information->signals_posted; 4bd06: 256a 0012 0016 movel %a2@(18),%a2@(22) information->signals_posted = _signals; 4bd0c: 2540 0012 movel %d0,%a2@(18) _ISR_Enable( _level ); 4bd10: 46c1 movew %d1,%sr /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4bd12: 4aaa 0012 tstl %a2@(18) 4bd16: 56c0 sne %d0 4bd18: 4480 negl %d0 4bd1a: 6002 bras 4bd1e 4bd1c: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4bd1e: 7203 moveq #3,%d1 4bd20: b2b9 0005 d968 cmpl 5d968 <_System_state_Current>,%d1 4bd26: 662c bnes 4bd54 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 4bd28: 2079 0005 d9bc moveal 5d9bc <_Per_CPU_Information+0xc>,%a0 if ( are_signals_pending || 4bd2e: 4a00 tstb %d0 4bd30: 660e bnes 4bd40 4bd32: b1f9 0005 d9c0 cmpal 5d9c0 <_Per_CPU_Information+0x10>,%a0 4bd38: 671a beqs 4bd54 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 4bd3a: 4a28 0074 tstb %a0@(116) 4bd3e: 6714 beqs 4bd54 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 4bd40: 7001 moveq #1,%d0 4bd42: 13c0 0005 d9c8 moveb %d0,5d9c8 <_Per_CPU_Information+0x18> if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 4bd48: 4eb9 0004 7b70 jsr 47b70 <_Thread_Dispatch> 4bd4e: 6004 bras 4bd54 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4bd50: 7009 moveq #9,%d0 4bd52: 6002 bras 4bd56 if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 4bd54: 4280 clrl %d0 } 4bd56: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4bd5c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049500 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 49500: 4e56 fffc linkw %fp,#-4 49504: 2f0a movel %a2,%sp@- 49506: 246e 0010 moveal %fp@(16),%a2 4950a: 2f02 movel %d2,%sp@- 4950c: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 49510: 670c beqs 4951e RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 49512: 4280 clrl %d0 49514: 1039 0005 f56a moveb 5f56a ,%d0 4951a: b082 cmpl %d2,%d0 4951c: 654e bcss 4956c !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4951e: 4a8a tstl %a2 49520: 674e beqs 49570 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49522: 486e fffc pea %fp@(-4) 49526: 2f2e 0008 movel %fp@(8),%sp@- 4952a: 4eb9 0004 b5d4 jsr 4b5d4 <_Thread_Get> switch ( location ) { 49530: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49532: 2040 moveal %d0,%a0 switch ( location ) { 49534: 4aae fffc tstl %fp@(-4) 49538: 663a bnes 49574 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4953a: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4953e: 4a82 tstl %d2 49540: 6720 beqs 49562 the_thread->real_priority = new_priority; 49542: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 49546: 4aa8 001c tstl %a0@(28) 4954a: 6706 beqs 49552 4954c: b4a8 0014 cmpl %a0@(20),%d2 49550: 6410 bccs 49562 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 49552: 42a7 clrl %sp@- 49554: 2f02 movel %d2,%sp@- 49556: 2f08 movel %a0,%sp@- 49558: 4eb9 0004 b15c jsr 4b15c <_Thread_Change_priority> 4955e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 49562: 4eb9 0004 b5ac jsr 4b5ac <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 49568: 4280 clrl %d0 4956a: 600a bras 49576 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 4956c: 7013 moveq #19,%d0 4956e: 6006 bras 49576 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 49570: 7009 moveq #9,%d0 49572: 6002 bras 49576 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 49574: 7004 moveq #4,%d0 } 49576: 242e fff4 movel %fp@(-12),%d2 4957a: 246e fff8 moveal %fp@(-8),%a2 4957e: 4e5e unlk %fp ... =============================================================================== 00051390 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 51390: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 51394: 486e fffc pea %fp@(-4) 51398: 2f2e 0008 movel %fp@(8),%sp@- 5139c: 4879 0007 5878 pea 75878 <_Timer_Information> 513a2: 4eb9 0005 3d18 jsr 53d18 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 513a8: 4fef 000c lea %sp@(12),%sp 513ac: 4aae fffc tstl %fp@(-4) 513b0: 6620 bnes 513d2 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 513b2: 7204 moveq #4,%d1 513b4: 2040 moveal %d0,%a0 513b6: b2a8 0038 cmpl %a0@(56),%d1 513ba: 670c beqs 513c8 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 513bc: 4868 0010 pea %a0@(16) 513c0: 4eb9 0005 5870 jsr 55870 <_Watchdog_Remove> 513c6: 588f addql #4,%sp _Thread_Enable_dispatch(); 513c8: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 513ce: 4280 clrl %d0 513d0: 6002 bras 513d4 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 513d2: 7004 moveq #4,%d0 } 513d4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045ee4 : rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ) { 45ee4: 4e56 0000 linkw %fp,#0 45ee8: 2f0a movel %a2,%sp@- 45eea: 246e 000c moveal %fp@(12),%a2 45eee: 2f02 movel %d2,%sp@- 45ef0: 242e 0008 movel %fp@(8),%d2 Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) 45ef4: 676e beqs 45f64 <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) 45ef6: 4a8a tstl %a2 45ef8: 676e beqs 45f68 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 45efa: 2039 0005 d89a movel 5d89a <_Thread_Dispatch_disable_level>,%d0 45f00: 5280 addql #1,%d0 45f02: 23c0 0005 d89a movel %d0,5d89a <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 45f08: 2039 0005 d89a movel 5d89a <_Thread_Dispatch_disable_level>,%d0 * This function allocates a timer control block from * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void ) { return (Timer_Control *) _Objects_Allocate( &_Timer_Information ); 45f0e: 4879 0005 da6c pea 5da6c <_Timer_Information> 45f14: 4eb9 0004 6d2c jsr 46d2c <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { 45f1a: 588f addql #4,%sp 45f1c: 2040 moveal %d0,%a0 45f1e: 4a80 tstl %d0 45f20: 660a bnes 45f2c _Thread_Enable_dispatch(); 45f22: 4eb9 0004 7d40 jsr 47d40 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 45f28: 7005 moveq #5,%d0 45f2a: 603e bras 45f6a } the_timer->the_class = TIMER_DORMANT; 45f2c: 7004 moveq #4,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45f2e: 4281 clrl %d1 45f30: 2140 0038 movel %d0,%a0@(56) Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 45f34: 2028 0008 movel %a0@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45f38: 2279 0005 da84 moveal 5da84 <_Timer_Information+0x18>,%a1 45f3e: 3200 movew %d0,%d1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45f40: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; 45f44: 42a8 002c clrl %a0@(44) the_watchdog->id = id; 45f48: 42a8 0030 clrl %a0@(48) the_watchdog->user_data = user_data; 45f4c: 42a8 0034 clrl %a0@(52) 45f50: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45f54: 2142 000c movel %d2,%a0@(12) &_Timer_Information, &the_timer->Object, (Objects_Name) name ); *id = the_timer->Object.id; 45f58: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 45f5a: 4eb9 0004 7d40 jsr 47d40 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45f60: 4280 clrl %d0 45f62: 6006 bras 45f6a ) { Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 45f64: 7003 moveq #3,%d0 45f66: 6002 bras 45f6a if ( !id ) return RTEMS_INVALID_ADDRESS; 45f68: 7009 moveq #9,%d0 ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45f6a: 242e fff8 movel %fp@(-8),%d2 45f6e: 246e fffc moveal %fp@(-4),%a2 45f72: 4e5e unlk %fp ... =============================================================================== 0005176c : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 5176c: 4e56 ffe8 linkw %fp,#-24 51770: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 51774: 262e 0008 movel %fp@(8),%d3 51778: 242e 000c movel %fp@(12),%d2 5177c: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; 51780: 2679 0007 58b0 moveal 758b0 <_Timer_server>,%a3 if ( !timer_server ) 51786: 4a8b tstl %a3 51788: 6700 0088 beqw 51812 return RTEMS_INCORRECT_STATE; if ( !routine ) 5178c: 4a84 tstl %d4 5178e: 6700 0086 beqw 51816 return RTEMS_INVALID_ADDRESS; if ( ticks == 0 ) 51792: 4a82 tstl %d2 51794: 6700 0084 beqw 5181a 51798: 486e fffc pea %fp@(-4) 5179c: 2f03 movel %d3,%sp@- 5179e: 4879 0007 5878 pea 75878 <_Timer_Information> 517a4: 4eb9 0005 3d18 jsr 53d18 <_Objects_Get> return RTEMS_INVALID_NUMBER; the_timer = _Timer_Get( id, &location ); switch ( location ) { 517aa: 4fef 000c lea %sp@(12),%sp 517ae: 2440 moveal %d0,%a2 517b0: 4aae fffc tstl %fp@(-4) 517b4: 6668 bnes 5181e <== NEVER TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 517b6: 486a 0010 pea %a2@(16) 517ba: 4eb9 0005 5870 jsr 55870 <_Watchdog_Remove> _ISR_Disable( level ); 517c0: 203c 0000 0700 movel #1792,%d0 517c6: 40c1 movew %sr,%d1 517c8: 8081 orl %d1,%d0 517ca: 46c0 movew %d0,%sr /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { 517cc: 588f addql #4,%sp 517ce: 4aaa 0018 tstl %a2@(24) 517d2: 670a beqs 517de _ISR_Enable( level ); 517d4: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 517d6: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> 517dc: 6030 bras 5180e /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL_ON_TASK; 517de: 7001 moveq #1,%d0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 517e0: 256e 0014 0034 movel %fp@(20),%a2@(52) 517e6: 2540 0038 movel %d0,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 517ea: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; 517ee: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 517f2: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; 517f6: 2542 001c movel %d2,%a2@(28) _ISR_Enable( level ); 517fa: 46c1 movew %d1,%sr (*timer_server->schedule_operation)( timer_server, the_timer ); 517fc: 2f0a movel %a2,%sp@- 517fe: 2f0b movel %a3,%sp@- 51800: 206b 0004 moveal %a3@(4),%a0 51804: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 51806: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5180c: 508f addql #8,%sp 5180e: 4280 clrl %d0 51810: 600e bras 51820 Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 51812: 700e moveq #14,%d0 51814: 600a bras 51820 if ( !routine ) return RTEMS_INVALID_ADDRESS; 51816: 7009 moveq #9,%d0 51818: 6006 bras 51820 if ( ticks == 0 ) return RTEMS_INVALID_NUMBER; 5181a: 700a moveq #10,%d0 5181c: 6002 bras 51820 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5181e: 7004 moveq #4,%d0 } 51820: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 51826: 4e5e unlk %fp ... =============================================================================== 0005182c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5182c: 4e56 ffe8 linkw %fp,#-24 51830: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 51834: 262e 0008 movel %fp@(8),%d3 51838: 242e 000c movel %fp@(12),%d2 5183c: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 51840: 2679 0007 58b0 moveal 758b0 <_Timer_server>,%a3 if ( !timer_server ) 51846: 4a8b tstl %a3 51848: 6700 0098 beqw 518e2 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 5184c: 4a39 0007 5674 tstb 75674 <_TOD_Is_set> 51852: 6700 0092 beqw 518e6 return RTEMS_NOT_DEFINED; if ( !routine ) 51856: 4a84 tstl %d4 51858: 6700 0090 beqw 518ea return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 5185c: 2f02 movel %d2,%sp@- 5185e: 4eb9 0004 ec6c jsr 4ec6c <_TOD_Validate> 51864: 588f addql #4,%sp 51866: 4a00 tstb %d0 51868: 6700 0084 beqw 518ee return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 5186c: 2f02 movel %d2,%sp@- 5186e: 4eb9 0004 ebd4 jsr 4ebd4 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 51874: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51876: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 51878: b0b9 0007 56ee cmpl 756ee <_TOD_Now>,%d0 5187e: 636e blss 518ee 51880: 486e fffc pea %fp@(-4) 51884: 2f03 movel %d3,%sp@- 51886: 4879 0007 5878 pea 75878 <_Timer_Information> 5188c: 4eb9 0005 3d18 jsr 53d18 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51892: 4fef 000c lea %sp@(12),%sp 51896: 2440 moveal %d0,%a2 51898: 4aae fffc tstl %fp@(-4) 5189c: 6654 bnes 518f2 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 5189e: 486a 0010 pea %a2@(16) 518a2: 4eb9 0005 5870 jsr 55870 <_Watchdog_Remove> the_watchdog->user_data = user_data; 518a8: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 518ae: 94b9 0007 56ee subl 756ee <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 518b4: 7003 moveq #3,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 518b6: 42aa 0018 clrl %a2@(24) 518ba: 2540 0038 movel %d0,%a2@(56) the_watchdog->routine = routine; 518be: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 518c2: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 518c6: 2542 001c movel %d2,%a2@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 518ca: 2f0a movel %a2,%sp@- 518cc: 2f0b movel %a3,%sp@- 518ce: 206b 0004 moveal %a3@(4),%a0 518d2: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 518d4: 4eb9 0005 4940 jsr 54940 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 518da: 4fef 000c lea %sp@(12),%sp 518de: 4280 clrl %d0 518e0: 6012 bras 518f4 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 518e2: 700e moveq #14,%d0 518e4: 600e bras 518f4 if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 518e6: 700b moveq #11,%d0 <== NOT EXECUTED 518e8: 600a bras 518f4 <== NOT EXECUTED if ( !routine ) return RTEMS_INVALID_ADDRESS; 518ea: 7009 moveq #9,%d0 518ec: 6006 bras 518f4 if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; 518ee: 7014 moveq #20,%d0 518f0: 6002 bras 518f4 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 518f2: 7004 moveq #4,%d0 } 518f4: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 518fa: 4e5e unlk %fp ...