=============================================================================== 0004b61c : * 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; 4b61c: 41f9 0005 f404 lea 5f404 ,%a0 #include uint32_t TOD_MICROSECONDS_TO_TICKS( uint32_t microseconds ) { 4b622: 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; 4b626: 202e 0008 movel %fp@(8),%d0 4b62a: 4c50 0001 remul %a0@,%d1,%d0 4b62e: 4c50 0000 remul %a0@,%d0,%d0 if ( (microseconds % microseconds_per_tick) != 0 ) 4b632: 4a81 tstl %d1 4b634: 6702 beqs 4b638 <== ALWAYS TAKEN ticks += 1; 4b636: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 4b638: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004775c : #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 4775c: 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(); 47760: 2039 0005 b664 movel 5b664 ,%d0 #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 47766: 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(); 47768: 243c 0000 03e8 movel #1000,%d2 4776e: 4c42 0000 remul %d2,%d0,%d0 ticks = milliseconds / milliseconds_per_tick; 47772: 242e 0008 movel %fp@(8),%d2 47776: 4c40 2001 remul %d0,%d1,%d2 4777a: 4c40 2002 remul %d0,%d2,%d2 4777e: 2002 movel %d2,%d0 if ( (milliseconds % milliseconds_per_tick) != 0 ) 47780: 4a81 tstl %d1 47782: 6702 beqs 47786 <== ALWAYS TAKEN ticks += 1; 47784: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 47786: 241f movel %sp@+,%d2 47788: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046c98 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 46c98: 4e56 0000 linkw %fp,#0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 46c9c: 2039 0005 dbf6 movel 5dbf6 <_Thread_Dispatch_disable_level>,%d0 ++level; 46ca2: 5280 addql #1,%d0 46ca4: 206e 0008 moveal %fp@(8),%a0 _Thread_Dispatch_disable_level = level; 46ca8: 23c0 0005 dbf6 movel %d0,5dbf6 <_Thread_Dispatch_disable_level> /* Dispatch is already disabled in SMP while lock is held. */ #if !defined(RTEMS_SMP) _Thread_Disable_dispatch(); #endif _CORE_mutex_Surrender( 46cae: 42a7 clrl %sp@- 46cb0: 2f28 0008 movel %a0@(8),%sp@- 46cb4: 4868 0010 pea %a0@(16) 46cb8: 4eb9 0004 6f4c jsr 46f4c <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46cbe: 4fef 000c lea %sp@(12),%sp } 46cc2: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46cc4: 4ef9 0004 8678 jmp 48678 <_Thread_Enable_dispatch> ... =============================================================================== 0004d1c0 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4d1c0: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4d1c6: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4d1ca: 2279 0005 fd72 moveal 5fd72 <_Per_CPU_Information+0xe>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4d1d0: 48d7 001c moveml %d2-%d4,%sp@ 4d1d4: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4d1d8: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4d1dc: 242e 000c movel %fp@(12),%d2 4d1e0: 262e 0014 movel %fp@(20),%d3 4d1e4: 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 ); 4d1e8: 40c1 movew %sr,%d1 4d1ea: 8081 orl %d1,%d0 4d1ec: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4d1ee: 2028 0048 movel %a0@(72),%d0 4d1f2: 5280 addql #1,%d0 4d1f4: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4d1f8: 4aa8 0040 tstl %a0@(64) 4d1fc: 6626 bnes 4d224 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 4d1fe: b0a8 0044 cmpl %a0@(68),%d0 4d202: 6620 bnes 4d224 <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4d204: 7001 moveq #1,%d0 4d206: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4d20a: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4d20c: 2d44 0010 movel %d4,%fp@(16) 4d210: 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 ); } 4d214: 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 ); 4d218: 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 ); } 4d21c: 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 ); 4d21e: 4ef9 0004 d18c jmp 4d18c <_CORE_barrier_Release> 4d224: 7001 moveq #1,%d0 4d226: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4d22a: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 4d22e: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 4d232: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4d234: 2d43 000c movel %d3,%fp@(12) 4d238: 203c 0004 a394 movel #304020,%d0 4d23e: 2d48 0008 movel %a0,%fp@(8) } 4d242: 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 ); 4d246: 2d40 0010 movel %d0,%fp@(16) } 4d24a: 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 ); 4d24c: 4ef9 0004 a0a4 jmp 4a0a4 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 0004e6fc <_CORE_message_queue_Initialize>: /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e6fc: 7003 moveq #3,%d0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4e6fe: 4e56 ffe4 linkw %fp,#-28 4e702: 222e 0014 movel %fp@(20),%d1 4e706: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 4e70a: 246e 0008 moveal %fp@(8),%a2 4e70e: 282e 0010 movel %fp@(16),%d4 /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e712: c081 andl %d1,%d0 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4e714: 2544 0044 movel %d4,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4e718: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4e71c: 2541 004c movel %d1,%a2@(76) /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e720: 4a80 tstl %d0 4e722: 6712 beqs 4e736 <_CORE_message_queue_Initialize+0x3a> allocated_message_size += sizeof(uintptr_t); 4e724: 2001 movel %d1,%d0 4e726: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 4e728: 74fc moveq #-4,%d2 4e72a: c082 andl %d2,%d0 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) 4e72c: b280 cmpl %d0,%d1 4e72e: 6308 blss 4e738 <_CORE_message_queue_Initialize+0x3c> return false; 4e730: 4200 clrb %d0 4e732: 6000 0086 braw 4e7ba <_CORE_message_queue_Initialize+0xbe> /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { 4e736: 2001 movel %d1,%d0 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 4e738: 2a00 movel %d0,%d5 4e73a: 0685 0000 0010 addil #16,%d5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 4e740: 2f05 movel %d5,%sp@- if ( x > SIZE_MAX ) 4e742: 4286 clrl %d6 4e744: 7eff moveq #-1,%d7 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 4e746: 42a7 clrl %sp@- 4e748: 2f04 movel %d4,%sp@- 4e74a: 42a7 clrl %sp@- 4e74c: 4eb9 0006 0948 jsr 60948 <__muldi3> 4e752: 4fef 0010 lea %sp@(16),%sp 4e756: 2400 movel %d0,%d2 4e758: 2601 movel %d1,%d3 if ( x > SIZE_MAX ) 4e75a: 9e83 subl %d3,%d7 4e75c: 9d82 subxl %d2,%d6 4e75e: 6dd0 blts 4e730 <_CORE_message_queue_Initialize+0x34> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 4e760: 2f01 movel %d1,%sp@- 4e762: 4eb9 0005 1050 jsr 51050 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 4e768: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e76a: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e76e: 67c0 beqs 4e730 <_CORE_message_queue_Initialize+0x34><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4e770: 2f05 movel %d5,%sp@- 4e772: 2f04 movel %d4,%sp@- 4e774: 2f00 movel %d0,%sp@- 4e776: 486a 0060 pea %a2@(96) 4e77a: 4eb9 0004 e6b8 jsr 4e6b8 <_Chain_Initialize> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4e780: 41ea 0054 lea %a2@(84),%a0 */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return 4e784: 7001 moveq #1,%d0 4e786: 2548 0050 movel %a0,%a2@(80) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e78a: 41ea 0050 lea %a2@(80),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 4e78e: 42aa 0054 clrl %a2@(84) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e792: 2548 0058 movel %a0,%a2@(88) allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4e796: 4878 0006 pea 6 4e79a: 206e 000c moveal %fp@(12),%a0 4e79e: 4878 0080 pea 80 4e7a2: b090 cmpl %a0@,%d0 4e7a4: 57c0 seq %d0 4e7a6: 49c0 extbl %d0 4e7a8: 4480 negl %d0 4e7aa: 2f00 movel %d0,%sp@- 4e7ac: 2f0a movel %a2,%sp@- 4e7ae: 4eb9 0005 0910 jsr 50910 <_Thread_queue_Initialize> 4e7b4: 4fef 0020 lea %sp@(32),%sp THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e7b8: 7001 moveq #1,%d0 } 4e7ba: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 4e7c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047084 <_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 ) { 47084: 4e56 0000 linkw %fp,#0 47088: 2f0a movel %a2,%sp@- 4708a: 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)) ) { 4708e: 2f0a movel %a2,%sp@- 47090: 4eb9 0004 895c jsr 4895c <_Thread_queue_Dequeue> 47096: 588f addql #4,%sp 47098: 4a80 tstl %d0 4709a: 6624 bnes 470c0 <_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 ); 4709c: 303c 0700 movew #1792,%d0 470a0: 40c1 movew %sr,%d1 470a2: 8081 orl %d1,%d0 470a4: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 470a6: 202a 0048 movel %a2@(72),%d0 470aa: b0aa 0040 cmpl %a2@(64),%d0 470ae: 640a bccs 470ba <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 470b0: 5280 addql #1,%d0 470b2: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 470b6: 4280 clrl %d0 470b8: 6002 bras 470bc <_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; 470ba: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 470bc: 46c1 movew %d1,%sr 470be: 6002 bras 470c2 <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 470c0: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 470c2: 246e fffc moveal %fp@(-4),%a2 470c6: 4e5e unlk %fp ... =============================================================================== 00045ed8 <_Event_Surrender>: rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 45ed8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 45ede: 4e56 ffe4 linkw %fp,#-28 45ee2: 206e 0010 moveal %fp@(16),%a0 45ee6: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 45eea: 246e 0008 moveal %fp@(8),%a2 45eee: 242e 000c movel %fp@(12),%d2 rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 45ef2: 282a 0030 movel %a2@(48),%d4 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 45ef6: 226e 0014 moveal %fp@(20),%a1 45efa: 2a2e 0018 movel %fp@(24),%d5 rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 45efe: 40c1 movew %sr,%d1 45f00: 8081 orl %d1,%d0 45f02: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 45f04: 8490 orl %a0@,%d2 45f06: 2082 movel %d2,%a0@ _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 45f08: 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 ); 45f0c: 2002 movel %d2,%d0 45f0e: c083 andl %d3,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 45f10: 6604 bnes 45f16 <_Event_Surrender+0x3e> 45f12: 6000 00aa braw 45fbe <_Event_Surrender+0xe6> /* * 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() && 45f16: 4ab9 0005 dd68 tstl 5dd68 <_Per_CPU_Information+0x8> 45f1c: 6736 beqs 45f54 <_Event_Surrender+0x7c> 45f1e: b5f9 0005 dd6e cmpal 5dd6e <_Per_CPU_Information+0xe>,%a2 45f24: 662e bnes 45f54 <_Event_Surrender+0x7c> _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45f26: 2c11 movel %a1@,%d6 /* * 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 ) && 45f28: 7e01 moveq #1,%d7 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45f2a: 5386 subql #1,%d6 /* * 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 ) && 45f2c: be86 cmpl %d6,%d7 45f2e: 6524 bcss 45f54 <_Event_Surrender+0x7c> <== NEVER TAKEN ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 45f30: b680 cmpl %d0,%d3 45f32: 6708 beqs 45f3c <_Event_Surrender+0x64> <== NEVER TAKEN 45f34: 0804 0001 btst #1,%d4 45f38: 6700 0084 beqw 45fbe <_Event_Surrender+0xe6> 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) ); 45f3c: 2600 movel %d0,%d3 45f3e: 4683 notl %d3 45f40: c682 andl %d2,%d3 45f42: 2083 movel %d3,%a0@ event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f44: 206a 0028 moveal %a2@(40),%a0 if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 45f48: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f4c: 2080 movel %d0,%a0@ *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 45f4e: 7003 moveq #3,%d0 45f50: 2280 movel %d0,%a1@ 45f52: 606a bras 45fbe <_Event_Surrender+0xe6> RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 45f54: caaa 0010 andl %a2@(16),%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 45f58: 6764 beqs 45fbe <_Event_Surrender+0xe6> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 45f5a: b680 cmpl %d0,%d3 45f5c: 6706 beqs 45f64 <_Event_Surrender+0x8c> 45f5e: 0804 0001 btst #1,%d4 45f62: 675a beqs 45fbe <_Event_Surrender+0xe6> <== NEVER TAKEN 45f64: 2600 movel %d0,%d3 45f66: 4683 notl %d3 45f68: c682 andl %d2,%d3 45f6a: 2083 movel %d3,%a0@ event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f6c: 206a 0028 moveal %a2@(40),%a0 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 45f70: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45f74: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45f76: 203c 0000 0700 movel #1792,%d0 45f7c: 46c1 movew %d1,%sr 45f7e: 8081 orl %d1,%d0 45f80: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 45f82: 7002 moveq #2,%d0 45f84: b0aa 0050 cmpl %a2@(80),%d0 45f88: 6704 beqs 45f8e <_Event_Surrender+0xb6> _ISR_Enable( level ); 45f8a: 46c1 movew %d1,%sr 45f8c: 6014 bras 45fa2 <_Event_Surrender+0xca> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45f8e: 7003 moveq #3,%d0 45f90: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 45f94: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45f96: 486a 0048 pea %a2@(72) 45f9a: 4eb9 0004 923c jsr 4923c <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45fa0: 588f addql #4,%sp 45fa2: 2d4a 0008 movel %a2,%fp@(8) 45fa6: 2e3c 1007 fff8 movel #268959736,%d7 45fac: 2d47 000c movel %d7,%fp@(12) } return; } } _ISR_Enable( level ); } 45fb0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 45fb6: 4e5e unlk %fp 45fb8: 4ef9 0004 8304 jmp 48304 <_Thread_Clear_state> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45fbe: 46c1 movew %d1,%sr } 45fc0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 45fc6: 4e5e unlk %fp ... =============================================================================== 00045fcc <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 45fcc: 4e56 fffc linkw %fp,#-4 45fd0: 2f0a movel %a2,%sp@- 45fd2: 246e 000c moveal %fp@(12),%a2 45fd6: 2f02 movel %d2,%sp@- ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 45fd8: 486e fffc pea %fp@(-4) 45fdc: 2f2e 0008 movel %fp@(8),%sp@- 45fe0: 4eb9 0004 8698 jsr 48698 <_Thread_Get> switch ( location ) { 45fe6: 508f addql #8,%sp 45fe8: 4aae fffc tstl %fp@(-4) 45fec: 664c bnes 4603a <_Event_Timeout+0x6e> <== 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 ); 45fee: 223c 0000 0700 movel #1792,%d1 45ff4: 40c2 movew %sr,%d2 45ff6: 8282 orl %d2,%d1 45ff8: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 45ffa: 2040 moveal %d0,%a0 45ffc: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 46000: b0b9 0005 dd6e cmpl 5dd6e <_Per_CPU_Information+0xe>,%d0 46006: 660a bnes 46012 <_Event_Timeout+0x46> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 46008: 7201 moveq #1,%d1 4600a: b292 cmpl %a2@,%d1 4600c: 6604 bnes 46012 <_Event_Timeout+0x46> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4600e: 7202 moveq #2,%d1 46010: 2481 movel %d1,%a2@ } the_thread->Wait.return_code = RTEMS_TIMEOUT; 46012: 7206 moveq #6,%d1 46014: 2040 moveal %d0,%a0 46016: 2141 0034 movel %d1,%a0@(52) _ISR_Enable( level ); 4601a: 46c2 movew %d2,%sr 4601c: 2f3c 1007 fff8 movel #268959736,%sp@- 46022: 2f00 movel %d0,%sp@- 46024: 4eb9 0004 8304 jsr 48304 <_Thread_Clear_state> RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; --level; _Thread_Dispatch_disable_level = level; 4602a: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4602c: 2039 0005 dbf6 movel 5dbf6 <_Thread_Dispatch_disable_level>,%d0 --level; 46032: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 46034: 23c0 0005 dbf6 movel %d0,5dbf6 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 4603a: 242e fff4 movel %fp@(-12),%d2 4603e: 246e fff8 moveal %fp@(-8),%a2 46042: 4e5e unlk %fp ... =============================================================================== 0004ad3c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4ad3c: 4e56 ffe8 linkw %fp,#-24 4ad40: 206e 0008 moveal %fp@(8),%a0 4ad44: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4ad48: 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 ) { 4ad4c: 6700 0154 beqw 4aea2 <_Heap_Free+0x166> 4ad50: 2240 moveal %d0,%a1 4ad52: 5189 subql #8,%a1 4ad54: 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 4ad5a: 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); 4ad5e: 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; 4ad60: b889 cmpl %a1,%d4 4ad62: 620c bhis 4ad70 <_Heap_Free+0x34> 4ad64: b3e8 0024 cmpal %a0@(36),%a1 4ad68: 53c0 sls %d0 4ad6a: 49c0 extbl %d0 4ad6c: 4480 negl %d0 4ad6e: 6002 bras 4ad72 <_Heap_Free+0x36> 4ad70: 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 ) ) { 4ad72: 0800 0000 btst #0,%d0 4ad76: 6700 012e beqw 4aea6 <_Heap_Free+0x16a> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4ad7a: 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; 4ad7e: 70fe moveq #-2,%d0 4ad80: 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); 4ad82: 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; 4ad86: b88a cmpl %a2,%d4 4ad88: 620c bhis 4ad96 <_Heap_Free+0x5a> <== NEVER TAKEN 4ad8a: b5e8 0024 cmpal %a0@(36),%a2 4ad8e: 53c1 sls %d1 4ad90: 49c1 extbl %d1 4ad92: 4481 negl %d1 4ad94: 6002 bras 4ad98 <_Heap_Free+0x5c> 4ad96: 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 ) ) { 4ad98: 0801 0000 btst #0,%d1 4ad9c: 6700 0108 beqw 4aea6 <_Heap_Free+0x16a> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4ada0: 242a 0004 movel %a2@(4),%d2 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4ada4: 0802 0000 btst #0,%d2 4ada8: 6700 00fc beqw 4aea6 <_Heap_Free+0x16a> - 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; 4adac: 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 4adae: 2668 0024 moveal %a0@(36),%a3 4adb2: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4adb4: b7ca cmpal %a2,%a3 4adb6: 670c beqs 4adc4 <_Heap_Free+0x88> 4adb8: 2232 2804 movel %a2@(00000004,%d2:l),%d1 4adbc: 7a01 moveq #1,%d5 4adbe: bb81 eorl %d5,%d1 4adc0: c285 andl %d5,%d1 4adc2: 6002 bras 4adc6 <_Heap_Free+0x8a> 4adc4: 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 4adc6: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4adc8: 0803 0000 btst #0,%d3 4adcc: 6662 bnes 4ae30 <_Heap_Free+0xf4> uintptr_t const prev_size = block->prev_size; 4adce: 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); 4add0: 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; 4add2: b889 cmpl %a1,%d4 4add4: 620a bhis 4ade0 <_Heap_Free+0xa4> <== NEVER TAKEN 4add6: b3cb cmpal %a3,%a1 4add8: 53c1 sls %d1 4adda: 49c1 extbl %d1 4addc: 4481 negl %d1 4adde: 6002 bras 4ade2 <_Heap_Free+0xa6> 4ade0: 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 ) ) { 4ade2: 0801 0000 btst #0,%d1 4ade6: 6700 00be beqw 4aea6 <_Heap_Free+0x16a> 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; 4adea: 7201 moveq #1,%d1 4adec: 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) ) { 4adf0: 6700 00b4 beqw 4aea6 <_Heap_Free+0x16a> 4adf4: d680 addl %d0,%d3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4adf6: 4a05 tstb %d5 4adf8: 6724 beqs 4ae1e <_Heap_Free+0xe2> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4adfa: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4adfe: d483 addl %d3,%d2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4ae00: 7201 moveq #1,%d1 Heap_Block *prev = block->prev; 4ae02: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4ae06: 254b 0008 movel %a3,%a2@(8) 4ae0a: 8282 orl %d2,%d1 next->prev = prev; 4ae0c: 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; 4ae10: 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; 4ae14: 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; 4ae18: 2341 0004 movel %d1,%a1@(4) 4ae1c: 6078 bras 4ae96 <_Heap_Free+0x15a> 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; 4ae1e: 7401 moveq #1,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4ae20: 7afe moveq #-2,%d5 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; 4ae22: 8483 orl %d3,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4ae24: 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; 4ae26: 2342 0004 movel %d2,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4ae2a: cbaa 0004 andl %d5,%a2@(4) 4ae2e: 6066 bras 4ae96 <_Heap_Free+0x15a> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4ae30: 4a01 tstb %d1 4ae32: 672a beqs 4ae5e <_Heap_Free+0x122> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4ae34: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4ae38: 2202 movel %d2,%d1 4ae3a: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4ae3c: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4ae3e: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4ae42: 234b 0008 movel %a3,%a1@(8) 4ae46: 8481 orl %d1,%d2 new_block->prev = prev; 4ae48: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4ae4c: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4ae50: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4ae54: 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; 4ae58: 2342 0004 movel %d2,%a1@(4) 4ae5c: 6038 bras 4ae96 <_Heap_Free+0x15a> 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; 4ae5e: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4ae60: 72fe moveq #-2,%d1 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; 4ae62: 8a80 orl %d0,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4ae64: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4ae68: 2348 000c movel %a0,%a1@(12) 4ae6c: 2345 0004 movel %d5,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4ae70: c3aa 0004 andl %d1,%a2@(4) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4ae74: 2228 0038 movel %a0@(56),%d1 4ae78: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4ae7a: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4ae7e: 2749 000c movel %a1,%a3@(12) /* 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; next_block->prev_size = block_size; 4ae82: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4ae84: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4ae88: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4ae8c: b2a8 003c cmpl %a0@(60),%d1 4ae90: 6304 blss 4ae96 <_Heap_Free+0x15a> stats->max_free_blocks = stats->free_blocks; 4ae92: 2141 003c movel %d1,%a0@(60) } } /* Statistics */ --stats->used_blocks; 4ae96: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4ae9a: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4ae9e: 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; 4aea2: 7001 moveq #1,%d0 4aea4: 6002 bras 4aea8 <_Heap_Free+0x16c> 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 ) ) { return false; 4aea6: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4aea8: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4aeac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048f20 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 48f20: 4e56 ffe8 linkw %fp,#-24 48f24: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 48f28: 246e 0008 moveal %fp@(8),%a2 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48f2c: 4282 clrl %d2 const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 48f2e: 97cb subal %a3,%a3 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 48f30: 4bf9 0004 eda8 lea 4eda8 <_Heap_Allocate_aligned_with_boundary>,%a5 48f36: 286e 000c moveal %fp@(12),%a4 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48f3a: 6026 bras 48f62 <_Heap_Greedy_allocate+0x42> 48f3c: 42a7 clrl %sp@- 48f3e: 42a7 clrl %sp@- 48f40: 2f1c movel %a4@+,%sp@- 48f42: 2f0a movel %a2,%sp@- 48f44: 4e95 jsr %a5@ void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 48f46: 4fef 0010 lea %sp@(16),%sp 48f4a: 4a80 tstl %d0 48f4c: 6712 beqs 48f60 <_Heap_Greedy_allocate+0x40> <== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 48f4e: 2040 moveal %d0,%a0 48f50: 5188 subql #8,%a0 48f52: 4c6a 0001 0010 remul %a2@(16),%d1,%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 48f58: 91c1 subal %d1,%a0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 48f5a: 214b 0008 movel %a3,%a0@(8) 48f5e: 2648 moveal %a0,%a3 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 48f60: 5282 addql #1,%d2 48f62: b4ae 0010 cmpl %fp@(16),%d2 48f66: 66d4 bnes 48f3c <_Heap_Greedy_allocate+0x1c> 48f68: 4282 clrl %d2 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 48f6a: 4bf9 0004 922e lea 4922e <_Heap_Block_allocate>,%a5 48f70: 6020 bras 48f92 <_Heap_Greedy_allocate+0x72> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 48f72: 70fe moveq #-2,%d0 48f74: c0ac 0004 andl %a4@(4),%d0 48f78: 2040 moveal %d0,%a0 48f7a: 4868 fff8 pea %a0@(-8) 48f7e: 486c 0008 pea %a4@(8) 48f82: 2f0c movel %a4,%sp@- 48f84: 2f0a movel %a2,%sp@- 48f86: 4e95 jsr %a5@ 48f88: 4fef 0010 lea %sp@(16),%sp current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 48f8c: 2942 0008 movel %d2,%a4@(8) 48f90: 240c movel %a4,%d2 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 48f92: 286a 0008 moveal %a2@(8),%a4 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 48f96: b5cc cmpal %a4,%a2 48f98: 66d8 bnes 48f72 <_Heap_Greedy_allocate+0x52> 48f9a: 6012 bras 48fae <_Heap_Greedy_allocate+0x8e> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 48f9c: 262b 0008 movel %a3@(8),%d3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 48fa0: 486b 0008 pea %a3@(8) blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 48fa4: 2643 moveal %d3,%a3 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 48fa6: 2f0a movel %a2,%sp@- 48fa8: 4e94 jsr %a4@ 48faa: 508f addql #8,%sp 48fac: 6006 bras 48fb4 <_Heap_Greedy_allocate+0x94> 48fae: 49f9 0004 ef08 lea 4ef08 <_Heap_Free>,%a4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 48fb4: 4a8b tstl %a3 48fb6: 66e4 bnes 48f9c <_Heap_Greedy_allocate+0x7c> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 48fb8: 2002 movel %d2,%d0 48fba: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 48fc0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f48c <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4f48c: 4e56 0000 linkw %fp,#0 4f490: 226e 0008 moveal %fp@(8),%a1 4f494: 2f0a movel %a2,%sp@- Heap_Block *current = heap->first_block; 4f496: 2069 0020 moveal %a1@(32),%a0 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4f49a: 2f02 movel %d2,%sp@- Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 4f49c: 2429 0024 movel %a1@(36),%d2 4f4a0: 602a bras 4f4cc <_Heap_Iterate+0x40> 4f4a2: 70fe moveq #-2,%d0 while ( !stop && current != end ) { uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 4f4a4: 7201 moveq #1,%d1 4f4a6: c0a8 0004 andl %a0@(4),%d0 4f4aa: 2f2e 0010 movel %fp@(16),%sp@- RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4f4ae: 45f0 0800 lea %a0@(00000000,%d0:l),%a2 4f4b2: c2aa 0004 andl %a2@(4),%d1 4f4b6: 2f01 movel %d1,%sp@- 4f4b8: 2f00 movel %d0,%sp@- 4f4ba: 2f08 movel %a0,%sp@- 4f4bc: 206e 000c moveal %fp@(12),%a0 4f4c0: 4e90 jsr %a0@ { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 4f4c2: 4fef 0010 lea %sp@(16),%sp 4f4c6: 204a moveal %a2,%a0 4f4c8: 4a00 tstb %d0 4f4ca: 6604 bnes 4f4d0 <_Heap_Iterate+0x44> <== NEVER TAKEN 4f4cc: b488 cmpl %a0,%d2 4f4ce: 66d2 bnes 4f4a2 <_Heap_Iterate+0x16> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 4f4d0: 242e fff8 movel %fp@(-8),%d2 4f4d4: 246e fffc moveal %fp@(-4),%a2 4f4d8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005a488 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5a488: 4e56 0000 linkw %fp,#0 5a48c: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5a490: 2040 moveal %d0,%a0 5a492: 5188 subql #8,%a0 5a494: 226e 0008 moveal %fp@(8),%a1 5a498: 2f02 movel %d2,%sp@- 5a49a: 2400 movel %d0,%d2 5a49c: 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 5a4a2: 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); 5a4a6: 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; 5a4a8: b488 cmpl %a0,%d2 5a4aa: 620c bhis 5a4b8 <_Heap_Size_of_alloc_area+0x30> 5a4ac: b1e9 0024 cmpal %a1@(36),%a0 5a4b0: 53c1 sls %d1 5a4b2: 49c1 extbl %d1 5a4b4: 4481 negl %d1 5a4b6: 6002 bras 5a4ba <_Heap_Size_of_alloc_area+0x32> 5a4b8: 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 ) ) { 5a4ba: 0801 0000 btst #0,%d1 5a4be: 673c beqs 5a4fc <_Heap_Size_of_alloc_area+0x74> - 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; 5a4c0: 72fe moveq #-2,%d1 5a4c2: 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); 5a4c6: 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; 5a4ca: b488 cmpl %a0,%d2 5a4cc: 620c bhis 5a4da <_Heap_Size_of_alloc_area+0x52> <== NEVER TAKEN 5a4ce: b1e9 0024 cmpal %a1@(36),%a0 5a4d2: 53c1 sls %d1 5a4d4: 49c1 extbl %d1 5a4d6: 4481 negl %d1 5a4d8: 6002 bras 5a4dc <_Heap_Size_of_alloc_area+0x54> 5a4da: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5a4dc: 0801 0000 btst #0,%d1 5a4e0: 671a beqs 5a4fc <_Heap_Size_of_alloc_area+0x74> <== 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; 5a4e2: 7201 moveq #1,%d1 5a4e4: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5a4e8: 6712 beqs 5a4fc <_Heap_Size_of_alloc_area+0x74> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5a4ea: 7204 moveq #4,%d1 5a4ec: 9280 subl %d0,%d1 5a4ee: 2001 movel %d1,%d0 5a4f0: d088 addl %a0,%d0 5a4f2: 226e 0010 moveal %fp@(16),%a1 5a4f6: 2280 movel %d0,%a1@ return true; 5a4f8: 7001 moveq #1,%d0 5a4fa: 6002 bras 5a4fe <_Heap_Size_of_alloc_area+0x76> 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 ) ) { return false; 5a4fc: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 5a4fe: 241f movel %sp@+,%d2 5a500: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d1a <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 47d1a: 4e56 ffd0 linkw %fp,#-48 47d1e: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47d22: 266e 0008 moveal %fp@(8),%a3 47d26: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 47d2a: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 47d2e: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 47d32: 286b 0020 moveal %a3@(32),%a4 Heap_Block *const last_block = heap->last_block; 47d36: 2c2b 0024 movel %a3@(36),%d6 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47d3a: 4a2e 0013 tstb %fp@(19) 47d3e: 6706 beqs 47d46 <_Heap_Walk+0x2c> 47d40: 45fa ff9a lea %pc@(47cdc <_Heap_Walk_print>),%a2 47d44: 6004 bras 47d4a <_Heap_Walk+0x30> 47d46: 45fa ff8c lea %pc@(47cd4 <_Heap_Walk_print_nothing>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 47d4a: 7003 moveq #3,%d0 47d4c: b0b9 0005 fe84 cmpl 5fe84 <_System_state_Current>,%d0 47d52: 6706 beqs 47d5a <_Heap_Walk+0x40> return true; 47d54: 7001 moveq #1,%d0 47d56: 6000 02fc braw 48054 <_Heap_Walk+0x33a> 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)( 47d5a: 2f2b 000c movel %a3@(12),%sp@- 47d5e: 2f2b 0008 movel %a3@(8),%sp@- 47d62: 2f06 movel %d6,%sp@- 47d64: 2f0c movel %a4,%sp@- 47d66: 2f2b 001c movel %a3@(28),%sp@- 47d6a: 2f2b 0018 movel %a3@(24),%sp@- 47d6e: 2f05 movel %d5,%sp@- 47d70: 2f04 movel %d4,%sp@- 47d72: 4879 0005 c3e2 pea 5c3e2 <_Copyright_Notice+0x94> 47d78: 42a7 clrl %sp@- 47d7a: 2f02 movel %d2,%sp@- 47d7c: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 47d7e: 4fef 002c lea %sp@(44),%sp 47d82: 4a84 tstl %d4 47d84: 6608 bnes 47d8e <_Heap_Walk+0x74> (*printer)( source, true, "page size is zero\n" ); 47d86: 4879 0005 c473 pea 5c473 <_Copyright_Notice+0x125> 47d8c: 6076 bras 47e04 <_Heap_Walk+0xea> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 47d8e: 7003 moveq #3,%d0 47d90: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47d92: 670c beqs 47da0 <_Heap_Walk+0x86> (*printer)( 47d94: 2f04 movel %d4,%sp@- 47d96: 4879 0005 c486 pea 5c486 <_Copyright_Notice+0x138> 47d9c: 6000 02a8 braw 48046 <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47da0: 2205 movel %d5,%d1 47da2: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47da6: 4a80 tstl %d0 47da8: 670c beqs 47db6 <_Heap_Walk+0x9c> (*printer)( 47daa: 2f05 movel %d5,%sp@- 47dac: 4879 0005 c4a4 pea 5c4a4 <_Copyright_Notice+0x156> 47db2: 6000 0292 braw 48046 <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47db6: 200c movel %a4,%d0 47db8: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47dba: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 47dbe: 4a81 tstl %d1 47dc0: 670c beqs 47dce <_Heap_Walk+0xb4> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47dc2: 2f0c movel %a4,%sp@- 47dc4: 4879 0005 c4c8 pea 5c4c8 <_Copyright_Notice+0x17a> 47dca: 6000 027a braw 48046 <_Heap_Walk+0x32c> 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; 47dce: 7001 moveq #1,%d0 47dd0: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47dd4: 6608 bnes 47dde <_Heap_Walk+0xc4> (*printer)( 47dd6: 4879 0005 c4f9 pea 5c4f9 <_Copyright_Notice+0x1ab> 47ddc: 6026 bras 47e04 <_Heap_Walk+0xea> - 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; 47dde: 70fe moveq #-2,%d0 47de0: 2046 moveal %d6,%a0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47de2: 2a46 moveal %d6,%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; 47de4: 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); 47de8: dbc0 addal %d0,%a5 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; 47dea: 7001 moveq #1,%d0 47dec: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 47df0: 6608 bnes 47dfa <_Heap_Walk+0xe0> (*printer)( 47df2: 4879 0005 c527 pea 5c527 <_Copyright_Notice+0x1d9> 47df8: 600a bras 47e04 <_Heap_Walk+0xea> ); return false; } if ( 47dfa: b9cd cmpal %a5,%a4 47dfc: 6716 beqs 47e14 <_Heap_Walk+0xfa> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 47dfe: 4879 0005 c53c pea 5c53c <_Copyright_Notice+0x1ee> 47e04: 4878 0001 pea 1 47e08: 2f02 movel %d2,%sp@- 47e0a: 4e92 jsr %a2@ 47e0c: 4fef 000c lea %sp@(12),%sp 47e10: 6000 0228 braw 4803a <_Heap_Walk+0x320> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 47e14: 222b 0010 movel %a3@(16),%d1 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 47e18: 224b moveal %a3,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47e1a: 206b 0008 moveal %a3@(8),%a0 47e1e: 6074 bras 47e94 <_Heap_Walk+0x17a> 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; 47e20: b1eb 0020 cmpal %a3@(32),%a0 47e24: 650c bcss 47e32 <_Heap_Walk+0x118> 47e26: b1eb 0024 cmpal %a3@(36),%a0 47e2a: 53c0 sls %d0 47e2c: 49c0 extbl %d0 47e2e: 4480 negl %d0 47e30: 6002 bras 47e34 <_Heap_Walk+0x11a> 47e32: 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 ) ) { 47e34: 0800 0000 btst #0,%d0 47e38: 660c bnes 47e46 <_Heap_Walk+0x12c> (*printer)( 47e3a: 2f08 movel %a0,%sp@- 47e3c: 4879 0005 c56b pea 5c56b <_Copyright_Notice+0x21d> 47e42: 6000 0202 braw 48046 <_Heap_Walk+0x32c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47e46: 2008 movel %a0,%d0 47e48: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47e4a: 4c41 0003 remul %d1,%d3,%d0 ); return false; } if ( 47e4e: 4a83 tstl %d3 47e50: 670c beqs 47e5e <_Heap_Walk+0x144> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47e52: 2f08 movel %a0,%sp@- 47e54: 4879 0005 c58b pea 5c58b <_Copyright_Notice+0x23d> 47e5a: 6000 01ea braw 48046 <_Heap_Walk+0x32c> - 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; 47e5e: 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; 47e60: 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; 47e62: 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; 47e66: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47e6a: 670c beqs 47e78 <_Heap_Walk+0x15e> (*printer)( 47e6c: 2f08 movel %a0,%sp@- 47e6e: 4879 0005 c5bb pea 5c5bb <_Copyright_Notice+0x26d> 47e74: 6000 01d0 braw 48046 <_Heap_Walk+0x32c> ); return false; } if ( free_block->prev != prev_block ) { 47e78: 2028 000c movel %a0@(12),%d0 47e7c: b3c0 cmpal %d0,%a1 47e7e: 670e beqs 47e8e <_Heap_Walk+0x174> (*printer)( 47e80: 2f00 movel %d0,%sp@- 47e82: 2f08 movel %a0,%sp@- 47e84: 4879 0005 c5d7 pea 5c5d7 <_Copyright_Notice+0x289> 47e8a: 6000 00aa braw 47f36 <_Heap_Walk+0x21c> return false; } prev_block = free_block; free_block = free_block->next; 47e8e: 2248 moveal %a0,%a1 47e90: 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 ) { 47e94: b7c8 cmpal %a0,%a3 47e96: 6688 bnes 47e20 <_Heap_Walk+0x106> 47e98: 284d moveal %a5,%a4 block = next_block; } while ( block != first_block ); return true; } 47e9a: 202c 0004 movel %a4@(4),%d0 47e9e: 7201 moveq #1,%d1 - 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; 47ea0: 76fe moveq #-2,%d3 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; 47ea2: c280 andl %d0,%d1 - 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; 47ea4: c680 andl %d0,%d3 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; 47ea6: 2d41 fffc movel %d1,%fp@(-4) 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; 47eaa: bc8c cmpl %a4,%d6 47eac: 56c1 sne %d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47eae: 2e03 movel %d3,%d7 47eb0: de8c addl %a4,%d7 47eb2: 2001 movel %d1,%d0 47eb4: 4480 negl %d0 47eb6: 1d40 fffb moveb %d0,%fp@(-5) 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; 47eba: beab 0020 cmpl %a3@(32),%d7 47ebe: 650c bcss 47ecc <_Heap_Walk+0x1b2> <== NEVER TAKEN 47ec0: beab 0024 cmpl %a3@(36),%d7 47ec4: 53c0 sls %d0 47ec6: 49c0 extbl %d0 47ec8: 4480 negl %d0 47eca: 6002 bras 47ece <_Heap_Walk+0x1b4> 47ecc: 4280 clrl %d0 <== NOT EXECUTED if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 47ece: 0800 0000 btst #0,%d0 47ed2: 660c bnes 47ee0 <_Heap_Walk+0x1c6> (*printer)( 47ed4: 2f07 movel %d7,%sp@- 47ed6: 2f0c movel %a4,%sp@- 47ed8: 4879 0005 c609 pea 5c609 <_Copyright_Notice+0x2bb> 47ede: 6056 bras 47f36 <_Heap_Walk+0x21c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47ee0: 2203 movel %d3,%d1 47ee2: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 47ee6: 4a80 tstl %d0 47ee8: 6712 beqs 47efc <_Heap_Walk+0x1e2> 47eea: 4a2e fffb tstb %fp@(-5) 47eee: 6756 beqs 47f46 <_Heap_Walk+0x22c> (*printer)( 47ef0: 2f03 movel %d3,%sp@- 47ef2: 2f0c movel %a4,%sp@- 47ef4: 4879 0005 c636 pea 5c636 <_Copyright_Notice+0x2e8> 47efa: 603a bras 47f36 <_Heap_Walk+0x21c> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 47efc: ba83 cmpl %d3,%d5 47efe: 6322 blss 47f22 <_Heap_Walk+0x208> 47f00: 4a2e fffb tstb %fp@(-5) 47f04: 6740 beqs 47f46 <_Heap_Walk+0x22c> <== NEVER TAKEN (*printer)( 47f06: 2f05 movel %d5,%sp@- 47f08: 2f03 movel %d3,%sp@- 47f0a: 2f0c movel %a4,%sp@- 47f0c: 4879 0005 c664 pea 5c664 <_Copyright_Notice+0x316> 47f12: 4878 0001 pea 1 47f16: 2f02 movel %d2,%sp@- 47f18: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 47f1a: 4fef 0018 lea %sp@(24),%sp 47f1e: 6000 011a braw 4803a <_Heap_Walk+0x320> } if ( next_block_begin <= block_begin && is_not_last_block ) { 47f22: b9c7 cmpal %d7,%a4 47f24: 6520 bcss 47f46 <_Heap_Walk+0x22c> 47f26: 4a2e fffb tstb %fp@(-5) 47f2a: 671a beqs 47f46 <_Heap_Walk+0x22c> (*printer)( 47f2c: 2f07 movel %d7,%sp@- 47f2e: 2f0c movel %a4,%sp@- 47f30: 4879 0005 c68f pea 5c68f <_Copyright_Notice+0x341> 47f36: 4878 0001 pea 1 47f3a: 2f02 movel %d2,%sp@- 47f3c: 4e92 jsr %a2@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47f3e: 4fef 0014 lea %sp@(20),%sp 47f42: 6000 00f6 braw 4803a <_Heap_Walk+0x320> 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; 47f46: 7001 moveq #1,%d0 47f48: 2047 moveal %d7,%a0 47f4a: c0a8 0004 andl %a0@(4),%d0 } if ( !_Heap_Is_prev_used( next_block ) ) { 47f4e: 6600 00ac bnew 47ffc <_Heap_Walk+0x2e2> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47f52: 222b 0008 movel %a3@(8),%d1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47f56: 206c 0008 moveal %a4@(8),%a0 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)( 47f5a: b1eb 000c cmpal %a3@(12),%a0 47f5e: 6712 beqs 47f72 <_Heap_Walk+0x258> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 47f60: 43f9 0005 c28e lea 5c28e ,%a1 47f66: b7c8 cmpal %a0,%a3 47f68: 660e bnes 47f78 <_Heap_Walk+0x25e> 47f6a: 43f9 0005 c3be lea 5c3be <_Copyright_Notice+0x70>,%a1 47f70: 6006 bras 47f78 <_Heap_Walk+0x25e> 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)( 47f72: 43f9 0005 c3af lea 5c3af <_Copyright_Notice+0x61>,%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 ? 47f78: 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)( 47f7c: b280 cmpl %d0,%d1 47f7e: 6712 beqs 47f92 <_Heap_Walk+0x278> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 47f80: 223c 0005 c28e movel #377486,%d1 47f86: b7c0 cmpal %d0,%a3 47f88: 660e bnes 47f98 <_Heap_Walk+0x27e> 47f8a: 223c 0005 c3d8 movel #377816,%d1 47f90: 6006 bras 47f98 <_Heap_Walk+0x27e> 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)( 47f92: 223c 0005 c3c8 movel #377800,%d1 47f98: 2f09 movel %a1,%sp@- 47f9a: 2f08 movel %a0,%sp@- 47f9c: 2f01 movel %d1,%sp@- 47f9e: 2f00 movel %d0,%sp@- 47fa0: 2f03 movel %d3,%sp@- 47fa2: 2f0c movel %a4,%sp@- 47fa4: 4879 0005 c6c3 pea 5c6c3 <_Copyright_Notice+0x375> 47faa: 42a7 clrl %sp@- 47fac: 2f02 movel %d2,%sp@- 47fae: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 47fb0: 4fef 0024 lea %sp@(36),%sp 47fb4: 2047 moveal %d7,%a0 47fb6: 2010 movel %a0@,%d0 47fb8: b083 cmpl %d3,%d0 47fba: 671c beqs 47fd8 <_Heap_Walk+0x2be> (*printer)( 47fbc: 2f07 movel %d7,%sp@- 47fbe: 2f00 movel %d0,%sp@- 47fc0: 2f03 movel %d3,%sp@- 47fc2: 2f0c movel %a4,%sp@- 47fc4: 4879 0005 c6f8 pea 5c6f8 <_Copyright_Notice+0x3aa> 47fca: 4878 0001 pea 1 47fce: 2f02 movel %d2,%sp@- 47fd0: 4e92 jsr %a2@ 47fd2: 4fef 001c lea %sp@(28),%sp 47fd6: 6062 bras 4803a <_Heap_Walk+0x320> ); return false; } if ( !prev_used ) { 47fd8: 4aae fffc tstl %fp@(-4) 47fdc: 660a bnes 47fe8 <_Heap_Walk+0x2ce> (*printer)( 47fde: 2f0c movel %a4,%sp@- 47fe0: 4879 0005 c731 pea 5c731 <_Copyright_Notice+0x3e3> 47fe6: 605e bras 48046 <_Heap_Walk+0x32c> 47fe8: 206b 0008 moveal %a3@(8),%a0 47fec: 6008 bras 47ff6 <_Heap_Walk+0x2dc> { 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 ) { 47fee: b9c8 cmpal %a0,%a4 47ff0: 673c beqs 4802e <_Heap_Walk+0x314> return true; } free_block = free_block->next; 47ff2: 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 ) { 47ff6: b7c8 cmpal %a0,%a3 47ff8: 66f4 bnes 47fee <_Heap_Walk+0x2d4> 47ffa: 6042 bras 4803e <_Heap_Walk+0x324> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 47ffc: 4aae fffc tstl %fp@(-4) 48000: 6716 beqs 48018 <_Heap_Walk+0x2fe> (*printer)( 48002: 2f03 movel %d3,%sp@- 48004: 2f0c movel %a4,%sp@- 48006: 4879 0005 c760 pea 5c760 <_Copyright_Notice+0x412> 4800c: 42a7 clrl %sp@- 4800e: 2f02 movel %d2,%sp@- 48010: 4e92 jsr %a2@ 48012: 4fef 0014 lea %sp@(20),%sp 48016: 6016 bras 4802e <_Heap_Walk+0x314> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 48018: 2f14 movel %a4@,%sp@- 4801a: 2f03 movel %d3,%sp@- 4801c: 2f0c movel %a4,%sp@- 4801e: 4879 0005 c777 pea 5c777 <_Copyright_Notice+0x429> 48024: 42a7 clrl %sp@- 48026: 2f02 movel %d2,%sp@- 48028: 4e92 jsr %a2@ 4802a: 4fef 0018 lea %sp@(24),%sp 4802e: 2847 moveal %d7,%a4 block->prev_size ); } block = next_block; } while ( block != first_block ); 48030: bbc7 cmpal %d7,%a5 48032: 6600 fe66 bnew 47e9a <_Heap_Walk+0x180> 48036: 6000 fd1c braw 47d54 <_Heap_Walk+0x3a> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4803a: 4200 clrb %d0 4803c: 6016 bras 48054 <_Heap_Walk+0x33a> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4803e: 2f0c movel %a4,%sp@- 48040: 4879 0005 c79c pea 5c79c <_Copyright_Notice+0x44e> 48046: 4878 0001 pea 1 4804a: 2f02 movel %d2,%sp@- 4804c: 4e92 jsr %a2@ 4804e: 4fef 0010 lea %sp@(16),%sp 48052: 60e6 bras 4803a <_Heap_Walk+0x320> block = next_block; } while ( block != first_block ); return true; } 48054: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 4805a: 4e5e unlk %fp ... =============================================================================== 000474f8 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 474f8: 4e56 ffe8 linkw %fp,#-24 474fc: 48d7 001c moveml %d2-%d4,%sp@ Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 47500: 4879 0004 900a pea 4900a <_User_extensions_Fatal_visitor> 47506: 262e 0008 movel %fp@(8),%d3 4750a: 486e fff6 pea %fp@(-10) 4750e: 242e 0010 movel %fp@(16),%d2 47512: 282e 000c movel %fp@(12),%d4 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 47516: 2d43 fff6 movel %d3,%fp@(-10) 4751a: 1d44 fffa moveb %d4,%fp@(-6) 4751e: 2d42 fffc movel %d2,%fp@(-4) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 47522: 4eb9 0004 903a jsr 4903a <_User_extensions_Iterate> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 47528: 7005 moveq #5,%d0 <== NOT EXECUTED _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 4752a: 23c3 0005 dd52 movel %d3,5dd52 <_Internal_errors_What_happened><== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 47530: 263c 0000 0700 movel #1792,%d3 <== NOT EXECUTED ) { _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 47536: 13c4 0005 dd56 moveb %d4,5dd56 <_Internal_errors_What_happened+0x4><== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 4753c: 23c2 0005 dd58 movel %d2,5dd58 <_Internal_errors_What_happened+0x6><== NOT EXECUTED 47542: 23c0 0005 dd5c movel %d0,5dd5c <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 47548: 40c0 movew %sr,%d0 <== NOT EXECUTED 4754a: 8083 orl %d3,%d0 <== NOT EXECUTED 4754c: 46c0 movew %d0,%sr <== NOT EXECUTED 4754e: 2002 movel %d2,%d0 <== NOT EXECUTED 47550: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 47556: 4ac8 halt <== NOT EXECUTED 47558: 508f addql #8,%sp <== NOT EXECUTED 4755a: 60fe bras 4755a <_Internal_error_Occurred+0x62> <== NOT EXECUTED =============================================================================== 000475bc <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 475bc: 4e56 fff0 linkw %fp,#-16 475c0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 475c4: 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 ) 475c8: 4aaa 0014 tstl %a2@(20) 475cc: 6604 bnes 475d2 <_Objects_Allocate+0x16> <== ALWAYS TAKEN return NULL; 475ce: 4280 clrl %d0 475d0: 6066 bras 47638 <_Objects_Allocate+0x7c> /* * 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 ); 475d2: 240a movel %a2,%d2 475d4: 0682 0000 001c addil #28,%d2 475da: 47f9 0004 6d04 lea 46d04 <_Chain_Get>,%a3 475e0: 2f02 movel %d2,%sp@- 475e2: 4e93 jsr %a3@ if ( information->auto_extend ) { 475e4: 588f addql #4,%sp 475e6: 4a2a 0010 tstb %a2@(16) 475ea: 674c beqs 47638 <_Objects_Allocate+0x7c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 475ec: 4a80 tstl %d0 475ee: 6612 bnes 47602 <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 475f0: 2f0a movel %a2,%sp@- 475f2: 4eb9 0004 7670 jsr 47670 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 475f8: 2f02 movel %d2,%sp@- 475fa: 4e93 jsr %a3@ } if ( the_object ) { 475fc: 508f addql #8,%sp 475fe: 4a80 tstl %d0 47600: 67cc beqs 475ce <_Objects_Allocate+0x12> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47602: 2040 moveal %d0,%a0 47604: 242a 0006 movel %a2@(6),%d2 47608: 2228 0008 movel %a0@(8),%d1 4760c: 0282 0000 ffff andil #65535,%d2 47612: 0281 0000 ffff andil #65535,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47618: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4761c: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 4761e: 4282 clrl %d2 47620: 342a 0012 movew %a2@(18),%d2 47624: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 47628: e589 lsll #2,%d1 4762a: d1c1 addal %d1,%a0 4762c: 5390 subql #1,%a0@ information->inactive--; 4762e: 322a 0028 movew %a2@(40),%d1 47632: 5381 subql #1,%d1 47634: 3541 0028 movew %d1,%a2@(40) ); } #endif return the_object; } 47638: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4763e: 4e5e unlk %fp ... =============================================================================== 00047644 <_Objects_Close>: void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 47644: 4e56 0000 linkw %fp,#0 47648: 226e 000c moveal %fp@(12),%a1 4764c: 206e 0008 moveal %fp@(8),%a0 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 47650: 2029 0008 movel %a1@(8),%d0 47654: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47656: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 4765a: 0280 0000 ffff andil #65535,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47660: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 47664: 245f moveal %sp@+,%a2 47666: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 47668: 4ef9 0004 7b74 jmp 47b74 <_Objects_Namespace_remove> ... =============================================================================== 00047984 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 47984: 4e56 0000 linkw %fp,#0 47988: 2f03 movel %d3,%sp@- 4798a: 362e 000e movew %fp@(14),%d3 4798e: 2f02 movel %d2,%sp@- 47990: 242e 0008 movel %fp@(8),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 47994: 4a43 tstw %d3 47996: 6604 bnes 4799c <_Objects_Get_information+0x18> return NULL; 47998: 4280 clrl %d0 4799a: 6034 bras 479d0 <_Objects_Get_information+0x4c> /* * 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 ); 4799c: 2f02 movel %d2,%sp@- 4799e: 4eb9 0004 aeb0 jsr 4aeb0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 479a4: 588f addql #4,%sp 479a6: 4a80 tstl %d0 479a8: 67ee beqs 47998 <_Objects_Get_information+0x14> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 479aa: 0283 0000 ffff andil #65535,%d3 479b0: b083 cmpl %d3,%d0 479b2: 65e4 bcss 47998 <_Objects_Get_information+0x14> return NULL; if ( !_Objects_Information_table[ the_api ] ) 479b4: 41f9 0005 dbb2 lea 5dbb2 <_Objects_Information_table>,%a0 479ba: 2070 2c00 moveal %a0@(00000000,%d2:l:4),%a0 479be: 4a88 tstl %a0 479c0: 67d6 beqs 47998 <_Objects_Get_information+0x14> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 479c2: 2030 3c00 movel %a0@(00000000,%d3:l:4),%d0 if ( !info ) 479c6: 67d0 beqs 47998 <_Objects_Get_information+0x14> <== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 479c8: 2040 moveal %d0,%a0 479ca: 4a68 000e tstw %a0@(14) 479ce: 67c8 beqs 47998 <_Objects_Get_information+0x14> return NULL; #endif return info; } 479d0: 242e fff8 movel %fp@(-8),%d2 479d4: 262e fffc movel %fp@(-4),%d3 479d8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00054af8 <_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; 54af8: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 54afa: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54afc: 4e56 0000 linkw %fp,#0 54b00: 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; 54b04: 90a8 0006 subl %a0@(6),%d0 54b08: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 54b0c: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54b10: 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 ) { 54b14: b081 cmpl %d1,%d0 54b16: 620e bhis 54b26 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 54b18: 2068 0018 moveal %a0@(24),%a0 54b1c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 54b20: 6704 beqs 54b26 <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 54b22: 4291 clrl %a1@ return the_object; 54b24: 6006 bras 54b2c <_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; 54b26: 7001 moveq #1,%d0 54b28: 2280 movel %d0,%a1@ return NULL; 54b2a: 4280 clrl %d0 } 54b2c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004afcc <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4afcc: 4e56 fffc linkw %fp,#-4 4afd0: 222e 0008 movel %fp@(8),%d1 4afd4: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4afd6: 4a81 tstl %d1 4afd8: 660a bnes 4afe4 <_Objects_Id_to_name+0x18> 4afda: 2079 0006 8e52 moveal 68e52 <_Per_CPU_Information+0xe>,%a0 4afe0: 2228 0008 movel %a0@(8),%d1 4afe4: 7418 moveq #24,%d2 4afe6: 2001 movel %d1,%d0 4afe8: e4a8 lsrl %d2,%d0 4afea: 143c 0007 moveb #7,%d2 4afee: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4aff0: 143c 0002 moveb #2,%d2 4aff4: 2040 moveal %d0,%a0 4aff6: 5388 subql #1,%a0 4aff8: b488 cmpl %a0,%d2 4affa: 643a bccs 4b036 <_Objects_Id_to_name+0x6a> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4affc: 7003 moveq #3,%d0 4affe: 6046 bras 4b046 <_Objects_Id_to_name+0x7a> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 4b000: 2001 movel %d1,%d0 4b002: 741b moveq #27,%d2 4b004: 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 ]; 4b006: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 4b00a: 67f0 beqs 4affc <_Objects_Id_to_name+0x30> <== 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 ); 4b00c: 486e fffc pea %fp@(-4) 4b010: 2f01 movel %d1,%sp@- 4b012: 2f00 movel %d0,%sp@- 4b014: 4eb9 0004 af6c jsr 4af6c <_Objects_Get> if ( !the_object ) 4b01a: 4fef 000c lea %sp@(12),%sp 4b01e: 4a80 tstl %d0 4b020: 67da beqs 4affc <_Objects_Id_to_name+0x30> return OBJECTS_INVALID_ID; *name = the_object->name; 4b022: 206e 000c moveal %fp@(12),%a0 4b026: 2240 moveal %d0,%a1 4b028: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 4b02c: 4eb9 0004 bc34 jsr 4bc34 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4b032: 4280 clrl %d0 4b034: 6010 bras 4b046 <_Objects_Id_to_name+0x7a> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 4b036: 41f9 0006 8c5e lea 68c5e <_Objects_Information_table>,%a0 4b03c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 4b040: 4a88 tstl %a0 4b042: 66bc bnes 4b000 <_Objects_Id_to_name+0x34> 4b044: 60b6 bras 4affc <_Objects_Id_to_name+0x30> return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4b046: 242e fff8 movel %fp@(-8),%d2 4b04a: 4e5e unlk %fp ... =============================================================================== 00047b84 <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 47b84: 4e56 fff4 linkw %fp,#-12 47b88: 226e 0008 moveal %fp@(8),%a1 47b8c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47b90: 222e 000c movel %fp@(12),%d1 47b94: 202e 0010 movel %fp@(16),%d0 47b98: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 47b9c: 4a8a tstl %a2 47b9e: 674a beqs 47bea <_Objects_Name_to_id_u32+0x66> <== NEVER TAKEN return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 47ba0: 4a81 tstl %d1 47ba2: 674a beqs 47bee <_Objects_Name_to_id_u32+0x6a> return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 47ba4: 3429 000e movew %a1@(14),%d2 47ba8: 6744 beqs 47bee <_Objects_Name_to_id_u32+0x6a> 47baa: 4a80 tstl %d0 47bac: 672e beqs 47bdc <_Objects_Name_to_id_u32+0x58> (node == OBJECTS_SEARCH_ALL_NODES || 47bae: 0c80 7fff ffff cmpil #2147483647,%d0 47bb4: 6726 beqs 47bdc <_Objects_Name_to_id_u32+0x58> node == OBJECTS_SEARCH_LOCAL_NODE || 47bb6: 7601 moveq #1,%d3 47bb8: b680 cmpl %d0,%d3 47bba: 6720 beqs 47bdc <_Objects_Name_to_id_u32+0x58> 47bbc: 6030 bras 47bee <_Objects_Name_to_id_u32+0x6a> )) search_local_node = true; if ( search_local_node ) { for ( index = 1; index <= information->maximum; index++ ) { the_object = information->local_table[ index ]; 47bbe: 2069 0018 moveal %a1@(24),%a0 47bc2: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !the_object ) 47bc6: 4a88 tstl %a0 47bc8: 670e beqs 47bd8 <_Objects_Name_to_id_u32+0x54> continue; if ( name == the_object->name.name_u32 ) { 47bca: b2a8 000c cmpl %a0@(12),%d1 47bce: 6608 bnes 47bd8 <_Objects_Name_to_id_u32+0x54> *id = the_object->id; 47bd0: 24a8 0008 movel %a0@(8),%a2@ return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47bd4: 4280 clrl %d0 47bd6: 6018 bras 47bf0 <_Objects_Name_to_id_u32+0x6c> _Objects_Is_local_node( node ) )) search_local_node = true; if ( search_local_node ) { for ( index = 1; index <= information->maximum; index++ ) { 47bd8: 5280 addql #1,%d0 47bda: 6008 bras 47be4 <_Objects_Name_to_id_u32+0x60> search_local_node = false; if ( information->maximum != 0 && (node == OBJECTS_SEARCH_ALL_NODES || node == OBJECTS_SEARCH_LOCAL_NODE || 47bdc: 7001 moveq #1,%d0 _Objects_Is_local_node( node ) )) search_local_node = true; if ( search_local_node ) { for ( index = 1; index <= information->maximum; index++ ) { 47bde: 0282 0000 ffff andil #65535,%d2 47be4: b480 cmpl %d0,%d2 47be6: 64d6 bccs 47bbe <_Objects_Name_to_id_u32+0x3a> 47be8: 6004 bras 47bee <_Objects_Name_to_id_u32+0x6a> #endif /* ASSERT: information->is_string == false */ if ( !id ) return OBJECTS_INVALID_ADDRESS; 47bea: 7002 moveq #2,%d0 47bec: 6002 bras 47bf0 <_Objects_Name_to_id_u32+0x6c> if ( name == 0 ) return OBJECTS_INVALID_NAME; 47bee: 7001 moveq #1,%d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 47bf0: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47bf4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048796 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 48796: 4e56 ffec linkw %fp,#-20 4879a: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4879e: 2a6e 0008 moveal %fp@(8),%a5 487a2: 246e 000c moveal %fp@(12),%a2 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 487a6: 4a8a tstl %a2 487a8: 6700 00fe beqw 488a8 <_RBTree_Extract_unprotected+0x112> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 487ac: b5ed 0008 cmpal %a5@(8),%a2 487b0: 6612 bnes 487c4 <_RBTree_Extract_unprotected+0x2e> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 487b2: 4878 0001 pea 1 487b6: 2f0a movel %a2,%sp@- 487b8: 4eb9 0004 8b28 jsr 48b28 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 487be: 508f addql #8,%sp 487c0: 2b40 0008 movel %d0,%a5@(8) } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 487c4: b5ed 000c cmpal %a5@(12),%a2 487c8: 6610 bnes 487da <_RBTree_Extract_unprotected+0x44> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 487ca: 42a7 clrl %sp@- 487cc: 2f0a movel %a2,%sp@- 487ce: 4eb9 0004 8b28 jsr 48b28 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 487d4: 508f addql #8,%sp 487d6: 2b40 000c movel %d0,%a5@(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]) { 487da: 266a 0004 moveal %a2@(4),%a3 487de: 4a8b tstl %a3 487e0: 6776 beqs 48858 <_RBTree_Extract_unprotected+0xc2> 487e2: 4aaa 0008 tstl %a2@(8) 487e6: 6604 bnes 487ec <_RBTree_Extract_unprotected+0x56> 487e8: 6078 bras 48862 <_RBTree_Extract_unprotected+0xcc> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 487ea: 2640 moveal %d0,%a3 487ec: 202b 0008 movel %a3@(8),%d0 487f0: 66f8 bnes 487ea <_RBTree_Extract_unprotected+0x54> * 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]; 487f2: 286b 0004 moveal %a3@(4),%a4 if(leaf) { 487f6: 4a8c tstl %a4 487f8: 6704 beqs 487fe <_RBTree_Extract_unprotected+0x68> leaf->parent = target->parent; 487fa: 2893 movel %a3@,%a4@ 487fc: 6008 bras 48806 <_RBTree_Extract_unprotected+0x70> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 487fe: 2f0b movel %a3,%sp@- 48800: 4eba fe60 jsr %pc@(48662 <_RBTree_Extract_validate_unprotected>) 48804: 588f addql #4,%sp } victim_color = target->color; dir = target != target->parent->child[0]; 48806: 2053 moveal %a3@,%a0 48808: b7e8 0004 cmpal %a0@(4),%a3 4880c: 56c1 sne %d1 target->parent->child[dir] = leaf; 4880e: 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]; 48810: 49c1 extbl %d1 target->parent->child[dir] = leaf; 48812: 9481 subl %d1,%d2 48814: 218c 2c00 movel %a4,%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; 48818: 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]; 4881a: 2052 moveal %a2@,%a0 4881c: b5e8 0004 cmpal %a0@(4),%a2 48820: 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; 48822: 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]; 48826: 49c1 extbl %d1 the_node->parent->child[dir] = target; 48828: 9481 subl %d1,%d2 4882a: 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]; 4882e: 276a 0008 0008 movel %a2@(8),%a3@(8) if (the_node->child[RBT_RIGHT]) 48834: 206a 0008 moveal %a2@(8),%a0 48838: 4a88 tstl %a0 4883a: 6702 beqs 4883e <_RBTree_Extract_unprotected+0xa8><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 4883c: 208b movel %a3,%a0@ target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4883e: 276a 0004 0004 movel %a2@(4),%a3@(4) if (the_node->child[RBT_LEFT]) 48844: 206a 0004 moveal %a2@(4),%a0 48848: 4a88 tstl %a0 4884a: 6702 beqs 4884e <_RBTree_Extract_unprotected+0xb8> the_node->child[RBT_LEFT]->parent = target; 4884c: 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; 4884e: 2692 movel %a2@,%a3@ target->color = the_node->color; 48850: 276a 000c 000c movel %a2@(12),%a3@(12) 48856: 602e bras 48886 <_RBTree_Extract_unprotected+0xf0> * 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]; 48858: 286a 0008 moveal %a2@(8),%a4 if( leaf ) { 4885c: 4a8c tstl %a4 4885e: 6604 bnes 48864 <_RBTree_Extract_unprotected+0xce> 48860: 6006 bras 48868 <_RBTree_Extract_unprotected+0xd2> * 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]) { 48862: 284b moveal %a3,%a4 * 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]; if( leaf ) { leaf->parent = the_node->parent; 48864: 2892 movel %a2@,%a4@ 48866: 6008 bras 48870 <_RBTree_Extract_unprotected+0xda> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 48868: 2f0a movel %a2,%sp@- 4886a: 4eba fdf6 jsr %pc@(48662 <_RBTree_Extract_validate_unprotected>) 4886e: 588f addql #4,%sp } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 48870: 2052 moveal %a2@,%a0 48872: b5e8 0004 cmpal %a0@(4),%a2 48876: 56c1 sne %d1 the_node->parent->child[dir] = leaf; 48878: 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]; 4887a: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4887c: 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; 4887e: 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; 48882: 218c 2c00 movel %a4,%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 */ 48886: 4a80 tstl %d0 48888: 6608 bnes 48892 <_RBTree_Extract_unprotected+0xfc> if (leaf) { 4888a: 4a8c tstl %a4 4888c: 6704 beqs 48892 <_RBTree_Extract_unprotected+0xfc> leaf->color = RBT_BLACK; /* case 2 */ 4888e: 42ac 000c clrl %a4@(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; 48892: 206d 0004 moveal %a5@(4),%a0 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 48896: 42aa 0008 clrl %a2@(8) 4889a: 42aa 0004 clrl %a2@(4) 4889e: 4292 clrl %a2@ 488a0: 4a88 tstl %a0 488a2: 6704 beqs 488a8 <_RBTree_Extract_unprotected+0x112> 488a4: 42a8 000c clrl %a0@(12) } 488a8: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 488ae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049458 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 49458: 4e56 fff0 linkw %fp,#-16 4945c: 202e 001c movel %fp@(28),%d0 49460: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 49464: 246e 0008 moveal %fp@(8),%a2 49468: 242e 0014 movel %fp@(20),%d2 size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4946c: 4a8a tstl %a2 4946e: 6736 beqs 494a6 <_RBTree_Initialize+0x4e> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 49470: 4292 clrl %a2@ the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 49472: 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; 49478: 262e 0010 movel %fp@(16),%d3 RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; 4947c: 42aa 0004 clrl %a2@(4) while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 49480: 47f9 0004 9238 lea 49238 <_RBTree_Insert_unprotected>,%a3 the_rbtree->first[0] = NULL; 49486: 42aa 0008 clrl %a2@(8) the_rbtree->first[1] = NULL; 4948a: 42aa 000c clrl %a2@(12) the_rbtree->compare_function = compare_function; the_rbtree->is_unique = is_unique; 4948e: 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-- ) { 49492: 600e bras 494a2 <_RBTree_Initialize+0x4a> _RBTree_Insert_unprotected(the_rbtree, next); 49494: 2f03 movel %d3,%sp@- 49496: 5382 subql #1,%d2 49498: 2f0a movel %a2,%sp@- 4949a: 4e93 jsr %a3@ 4949c: 508f addql #8,%sp #include #include #include #include void _RBTree_Initialize( 4949e: d6ae 0018 addl %fp@(24),%d3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 494a2: 4a82 tstl %d2 494a4: 66ee bnes 49494 <_RBTree_Initialize+0x3c> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 494a6: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 494ac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004893c <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4893c: 4e56 ffec linkw %fp,#-20 48940: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 48944: 266e 0008 moveal %fp@(8),%a3 48948: 246e 000c moveal %fp@(12),%a2 if(!the_node) return (RBTree_Node*)-1; 4894c: 4a8a tstl %a2 4894e: 6700 013a beqw 48a8a <_RBTree_Insert_unprotected+0x14e> RBTree_Node *iter_node = the_rbtree->root; 48952: 286b 0004 moveal %a3@(4),%a4 int compare_result; if (!iter_node) { /* special case: first node inserted */ 48956: 2a4c moveal %a4,%a5 48958: 4a8c tstl %a4 4895a: 6620 bnes 4897c <_RBTree_Insert_unprotected+0x40> the_node->color = RBT_BLACK; 4895c: 42aa 000c clrl %a2@(12) the_rbtree->root = the_node; 48960: 274a 0004 movel %a2,%a3@(4) the_rbtree->first[0] = the_rbtree->first[1] = the_node; 48964: 274a 000c movel %a2,%a3@(12) 48968: 274a 0008 movel %a2,%a3@(8) the_node->parent = (RBTree_Node *) the_rbtree; 4896c: 248b movel %a3,%a2@ the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4896e: 42aa 0008 clrl %a2@(8) 48972: 42aa 0004 clrl %a2@(4) 48976: 6000 0126 braw 48a9e <_RBTree_Insert_unprotected+0x162> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 4897a: 2a4c moveal %a4,%a5 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 4897c: 2f0c movel %a4,%sp@- 4897e: 2f0a movel %a2,%sp@- 48980: 206b 0010 moveal %a3@(16),%a0 48984: 4e90 jsr %a0@ if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 48986: 508f addql #8,%sp 48988: 4a2b 0014 tstb %a3@(20) 4898c: 6706 beqs 48994 <_RBTree_Insert_unprotected+0x58> 4898e: 4a80 tstl %d0 48990: 6700 010c beqw 48a9e <_RBTree_Insert_unprotected+0x162> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 48994: 2400 movel %d0,%d2 48996: 4682 notl %d2 48998: d482 addl %d2,%d2 4899a: 9582 subxl %d2,%d2 4899c: 4482 negl %d2 if (!iter_node->child[dir]) { 4899e: 2002 movel %d2,%d0 489a0: 5280 addql #1,%d0 489a2: 2874 0c00 moveal %a4@(00000000,%d0:l:4),%a4 489a6: 4a8c tstl %a4 489a8: 66d0 bnes 4897a <_RBTree_Insert_unprotected+0x3e> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 489aa: 42aa 0008 clrl %a2@(8) the_node->color = RBT_RED; 489ae: 7201 moveq #1,%d1 compare_result = the_rbtree->compare_function(the_node, iter_node); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 489b0: 42aa 0004 clrl %a2@(4) the_node->color = RBT_RED; iter_node->child[dir] = the_node; 489b4: 2b8a 0c00 movel %a2,%a5@(00000000,%d0:l:4) the_node->parent = iter_node; 489b8: 248d movel %a5,%a2@ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 489ba: 2a42 moveal %d2,%a5 489bc: 548d addql #2,%a5 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 489be: 2541 000c movel %d1,%a2@(12) iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 489c2: 2f33 dc00 movel %a3@(00000000,%a5:l:4),%sp@- 489c6: 2f0a movel %a2,%sp@- 489c8: 206b 0010 moveal %a3@(16),%a0 489cc: 4e90 jsr %a0@ the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 489ce: 508f addql #8,%sp 489d0: 4a82 tstl %d2 489d2: 6608 bnes 489dc <_RBTree_Insert_unprotected+0xa0> 489d4: 4a80 tstl %d0 489d6: 6c00 0092 bgew 48a6a <_RBTree_Insert_unprotected+0x12e> 489da: 6006 bras 489e2 <_RBTree_Insert_unprotected+0xa6> (dir && _RBTree_Is_greater(compare_result)) ) { 489dc: 4a80 tstl %d0 489de: 6f00 008a blew 48a6a <_RBTree_Insert_unprotected+0x12e> the_rbtree->first[dir] = the_node; 489e2: 278a dc00 movel %a2,%a3@(00000000,%a5:l:4) 489e6: 6000 0082 braw 48a6a <_RBTree_Insert_unprotected+0x12e> const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 489ea: 4a8b tstl %a3 489ec: 671e beqs 48a0c <_RBTree_Insert_unprotected+0xd0><== NEVER TAKEN if(!(the_node->parent->parent->parent)) return NULL; 489ee: 4a93 tstl %a3@ 489f0: 671a beqs 48a0c <_RBTree_Insert_unprotected+0xd0><== 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]) 489f2: 226b 0004 moveal %a3@(4),%a1 489f6: b3c8 cmpal %a0,%a1 489f8: 6604 bnes 489fe <_RBTree_Insert_unprotected+0xc2> return the_node->parent->child[RBT_RIGHT]; 489fa: 226b 0008 moveal %a3@(8),%a1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 489fe: 4a89 tstl %a1 48a00: 670c beqs 48a0e <_RBTree_Insert_unprotected+0xd2> 48a02: 7001 moveq #1,%d0 48a04: b0a9 000c cmpl %a1@(12),%d0 48a08: 6604 bnes 48a0e <_RBTree_Insert_unprotected+0xd2> 48a0a: 6006 bras 48a12 <_RBTree_Insert_unprotected+0xd6> ) { 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; 48a0c: 93c9 subal %a1,%a1 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 48a0e: 4280 clrl %d0 48a10: 6002 bras 48a14 <_RBTree_Insert_unprotected+0xd8> 48a12: 7001 moveq #1,%d0 while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 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)) { 48a14: 4a80 tstl %d0 48a16: 6710 beqs 48a28 <_RBTree_Insert_unprotected+0xec> the_node->parent->color = RBT_BLACK; 48a18: 42a8 000c clrl %a0@(12) u->color = RBT_BLACK; g->color = RBT_RED; 48a1c: 7201 moveq #1,%d1 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; 48a1e: 42a9 000c clrl %a1@(12) g->color = RBT_RED; 48a22: 2741 000c movel %d1,%a3@(12) 48a26: 603e bras 48a66 <_RBTree_Insert_unprotected+0x12a> 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]; 48a28: b1eb 0004 cmpal %a3@(4),%a0 48a2c: 56c0 sne %d0 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]; 48a2e: b5e8 0004 cmpal %a0@(4),%a2 48a32: 56c1 sne %d1 RBTree_Direction pdir = the_node->parent != g->child[0]; 48a34: 49c0 extbl %d0 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]; 48a36: 2400 movel %d0,%d2 48a38: 49c1 extbl %d1 48a3a: 4482 negl %d2 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 48a3c: b081 cmpl %d1,%d0 48a3e: 670c beqs 48a4c <_RBTree_Insert_unprotected+0x110> _RBTree_Rotate(the_node->parent, pdir); 48a40: 2f02 movel %d2,%sp@- 48a42: 2f08 movel %a0,%sp@- 48a44: 4e95 jsr %a5@ the_node = the_node->child[pdir]; 48a46: 508f addql #8,%sp 48a48: 2472 2c04 moveal %a2@(00000004,%d2:l:4),%a2 } the_node->parent->color = RBT_BLACK; 48a4c: 2052 moveal %a2@,%a0 g->color = RBT_RED; 48a4e: 7001 moveq #1,%d0 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 48a50: 7201 moveq #1,%d1 48a52: 9282 subl %d2,%d1 /* 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; 48a54: 42a8 000c clrl %a0@(12) g->color = RBT_RED; 48a58: 2740 000c movel %d0,%a3@(12) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 48a5c: 2f01 movel %d1,%sp@- 48a5e: 2f0b movel %a3,%sp@- 48a60: 264a moveal %a2,%a3 48a62: 4e95 jsr %a5@ 48a64: 508f addql #8,%sp 48a66: 244b moveal %a3,%a2 48a68: 6004 bras 48a6e <_RBTree_Insert_unprotected+0x132> 48a6a: 4bfa fe74 lea %pc@(488e0 <_RBTree_Rotate>),%a5 _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 48a6e: 2052 moveal %a2@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 48a70: 2650 moveal %a0@,%a3 48a72: 4a8b tstl %a3 48a74: 661a bnes 48a90 <_RBTree_Insert_unprotected+0x154> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 48a76: 4280 clrl %d0 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))) { 48a78: 0800 0000 btst #0,%d0 48a7c: 6600 ff6c bnew 489ea <_RBTree_Insert_unprotected+0xae> /* 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; 48a80: 4a8b tstl %a3 48a82: 661a bnes 48a9e <_RBTree_Insert_unprotected+0x162> 48a84: 42aa 000c clrl %a2@(12) 48a88: 6014 bras 48a9e <_RBTree_Insert_unprotected+0x162> RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 48a8a: 387c ffff moveaw #-1,%a4 48a8e: 600e bras 48a9e <_RBTree_Insert_unprotected+0x162> 48a90: 7001 moveq #1,%d0 48a92: b0a8 000c cmpl %a0@(12),%d0 48a96: 57c0 seq %d0 48a98: 49c0 extbl %d0 48a9a: 4480 negl %d0 48a9c: 60da bras 48a78 <_RBTree_Insert_unprotected+0x13c> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 48a9e: 200c movel %a4,%d0 48aa0: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48aa6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048ad4 <_RBTree_Iterate_unprotected>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 48ad4: 7202 moveq #2,%d1 const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 48ad6: 4e56 fff0 linkw %fp,#-16 48ada: 206e 0008 moveal %fp@(8),%a0 48ade: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48ae2: 262e 000c movel %fp@(12),%d3 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 48ae6: 57c0 seq %d0 bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); 48ae8: 45f9 0004 8b28 lea 48b28 <_RBTree_Next_unprotected>,%a2 48aee: 49c0 extbl %d0 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 48af0: 9280 subl %d0,%d1 48af2: 2430 1c00 movel %a0@(00000000,%d1:l:4),%d2 48af6: 6020 bras 48b18 <_RBTree_Iterate_unprotected+0x44> RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 48af8: 2f2e 0014 movel %fp@(20),%sp@- 48afc: 206e 0010 moveal %fp@(16),%a0 48b00: 2f03 movel %d3,%sp@- 48b02: 2f02 movel %d2,%sp@- 48b04: 4e90 jsr %a0@ current = _RBTree_Next_unprotected( current, dir ); 48b06: 2f03 movel %d3,%sp@- RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 48b08: 1800 moveb %d0,%d4 current = _RBTree_Next_unprotected( current, dir ); 48b0a: 2f02 movel %d2,%sp@- 48b0c: 4e92 jsr %a2@ { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 48b0e: 4fef 0014 lea %sp@(20),%sp stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); 48b12: 2400 movel %d0,%d2 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 48b14: 4a04 tstb %d4 48b16: 6604 bnes 48b1c <_RBTree_Iterate_unprotected+0x48><== NEVER TAKEN 48b18: 4a82 tstl %d2 48b1a: 66dc bnes 48af8 <_RBTree_Iterate_unprotected+0x24> stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 48b1c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48b22: 4e5e unlk %fp ... =============================================================================== 00048606 <_RBTree_Rotate>: */ RTEMS_INLINE_ROUTINE void _RBTree_Rotate( RBTree_Node *the_node, RBTree_Direction dir ) { 48606: 4e56 0000 linkw %fp,#0 4860a: 206e 0008 moveal %fp@(8),%a0 4860e: 2f0a movel %a2,%sp@- 48610: 202e 000c movel %fp@(12),%d0 48614: 2f02 movel %d2,%sp@- RBTree_Node *c; if (the_node == NULL) return; 48616: 4a88 tstl %a0 48618: 6740 beqs 4865a <_RBTree_Rotate+0x54> <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4861a: 4a80 tstl %d0 4861c: 57c1 seq %d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4861e: 7401 moveq #1,%d2 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 48620: 49c1 extbl %d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 48622: 9481 subl %d1,%d2 48624: 2270 2c00 moveal %a0@(00000000,%d2:l:4),%a1 48628: 4a89 tstl %a1 4862a: 672e beqs 4865a <_RBTree_Rotate+0x54> <== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4862c: 5280 addql #1,%d0 4862e: 45f1 0c00 lea %a1@(00000000,%d0:l:4),%a2 48632: 2192 2c00 movel %a2@,%a0@(00000000,%d2:l:4) if (c->child[dir]) 48636: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2 4863a: 4a8a tstl %a2 4863c: 6702 beqs 48640 <_RBTree_Rotate+0x3a> c->child[dir]->parent = the_node; 4863e: 2488 movel %a0,%a2@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 48640: 2450 moveal %a0@,%a2 48642: 7201 moveq #1,%d1 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 48644: 2388 0c00 movel %a0,%a1@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 48648: b1ea 0004 cmpal %a2@(4),%a0 4864c: 56c0 sne %d0 c->parent = the_node->parent; 4864e: 228a movel %a2,%a1@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 48650: 49c0 extbl %d0 48652: 9280 subl %d0,%d1 48654: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4) c->parent = the_node->parent; the_node->parent = c; 48658: 2089 movel %a1,%a0@ } 4865a: 241f movel %sp@+,%d2 4865c: 245f moveal %sp@+,%a2 4865e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000485dc <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { 485dc: 4e56 0000 linkw %fp,#0 485e0: 226e 0008 moveal %fp@(8),%a1 if(!the_node) return NULL; 485e4: 4a89 tstl %a1 485e6: 6718 beqs 48600 <_RBTree_Sibling+0x24> <== NEVER TAKEN if(!(the_node->parent)) return NULL; 485e8: 2051 moveal %a1@,%a0 485ea: 4a88 tstl %a0 485ec: 6712 beqs 48600 <_RBTree_Sibling+0x24> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 485ee: 4a90 tstl %a0@ 485f0: 670e beqs 48600 <_RBTree_Sibling+0x24> if(the_node == the_node->parent->child[RBT_LEFT]) 485f2: 2028 0004 movel %a0@(4),%d0 485f6: b089 cmpl %a1,%d0 485f8: 6608 bnes 48602 <_RBTree_Sibling+0x26> return the_node->parent->child[RBT_RIGHT]; 485fa: 2028 0008 movel %a0@(8),%d0 485fe: 6002 bras 48602 <_RBTree_Sibling+0x26> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 48600: 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]; } 48602: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047028 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 47028: 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 ]; 4702c: 206e 0008 moveal %fp@(8),%a0 #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 47030: 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 ]; 47034: 2468 00f8 moveal %a0@(248),%a2 if ( !api ) 47038: 4a8a tstl %a2 4703a: 6754 beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4703c: 203c 0000 0700 movel #1792,%d0 47042: 40c1 movew %sr,%d1 47044: 8081 orl %d1,%d0 47046: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 47048: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 4704c: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 47050: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 47052: 4a83 tstl %d3 47054: 673a beqs 47090 <_RTEMS_signal_Post_switch_hook+0x68> return; asr->nest_level += 1; 47056: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4705a: 240e movel %fp,%d2 4705c: 5982 subql #4,%d2 4705e: 47f9 0004 7434 lea 47434 ,%a3 47064: 2f02 movel %d2,%sp@- 47066: 2f3c 0000 ffff movel #65535,%sp@- 4706c: 2f2a 000e movel %a2@(14),%sp@- 47070: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 47072: 2f03 movel %d3,%sp@- 47074: 206a 000a moveal %a2@(10),%a0 47078: 4e90 jsr %a0@ asr->nest_level -= 1; 4707a: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4707e: 2f02 movel %d2,%sp@- 47080: 2f3c 0000 ffff movel #65535,%sp@- 47086: 2f2e fffc movel %fp@(-4),%sp@- 4708a: 4e93 jsr %a3@ 4708c: 4fef 001c lea %sp@(28),%sp } 47090: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 47096: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00057ac0 <_Region_Process_queue>: #include void _Region_Process_queue( Region_Control *the_region ) { 57ac0: 4e56 ffe4 linkw %fp,#-28 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 57ac4: 2039 0007 6042 movel 76042 <_Thread_Dispatch_disable_level>,%d0 ++level; 57aca: 5280 addql #1,%d0 57acc: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 57ad0: 266e 0008 moveal %fp@(8),%a3 _Thread_Dispatch_disable_level = level; 57ad4: 23c0 0007 6042 movel %d0,76042 <_Thread_Dispatch_disable_level> * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 57ada: 2f39 0007 60c6 movel 760c6 <_RTEMS_Allocator_Mutex>,%sp@- /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 57ae0: 240b movel %a3,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 57ae2: 260b movel %a3,%d3 57ae4: 0682 0000 0010 addil #16,%d2 57aea: 4bf9 0005 8158 lea 58158 <_Thread_queue_First>,%a5 57af0: 0683 0000 0068 addil #104,%d3 if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 57af6: 49f9 0005 8054 lea 58054 <_Thread_queue_Extract>,%a4 * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 57afc: 4eb9 0005 315c jsr 5315c <_API_Mutex_Unlock> 57b02: 588f addql #4,%sp 57b04: 283c 0005 3b24 movel #342820,%d4 /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 57b0a: 2f02 movel %d2,%sp@- 57b0c: 4e95 jsr %a5@ if ( the_thread == NULL ) 57b0e: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 57b10: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 57b12: 4a80 tstl %d0 57b14: 672e beqs 57b44 <_Region_Process_queue+0x84> 57b16: 42a7 clrl %sp@- 57b18: 2044 moveal %d4,%a0 57b1a: 42a7 clrl %sp@- 57b1c: 2f2a 0024 movel %a2@(36),%sp@- 57b20: 2f03 movel %d3,%sp@- 57b22: 4e90 jsr %a0@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 57b24: 4fef 0010 lea %sp@(16),%sp 57b28: 4a80 tstl %d0 57b2a: 6718 beqs 57b44 <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 57b2c: 206a 0028 moveal %a2@(40),%a0 57b30: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 57b32: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 57b36: 2f0a movel %a2,%sp@- 57b38: 2f02 movel %d2,%sp@- 57b3a: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 57b3c: 508f addql #8,%sp break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; 57b3e: 42aa 0034 clrl %a2@(52) } 57b42: 60c6 bras 57b0a <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 57b44: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 57b4a: 4e5e unlk %fp *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 57b4c: 4ef9 0005 5774 jmp 55774 <_Thread_Enable_dispatch> ... =============================================================================== 000484a4 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 484a4: 4e56 0000 linkw %fp,#0 484a8: 2f0a movel %a2,%sp@- void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 484aa: 4878 001c pea 1c #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 484ae: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 484b2: 4eb9 0004 9b90 jsr 49b90 <_Workspace_Allocate> if ( sched ) { 484b8: 588f addql #4,%sp 484ba: 4a80 tstl %d0 484bc: 6712 beqs 484d0 <_Scheduler_CBS_Allocate+0x2c> <== NEVER TAKEN the_thread->scheduler_info = sched; 484be: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 484c2: 2040 moveal %d0,%a0 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 484c4: 7202 moveq #2,%d1 sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 484c6: 208a movel %a2,%a0@ schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 484c8: 2141 0014 movel %d1,%a0@(20) schinfo->cbs_server = NULL; 484cc: 42a8 0018 clrl %a0@(24) } return sched; } 484d0: 246e fffc moveal %fp@(-4),%a2 484d4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004996c <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4996c: 4e56 fffc linkw %fp,#-4 49970: 2f0a movel %a2,%sp@- 49972: 246e 0008 moveal %fp@(8),%a2 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 49976: 202a 00a8 movel %a2@(168),%d0 if ( the_thread->real_priority != new_priority ) 4997a: b0aa 0018 cmpl %a2@(24),%d0 4997e: 6704 beqs 49984 <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN the_thread->real_priority = new_priority; 49980: 2540 0018 movel %d0,%a2@(24) if ( the_thread->current_priority != new_priority ) 49984: b0aa 0014 cmpl %a2@(20),%d0 49988: 6712 beqs 4999c <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 4998a: 4878 0001 pea 1 4998e: 2f00 movel %d0,%sp@- 49990: 2f0a movel %a2,%sp@- 49992: 4eb9 0004 9ec0 jsr 49ec0 <_Thread_Change_priority> 49998: 4fef 000c lea %sp@(12),%sp /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4999c: 246a 0086 moveal %a2@(134),%a2 if ( sched_info->cbs_server->cbs_budget_overrun ) { 499a0: 206a 0018 moveal %a2@(24),%a0 499a4: 4aa8 000c tstl %a0@(12) 499a8: 671e beqs 499c8 <_Scheduler_CBS_Budget_callout+0x5c> _Scheduler_CBS_Get_server_id( 499aa: 486e fffc pea %fp@(-4) 499ae: 2f10 movel %a0@,%sp@- 499b0: 4eb9 0004 9930 jsr 49930 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 499b6: 206a 0018 moveal %a2@(24),%a0 499ba: 2f2e fffc movel %fp@(-4),%sp@- 499be: 2068 000c moveal %a0@(12),%a0 499c2: 4e90 jsr %a0@ 499c4: 4fef 000c lea %sp@(12),%sp } } 499c8: 246e fff8 moveal %fp@(-8),%a2 499cc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049640 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 49640: 4e56 fff4 linkw %fp,#-12 49644: 48d7 1c00 moveml %a2-%a4,%sp@ 49648: 246e 0008 moveal %fp@(8),%a2 4964c: 266e 0010 moveal %fp@(16),%a3 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 49650: 4aaa 0004 tstl %a2@(4) 49654: 6f3e bles 49694 <_Scheduler_CBS_Create_server+0x54> 49656: 4a92 tstl %a2@ 49658: 6f3a bles 49694 <_Scheduler_CBS_Create_server+0x54> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4965a: 2239 0005 f54c movel 5f54c <_Scheduler_CBS_Maximum_servers>,%d1 if ( !_Scheduler_CBS_Server_list[i] ) 49660: 4280 clrl %d0 49662: 2079 0006 0f22 moveal 60f22 <_Scheduler_CBS_Server_list>,%a0 49668: 6006 bras 49670 <_Scheduler_CBS_Create_server+0x30> 4966a: 4a98 tstl %a0@+ 4966c: 672e beqs 4969c <_Scheduler_CBS_Create_server+0x5c> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4966e: 5280 addql #1,%d0 49670: b280 cmpl %d0,%d1 49672: 66f6 bnes 4966a <_Scheduler_CBS_Create_server+0x2a> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 49674: 70e6 moveq #-26,%d0 49676: 6050 bras 496c8 <_Scheduler_CBS_Create_server+0x88> _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 49678: 2012 movel %a2@,%d0 4967a: 222a 0004 movel %a2@(4),%d1 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4967e: 216e 000c 000c movel %fp@(12),%a0@(12) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 49684: 2140 0004 movel %d0,%a0@(4) 49688: 2141 0008 movel %d1,%a0@(8) the_server->task_id = -1; 4968c: 70ff moveq #-1,%d0 4968e: 2080 movel %d0,%a0@ the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 49690: 4280 clrl %d0 49692: 6034 bras 496c8 <_Scheduler_CBS_Create_server+0x88> if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 49694: 70ee moveq #-18,%d0 49696: 6030 bras 496c8 <_Scheduler_CBS_Create_server+0x88> *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 49698: 70ef moveq #-17,%d0 <== NOT EXECUTED 4969a: 602c bras 496c8 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4969c: 2680 movel %d0,%a3@ _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4969e: 4878 0010 pea 10 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 496a2: 2879 0006 0f22 moveal 60f22 <_Scheduler_CBS_Server_list>,%a4 496a8: e588 lsll #2,%d0 496aa: d9c0 addal %d0,%a4 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 496ac: 4eb9 0004 b094 jsr 4b094 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) 496b2: 588f addql #4,%sp if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 496b4: 2880 movel %d0,%a4@ _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 496b6: 2013 movel %a3@,%d0 496b8: 2079 0006 0f22 moveal 60f22 <_Scheduler_CBS_Server_list>,%a0 496be: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !the_server ) 496c2: 4a88 tstl %a0 496c4: 66b2 bnes 49678 <_Scheduler_CBS_Create_server+0x38><== ALWAYS TAKEN 496c6: 60d0 bras 49698 <_Scheduler_CBS_Create_server+0x58><== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 496c8: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 496ce: 4e5e unlk %fp ... =============================================================================== 0004974c <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4974c: 4e56 fff0 linkw %fp,#-16 49750: 48d7 040c moveml %d2-%d3/%a2,%sp@ Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 49754: 486e fffc pea %fp@(-4) int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 49758: 242e 000c movel %fp@(12),%d2 4975c: 262e 0008 movel %fp@(8),%d3 Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 49760: 2f02 movel %d2,%sp@- 49762: 4eb9 0004 a330 jsr 4a330 <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 49768: 508f addql #8,%sp { Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4976a: 2440 moveal %d0,%a2 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4976c: 4a80 tstl %d0 4976e: 6706 beqs 49776 <_Scheduler_CBS_Detach_thread+0x2a> _Thread_Enable_dispatch(); 49770: 4eb9 0004 a310 jsr 4a310 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 49776: b6b9 0005 f54c cmpl 5f54c <_Scheduler_CBS_Maximum_servers>,%d3 4977c: 643c bccs 497ba <_Scheduler_CBS_Detach_thread+0x6e> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4977e: 4a8a tstl %a2 49780: 6738 beqs 497ba <_Scheduler_CBS_Detach_thread+0x6e> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 49782: 2079 0006 0f22 moveal 60f22 <_Scheduler_CBS_Server_list>,%a0 49788: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 4978c: 4a88 tstl %a0 4978e: 6726 beqs 497b6 <_Scheduler_CBS_Detach_thread+0x6a> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 49790: b490 cmpl %a0@,%d2 49792: 6626 bnes 497ba <_Scheduler_CBS_Detach_thread+0x6e><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 49794: 70ff moveq #-1,%d0 49796: 2080 movel %d0,%a0@ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 49798: 206a 0086 moveal %a2@(134),%a0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; 4979c: 4280 clrl %d0 if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4979e: 42a8 0018 clrl %a0@(24) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 497a2: 256a 009c 0076 movel %a2@(156),%a2@(118) the_thread->budget_callout = the_thread->Start.budget_callout; 497a8: 256a 00a0 007a movel %a2@(160),%a2@(122) the_thread->is_preemptible = the_thread->Start.is_preemptible; 497ae: 156a 009a 0070 moveb %a2@(154),%a2@(112) 497b4: 6006 bras 497bc <_Scheduler_CBS_Detach_thread+0x70> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 497b6: 70e7 moveq #-25,%d0 497b8: 6002 bras 497bc <_Scheduler_CBS_Detach_thread+0x70> if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 497ba: 70ee moveq #-18,%d0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 497bc: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 497c2: 4e5e unlk %fp ... =============================================================================== 000499d0 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 499d0: 4e56 0000 linkw %fp,#0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 499d4: 2039 0005 f54c movel 5f54c <_Scheduler_CBS_Maximum_servers>,%d0 499da: e588 lsll #2,%d0 499dc: 2f00 movel %d0,%sp@- 499de: 4eb9 0004 b094 jsr 4b094 <_Workspace_Allocate> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 499e4: 588f addql #4,%sp } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 499e6: 23c0 0006 0f22 movel %d0,60f22 <_Scheduler_CBS_Server_list> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 499ec: 671e beqs 49a0c <_Scheduler_CBS_Initialize+0x3c> <== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 499ee: 2239 0005 f54c movel 5f54c <_Scheduler_CBS_Maximum_servers>,%d1 499f4: 4280 clrl %d0 499f6: 600c bras 49a04 <_Scheduler_CBS_Initialize+0x34> _Scheduler_CBS_Server_list[i] = NULL; 499f8: 2079 0006 0f22 moveal 60f22 <_Scheduler_CBS_Server_list>,%a0 499fe: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 49a02: 5280 addql #1,%d0 49a04: b280 cmpl %d0,%d1 49a06: 66f0 bnes 499f8 <_Scheduler_CBS_Initialize+0x28> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 49a08: 4280 clrl %d0 49a0a: 6002 bras 49a0e <_Scheduler_CBS_Initialize+0x3e> { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 49a0c: 70ef moveq #-17,%d0 <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } 49a0e: 4e5e unlk %fp ... =============================================================================== 000484d8 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 484d8: 4e56 0000 linkw %fp,#0 484dc: 206e 0008 moveal %fp@(8),%a0 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 484e0: 2268 0086 moveal %a0@(134),%a1 void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 484e4: 202e 000c movel %fp@(12),%d0 Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 484e8: 2269 0018 moveal %a1@(24),%a1 (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 484ec: 6722 beqs 48510 <_Scheduler_CBS_Release_job+0x38> /* Initializing or shifting deadline. */ if (serv_info) 484ee: 4a89 tstl %a1 484f0: 6710 beqs 48502 <_Scheduler_CBS_Release_job+0x2a> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 484f2: 2039 0005 f292 movel 5f292 <_Watchdog_Ticks_since_boot>,%d0 484f8: d0a9 0004 addl %a1@(4),%d0 484fc: 0880 001f bclr #31,%d0 48500: 6016 bras 48518 <_Scheduler_CBS_Release_job+0x40> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 48502: 2239 0005 f292 movel 5f292 <_Watchdog_Ticks_since_boot>,%d1 48508: d081 addl %d1,%d0 4850a: 0880 001f bclr #31,%d0 4850e: 600e bras 4851e <_Scheduler_CBS_Release_job+0x46> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 48510: 2028 00a8 movel %a0@(168),%d0 } /* Budget replenishment for the next job. */ if (serv_info) 48514: 4a89 tstl %a1 48516: 6706 beqs 4851e <_Scheduler_CBS_Release_job+0x46><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 48518: 2169 0008 0072 movel %a1@(8),%a0@(114) the_thread->real_priority = new_priority; 4851e: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 48522: 4878 0001 pea 1 48526: 2f00 movel %d0,%sp@- 48528: 2f08 movel %a0,%sp@- 4852a: 4eb9 0004 893c jsr 4893c <_Thread_Change_priority> 48530: 4fef 000c lea %sp@(12),%sp } 48534: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048538 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 48538: 4e56 0000 linkw %fp,#0 4853c: 2f0a movel %a2,%sp@- 4853e: 246e 0008 moveal %fp@(8),%a2 48542: 2f02 movel %d2,%sp@- Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 48544: 2f0a movel %a2,%sp@- 48546: 4eb9 0004 8638 jsr 48638 <_Scheduler_EDF_Enqueue> /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 4854c: 206a 0086 moveal %a2@(134),%a0 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 48550: 588f addql #4,%sp _Scheduler_EDF_Enqueue(the_thread); /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 48552: 2068 0018 moveal %a0@(24),%a0 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 48556: 4a88 tstl %a0 48558: 674c beqs 485a6 <_Scheduler_CBS_Unblock+0x6e> time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 4855a: 222a 0018 movel %a2@(24),%d1 4855e: 2401 movel %d1,%d2 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 48560: 43e8 0004 lea %a0@(4),%a1 */ if (serv_info) { time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 48564: 2039 0005 f292 movel 5f292 <_Watchdog_Ticks_since_boot>,%d0 4856a: 9480 subl %d0,%d2 4856c: 2002 movel %d2,%d0 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4856e: 4c11 0800 mulsl %a1@,%d0 48572: 43ea 0072 lea %a2@(114),%a1 48576: 2428 0008 movel %a0@(8),%d2 4857a: 4c11 2800 mulsl %a1@,%d2 4857e: b480 cmpl %d0,%d2 48580: 6c24 bges 485a6 <_Scheduler_CBS_Unblock+0x6e> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 48582: 202a 00a8 movel %a2@(168),%d0 if ( the_thread->real_priority != new_priority ) 48586: b081 cmpl %d1,%d0 48588: 6704 beqs 4858e <_Scheduler_CBS_Unblock+0x56> the_thread->real_priority = new_priority; 4858a: 2540 0018 movel %d0,%a2@(24) if ( the_thread->current_priority != new_priority ) 4858e: b0aa 0014 cmpl %a2@(20),%d0 48592: 6712 beqs 485a6 <_Scheduler_CBS_Unblock+0x6e> _Thread_Change_priority(the_thread, new_priority, true); 48594: 4878 0001 pea 1 48598: 2f00 movel %d0,%sp@- 4859a: 2f0a movel %a2,%sp@- 4859c: 4eb9 0004 893c jsr 4893c <_Thread_Change_priority> 485a2: 4fef 000c lea %sp@(12),%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_higher_than( the_thread->current_priority, 485a6: 2079 0005 f32a moveal 5f32a <_Per_CPU_Information+0x12>,%a0 485ac: 2f28 0014 movel %a0@(20),%sp@- 485b0: 2f2a 0014 movel %a2@(20),%sp@- 485b4: 2079 0005 d990 moveal 5d990 <_Scheduler+0x30>,%a0 485ba: 4e90 jsr %a0@ 485bc: 508f addql #8,%sp 485be: 4a80 tstl %d0 485c0: 6f20 bles 485e2 <_Scheduler_CBS_Unblock+0xaa> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 485c2: 2079 0005 f326 moveal 5f326 <_Per_CPU_Information+0xe>,%a0 * 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_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 485c8: 23ca 0005 f32a movel %a2,5f32a <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 485ce: 4a28 0070 tstb %a0@(112) 485d2: 6606 bnes 485da <_Scheduler_CBS_Unblock+0xa2> 485d4: 4aaa 0014 tstl %a2@(20) 485d8: 6608 bnes 485e2 <_Scheduler_CBS_Unblock+0xaa> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 485da: 7001 moveq #1,%d0 485dc: 13c0 0005 f324 moveb %d0,5f324 <_Per_CPU_Information+0xc> } } 485e2: 242e fff8 movel %fp@(-8),%d2 485e6: 246e fffc moveal %fp@(-4),%a2 485ea: 4e5e unlk %fp ... =============================================================================== 000484a4 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 484a4: 4e56 0000 linkw %fp,#0 484a8: 2f0a movel %a2,%sp@- void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 484aa: 4878 0018 pea 18 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 484ae: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 484b2: 4eb9 0004 9b08 jsr 49b08 <_Workspace_Allocate> if ( sched ) { 484b8: 588f addql #4,%sp 484ba: 4a80 tstl %d0 484bc: 670e beqs 484cc <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN the_thread->scheduler_info = sched; 484be: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 484c2: 2040 moveal %d0,%a0 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 484c4: 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; 484c6: 208a movel %a2,%a0@ schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 484c8: 2141 0014 movel %d1,%a0@(20) } return sched; } 484cc: 246e fffc moveal %fp@(-4),%a2 484d0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048694 <_Scheduler_EDF_Free>: #include void _Scheduler_EDF_Free( Thread_Control *the_thread ) { 48694: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 48698: 206e 0008 moveal %fp@(8),%a0 4869c: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 486a2: 4e5e unlk %fp void _Scheduler_EDF_Free( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 486a4: 4ef9 0004 9bac jmp 49bac <_Workspace_Free> ... =============================================================================== 00048680 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 48680: 4e56 0000 linkw %fp,#0 48684: 2f0a movel %a2,%sp@- 48686: 246e 0008 moveal %fp@(8),%a2 _Scheduler_EDF_Enqueue(the_thread); 4868a: 2f0a movel %a2,%sp@- 4868c: 4eb9 0004 851c jsr 4851c <_Scheduler_EDF_Enqueue> 48692: 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( 48696: 2079 0005 f2aa moveal 5f2aa <_Per_CPU_Information+0x12>,%a0 4869c: 2f28 0014 movel %a0@(20),%sp@- 486a0: 2079 0005 d910 moveal 5d910 <_Scheduler+0x30>,%a0 486a6: 4e90 jsr %a0@ 486a8: 4fef 000c lea %sp@(12),%sp 486ac: 4a80 tstl %d0 486ae: 6c20 bges 486d0 <_Scheduler_EDF_Unblock+0x50> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 486b0: 2079 0005 f2a6 moveal 5f2a6 <_Per_CPU_Information+0xe>,%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; 486b6: 23ca 0005 f2aa movel %a2,5f2aa <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 486bc: 4a28 0070 tstb %a0@(112) 486c0: 6606 bnes 486c8 <_Scheduler_EDF_Unblock+0x48> 486c2: 4aaa 0014 tstl %a2@(20) 486c6: 6608 bnes 486d0 <_Scheduler_EDF_Unblock+0x50> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 486c8: 7001 moveq #1,%d0 486ca: 13c0 0005 f2a4 moveb %d0,5f2a4 <_Per_CPU_Information+0xc> } } 486d0: 246e fffc moveal %fp@(-4),%a2 486d4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d30 <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 47d30: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 47d34: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 47d36: 2279 0005 c414 moveal 5c414 <_Scheduler+0x4>,%a1 47d3c: 4ed1 jmp %a1@ ... =============================================================================== 00047f08 <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 47f08: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 47f0c: 206e 0008 moveal %fp@(8),%a0 47f10: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 47f16: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 47f18: 4ef9 0004 9418 jmp 49418 <_Workspace_Free> ... =============================================================================== 000482ac <_TOD_Set_with_timestamp>: #include void _TOD_Set_with_timestamp( const Timestamp_Control *tod ) { 482ac: 4e56 ffec linkw %fp,#-20 482b0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 482b4: 246e 0008 moveal %fp@(8),%a2 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 482b8: 47f9 0005 a434 lea 5a434 <__divdi3>,%a3 _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 482be: 2412 movel %a2@,%d2 482c0: 262a 0004 movel %a2@(4),%d3 static inline uint32_t _Timestamp64_implementation_Get_nanoseconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time % 1000000000L); 482c4: 2f3c 3b9a ca00 movel #1000000000,%sp@- 482ca: 42a7 clrl %sp@- 482cc: 2f03 movel %d3,%sp@- 482ce: 2f02 movel %d2,%sp@- 482d0: 4eb9 0005 a894 jsr 5a894 <__moddi3> 482d6: 4fef 0010 lea %sp@(16),%sp 482da: 2801 movel %d1,%d4 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 482dc: 2f3c 3b9a ca00 movel #1000000000,%sp@- 482e2: 42a7 clrl %sp@- 482e4: 2f03 movel %d3,%sp@- 482e6: 2f02 movel %d2,%sp@- 482e8: 4e93 jsr %a3@ * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 482ea: 2039 0006 0036 movel 60036 <_Thread_Dispatch_disable_level>,%d0 ++level; 482f0: 5280 addql #1,%d0 482f2: 4fef 0010 lea %sp@(16),%sp 482f6: 2401 movel %d1,%d2 _Thread_Dispatch_disable_level = level; 482f8: 23c0 0006 0036 movel %d0,60036 <_Thread_Dispatch_disable_level> 482fe: 2f3c 3b9a ca00 movel #1000000000,%sp@- 48304: 42a7 clrl %sp@- 48306: 2f39 0005 ffdc movel 5ffdc <_TOD+0x4>,%sp@- 4830c: 2f39 0005 ffd8 movel 5ffd8 <_TOD>,%sp@- 48312: 4e93 jsr %a3@ 48314: 4fef 0010 lea %sp@(16),%sp _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds_now = _TOD_Seconds_since_epoch(); if ( seconds_next < seconds_now ) 48318: b282 cmpl %d2,%d1 4831a: 630a blss 48326 <_TOD_Set_with_timestamp+0x7a> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 4831c: 9282 subl %d2,%d1 4831e: 2f01 movel %d1,%sp@- 48320: 4878 0001 pea 1 48324: 6006 bras 4832c <_TOD_Set_with_timestamp+0x80> 48326: 9481 subl %d1,%d2 48328: 2f02 movel %d2,%sp@- 4832a: 42a7 clrl %sp@- 4832c: 4879 0006 00c6 pea 600c6 <_Watchdog_Seconds_chain> 48332: 4eb9 0004 a4bc jsr 4a4bc <_Watchdog_Adjust> 48338: 4fef 000c lea %sp@(12),%sp _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; 4833c: 2012 movel %a2@,%d0 4833e: 222a 0004 movel %a2@(4),%d1 _TOD.seconds_trigger = nanoseconds; 48342: 23c4 0005 ffe8 movel %d4,5ffe8 <_TOD+0x10> if ( seconds_next < seconds_now ) _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; 48348: 23c0 0005 ffd8 movel %d0,5ffd8 <_TOD> 4834e: 23c1 0005 ffdc movel %d1,5ffdc <_TOD+0x4> _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 48354: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 4835a: 7201 moveq #1,%d1 _TOD_Activate(); _Thread_Enable_dispatch(); } 4835c: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 4835e: 13c1 0005 ffec moveb %d1,5ffec <_TOD+0x14> _TOD_Activate(); _Thread_Enable_dispatch(); 48364: 4ef9 0004 994c jmp 4994c <_Thread_Enable_dispatch> ... =============================================================================== 00046c20 <_TOD_Validate>: ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c20: 43f9 0005 c2ae lea 5c2ae ,%a1 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46c26: 4e56 0000 linkw %fp,#0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c2a: 203c 000f 4240 movel #1000000,%d0 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46c30: 2f03 movel %d3,%sp@- 46c32: 206e 0008 moveal %fp@(8),%a0 46c36: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46c38: 4c51 0000 remul %a1@,%d0,%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c3c: 4a88 tstl %a0 46c3e: 6758 beqs 46c98 <_TOD_Validate+0x78> <== NEVER TAKEN 46c40: b0a8 0018 cmpl %a0@(24),%d0 46c44: 6352 blss 46c98 <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 46c46: 703b moveq #59,%d0 46c48: b0a8 0014 cmpl %a0@(20),%d0 46c4c: 654a bcss 46c98 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46c4e: b0a8 0010 cmpl %a0@(16),%d0 46c52: 6544 bcss 46c98 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 46c54: 7217 moveq #23,%d1 46c56: b2a8 000c cmpl %a0@(12),%d1 46c5a: 653c bcss 46c98 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 46c5c: 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) || 46c60: 6736 beqs 46c98 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 46c62: 760c moveq #12,%d3 46c64: b680 cmpl %d0,%d3 46c66: 6530 bcss 46c98 <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 46c68: 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) || 46c6a: 0c82 0000 07c3 cmpil #1987,%d2 46c70: 6326 blss 46c98 <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 46c72: 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) || 46c76: 6720 beqs 46c98 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 46c78: 163c 0003 moveb #3,%d3 46c7c: 41f9 0005 d638 lea 5d638 <_TOD_Days_per_month>,%a0 46c82: c483 andl %d3,%d2 46c84: 6606 bnes 46c8c <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 46c86: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 46c8a: 6004 bras 46c90 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 46c8c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( the_tod->day > days_in_month ) 46c90: b081 cmpl %d1,%d0 46c92: 54c0 scc %d0 46c94: 4480 negl %d0 46c96: 6002 bras 46c9a <_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; 46c98: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c9a: 241f movel %sp@+,%d2 46c9c: 261f movel %sp@+,%d3 46c9e: 4e5e unlk %fp ... =============================================================================== 00048228 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 48228: 4e56 fff0 linkw %fp,#-16 4822c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48230: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 48234: 282a 0010 movel %a2@(16),%d4 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 48238: 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 ); 4823c: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4823e: 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 ); 48242: 4eb9 0004 8e18 jsr 48e18 <_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 ) 48248: 588f addql #4,%sp 4824a: b4aa 0014 cmpl %a2@(20),%d2 4824e: 670c beqs 4825c <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 48250: 2f02 movel %d2,%sp@- 48252: 2f0a movel %a2,%sp@- 48254: 4eb9 0004 8dbc jsr 48dbc <_Thread_Set_priority> 4825a: 508f addql #8,%sp _ISR_Disable( level ); 4825c: 203c 0000 0700 movel #1792,%d0 48262: 40c2 movew %sr,%d2 48264: 8082 orl %d2,%d0 48266: 46c0 movew %d0,%sr 48268: 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; 4826a: 202a 0010 movel %a2@(16),%d0 4826e: c284 andl %d4,%d1 if ( state != STATES_TRANSIENT ) { 48270: 7804 moveq #4,%d4 48272: b880 cmpl %d0,%d4 48274: 672e beqs 482a4 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 48276: 4a81 tstl %d1 48278: 6608 bnes 48282 <_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); 4827a: 72fb moveq #-5,%d1 4827c: c280 andl %d0,%d1 4827e: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 48282: 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); 48284: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4828a: 676c beqs 482f8 <_Thread_Change_priority+0xd0> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4828c: 2d4a 000c movel %a2,%fp@(12) 48290: 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 ); } 48296: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4829c: 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 ); 4829e: 4ef9 0004 8d20 jmp 48d20 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 482a4: 4a81 tstl %d1 482a6: 661e bnes 482c6 <_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 ); 482a8: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 482ac: 4a03 tstb %d3 482ae: 670a beqs 482ba <_Thread_Change_priority+0x92> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 482b0: 2f0a movel %a2,%sp@- 482b2: 2079 0005 c438 moveal 5c438 <_Scheduler+0x28>,%a0 482b8: 6008 bras 482c2 <_Thread_Change_priority+0x9a> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 482ba: 2079 0005 c434 moveal 5c434 <_Scheduler+0x24>,%a0 482c0: 2f0a movel %a2,%sp@- 482c2: 4e90 jsr %a0@ 482c4: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 482c6: 203c 0000 0700 movel #1792,%d0 482cc: 46c2 movew %d2,%sr 482ce: 8082 orl %d2,%d0 482d0: 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(); 482d2: 2079 0005 c418 moveal 5c418 <_Scheduler+0x8>,%a0 482d8: 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 ); 482da: 2079 0005 dd6e moveal 5dd6e <_Per_CPU_Information+0xe>,%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() && 482e0: b1f9 0005 dd72 cmpal 5dd72 <_Per_CPU_Information+0x12>,%a0 482e6: 670e beqs 482f6 <_Thread_Change_priority+0xce> 482e8: 4a28 0070 tstb %a0@(112) 482ec: 6708 beqs 482f6 <_Thread_Change_priority+0xce> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 482ee: 7801 moveq #1,%d4 482f0: 13c4 0005 dd6c moveb %d4,5dd6c <_Per_CPU_Information+0xc> _ISR_Enable( level ); 482f6: 46c2 movew %d2,%sr } 482f8: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 482fe: 4e5e unlk %fp ... =============================================================================== 000484d0 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 484d0: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 484d4: 486e fffc pea %fp@(-4) 484d8: 2f2e 0008 movel %fp@(8),%sp@- 484dc: 4eb9 0004 8698 jsr 48698 <_Thread_Get> switch ( location ) { 484e2: 508f addql #8,%sp 484e4: 4aae fffc tstl %fp@(-4) 484e8: 661e bnes 48508 <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 484ea: 2f3c 1000 0018 movel #268435480,%sp@- 484f0: 2f00 movel %d0,%sp@- 484f2: 4eb9 0004 8304 jsr 48304 <_Thread_Clear_state> 484f8: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 484fa: 2039 0005 dbf6 movel 5dbf6 <_Thread_Dispatch_disable_level>,%d0 --level; 48500: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 48502: 23c0 0005 dbf6 movel %d0,5dbf6 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 48508: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004850c <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4850c: 4e56 ffd0 linkw %fp,#-48 48510: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 48514: 283c 0000 0700 movel #1792,%d4 4851a: 2204 movel %d4,%d1 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 4851c: 2479 0005 dd6e moveal 5dd6e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 48522: 40c0 movew %sr,%d0 48524: 8280 orl %d0,%d1 48526: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 48528: 240e movel %fp,%d2 4852a: 5182 subql #8,%d2 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4852c: 2a3c 0004 70cc movel #291020,%d5 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 48532: 49f9 0004 9468 lea 49468 <_CPU_Context_switch>,%a4 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); 48538: 4bf9 0004 95d0 lea 495d0 <_CPU_Context_restore_fp>,%a5 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4853e: 263c 0004 95ae movel #300462,%d3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 48544: 6000 0104 braw 4864a <_Thread_Dispatch+0x13e> * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 48548: 7201 moveq #1,%d1 heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4854a: 4206 clrb %d6 * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; 4854c: 2679 0005 dd72 moveal 5dd72 <_Per_CPU_Information+0x12>,%a3 48552: 23c1 0005 dbf6 movel %d1,5dbf6 <_Thread_Dispatch_disable_level> #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 48558: 13c6 0005 dd6c moveb %d6,5dd6c <_Per_CPU_Information+0xc> _Thread_Executing = heir; 4855e: 23cb 0005 dd6e movel %a3,5dd6e <_Per_CPU_Information+0xe> /* * 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 ) 48564: b5cb cmpal %a3,%a2 48566: 6612 bnes 4857a <_Thread_Dispatch+0x6e> 48568: 42b9 0005 dbf6 clrl 5dbf6 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 4856e: 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; 48570: 2679 0005 dc6a moveal 5dc6a <_API_extensions_Post_switch_list>,%a3 48576: 6000 00ec braw 48664 <_Thread_Dispatch+0x158> */ #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 ) 4857a: 7201 moveq #1,%d1 4857c: b2ab 0076 cmpl %a3@(118),%d1 48580: 660a bnes 4858c <_Thread_Dispatch+0x80> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 48582: 41f9 0005 dbae lea 5dbae <_Thread_Ticks_per_timeslice>,%a0 48588: 2750 0072 movel %a0@,%a3@(114) _ISR_Enable( level ); 4858c: 46c0 movew %d0,%sr 4858e: 4879 0005 dba0 pea 5dba0 <_TOD+0x8> 48594: 2245 moveal %d5,%a1 48596: 2f02 movel %d2,%sp@- 48598: 4e91 jsr %a1@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4859a: 508f addql #8,%sp #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 4859c: 206e fff8 moveal %fp@(-8),%a0 485a0: 226e fffc moveal %fp@(-4),%a1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 485a4: 2008 movel %a0,%d0 485a6: 2209 movel %a1,%d1 485a8: 2c39 0005 dd7a movel 5dd7a <_Per_CPU_Information+0x1a>,%d6 485ae: 92b9 0005 dd7e subl 5dd7e <_Per_CPU_Information+0x1e>,%d1 485b4: 9186 subxl %d6,%d0 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 485b6: d3aa 0082 addl %d1,%a2@(130) 485ba: 2c2a 007e movel %a2@(126),%d6 485be: dd80 addxl %d0,%d6 485c0: 2546 007e movel %d6,%a2@(126) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 485c4: 23c8 0005 dd7a movel %a0,5dd7a <_Per_CPU_Information+0x1a> 485ca: 23c9 0005 dd7e movel %a1,5dd7e <_Per_CPU_Information+0x1e> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 485d0: 2079 0005 dc66 moveal 5dc66 <_Thread_libc_reent>,%a0 485d6: 4a88 tstl %a0 485d8: 6708 beqs 485e2 <_Thread_Dispatch+0xd6> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 485da: 2550 00f4 movel %a0@,%a2@(244) *_Thread_libc_reent = heir->libc_reent; 485de: 20ab 00f4 movel %a3@(244),%a0@ 485e2: 2c39 0005 c538 movel 5c538 <_User_extensions_Switches_list>,%d6 485e8: 6012 bras 485fc <_Thread_Dispatch+0xf0> while ( node != tail ) { const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 485ea: 2f0b movel %a3,%sp@- 485ec: 2246 moveal %d6,%a1 485ee: 2f0a movel %a2,%sp@- 485f0: 2069 0008 moveal %a1@(8),%a0 485f4: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 485f6: 508f addql #8,%sp 485f8: 2046 moveal %d6,%a0 485fa: 2c10 movel %a0@,%d6 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 485fc: 0c86 0005 c53c cmpil #378172,%d6 48602: 66e6 bnes 485ea <_Thread_Dispatch+0xde> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 48604: 486b 00bc pea %a3@(188) 48608: 486a 00bc pea %a2@(188) 4860c: 4e94 jsr %a4@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4860e: 508f addql #8,%sp 48610: 4aaa 00f0 tstl %a2@(240) 48614: 6726 beqs 4863c <_Thread_Dispatch+0x130> #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 ); 48616: 2079 0005 dc62 moveal 5dc62 <_Thread_Allocated_fp>,%a0 4861c: b1ca cmpal %a2,%a0 4861e: 671c beqs 4863c <_Thread_Dispatch+0x130> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 48620: 4a88 tstl %a0 48622: 670a beqs 4862e <_Thread_Dispatch+0x122> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 48624: 4868 00f0 pea %a0@(240) 48628: 2243 moveal %d3,%a1 4862a: 4e91 jsr %a1@ 4862c: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 4862e: 486a 00f0 pea %a2@(240) 48632: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 48634: 588f addql #4,%sp 48636: 23ca 0005 dc62 movel %a2,5dc62 <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4863c: 2479 0005 dd6e moveal 5dd6e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 48642: 2204 movel %d4,%d1 48644: 40c0 movew %sr,%d0 48646: 8280 orl %d0,%d1 48648: 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 ) { 4864a: 1239 0005 dd6c moveb 5dd6c <_Per_CPU_Information+0xc>,%d1 48650: 6600 fef6 bnew 48548 <_Thread_Dispatch+0x3c> 48654: 6000 ff12 braw 48568 <_Thread_Dispatch+0x5c> while ( node != tail ) { const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 48658: 2f0a movel %a2,%sp@- 4865a: 206b 0008 moveal %a3@(8),%a0 4865e: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 48660: 2653 moveal %a3@,%a3 48662: 588f addql #4,%sp { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 48664: b7fc 0005 dc6e cmpal #384110,%a3 4866a: 66ec bnes 48658 <_Thread_Dispatch+0x14c> 4866c: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 48672: 4e5e unlk %fp ... =============================================================================== 0004c1a4 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4c1a4: 4e56 0000 linkw %fp,#0 4c1a8: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4c1aa: 2479 0005 dd6e moveal 5dd6e <_Per_CPU_Information+0xe>,%a2 #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4c1b0: 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; 4c1b2: 222a 00a4 movel %a2@(164),%d1 _ISR_Set_level(level); 4c1b6: 40c0 movew %sr,%d0 4c1b8: e189 lsll #8,%d1 4c1ba: 0280 0000 f8ff andil #63743,%d0 4c1c0: 8081 orl %d1,%d0 4c1c2: 46c0 movew %d0,%sr && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; doneConstructors = true; 4c1c4: 7001 moveq #1,%d0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4c1c6: 1439 0005 d3f8 moveb 5d3f8 ,%d2 doneConstructors = true; 4c1cc: 13c0 0005 d3f8 moveb %d0,5d3f8 #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4c1d2: 4aaa 00f0 tstl %a2@(240) 4c1d6: 6720 beqs 4c1f8 <_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 ); 4c1d8: 2079 0005 dc62 moveal 5dc62 <_Thread_Allocated_fp>,%a0 4c1de: b1ca cmpal %a2,%a0 4c1e0: 6716 beqs 4c1f8 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4c1e2: 4a88 tstl %a0 4c1e4: 670c beqs 4c1f2 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4c1e6: 4868 00f0 pea %a0@(240) 4c1ea: 4eb9 0004 95ae jsr 495ae <_CPU_Context_save_fp> 4c1f0: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4c1f2: 23ca 0005 dc62 movel %a2,5dc62 <_Thread_Allocated_fp> ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4c1f8: 4879 0004 8fda pea 48fda <_User_extensions_Thread_begin_visitor> 4c1fe: 2f0a movel %a2,%sp@- 4c200: 4eb9 0004 903a jsr 4903a <_User_extensions_Iterate> _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4c206: 4eb9 0004 8678 jsr 48678 <_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) */ { 4c20c: 508f addql #8,%sp 4c20e: 4a02 tstb %d2 4c210: 6606 bnes 4c218 <_Thread_Handler+0x74> INIT_NAME (); 4c212: 4eb9 0005 a598 jsr 5a598 <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4c218: 4aaa 008e tstl %a2@(142) 4c21c: 6610 bnes 4c22e <_Thread_Handler+0x8a> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4c21e: 2f2a 0096 movel %a2@(150),%sp@- 4c222: 206a 008a moveal %a2@(138),%a0 4c226: 4e90 jsr %a0@ #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4c228: 588f addql #4,%sp 4c22a: 2540 0028 movel %d0,%a2@(40) } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4c22e: 4879 0004 8ff2 pea 48ff2 <_User_extensions_Thread_exitted_visitor> 4c234: 2f0a movel %a2,%sp@- 4c236: 4eb9 0004 903a jsr 4903a <_User_extensions_Iterate> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4c23c: 4878 0005 pea 5 4c240: 4878 0001 pea 1 4c244: 42a7 clrl %sp@- 4c246: 4eb9 0004 74f8 jsr 474f8 <_Internal_error_Occurred> =============================================================================== 000488c8 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 488c8: 4e56 0000 linkw %fp,#0 uint32_t ticks_per_timeslice = rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 488cc: 2079 0005 a7e8 moveal 5a7e8 ,%a0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 488d2: 4ab9 0005 a7ec tstl 5a7ec 488d8: 6708 beqs 488e2 <_Thread_Handler_initialization+0x1a><== NEVER TAKEN 488da: 4ab9 0005 a7f0 tstl 5a7f0 488e0: 6610 bnes 488f2 <_Thread_Handler_initialization+0x2a> rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 488e2: 4878 000e pea e 488e6: 4878 0001 pea 1 488ea: 42a7 clrl %sp@- 488ec: 4eb9 0004 74f8 jsr 474f8 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 488f2: 4a88 tstl %a0 488f4: 670a beqs 48900 <_Thread_Handler_initialization+0x38> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 488f6: 2f39 0005 a7c8 movel 5a7c8 ,%sp@- 488fc: 4e90 jsr %a0@ 488fe: 588f addql #4,%sp #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 48900: 4878 0008 pea 8 _Thread_Heir = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 48904: 41f9 0005 a7cc lea 5a7cc ,%a0 4890a: 23d0 0005 dc76 movel %a0@,5dc76 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 48910: 41f9 0005 a7d8 lea 5a7d8 ,%a0 48916: 23d0 0005 dbae movel %a0@,5dbae <_Thread_Ticks_per_timeslice> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 4891c: 4200 clrb %d0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4891e: 42a7 clrl %sp@- 48920: 4878 0108 pea 108 48924: 4878 0001 pea 1 48928: 4878 0001 pea 1 4892c: 4878 0001 pea 1 48930: 4879 0005 dce2 pea 5dce2 <_Thread_Internal_information> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 48936: 13c0 0005 dd6c moveb %d0,5dd6c <_Per_CPU_Information+0xc> _Thread_Executing = NULL; 4893c: 42b9 0005 dd6e clrl 5dd6e <_Per_CPU_Information+0xe> _Thread_Heir = NULL; 48942: 42b9 0005 dd72 clrl 5dd72 <_Per_CPU_Information+0x12> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 48948: 42b9 0005 dc62 clrl 5dc62 <_Thread_Allocated_fp> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4894e: 4eb9 0004 7a94 jsr 47a94 <_Objects_Initialize_information> 48954: 4fef 001c lea %sp@(28),%sp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 48958: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000493b8 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 493b8: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 493ba: 4e56 0000 linkw %fp,#0 493be: 2f0a movel %a2,%sp@- 493c0: 246e 0008 moveal %fp@(8),%a2 493c4: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 493c8: 666e bnes 49438 <_Thread_Restart+0x80> _Thread_Set_transient( the_thread ); 493ca: 2f0a movel %a2,%sp@- 493cc: 4eb9 0004 94a0 jsr 494a0 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 493d2: 2f2e 0010 movel %fp@(16),%sp@- 493d6: 2f2e 000c movel %fp@(12),%sp@- 493da: 2f0a movel %a2,%sp@- 493dc: 4eb9 0004 b824 jsr 4b824 <_Thread_Reset> _Thread_Load_environment( the_thread ); 493e2: 2f0a movel %a2,%sp@- 493e4: 4eb9 0004 b560 jsr 4b560 <_Thread_Load_environment> _Thread_Ready( the_thread ); 493ea: 2f0a movel %a2,%sp@- 493ec: 4eb9 0004 b7f4 jsr 4b7f4 <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( 493f2: 4879 0004 964a pea 4964a <_User_extensions_Thread_restart_visitor> 493f8: 2f0a movel %a2,%sp@- 493fa: 4eb9 0004 96c2 jsr 496c2 <_User_extensions_Iterate> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 49400: 4fef 0020 lea %sp@(32),%sp _Thread_Restart_self(); return true; 49404: 7001 moveq #1,%d0 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 49406: b5f9 0005 e626 cmpal 5e626 <_Per_CPU_Information+0xe>,%a2 4940c: 662c bnes 4943a <_Thread_Restart+0x82> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 4940e: 4aaa 00f0 tstl %a2@(240) 49412: 670c beqs 49420 <_Thread_Restart+0x68> _Context_Restore_fp( &_Thread_Executing->fp_context ); 49414: 486a 00f0 pea %a2@(240) 49418: 4eb9 0004 9c58 jsr 49c58 <_CPU_Context_restore_fp> 4941e: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 49420: 2079 0005 e626 moveal 5e626 <_Per_CPU_Information+0xe>,%a0 49426: 41e8 00bc lea %a0@(188),%a0 4942a: 2f08 movel %a0,%sp@- 4942c: 4eb9 0004 9b06 jsr 49b06 <_CPU_Context_Restart_self> 49432: 588f addql #4,%sp <== NOT EXECUTED _Thread_Restart_self(); return true; 49434: 7001 moveq #1,%d0 <== NOT EXECUTED 49436: 6002 bras 4943a <_Thread_Restart+0x82> <== NOT EXECUTED } return false; 49438: 4200 clrb %d0 } 4943a: 246e fffc moveal %fp@(-4),%a2 4943e: 4e5e unlk %fp ... =============================================================================== 000481d8 <_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 ) ) { 481d8: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 481da: 4e56 0000 linkw %fp,#0 481de: 202e 0010 movel %fp@(16),%d0 481e2: 2f0a movel %a2,%sp@- 481e4: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 481e8: 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 ) ) { 481ec: b2aa 0050 cmpl %a2@(80),%d1 481f0: 6618 bnes 4820a <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 481f2: 123c 0003 moveb #3,%d1 481f6: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 481fa: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 481fc: 486a 0048 pea %a2@(72) 48200: 4eb9 0004 923c jsr 4923c <_Watchdog_Remove> 48206: 588f addql #4,%sp 48208: 6002 bras 4820c <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4820a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4820c: 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 } 48210: 246e fffc moveal %fp@(-4),%a2 48214: 203c 1007 fff8 movel #268959736,%d0 4821a: 2d40 000c movel %d0,%fp@(12) 4821e: 4e5e unlk %fp 48220: 4ef9 0004 8304 jmp 48304 <_Thread_Clear_state> ... =============================================================================== 00048b2c <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 48b2c: 4e56 ffdc linkw %fp,#-36 48b30: 206e 000c moveal %fp@(12),%a0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 48b34: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 48b38: 2028 0014 movel %a0@(20),%d0 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 48b3c: 2200 movel %d0,%d1 48b3e: ec89 lsrl #6,%d1 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 48b40: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 48b44: 2401 movel %d1,%d2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48b46: 49e8 0038 lea %a0@(56),%a4 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 48b4a: 2a3c 0000 0700 movel #1792,%d5 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 48b50: e58a lsll #2,%d2 48b52: e989 lsll #4,%d1 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 48b54: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 48b58: 9282 subl %d2,%d1 48b5a: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 block_state = the_thread_queue->state; 48b5e: 282a 0038 movel %a2@(56),%d4 Chain_Node *tail = _Chain_Tail( the_chain ); 48b62: 2149 0038 movel %a1,%a0@(56) head->next = tail; head->previous = NULL; 48b66: 42a8 003c clrl %a0@(60) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48b6a: 214c 0040 movel %a4,%a0@(64) if ( _Thread_queue_Is_reverse_search( priority ) ) 48b6e: 0800 0005 btst #5,%d0 48b72: 665a bnes 48bce <_Thread_queue_Enqueue_priority+0xa2> RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 48b74: 2e0b movel %a3,%d7 48b76: 5887 addql #4,%d7 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 48b78: 2405 movel %d5,%d2 48b7a: 40c1 movew %sr,%d1 48b7c: 8481 orl %d1,%d2 48b7e: 46c2 movew %d2,%sr 48b80: 2401 movel %d1,%d2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 48b82: 2253 moveal %a3@,%a1 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 48b84: 76ff moveq #-1,%d3 _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48b86: 601e bras 48ba6 <_Thread_queue_Enqueue_priority+0x7a> search_priority = search_thread->current_priority; 48b88: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 48b8c: b680 cmpl %d0,%d3 48b8e: 641a bccs 48baa <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 48b90: 2c05 movel %d5,%d6 48b92: 46c1 movew %d1,%sr 48b94: 8c81 orl %d1,%d6 48b96: 46c6 movew %d6,%sr RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 48b98: 2c04 movel %d4,%d6 48b9a: cca9 0010 andl %a1@(16),%d6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 48b9e: 6604 bnes 48ba4 <_Thread_queue_Enqueue_priority+0x78><== ALWAYS TAKEN _ISR_Enable( level ); 48ba0: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 48ba2: 60d4 bras 48b78 <_Thread_queue_Enqueue_priority+0x4c><== NOT EXECUTED } search_thread = 48ba4: 2251 moveal %a1@,%a1 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48ba6: be89 cmpl %a1,%d7 48ba8: 66de bnes 48b88 <_Thread_queue_Enqueue_priority+0x5c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48baa: 7801 moveq #1,%d4 48bac: b8aa 0030 cmpl %a2@(48),%d4 48bb0: 6600 009e bnew 48c50 <_Thread_queue_Enqueue_priority+0x124> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 48bb4: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 48bb8: b680 cmpl %d0,%d3 48bba: 6778 beqs 48c34 <_Thread_queue_Enqueue_priority+0x108> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 48bbc: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 48bc0: 2089 movel %a1,%a0@ the_node->previous = previous_node; 48bc2: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; 48bc6: 2688 movel %a0,%a3@ search_node->previous = the_node; 48bc8: 2348 0004 movel %a0,%a1@(4) 48bcc: 605c bras 48c2a <_Thread_queue_Enqueue_priority+0xfe> the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 48bce: 4283 clrl %d3 48bd0: 1639 0005 c38c moveb 5c38c ,%d3 _ISR_Disable( level ); 48bd6: 2405 movel %d5,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 48bd8: 5283 addql #1,%d3 _ISR_Disable( level ); 48bda: 40c1 movew %sr,%d1 48bdc: 8481 orl %d1,%d2 48bde: 46c2 movew %d2,%sr 48be0: 2401 movel %d1,%d2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 48be2: 226b 0008 moveal %a3@(8),%a1 search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 48be6: 6020 bras 48c08 <_Thread_queue_Enqueue_priority+0xdc> search_priority = search_thread->current_priority; 48be8: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 48bec: b680 cmpl %d0,%d3 48bee: 631c blss 48c0c <_Thread_queue_Enqueue_priority+0xe0> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 48bf0: 2c05 movel %d5,%d6 48bf2: 46c1 movew %d1,%sr 48bf4: 8c81 orl %d1,%d6 48bf6: 46c6 movew %d6,%sr 48bf8: 2c04 movel %d4,%d6 48bfa: cca9 0010 andl %a1@(16),%d6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 48bfe: 6604 bnes 48c04 <_Thread_queue_Enqueue_priority+0xd8> _ISR_Enable( level ); 48c00: 46c1 movew %d1,%sr goto restart_reverse_search; 48c02: 60ca bras 48bce <_Thread_queue_Enqueue_priority+0xa2> } search_thread = (Thread_Control *) 48c04: 2269 0004 moveal %a1@(4),%a1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 48c08: b7c9 cmpal %a1,%a3 48c0a: 66dc bnes 48be8 <_Thread_queue_Enqueue_priority+0xbc> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 48c0c: 7801 moveq #1,%d4 48c0e: b8aa 0030 cmpl %a2@(48),%d4 48c12: 663c bnes 48c50 <_Thread_queue_Enqueue_priority+0x124> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 48c14: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 48c18: b680 cmpl %d0,%d3 48c1a: 6718 beqs 48c34 <_Thread_queue_Enqueue_priority+0x108> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 48c1c: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 48c1e: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 48c22: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; 48c24: 2748 0004 movel %a0,%a3@(4) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 48c28: 2288 movel %a0,%a1@ next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 48c2a: 214a 0044 movel %a2,%a0@(68) _ISR_Enable( level ); 48c2e: 46c1 movew %d1,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 48c30: 7001 moveq #1,%d0 48c32: 6026 bras 48c5a <_Thread_queue_Enqueue_priority+0x12e> equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 48c34: 2669 0040 moveal %a1@(64),%a3 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 48c38: 49e9 003c lea %a1@(60),%a4 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 48c3c: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 48c40: 208c movel %a4,%a0@ the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; 48c42: 2348 0040 movel %a0,%a1@(64) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 48c46: 2688 movel %a0,%a3@ search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 48c48: 214a 0044 movel %a2,%a0@(68) _ISR_Enable( level ); 48c4c: 46c2 movew %d2,%sr 48c4e: 60e0 bras 48c30 <_Thread_queue_Enqueue_priority+0x104> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 48c50: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 48c54: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 48c58: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 48c5a: 4cd7 1cfc moveml %sp@,%d2-%d7/%a2-%a4 48c5e: 4e5e unlk %fp ... =============================================================================== 0004b128 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4b128: 4e56 0000 linkw %fp,#0 4b12c: 226e 0008 moveal %fp@(8),%a1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4b130: 2069 0044 moveal %a1@(68),%a0 * 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. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4b134: 2028 0030 movel %a0@(48),%d0 4b138: 671c beqs 4b156 <_Thread_queue_Process_timeout+0x2e> 4b13a: b3f9 0005 dd6e cmpal 5dd6e <_Per_CPU_Information+0xe>,%a1 4b140: 6614 bnes 4b156 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4b142: 7203 moveq #3,%d1 4b144: b280 cmpl %d0,%d1 4b146: 6720 beqs 4b168 <_Thread_queue_Process_timeout+0x40> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b148: 7002 moveq #2,%d0 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b14a: 2368 003c 0034 movel %a0@(60),%a1@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b150: 2140 0030 movel %d0,%a0@(48) 4b154: 6012 bras 4b168 <_Thread_queue_Process_timeout+0x40> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b156: 2368 003c 0034 movel %a0@(60),%a1@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4b15c: 2f09 movel %a1,%sp@- 4b15e: 2f08 movel %a0,%sp@- 4b160: 4eb9 0004 b024 jsr 4b024 <_Thread_queue_Extract> 4b166: 508f addql #8,%sp } } 4b168: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048d20 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 48d20: 4e56 fff0 linkw %fp,#-16 48d24: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48d28: 246e 0008 moveal %fp@(8),%a2 48d2c: 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 ) 48d30: 4a8a tstl %a2 48d32: 6746 beqs 48d7a <_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 ) { 48d34: 7001 moveq #1,%d0 48d36: b0aa 0034 cmpl %a2@(52),%d0 48d3a: 663e bnes 48d7a <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 48d3c: 303c 0700 movew #1792,%d0 48d40: 40c2 movew %sr,%d2 48d42: 8082 orl %d2,%d0 48d44: 46c0 movew %d0,%sr 48d46: 202b 0010 movel %a3@(16),%d0 48d4a: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48d50: 6726 beqs 48d78 <_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; 48d52: 7001 moveq #1,%d0 48d54: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 48d58: 4878 0001 pea 1 48d5c: 2f0b movel %a3,%sp@- 48d5e: 2f0a movel %a2,%sp@- 48d60: 4eb9 0004 b060 jsr 4b060 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 48d66: 486e fffc pea %fp@(-4) 48d6a: 2f0b movel %a3,%sp@- 48d6c: 2f0a movel %a2,%sp@- 48d6e: 4eb9 0004 8b2c jsr 48b2c <_Thread_queue_Enqueue_priority> 48d74: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 48d78: 46c2 movew %d2,%sr } } 48d7a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48d80: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048d84 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 48d84: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48d88: 486e fffc pea %fp@(-4) 48d8c: 2f2e 0008 movel %fp@(8),%sp@- 48d90: 4eb9 0004 8698 jsr 48698 <_Thread_Get> switch ( location ) { 48d96: 508f addql #8,%sp 48d98: 4aae fffc tstl %fp@(-4) 48d9c: 6618 bnes 48db6 <_Thread_queue_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 48d9e: 2f00 movel %d0,%sp@- 48da0: 4eb9 0004 b128 jsr 4b128 <_Thread_queue_Process_timeout> RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; --level; _Thread_Dispatch_disable_level = level; 48da6: 588f addql #4,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 48da8: 2039 0005 dbf6 movel 5dbf6 <_Thread_Dispatch_disable_level>,%d0 --level; 48dae: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 48db0: 23c0 0005 dbf6 movel %d0,5dbf6 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48db6: 4e5e unlk %fp ... =============================================================================== 000526b8 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 526b8: 4e56 ffc0 linkw %fp,#-64 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526bc: 200e movel %fp,%d0 526be: 220e movel %fp,%d1 526c0: 41ee ffec lea %fp@(-20),%a0 526c4: 5181 subql #8,%d1 526c6: 0680 ffff ffe8 addil #-24,%d0 526cc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 526d0: 246e 0008 moveal %fp@(8),%a2 526d4: 240e movel %fp,%d2 526d6: 0682 ffff fff4 addil #-12,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 526dc: 280a movel %a2,%d4 /* * 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 ); 526de: 260a movel %a2,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 526e0: 0684 0000 0030 addil #48,%d4 /* * 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 ); 526e6: 0683 0000 0068 addil #104,%d3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 526ec: 2c08 movel %a0,%d6 526ee: 2a01 movel %d1,%d5 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526f0: 2d48 ffe8 movel %a0,%fp@(-24) head->previous = NULL; 526f4: 42ae ffec clrl %fp@(-20) tail->previous = head; 526f8: 2d40 fff0 movel %d0,%fp@(-16) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 526fc: 2d41 fff4 movel %d1,%fp@(-12) head->previous = NULL; 52700: 42ae fff8 clrl %fp@(-8) tail->previous = head; 52704: 2d42 fffc movel %d2,%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; 52708: 41ee ffe8 lea %fp@(-24),%a0 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5270c: 47f9 0005 6320 lea 56320 <_Watchdog_Adjust_to_chain>,%a3 52712: 4bf9 0006 618c lea 6618c <__divdi3>,%a5 { /* * 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; 52718: 2548 0078 movel %a0,%a2@(120) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 5271c: 2039 0007 6126 movel 76126 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 52722: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 52726: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5272a: 9081 subl %d1,%d0 5272c: 2f02 movel %d2,%sp@- 5272e: 2f00 movel %d0,%sp@- 52730: 2f04 movel %d4,%sp@- 52732: 4e93 jsr %a3@ 52734: 2f3c 3b9a ca00 movel #1000000000,%sp@- 5273a: 42a7 clrl %sp@- 5273c: 2f39 0007 5fe8 movel 75fe8 <_TOD+0x4>,%sp@- 52742: 2f39 0007 5fe4 movel 75fe4 <_TOD>,%sp@- 52748: 4e95 jsr %a5@ Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 5274a: 202a 0074 movel %a2@(116),%d0 5274e: 2e01 movel %d1,%d7 /* * 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 ) { 52750: 4fef 001c lea %sp@(28),%sp 52754: b081 cmpl %d1,%d0 52756: 640c bccs 52764 <_Timer_server_Body+0xac> /* * 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 ); 52758: 2f02 movel %d2,%sp@- 5275a: 9280 subl %d0,%d1 5275c: 2f01 movel %d1,%sp@- 5275e: 2f03 movel %d3,%sp@- 52760: 4e93 jsr %a3@ 52762: 6014 bras 52778 <_Timer_server_Body+0xc0> } else if ( snapshot < last_snapshot ) { 52764: b081 cmpl %d1,%d0 52766: 6314 blss 5277c <_Timer_server_Body+0xc4> /* * 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 ); 52768: 9081 subl %d1,%d0 5276a: 2f00 movel %d0,%sp@- 5276c: 4878 0001 pea 1 52770: 2f03 movel %d3,%sp@- 52772: 4eb9 0005 62a0 jsr 562a0 <_Watchdog_Adjust> 52778: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 5277c: 2547 0074 movel %d7,%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 ); 52780: 49f9 0005 63a4 lea 563a4 <_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 ); 52786: 2e3c 0005 31c8 movel #340424,%d7 5278c: 202a 0078 movel %a2@(120),%d0 52790: 2047 moveal %d7,%a0 52792: 2f00 movel %d0,%sp@- 52794: 4e90 jsr %a0@ if ( timer == NULL ) { 52796: 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 ); 52798: 2040 moveal %d0,%a0 if ( timer == NULL ) { 5279a: 4a80 tstl %d0 5279c: 6724 beqs 527c2 <_Timer_server_Body+0x10a> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 5279e: 2028 0038 movel %a0@(56),%d0 <== NOT EXECUTED 527a2: 7201 moveq #1,%d1 <== NOT EXECUTED 527a4: b280 cmpl %d0,%d1 <== NOT EXECUTED 527a6: 6608 bnes 527b0 <_Timer_server_Body+0xf8> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 527a8: 4868 0010 pea %a0@(16) <== NOT EXECUTED 527ac: 2f04 movel %d4,%sp@- <== NOT EXECUTED 527ae: 600c bras 527bc <_Timer_server_Body+0x104> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 527b0: 7203 moveq #3,%d1 <== NOT EXECUTED 527b2: b280 cmpl %d0,%d1 <== NOT EXECUTED 527b4: 66d6 bnes 5278c <_Timer_server_Body+0xd4> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 527b6: 4868 0010 pea %a0@(16) <== NOT EXECUTED 527ba: 2f03 movel %d3,%sp@- <== NOT EXECUTED 527bc: 4e94 jsr %a4@ <== NOT EXECUTED 527be: 508f addql #8,%sp <== NOT EXECUTED 527c0: 60ca bras 5278c <_Timer_server_Body+0xd4> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 527c2: 203c 0000 0700 movel #1792,%d0 527c8: 40c1 movew %sr,%d1 527ca: 8081 orl %d1,%d0 527cc: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 527ce: bcae ffe8 cmpl %fp@(-24),%d6 527d2: 6614 bnes 527e8 <_Timer_server_Body+0x130> <== NEVER TAKEN ts->insert_chain = NULL; 527d4: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 527d8: 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 ); 527da: 2e3c 0000 0700 movel #1792,%d7 _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 ) ) { 527e0: baae fff4 cmpl %fp@(-12),%d5 527e4: 6608 bnes 527ee <_Timer_server_Body+0x136> 527e6: 603e bras 52826 <_Timer_server_Body+0x16e> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 527e8: 46c1 movew %d1,%sr <== NOT EXECUTED 527ea: 6000 ff30 braw 5271c <_Timer_server_Body+0x64> <== 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 ); 527ee: 2007 movel %d7,%d0 527f0: 40c1 movew %sr,%d1 527f2: 8081 orl %d1,%d0 527f4: 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; 527f6: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 527fa: ba88 cmpl %a0,%d5 527fc: 6722 beqs 52820 <_Timer_server_Body+0x168> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 527fe: 2250 moveal %a0@,%a1 head->next = new_first; new_first->previous = head; 52800: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 52804: 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; 52808: 2d49 fff4 movel %a1,%fp@(-12) _ISR_Enable( level ); 5280c: 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 ); 5280e: 2f28 0024 movel %a0@(36),%sp@- 52812: 2f28 0020 movel %a0@(32),%sp@- 52816: 2068 001c moveal %a0@(28),%a0 5281a: 4e90 jsr %a0@ } 5281c: 508f addql #8,%sp 5281e: 60ce bras 527ee <_Timer_server_Body+0x136> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 52820: 46c1 movew %d1,%sr 52822: 6000 fee4 braw 52708 <_Timer_server_Body+0x50> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 52826: 4200 clrb %d0 52828: 1540 007c moveb %d0,%a2@(124) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 5282c: 2039 0007 6042 movel 76042 <_Thread_Dispatch_disable_level>,%d0 ++level; 52832: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 52834: 23c0 0007 6042 movel %d0,76042 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 5283a: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5283e: 47f9 0005 64c8 lea 564c8 <_Watchdog_Remove>,%a3 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 52844: 2f12 movel %a2@,%sp@- 52846: 4eb9 0005 5f5c jsr 55f5c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 5284c: 2f0a movel %a2,%sp@- 5284e: 4eba fda4 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 52852: 2f0a movel %a2,%sp@- 52854: 4eba fdfe jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 52858: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> ts->active = true; 5285e: 7201 moveq #1,%d1 52860: 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 ); 52864: 486a 0008 pea %a2@(8) 52868: 4e93 jsr %a3@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 5286a: 486a 0040 pea %a2@(64) 5286e: 4e93 jsr %a3@ 52870: 4fef 0018 lea %sp@(24),%sp 52874: 6000 fe92 braw 52708 <_Timer_server_Body+0x50> =============================================================================== 00052878 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 52878: 4e56 fff0 linkw %fp,#-16 5287c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 52880: 246e 0008 moveal %fp@(8),%a2 52884: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 52888: 202a 0078 movel %a2@(120),%d0 5288c: 6600 0112 bnew 529a0 <_Timer_server_Schedule_operation_method+0x128> * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 52890: 2039 0007 6042 movel 76042 <_Thread_Dispatch_disable_level>,%d0 ++level; 52896: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 52898: 23c0 0007 6042 movel %d0,76042 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 5289e: 202b 0038 movel %a3@(56),%d0 528a2: 7201 moveq #1,%d1 528a4: b280 cmpl %d0,%d1 528a6: 6660 bnes 52908 <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 528a8: 203c 0000 0700 movel #1792,%d0 528ae: 40c2 movew %sr,%d2 528b0: 8082 orl %d2,%d0 528b2: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 528b4: 2039 0007 6126 movel 76126 <_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 ); 528ba: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 528be: 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; 528c2: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 528c6: b3c8 cmpal %a0,%a1 528c8: 6716 beqs 528e0 <_Timer_server_Schedule_operation_method+0x68> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 528ca: 2240 moveal %d0,%a1 528cc: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 528ce: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 528d2: b3c1 cmpal %d1,%a1 528d4: 6404 bccs 528da <_Timer_server_Schedule_operation_method+0x62> delta_interval -= delta; 528d6: 9289 subl %a1,%d1 528d8: 6002 bras 528dc <_Timer_server_Schedule_operation_method+0x64> } else { delta_interval = 0; 528da: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 528dc: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 528e0: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 528e4: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 528e6: 486b 0010 pea %a3@(16) 528ea: 486a 0030 pea %a2@(48) 528ee: 4eb9 0005 63a4 jsr 563a4 <_Watchdog_Insert> if ( !ts->active ) { 528f4: 508f addql #8,%sp 528f6: 102a 007c moveb %a2@(124),%d0 528fa: 6600 0096 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a> _Timer_server_Reset_interval_system_watchdog( ts ); 528fe: 2f0a movel %a2,%sp@- 52900: 4eba fcf2 jsr %pc@(525f4 <_Timer_server_Reset_interval_system_watchdog>) 52904: 6000 008a braw 52990 <_Timer_server_Schedule_operation_method+0x118> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 52908: 7203 moveq #3,%d1 5290a: b280 cmpl %d0,%d1 5290c: 6600 0084 bnew 52992 <_Timer_server_Schedule_operation_method+0x11a> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 52910: 203c 0000 0700 movel #1792,%d0 52916: 40c2 movew %sr,%d2 52918: 8082 orl %d2,%d0 5291a: 46c0 movew %d0,%sr 5291c: 2f3c 3b9a ca00 movel #1000000000,%sp@- 52922: 42a7 clrl %sp@- 52924: 2f39 0007 5fe8 movel 75fe8 <_TOD+0x4>,%sp@- 5292a: 2f39 0007 5fe4 movel 75fe4 <_TOD>,%sp@- 52930: 4eb9 0006 618c jsr 6618c <__divdi3> snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 52936: 226a 0074 moveal %a2@(116),%a1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 5293a: 200a movel %a2,%d0 5293c: 4fef 0010 lea %sp@(16),%sp 52940: 0680 0000 006c addil #108,%d0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 52946: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 5294a: b088 cmpl %a0,%d0 5294c: 6720 beqs 5296e <_Timer_server_Schedule_operation_method+0xf6> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 5294e: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 52952: b3c1 cmpal %d1,%a1 52954: 640c bccs 52962 <_Timer_server_Schedule_operation_method+0xea> /* * We advanced in time. */ delta = snapshot - last_snapshot; 52956: 2841 moveal %d1,%a4 52958: 99c9 subal %a1,%a4 if (delta_interval > delta) { 5295a: b9c0 cmpal %d0,%a4 5295c: 640a bccs 52968 <_Timer_server_Schedule_operation_method+0xf0><== NEVER TAKEN delta_interval -= delta; 5295e: 908c subl %a4,%d0 52960: 6008 bras 5296a <_Timer_server_Schedule_operation_method+0xf2> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 52962: d089 addl %a1,%d0 delta_interval += delta; 52964: 9081 subl %d1,%d0 52966: 6002 bras 5296a <_Timer_server_Schedule_operation_method+0xf2> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 52968: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 5296a: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 5296e: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 52972: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52974: 486b 0010 pea %a3@(16) 52978: 486a 0068 pea %a2@(104) 5297c: 4eb9 0005 63a4 jsr 563a4 <_Watchdog_Insert> if ( !ts->active ) { 52982: 508f addql #8,%sp 52984: 102a 007c moveb %a2@(124),%d0 52988: 6608 bnes 52992 <_Timer_server_Schedule_operation_method+0x11a><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 5298a: 2f0a movel %a2,%sp@- 5298c: 4eba fcc6 jsr %pc@(52654 <_Timer_server_Reset_tod_system_watchdog>) 52990: 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 ); } } 52992: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 52998: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 5299a: 4ef9 0005 5774 jmp 55774 <_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 ); 529a0: 246a 0078 moveal %a2@(120),%a2 <== NOT EXECUTED 529a4: 2d4b 000c movel %a3,%fp@(12) <== NOT EXECUTED 529a8: 2d4a 0008 movel %a2,%fp@(8) <== NOT EXECUTED } } 529ac: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 <== NOT EXECUTED 529b2: 4e5e unlk %fp <== NOT EXECUTED * 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 ); 529b4: 4ef9 0005 3190 jmp 53190 <_Chain_Append> <== NOT EXECUTED =============================================================================== 0004a228 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4a228: 4e56 ffec linkw %fp,#-20 Timestamp64_Control answer; if ( *_rhs == 0 ) { 4a22c: 206e 000c moveal %fp@(12),%a0 const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4a230: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4a234: 266e 0010 moveal %fp@(16),%a3 4a238: 246e 0014 moveal %fp@(20),%a2 Timestamp64_Control answer; if ( *_rhs == 0 ) { 4a23c: 2410 movel %a0@,%d2 4a23e: 2628 0004 movel %a0@(4),%d3 4a242: 2002 movel %d2,%d0 4a244: 8083 orl %d3,%d0 4a246: 6606 bnes 4a24e <_Timestamp64_Divide+0x26> <== ALWAYS TAKEN *_ival_percentage = 0; 4a248: 4293 clrl %a3@ <== NOT EXECUTED *_fval_percentage = 0; 4a24a: 4292 clrl %a2@ <== NOT EXECUTED return; 4a24c: 605c bras 4a2aa <_Timestamp64_Divide+0x82> <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4a24e: 206e 0008 moveal %fp@(8),%a0 4a252: 49f9 0005 a434 lea 5a434 <__divdi3>,%a4 4a258: 2f3c 0001 86a0 movel #100000,%sp@- 4a25e: 42a7 clrl %sp@- 4a260: 2f28 0004 movel %a0@(4),%sp@- 4a264: 2f10 movel %a0@,%sp@- 4a266: 4eb9 0005 a384 jsr 5a384 <__muldi3> 4a26c: 4fef 0010 lea %sp@(16),%sp 4a270: 2f03 movel %d3,%sp@- 4a272: 2f02 movel %d2,%sp@- 4a274: 2f01 movel %d1,%sp@- 4a276: 2f00 movel %d0,%sp@- 4a278: 4e94 jsr %a4@ 4a27a: 4fef 0010 lea %sp@(16),%sp 4a27e: 2400 movel %d0,%d2 *_ival_percentage = answer / 1000; 4a280: 4878 03e8 pea 3e8 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4a284: 2601 movel %d1,%d3 *_ival_percentage = answer / 1000; 4a286: 42a7 clrl %sp@- 4a288: 2f01 movel %d1,%sp@- 4a28a: 2f02 movel %d2,%sp@- 4a28c: 4e94 jsr %a4@ 4a28e: 4fef 0010 lea %sp@(16),%sp 4a292: 2681 movel %d1,%a3@ *_fval_percentage = answer % 1000; 4a294: 4878 03e8 pea 3e8 4a298: 42a7 clrl %sp@- 4a29a: 2f03 movel %d3,%sp@- 4a29c: 2f02 movel %d2,%sp@- 4a29e: 4eb9 0005 a894 jsr 5a894 <__moddi3> 4a2a4: 4fef 0010 lea %sp@(16),%sp 4a2a8: 2481 movel %d1,%a2@ } 4a2aa: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4a2b0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000490e4 <_User_extensions_Handler_initialization>: void _User_extensions_Handler_initialization(void) { 490e4: 4e56 fffc linkw %fp,#-4 uint32_t number_of_initial_extensions = 490e8: 2039 0005 a804 movel 5a804 ,%d0 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 490ee: 6724 beqs 49114 <_User_extensions_Handler_initialization+0x30><== NEVER TAKEN User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( 490f0: 2200 movel %d0,%d1 490f2: e988 lsll #4,%d0 490f4: e589 lsll #2,%d1 { uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = 490f6: 9081 subl %d1,%d0 490f8: 2f00 movel %d0,%sp@- 490fa: 4eb9 0004 9432 jsr 49432 <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 49100: 204e moveal %fp,%a0 49102: 2100 movel %d0,%a0@- _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 49104: 487a ff9e pea %pc@(490a4 <_User_extensions_Switch_visitor>) 49108: 2f08 movel %a0,%sp@- 4910a: 4eb9 0004 903a jsr 4903a <_User_extensions_Iterate> 49110: 4fef 000c lea %sp@(12),%sp } } 49114: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a4bc <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 4a4bc: 327c 0700 moveaw #1792,%a1 4a4c0: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4a4c2: 4e56 ffec linkw %fp,#-20 4a4c6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4a4ca: 246e 0008 moveal %fp@(8),%a2 4a4ce: 262e 000c movel %fp@(12),%d3 4a4d2: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4a4d6: 40c0 movew %sr,%d0 4a4d8: 8280 orl %d0,%d1 4a4da: 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; 4a4dc: 264a moveal %a2,%a3 4a4de: 205b moveal %a3@+,%a0 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4a4e0: b7c8 cmpal %a0,%a3 4a4e2: 674c beqs 4a530 <_Watchdog_Adjust+0x74> switch ( direction ) { 4a4e4: 4a83 tstl %d3 4a4e6: 673c beqs 4a524 <_Watchdog_Adjust+0x68> 4a4e8: 7201 moveq #1,%d1 4a4ea: b283 cmpl %d3,%d1 4a4ec: 6642 bnes 4a530 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4a4ee: d5a8 0010 addl %d2,%a0@(16) break; 4a4f2: 603c bras 4a530 <_Watchdog_Adjust+0x74> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a4f4: 2052 moveal %a2@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4a4f6: 2228 0010 movel %a0@(16),%d1 4a4fa: b282 cmpl %d2,%d1 4a4fc: 6308 blss 4a506 <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 4a4fe: 9282 subl %d2,%d1 4a500: 2141 0010 movel %d1,%a0@(16) break; 4a504: 602a bras 4a530 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; 4a506: 9481 subl %d1,%d2 _Watchdog_First( header )->delta_interval = 1; 4a508: 7201 moveq #1,%d1 4a50a: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 4a50e: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 4a510: 2f0a movel %a2,%sp@- 4a512: 4e94 jsr %a4@ _ISR_Disable( level ); 4a514: 2203 movel %d3,%d1 4a516: 40c0 movew %sr,%d0 4a518: 8280 orl %d0,%d1 4a51a: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 4a51c: 588f addql #4,%sp 4a51e: b7d2 cmpal %a2@,%a3 4a520: 660a bnes 4a52c <_Watchdog_Adjust+0x70> 4a522: 600c bras 4a530 <_Watchdog_Adjust+0x74> units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 4a524: 49f9 0004 a6dc lea 4a6dc <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 4a52a: 2609 movel %a1,%d3 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4a52c: 4a82 tstl %d2 4a52e: 66c4 bnes 4a4f4 <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 4a530: 46c0 movew %d0,%sr } 4a532: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4a538: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004923c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4923c: 203c 0000 0700 movel #1792,%d0 #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 49242: 4e56 0000 linkw %fp,#0 49246: 206e 0008 moveal %fp@(8),%a0 4924a: 2f0a movel %a2,%sp@- 4924c: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4924e: 40c1 movew %sr,%d1 49250: 8081 orl %d1,%d0 49252: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 49254: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 49258: 7401 moveq #1,%d2 4925a: b480 cmpl %d0,%d2 4925c: 670c beqs 4926a <_Watchdog_Remove+0x2e> 4925e: 6242 bhis 492a2 <_Watchdog_Remove+0x66> 49260: 143c 0003 moveb #3,%d2 49264: b480 cmpl %d0,%d2 49266: 653a bcss 492a2 <_Watchdog_Remove+0x66> <== NEVER TAKEN 49268: 6006 bras 49270 <_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; 4926a: 42a8 0008 clrl %a0@(8) break; 4926e: 6032 bras 492a2 <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 49270: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 49272: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 49276: 4a91 tstl %a1@ 49278: 6708 beqs 49282 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 4927a: 2428 0010 movel %a0@(16),%d2 4927e: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 49282: 2479 0005 dcd6 moveal 5dcd6 <_Watchdog_Sync_count>,%a2 49288: 4a8a tstl %a2 4928a: 670c beqs 49298 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 4928c: 45f9 0005 dd68 lea 5dd68 <_Per_CPU_Information+0x8>,%a2 49292: 23d2 0005 dc7e movel %a2@,5dc7e <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 49298: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 4929c: 234a 0004 movel %a2,%a1@(4) previous->next = next; 492a0: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 492a2: 2439 0005 dcda movel 5dcda <_Watchdog_Ticks_since_boot>,%d2 492a8: 2142 0018 movel %d2,%a0@(24) _ISR_Enable( level ); 492ac: 46c1 movew %d1,%sr return( previous_state ); } 492ae: 241f movel %sp@+,%d2 492b0: 245f moveal %sp@+,%a2 492b2: 4e5e unlk %fp ... =============================================================================== 000492b8 <_Watchdog_Tickle>: * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 492b8: 203c 0000 0700 movel #1792,%d0 #include void _Watchdog_Tickle( Chain_Control *header ) { 492be: 4e56 ffe8 linkw %fp,#-24 492c2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 492c6: 286e 0008 moveal %fp@(8),%a4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 492ca: 40c2 movew %sr,%d2 492cc: 8082 orl %d2,%d0 492ce: 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; 492d0: 264c moveal %a4,%a3 492d2: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 492d4: b7ca cmpal %a2,%a3 492d6: 674c beqs 49324 <_Watchdog_Tickle+0x6c> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 492d8: 202a 0010 movel %a2@(16),%d0 492dc: 6708 beqs 492e6 <_Watchdog_Tickle+0x2e> <== NEVER TAKEN the_watchdog->delta_interval--; 492de: 5380 subql #1,%d0 492e0: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 492e4: 663e bnes 49324 <_Watchdog_Tickle+0x6c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 492e6: 4bf9 0004 923c lea 4923c <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 492ec: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 492f2: 2f0a movel %a2,%sp@- 492f4: 4e95 jsr %a5@ _ISR_Enable( level ); 492f6: 46c2 movew %d2,%sr switch( watchdog_state ) { 492f8: 7202 moveq #2,%d1 492fa: 588f addql #4,%sp 492fc: b280 cmpl %d0,%d1 492fe: 6610 bnes 49310 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 49300: 2f2a 0024 movel %a2@(36),%sp@- 49304: 2f2a 0020 movel %a2@(32),%sp@- 49308: 206a 001c moveal %a2@(28),%a0 4930c: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 4930e: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 49310: 2003 movel %d3,%d0 49312: 40c2 movew %sr,%d2 49314: 8082 orl %d2,%d0 49316: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49318: 2454 moveal %a4@,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4931a: b7ca cmpal %a2,%a3 4931c: 6706 beqs 49324 <_Watchdog_Tickle+0x6c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4931e: 4aaa 0010 tstl %a2@(16) 49322: 67ce beqs 492f2 <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 49324: 46c2 movew %d2,%sr } 49326: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4932c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049330 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 49330: 4e56 ffe4 linkw %fp,#-28 49334: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 49338: 2a2e 0010 movel %fp@(16),%d5 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4933c: 4a39 0005 a7f6 tstb 5a7f6 49342: 6608 bnes 4934c <_Workspace_Handler_initialization+0x1c> 49344: 2439 0005 a7c8 movel 5a7c8 ,%d2 4934a: 6002 bras 4934e <_Workspace_Handler_initialization+0x1e> 4934c: 4282 clrl %d2 4934e: d4b9 0005 a7c4 addl 5a7c4 ,%d2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 49354: 4284 clrl %d4 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 49356: 47f9 0004 7304 lea 47304 <_Heap_Initialize>,%a3 for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 4935c: 49f9 0004 cbc0 lea 4cbc0 ,%a4 49362: 246e 0008 moveal %fp@(8),%a2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 49366: 6070 bras 493d8 <_Workspace_Handler_initialization+0xa8> Heap_Area *area = &areas [i]; if ( do_zero ) { 49368: 4a39 0005 a7f4 tstb 5a7f4 4936e: 670e beqs 4937e <_Workspace_Handler_initialization+0x4e> memset( area->begin, 0, area->size ); 49370: 2f2a 0004 movel %a2@(4),%sp@- 49374: 42a7 clrl %sp@- 49376: 2f12 movel %a2@,%sp@- 49378: 4e94 jsr %a4@ 4937a: 4fef 000c lea %sp@(12),%sp } if ( area->size > overhead ) { 4937e: 262a 0004 movel %a2@(4),%d3 49382: 700e moveq #14,%d0 49384: b083 cmpl %d3,%d0 49386: 644c bccs 493d4 <_Workspace_Handler_initialization+0xa4> uintptr_t space_available; uintptr_t size; if ( unified ) { 49388: 4a39 0005 a7f5 tstb 5a7f5 4938e: 661c bnes 493ac <_Workspace_Handler_initialization+0x7c> size = area->size; } else { if ( remaining > 0 ) { 49390: 4a82 tstl %d2 49392: 6716 beqs 493aa <_Workspace_Handler_initialization+0x7a><== NEVER TAKEN size = remaining < area->size - overhead ? 49394: 2003 movel %d3,%d0 49396: 0680 ffff fff2 addil #-14,%d0 remaining + overhead : area->size; 4939c: b082 cmpl %d2,%d0 4939e: 630c blss 493ac <_Workspace_Handler_initialization+0x7c><== NEVER TAKEN 493a0: 2602 movel %d2,%d3 493a2: 0683 0000 000e addil #14,%d3 493a8: 6002 bras 493ac <_Workspace_Handler_initialization+0x7c> } else { size = 0; 493aa: 4283 clrl %d3 <== NOT EXECUTED } } space_available = (*init_or_extend)( 493ac: 4878 0004 pea 4 493b0: 2f03 movel %d3,%sp@- 493b2: 2f12 movel %a2@,%sp@- 493b4: 4879 0005 dc06 pea 5dc06 <_Workspace_Area> 493ba: 4e93 jsr %a3@ ); area->begin = (char *) area->begin + size; area->size -= size; if ( space_available < remaining ) { 493bc: 4fef 0010 lea %sp@(16),%sp area->begin, size, page_size ); area->begin = (char *) area->begin + size; 493c0: d792 addl %d3,%a2@ area->size -= size; 493c2: 97aa 0004 subl %d3,%a2@(4) if ( space_available < remaining ) { 493c6: b480 cmpl %d0,%d2 493c8: 6306 blss 493d0 <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN remaining -= space_available; 493ca: 9480 subl %d0,%d2 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 493cc: 2645 moveal %d5,%a3 <== NOT EXECUTED 493ce: 6004 bras 493d4 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 493d0: 2645 moveal %d5,%a3 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 493d2: 4282 clrl %d2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 493d4: 5284 addql #1,%d4 493d6: 508a addql #8,%a2 493d8: b8ae 000c cmpl %fp@(12),%d4 493dc: 668a bnes 49368 <_Workspace_Handler_initialization+0x38> init_or_extend = extend; } } if ( remaining > 0 ) { 493de: 4a82 tstl %d2 493e0: 6710 beqs 493f2 <_Workspace_Handler_initialization+0xc2> _Internal_error_Occurred( 493e2: 4878 0002 pea 2 493e6: 4878 0001 pea 1 493ea: 42a7 clrl %sp@- 493ec: 4eb9 0004 74f8 jsr 474f8 <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 493f2: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 493f8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000495d0 <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 495d0: 4e56 0000 linkw %fp,#0 495d4: 2f0b movel %a3,%sp@- 495d6: 266e 000c moveal %fp@(12),%a3 495da: 2f0a movel %a2,%sp@- char *dup = _Workspace_Allocate(len + 1); 495dc: 486b 0001 pea %a3@(1) 495e0: 4eb9 0004 9564 jsr 49564 <_Workspace_Allocate> if (dup != NULL) { 495e6: 588f addql #4,%sp char *_Workspace_String_duplicate( const char *string, size_t len ) { char *dup = _Workspace_Allocate(len + 1); 495e8: 2440 moveal %d0,%a2 if (dup != NULL) { 495ea: 4a80 tstl %d0 495ec: 6718 beqs 49606 <_Workspace_String_duplicate+0x36><== NEVER TAKEN dup [len] = '\0'; 495ee: 4200 clrb %d0 495f0: 1580 b800 moveb %d0,%a2@(00000000,%a3:l) memcpy(dup, string, len); 495f4: 2f0b movel %a3,%sp@- 495f6: 2f2e 0008 movel %fp@(8),%sp@- 495fa: 2f0a movel %a2,%sp@- 495fc: 4eb9 0004 cdac jsr 4cdac 49602: 4fef 000c lea %sp@(12),%sp } return dup; } 49606: 200a movel %a2,%d0 49608: 246e fff8 moveal %fp@(-8),%a2 4960c: 266e fffc moveal %fp@(-4),%a3 49610: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004cab0 : #include rtems_status_code rtems_barrier_delete( rtems_id id ) { 4cab0: 4e56 fffc linkw %fp,#-4 4cab4: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4cab6: 486e fffc pea %fp@(-4) 4caba: 2f2e 0008 movel %fp@(8),%sp@- 4cabe: 4879 0005 fdac pea 5fdac <_Barrier_Information> 4cac4: 4eb9 0004 90b8 jsr 490b8 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4caca: 4fef 000c lea %sp@(12),%sp 4cace: 2440 moveal %d0,%a2 4cad0: 4aae fffc tstl %fp@(-4) 4cad4: 663a bnes 4cb10 <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4cad6: 4878 0002 pea 2 4cada: 42a7 clrl %sp@- 4cadc: 486a 0014 pea %a2@(20) 4cae0: 4eb9 0004 a2a0 jsr 4a2a0 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4cae6: 2f0a movel %a2,%sp@- 4cae8: 4879 0005 fdac pea 5fdac <_Barrier_Information> 4caee: 4eb9 0004 8cc8 jsr 48cc8 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4caf4: 2f0a movel %a2,%sp@- 4caf6: 4879 0005 fdac pea 5fdac <_Barrier_Information> 4cafc: 4eb9 0004 8f50 jsr 48f50 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4cb02: 4eb9 0004 9c88 jsr 49c88 <_Thread_Enable_dispatch> 4cb08: 4fef 001c lea %sp@(28),%sp return RTEMS_SUCCESSFUL; 4cb0c: 4280 clrl %d0 4cb0e: 6002 bras 4cb12 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4cb10: 7004 moveq #4,%d0 } 4cb12: 246e fff8 moveal %fp@(-8),%a2 4cb16: 4e5e unlk %fp ... =============================================================================== 00046de8 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 46de8: 4e56 ffec linkw %fp,#-20 46dec: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 46df0: 260e movel %fp,%d3 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 46df2: 45f9 0004 7394 lea 47394 <_Chain_Get>,%a2 46df8: 5983 subql #4,%d3 46dfa: 47f9 0004 622c lea 4622c ,%a3 46e00: 6016 bras 46e18 46e02: 2f03 movel %d3,%sp@- 46e04: 2f2e 0010 movel %fp@(16),%sp@- 46e08: 42a7 clrl %sp@- 46e0a: 2f2e 000c movel %fp@(12),%sp@- 46e0e: 4e93 jsr %a3@ ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 46e10: 4fef 0010 lea %sp@(16),%sp 46e14: 4a80 tstl %d0 46e16: 660e bnes 46e26 <== ALWAYS TAKEN 46e18: 2f2e 0008 movel %fp@(8),%sp@- 46e1c: 4e92 jsr %a2@ sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 46e1e: 588f addql #4,%sp 46e20: 2400 movel %d0,%d2 46e22: 67de beqs 46e02 46e24: 4280 clrl %d0 timeout, &out ); } *node_ptr = node; 46e26: 206e 0014 moveal %fp@(20),%a0 46e2a: 2082 movel %d2,%a0@ return sc; } 46e2c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 46e32: 4e5e unlk %fp ... =============================================================================== 0004e13c : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 4e13c: 4e56 0000 linkw %fp,#0 4e140: 202e 0008 movel %fp@(8),%d0 4e144: 206e 0014 moveal %fp@(20),%a0 4e148: 2f0a movel %a2,%sp@- rtems_status_code sc; if ( event_out != NULL ) { 4e14a: 4a88 tstl %a0 4e14c: 6758 beqs 4e1a6 <== NEVER TAKEN Thread_Control *executing = _Thread_Executing; 4e14e: 2479 0006 16a2 moveal 616a2 <_Per_CPU_Information+0xe>,%a2 RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4e154: 226a 00f8 moveal %a2@(248),%a1 Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 4e158: 4a80 tstl %d0 4e15a: 6742 beqs 4e19e <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4e15c: 2239 0006 152a movel 6152a <_Thread_Dispatch_disable_level>,%d1 ++level; 4e162: 5281 addql #1,%d1 _Thread_Dispatch_disable_level = level; 4e164: 23c1 0006 152a movel %d1,6152a <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Event_Seize( 4e16a: 2f3c 0004 0000 movel #262144,%sp@- 4e170: 4879 0006 16dc pea 616dc <_System_event_Sync_state> 4e176: 4869 0004 pea %a1@(4) 4e17a: 2f0a movel %a2,%sp@- 4e17c: 2f08 movel %a0,%sp@- 4e17e: 2f2e 0010 movel %fp@(16),%sp@- 4e182: 2f2e 000c movel %fp@(12),%sp@- 4e186: 2f00 movel %d0,%sp@- 4e188: 4eb9 0004 6e70 jsr 46e70 <_Event_Seize> executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 4e18e: 4fef 0020 lea %sp@(32),%sp 4e192: 4eb9 0004 98b4 jsr 498b4 <_Thread_Enable_dispatch> sc = executing->Wait.return_code; 4e198: 202a 0034 movel %a2@(52),%d0 4e19c: 600a bras 4e1a8 } else { *event_out = event->pending_events; 4e19e: 20a9 0004 movel %a1@(4),%a0@ <== NOT EXECUTED sc = RTEMS_SUCCESSFUL; 4e1a2: 4280 clrl %d0 <== NOT EXECUTED 4e1a4: 6002 bras 4e1a8 <== NOT EXECUTED } } else { sc = RTEMS_INVALID_ADDRESS; 4e1a6: 7009 moveq #9,%d0 <== NOT EXECUTED } return sc; } 4e1a8: 246e fffc moveal %fp@(-4),%a2 4e1ac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046478 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 46478: 4e56 fffc linkw %fp,#-4 rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 4647c: 486e fffc pea %fp@(-4) 46480: 2f2e 0008 movel %fp@(8),%sp@- 46484: 4eb9 0004 8698 jsr 48698 <_Thread_Get> switch ( location ) { 4648a: 508f addql #8,%sp 4648c: 4aae fffc tstl %fp@(-4) 46490: 6630 bnes 464c2 <== NEVER TAKEN case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 46492: 2040 moveal %d0,%a0 46494: 2f3c 0004 0000 movel #262144,%sp@- 4649a: 4879 0005 dda8 pea 5dda8 <_System_event_Sync_state> 464a0: 2228 00f8 movel %a0@(248),%d1 464a4: 5881 addql #4,%d1 464a6: 2f01 movel %d1,%sp@- 464a8: 2f2e 000c movel %fp@(12),%sp@- 464ac: 2f00 movel %d0,%sp@- 464ae: 4eb9 0004 5ed8 jsr 45ed8 <_Event_Surrender> event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 464b4: 4eb9 0004 8678 jsr 48678 <_Thread_Enable_dispatch> sc = RTEMS_SUCCESSFUL; break; 464ba: 4fef 0014 lea %sp@(20),%sp &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); sc = RTEMS_SUCCESSFUL; 464be: 4280 clrl %d0 break; 464c0: 6002 bras 464c4 case OBJECTS_REMOTE: sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT; break; #endif default: sc = RTEMS_INVALID_ID; 464c2: 7004 moveq #4,%d0 <== NOT EXECUTED break; } return sc; } 464c4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004693c : 4693c: 7002 moveq #2,%d0 } void rtems_initialize_start_multitasking(void) { 4693e: 4e56 0000 linkw %fp,#0 46942: 23c0 0005 dd5c movel %d0,5dd5c <_System_state_Current> uint32_t status; _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); _Thread_Start_multitasking(); 46948: 4eb9 0004 8ea8 jsr 48ea8 <_Thread_Start_multitasking> ****** RETURNS WHEN SYSTEM IS SHUT DOWN ****** ******************************************************************* ******************************************************************* *******************************************************************/ status = _Per_CPU_Information[0].idle->Wait.return_code; 4694e: 2079 0005 dd76 moveal 5dd76 <_Per_CPU_Information+0x16>,%a0 rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); 46954: 2f28 0034 movel %a0@(52),%sp@- 46958: 4878 0005 pea 5 4695c: 4eb9 0004 69d8 jsr 469d8 ... =============================================================================== 000487d8 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 487d8: 4e56 fff0 linkw %fp,#-16 487dc: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 487e0: 286e 0008 moveal %fp@(8),%a4 487e4: 45f9 0005 fff6 lea 5fff6 <_Objects_Information_table+0x4>,%a2 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 487ea: 4a8c tstl %a4 487ec: 673a beqs 48828 <== NEVER TAKEN 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 ] ) 487ee: 205a moveal %a2@+,%a0 487f0: 4a88 tstl %a0 487f2: 660a bnes 487fe Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 487f4: b5fc 0006 0002 cmpal #393218,%a2 487fa: 66f2 bnes 487ee 487fc: 602a bras 48828 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 487fe: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 48802: 4a8b tstl %a3 48804: 67ee beqs 487f4 48806: 7401 moveq #1,%d2 48808: 6012 bras 4881c continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 4880a: 206b 0018 moveal %a3@(24),%a0 4880e: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !the_thread ) 48812: 6706 beqs 4881a <== NEVER TAKEN continue; (*routine)(the_thread); 48814: 2f00 movel %d0,%sp@- 48816: 4e94 jsr %a4@ 48818: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4881a: 5282 addql #1,%d2 4881c: 4280 clrl %d0 4881e: 302b 000e movew %a3@(14),%d0 48822: b082 cmpl %d2,%d0 48824: 64e4 bccs 4880a 48826: 60cc bras 487f4 (*routine)(the_thread); } } } 48828: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4882e: 4e5e unlk %fp ... =============================================================================== 0004d564 : void *buffer, size_t *size, rtems_option option_set, rtems_interval timeout ) { 4d564: 4e56 fff0 linkw %fp,#-16 4d568: 48d7 001c moveml %d2-%d4,%sp@ 4d56c: 242e 000c movel %fp@(12),%d2 4d570: 262e 0010 movel %fp@(16),%d3 register Message_queue_Control *the_message_queue; Objects_Locations location; bool wait; if ( !buffer ) 4d574: 4a82 tstl %d2 4d576: 6762 beqs 4d5da <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !size ) 4d578: 4a83 tstl %d3 4d57a: 675e beqs 4d5da <== NEVER TAKEN RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4d57c: 486e fffc pea %fp@(-4) 4d580: 2f2e 0008 movel %fp@(8),%sp@- 4d584: 4879 0006 65d8 pea 665d8 <_Message_queue_Information> 4d58a: 4eb9 0004 f600 jsr 4f600 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4d590: 4fef 000c lea %sp@(12),%sp 4d594: 4aae fffc tstl %fp@(-4) 4d598: 6644 bnes 4d5de 4d59a: 222e 0014 movel %fp@(20),%d1 if ( _Options_Is_no_wait( option_set ) ) wait = false; else wait = true; _CORE_message_queue_Seize( 4d59e: 7801 moveq #1,%d4 4d5a0: 4681 notl %d1 4d5a2: 2040 moveal %d0,%a0 4d5a4: 2f2e 0018 movel %fp@(24),%sp@- 4d5a8: c881 andl %d1,%d4 4d5aa: 2f04 movel %d4,%sp@- 4d5ac: 2f03 movel %d3,%sp@- 4d5ae: 2f02 movel %d2,%sp@- 4d5b0: 2f28 0008 movel %a0@(8),%sp@- 4d5b4: 4868 0014 pea %a0@(20) 4d5b8: 4eb9 0004 e7c4 jsr 4e7c4 <_CORE_message_queue_Seize> buffer, size, wait, timeout ); _Thread_Enable_dispatch(); 4d5be: 4eb9 0005 02cc jsr 502cc <_Thread_Enable_dispatch> return _Message_queue_Translate_core_message_queue_return_code( _Thread_Executing->Wait.return_code 4d5c4: 2079 0006 6596 moveal 66596 <_Per_CPU_Information+0xe>,%a0 size, wait, timeout ); _Thread_Enable_dispatch(); return _Message_queue_Translate_core_message_queue_return_code( 4d5ca: 2f28 0034 movel %a0@(52),%sp@- 4d5ce: 4eb9 0004 d664 jsr 4d664 <_Message_queue_Translate_core_message_queue_return_code> 4d5d4: 4fef 001c lea %sp@(28),%sp 4d5d8: 6006 bras 4d5e0 register Message_queue_Control *the_message_queue; Objects_Locations location; bool wait; if ( !buffer ) return RTEMS_INVALID_ADDRESS; 4d5da: 7009 moveq #9,%d0 4d5dc: 6002 bras 4d5e0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4d5de: 7004 moveq #4,%d0 } 4d5e0: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4d5e6: 4e5e unlk %fp ... =============================================================================== 0006a8e0 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 6a8e0: 4e56 ffec linkw %fp,#-20 6a8e4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 6a8e8: 486e fffc pea %fp@(-4) 6a8ec: 282e 0008 movel %fp@(8),%d4 6a8f0: 2f04 movel %d4,%sp@- 6a8f2: 4879 0009 6570 pea 96570 <_Rate_monotonic_Information> 6a8f8: 242e 000c movel %fp@(12),%d2 6a8fc: 4eb9 0004 7820 jsr 47820 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 6a902: 4fef 000c lea %sp@(12),%sp 6a906: 2440 moveal %d0,%a2 6a908: 4aae fffc tstl %fp@(-4) 6a90c: 6600 0156 bnew 6aa64 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 6a910: 2039 0009 63a2 movel 963a2 <_Per_CPU_Information+0xe>,%d0 6a916: b0aa 0040 cmpl %a2@(64),%d0 6a91a: 670c beqs 6a928 _Thread_Enable_dispatch(); 6a91c: 4eb9 0004 83f0 jsr 483f0 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 6a922: 7417 moveq #23,%d2 6a924: 6000 0140 braw 6aa66 } if ( length == RTEMS_PERIOD_STATUS ) { 6a928: 4a82 tstl %d2 6a92a: 6624 bnes 6a950 switch ( the_period->state ) { 6a92c: 202a 0038 movel %a2@(56),%d0 6a930: 7204 moveq #4,%d1 6a932: b280 cmpl %d0,%d1 6a934: 650e bcss 6a944 <== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a936: 41f9 0008 fd14 lea 8fd14 ,%a0 6a93c: 4282 clrl %d2 6a93e: 1430 0800 moveb %a0@(00000000,%d0:l),%d2 6a942: 6002 bras 6a946 _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 6a944: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 6a946: 4eb9 0004 83f0 jsr 483f0 <_Thread_Enable_dispatch> 6a94c: 6000 0118 braw 6aa66 return( return_value ); } _ISR_Disable( level ); 6a950: 203c 0000 0700 movel #1792,%d0 6a956: 40c3 movew %sr,%d3 6a958: 8083 orl %d3,%d0 6a95a: 46c0 movew %d0,%sr if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 6a95c: 202a 0038 movel %a2@(56),%d0 6a960: 664a bnes 6a9ac _ISR_Enable( level ); 6a962: 46c3 movew %d3,%sr the_period->next_length = length; 6a964: 2542 003c movel %d2,%a2@(60) /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 6a968: 2f0a movel %a2,%sp@- 6a96a: 4eb9 0006 a85c jsr 6a85c <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 6a970: 7002 moveq #2,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 6a972: 223c 0006 aa74 movel #436852,%d1 6a978: 2540 0038 movel %d0,%a2@(56) 6a97c: 2541 002c movel %d1,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 6a980: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; 6a984: 2544 0030 movel %d4,%a2@(48) the_watchdog->user_data = user_data; 6a988: 42aa 0034 clrl %a2@(52) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 6a98c: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 6a990: 486a 0010 pea %a2@(16) 6a994: 4879 0009 62c6 pea 962c6 <_Watchdog_Ticks_chain> 6a99a: 4eb9 0004 8e90 jsr 48e90 <_Watchdog_Insert> id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 6a9a0: 4eb9 0004 83f0 jsr 483f0 <_Thread_Enable_dispatch> 6a9a6: 4fef 000c lea %sp@(12),%sp 6a9aa: 606a bras 6aa16 return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 6a9ac: 7202 moveq #2,%d1 6a9ae: b280 cmpl %d0,%d1 6a9b0: 6668 bnes 6aa1a /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 6a9b2: 2f0a movel %a2,%sp@- 6a9b4: 4eba fde2 jsr %pc@(6a798 <_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; 6a9b8: 7001 moveq #1,%d0 the_period->next_length = length; 6a9ba: 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; 6a9be: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 6a9c2: 46c3 movew %d3,%sr _Thread_Executing->Wait.id = the_period->Object.id; 6a9c4: 2079 0009 63a2 moveal 963a2 <_Per_CPU_Information+0xe>,%a0 6a9ca: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 6a9d0: 4878 4000 pea 4000 6a9d4: 2f08 movel %a0,%sp@- 6a9d6: 4eb9 0004 8b4c jsr 48b4c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 6a9dc: 203c 0000 0700 movel #1792,%d0 6a9e2: 40c1 movew %sr,%d1 6a9e4: 8081 orl %d1,%d0 6a9e6: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 6a9e8: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 6a9ea: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 6a9ee: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 6a9f2: 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 ) 6a9f4: 7203 moveq #3,%d1 6a9f6: 4fef 000c lea %sp@(12),%sp 6a9fa: b280 cmpl %d0,%d1 6a9fc: 6612 bnes 6aa10 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 6a9fe: 4878 4000 pea 4000 6aa02: 2f39 0009 63a2 movel 963a2 <_Per_CPU_Information+0xe>,%sp@- 6aa08: 4eb9 0004 807c jsr 4807c <_Thread_Clear_state> 6aa0e: 508f addql #8,%sp _Thread_Enable_dispatch(); 6aa10: 4eb9 0004 83f0 jsr 483f0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 6aa16: 4282 clrl %d2 6aa18: 604c bras 6aa66 } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 6aa1a: 7204 moveq #4,%d1 6aa1c: b280 cmpl %d0,%d1 6aa1e: 6644 bnes 6aa64 <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 6aa20: 2f0a movel %a2,%sp@- 6aa22: 4eba fd74 jsr %pc@(6a798 <_Rate_monotonic_Update_statistics>) _ISR_Enable( level ); 6aa26: 46c3 movew %d3,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 6aa28: 7002 moveq #2,%d0 the_period->next_length = length; 6aa2a: 2542 003c movel %d2,%a2@(60) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 6aa2e: 2540 0038 movel %d0,%a2@(56) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 6aa32: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 6aa36: 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; 6aa3a: 7406 moveq #6,%d2 6aa3c: 4879 0009 62c6 pea 962c6 <_Watchdog_Ticks_chain> 6aa42: 4eb9 0004 8e90 jsr 48e90 <_Watchdog_Insert> 6aa48: 2f2a 003c movel %a2@(60),%sp@- 6aa4c: 2f2a 0040 movel %a2@(64),%sp@- 6aa50: 2079 0009 1560 moveal 91560 <_Scheduler+0x34>,%a0 6aa56: 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(); 6aa58: 4eb9 0004 83f0 jsr 483f0 <_Thread_Enable_dispatch> 6aa5e: 4fef 0014 lea %sp@(20),%sp 6aa62: 6002 bras 6aa66 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 6aa64: 7404 moveq #4,%d2 } 6aa66: 2002 movel %d2,%d0 6aa68: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 6aa6e: 4e5e unlk %fp ... =============================================================================== 000471d0 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 471d0: 4e56 ffec linkw %fp,#-20 471d4: 202e 000c movel %fp@(12),%d0 471d8: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 471dc: 286e 0008 moveal %fp@(8),%a4 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 471e0: 2600 movel %d0,%d3 void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 471e2: 242c 002e movel %a4@(46),%d2 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 471e6: 4c42 3001 remul %d2,%d1,%d3 if (excess > 0) { 471ea: 4a81 tstl %d1 471ec: 6700 0090 beqw 4727e value += alignment - excess; 471f0: d480 addl %d0,%d2 <== NOT EXECUTED 471f2: 9481 subl %d1,%d2 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 471f4: 4a80 tstl %d0 <== NOT EXECUTED 471f6: 6606 bnes 471fe <== NOT EXECUTED return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 471f8: 4280 clrl %d0 471fa: 6000 008a braw 47286 rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 471fe: b480 cmpl %d0,%d2 <== NOT EXECUTED 47200: 65f6 bcss 471f8 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 47202: 224c moveal %a4,%a1 size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; 47204: 95ca subal %a2,%a2 47206: 2059 moveal %a1@+,%a0 47208: 600a bras 47214 while (current != tail && big_enough == NULL) { rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 4720a: b4a8 001c cmpl %a0@(28),%d2 4720e: 6202 bhis 47212 47210: 2448 moveal %a0,%a2 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 47212: 2050 moveal %a0@,%a0 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 47214: b3c8 cmpal %a0,%a1 47216: 6606 bnes 4721e uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 47218: 4a8a tstl %a2 4721a: 6606 bnes 47222 4721c: 60da bras 471f8 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 4721e: 4a8a tstl %a2 47220: 67e8 beqs 4720a <== ALWAYS TAKEN if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { uintptr_t free_size = free_chunk->size; 47222: 262a 001c movel %a2@(28),%d3 if (free_size > aligned_size) { 47226: b483 cmpl %d3,%d2 47228: 643c bccs 47266 rtems_rbheap_chunk *new_chunk = get_chunk(control); 4722a: 2f0c movel %a4,%sp@- 4722c: 4eba fe50 jsr %pc@(4707e ) if (new_chunk != NULL) { 47230: 588f addql #4,%sp if (free_chunk != NULL) { uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { rtems_rbheap_chunk *new_chunk = get_chunk(control); 47232: 2640 moveal %d0,%a3 if (new_chunk != NULL) { 47234: 4a80 tstl %d0 47236: 67c0 beqs 471f8 <== NEVER TAKEN uintptr_t new_free_size = free_size - aligned_size; 47238: 9682 subl %d2,%d3 free_chunk->size = new_free_size; 4723a: 2543 001c movel %d3,%a2@(28) new_chunk->begin = free_chunk->begin + new_free_size; 4723e: d6aa 0018 addl %a2@(24),%d3 new_chunk->size = aligned_size; 47242: 2742 001c movel %d2,%a3@(28) if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 47246: 2743 0018 movel %d3,%a3@(24) */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 4724a: 42ab 0004 clrl %a3@(4) 4724e: 4293 clrl %a3@ static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 47250: 486b 0008 pea %a3@(8) 47254: 486c 0018 pea %a4@(24) 47258: 4eb9 0004 893c jsr 4893c <_RBTree_Insert_unprotected> free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 4725e: 202b 0018 movel %a3@(24),%d0 47262: 508f addql #8,%sp 47264: 6020 bras 47286 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47266: 2252 moveal %a2@,%a1 previous = the_node->previous; 47268: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4726c: 2348 0004 movel %a0,%a1@(4) } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 47270: 202a 0018 movel %a2@(24),%d0 previous->next = next; 47274: 2089 movel %a1,%a0@ */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 47276: 42aa 0004 clrl %a2@(4) 4727a: 4292 clrl %a2@ 4727c: 6008 bras 47286 rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 4727e: 2400 movel %d0,%d2 47280: 6680 bnes 47202 47282: 6000 ff74 braw 471f8 } } } return ptr; } 47286: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4728c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047388 : void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 47388: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED 4738c: 2f0a movel %a2,%sp@- <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 4738e: 4878 0020 pea 20 <== NOT EXECUTED { /* Do nothing */ } void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 47392: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 47396: 4eb9 0004 3294 jsr 43294 <== NOT EXECUTED if (chunk != NULL) { 4739c: 588f addql #4,%sp <== NOT EXECUTED 4739e: 4a80 tstl %d0 <== NOT EXECUTED 473a0: 671a beqs 473bc <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert_unprotected(_Chain_Head(the_chain), the_node); 473a2: 43ea 000c lea %a2@(12),%a1 <== NOT EXECUTED 473a6: 2040 moveal %d0,%a0 <== NOT EXECUTED 473a8: 2149 0004 movel %a1,%a0@(4) <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 473ac: 206a 000c moveal %a2@(12),%a0 <== NOT EXECUTED after_node->next = the_node; the_node->next = before_node; 473b0: 2240 moveal %d0,%a1 <== NOT EXECUTED { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; 473b2: 2540 000c movel %d0,%a2@(12) <== NOT EXECUTED the_node->next = before_node; before_node->previous = the_node; 473b6: 2140 0004 movel %d0,%a0@(4) <== NOT EXECUTED Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 473ba: 2288 movel %a0,%a1@ <== NOT EXECUTED rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 473bc: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 473c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047290 : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 47290: 4e56 ffc8 linkw %fp,#-56 47294: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 47298: 266e 0008 moveal %fp@(8),%a3 4729c: 246e 000c moveal %fp@(12),%a2 rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 472a0: 4a8a tstl %a2 472a2: 6700 00c8 beqw 4736c #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 472a6: 4878 0020 pea 20 return rtems_rbheap_chunk_of_node( 472aa: 260e movel %fp,%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; 472ac: 49eb 0018 lea %a3@(24),%a4 RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; 472b0: 4282 clrl %d2 static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; return rtems_rbheap_chunk_of_node( 472b2: 0683 ffff ffe8 addil #-24,%d3 #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 472b8: 42a7 clrl %sp@- 472ba: 486e ffe0 pea %fp@(-32) 472be: 4eb9 0004 da40 jsr 4da40 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 472c4: 4fef 000c lea %sp@(12),%sp 472c8: 2d4a fff8 movel %a2,%fp@(-8) 472cc: 246b 001c moveal %a3@(28),%a2 472d0: 6026 bras 472f8 RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 472d2: 2f0a movel %a2,%sp@- 472d4: 2f03 movel %d3,%sp@- 472d6: 206c 0010 moveal %a4@(16),%a0 472da: 4e90 jsr %a0@ if ( _RBTree_Is_equal( compare_result ) ) { 472dc: 508f addql #8,%sp 472de: 4a80 tstl %d0 472e0: 6608 bnes 472ea found = iter_node; if ( the_rbtree->is_unique ) 472e2: 4a2c 0014 tstb %a4@(20) 472e6: 6616 bnes 472fe <== ALWAYS TAKEN 472e8: 240a movel %a2,%d2 <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 472ea: 4a80 tstl %d0 472ec: 5ec0 sgt %d0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 472ee: 7201 moveq #1,%d1 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 472f0: 49c0 extbl %d0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 472f2: 9280 subl %d0,%d1 472f4: 2472 1c00 moveal %a2@(00000000,%d1:l:4),%a2 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 472f8: 4a8a tstl %a2 472fa: 66d6 bnes 472d2 472fc: 2442 moveal %d2,%a2 return rtems_rbheap_chunk_of_node( 472fe: 518a subql #8,%a2 if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 47300: 70f8 moveq #-8,%d0 47302: b08a cmpl %a2,%d0 47304: 676a beqs 47370 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 47306: 4a92 tstl %a2@ 47308: 660c bnes 47316 4730a: 4aaa 0004 tstl %a2@(4) 4730e: 57c0 seq %d0 47310: 49c0 extbl %d0 47312: 4480 negl %d0 47314: 6002 bras 47318 47316: 4280 clrl %d0 if (!rtems_rbheap_is_chunk_free(chunk)) { 47318: 0800 0000 btst #0,%d0 4731c: 6756 beqs 47374 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 4731e: 42a7 clrl %sp@- 47320: 240a movel %a2,%d2 47322: 5082 addql #8,%d2 47324: 4bf9 0004 8b28 lea 48b28 <_RBTree_Next_unprotected>,%a5 4732a: 2f02 movel %d2,%sp@- 4732c: 4e95 jsr %a5@ 4732e: 4878 0001 pea 1 47332: 2600 movel %d0,%d3 47334: 2f02 movel %d2,%sp@- 47336: 4e95 jsr %a5@ if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 47338: 4bfa fcbe lea %pc@(46ff8 ),%a5 4733c: 5180 subql #8,%d0 4733e: 2f00 movel %d0,%sp@- 47340: 2f0a movel %a2,%sp@- 47342: 2f0c movel %a4,%sp@- 47344: 2f0b movel %a3,%sp@- 47346: 4e95 jsr %a5@ ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 47348: 2053 moveal %a3@,%a0 add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 4734a: 4fef 0020 lea %sp@(32),%sp Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4734e: 254b 0004 movel %a3,%a2@(4) before_node = after_node->next; after_node->next = the_node; 47352: 268a movel %a2,%a3@ the_node->next = before_node; before_node->previous = the_node; 47354: 214a 0004 movel %a2,%a0@(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; 47358: 2488 movel %a0,%a2@ 4735a: 2043 moveal %d3,%a0 4735c: 4868 fff8 pea %a0@(-8) 47360: 2f0a movel %a2,%sp@- 47362: 2f0c movel %a4,%sp@- 47364: 2f0b movel %a3,%sp@- 47366: 4e95 jsr %a5@ 47368: 4fef 0010 lea %sp@(16),%sp } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { rtems_status_code sc = RTEMS_SUCCESSFUL; 4736c: 4280 clrl %d0 4736e: 6006 bras 47376 check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; } } else { sc = RTEMS_INVALID_ID; 47370: 7004 moveq #4,%d0 47372: 6002 bras 47376 check_and_merge(free_chain, chunk_tree, chunk, succ); add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; 47374: 700e moveq #14,%d0 sc = RTEMS_INVALID_ID; } } return sc; } 47376: 4cee 3c0c ffc8 moveml %fp@(-56),%d2-%d3/%a2-%a5 4737c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000510b8 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 510b8: 4e56 fffc linkw %fp,#-4 510bc: 2f03 movel %d3,%sp@- 510be: 262e 0010 movel %fp@(16),%d3 510c2: 2f02 movel %d2,%sp@- 510c4: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 510c8: 6768 beqs 51132 return RTEMS_INVALID_ADDRESS; if ( !size ) 510ca: 4a83 tstl %d3 510cc: 6764 beqs 51132 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 510ce: 2f39 0007 60c6 movel 760c6 <_RTEMS_Allocator_Mutex>,%sp@- 510d4: 4eb9 0005 30fc jsr 530fc <_API_Mutex_Lock> 510da: 486e fffc pea %fp@(-4) 510de: 2f2e 0008 movel %fp@(8),%sp@- 510e2: 4879 0007 5f3c pea 75f3c <_Region_Information> 510e8: 4eb9 0005 4af8 jsr 54af8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 510ee: 222e fffc movel %fp@(-4),%d1 510f2: 4fef 0010 lea %sp@(16),%sp 510f6: 6708 beqs 51100 510f8: 7001 moveq #1,%d0 510fa: b081 cmpl %d1,%d0 510fc: 671e beqs 5111c <== ALWAYS TAKEN 510fe: 6018 bras 51118 <== NOT EXECUTED case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 51100: 2f03 movel %d3,%sp@- 51102: 2040 moveal %d0,%a0 51104: 2f02 movel %d2,%sp@- 51106: 4868 0068 pea %a0@(104) 5110a: 4eb9 0005 4540 jsr 54540 <_Heap_Size_of_alloc_area> 51110: 4fef 000c lea %sp@(12),%sp 51114: 4a00 tstb %d0 51116: 6708 beqs 51120 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 51118: 4282 clrl %d2 5111a: 6006 bras 51122 case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 5111c: 7404 moveq #4,%d2 5111e: 6002 bras 51122 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; 51120: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 51122: 2f39 0007 60c6 movel 760c6 <_RTEMS_Allocator_Mutex>,%sp@- 51128: 4eb9 0005 315c jsr 5315c <_API_Mutex_Unlock> 5112e: 588f addql #4,%sp 51130: 6002 bras 51134 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) return RTEMS_INVALID_ADDRESS; 51132: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 51134: 2002 movel %d2,%d0 51136: 242e fff4 movel %fp@(-12),%d2 5113a: 262e fff8 movel %fp@(-8),%d3 5113e: 4e5e unlk %fp ... =============================================================================== 00046964 : void rtems_shutdown_executive( uint32_t result ) { if ( _System_state_Is_up( _System_state_Get() ) ) { 46964: 7003 moveq #3,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 46966: 4e56 0000 linkw %fp,#0 if ( _System_state_Is_up( _System_state_Get() ) ) { 4696a: b0b9 0005 dd5c cmpl 5dd5c <_System_state_Current>,%d0 46970: 6624 bnes 46996 #if defined(RTEMS_SMP) _SMP_Request_other_cores_to_shutdown(); #endif _Per_CPU_Information[0].idle->Wait.return_code = result; 46972: 2079 0005 dd76 moveal 5dd76 <_Per_CPU_Information+0x16>,%a0 46978: 103c 0004 moveb #4,%d0 4697c: 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 ); 46982: 4879 0005 dbc2 pea 5dbc2 <_Thread_BSP_context> 46988: 23c0 0005 dd5c movel %d0,5dd5c <_System_state_Current> 4698e: 4eb9 0004 947e jsr 4947e <_CPU_Context_Restart_self> 46994: 588f addql #4,%sp <== NOT EXECUTED ****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ****** ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 46996: 4878 0014 pea 14 4699a: 4878 0001 pea 1 4699e: 42a7 clrl %sp@- 469a0: 4eb9 0004 74f8 jsr 474f8 <_Internal_error_Occurred> ... =============================================================================== 00051718 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 51718: 4e56 fffc linkw %fp,#-4 5171c: 2f03 movel %d3,%sp@- 5171e: 2f02 movel %d2,%sp@- 51720: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 51724: 6776 beqs 5179c return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 51726: 486e fffc pea %fp@(-4) 5172a: 2f2e 0008 movel %fp@(8),%sp@- 5172e: 4eb9 0005 5794 jsr 55794 <_Thread_Get> switch ( location ) { 51734: 508f addql #8,%sp 51736: 4aae fffc tstl %fp@(-4) 5173a: 6664 bnes 517a0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 5173c: 2240 moveal %d0,%a1 5173e: 2069 00f8 moveal %a1@(248),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 51742: 4aa8 000a tstl %a0@(10) 51746: 674a beqs 51792 51748: 223c 0000 0700 movel #1792,%d1 if ( asr->is_enabled ) { 5174e: 4a28 0008 tstb %a0@(8) 51752: 6726 beqs 5177a rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 51754: 40c3 movew %sr,%d3 51756: 8283 orl %d3,%d1 51758: 46c1 movew %d1,%sr *signal_set |= signals; 5175a: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 5175e: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 51760: 4ab9 0007 61bc tstl 761bc <_Per_CPU_Information+0x8> 51766: 6720 beqs 51788 51768: b0b9 0007 61c2 cmpl 761c2 <_Per_CPU_Information+0xe>,%d0 5176e: 6618 bnes 51788 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 51770: 7001 moveq #1,%d0 51772: 13c0 0007 61c0 moveb %d0,761c0 <_Per_CPU_Information+0xc> 51778: 600e bras 51788 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 5177a: 2001 movel %d1,%d0 5177c: 40c1 movew %sr,%d1 5177e: 8081 orl %d1,%d0 51780: 46c0 movew %d0,%sr *signal_set |= signals; 51782: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 51786: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 51788: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5178e: 4280 clrl %d0 51790: 6010 bras 517a2 } _Thread_Enable_dispatch(); 51792: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 51798: 700b moveq #11,%d0 5179a: 6006 bras 517a2 Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 5179c: 700a moveq #10,%d0 5179e: 6002 bras 517a2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 517a0: 7004 moveq #4,%d0 } 517a2: 242e fff4 movel %fp@(-12),%d2 517a6: 262e fff8 movel %fp@(-8),%d3 517aa: 4e5e unlk %fp ... =============================================================================== 0004e1b0 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4e1b0: 4e56 ffe4 linkw %fp,#-28 4e1b4: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4e1b8: 262e 0008 movel %fp@(8),%d3 4e1bc: 282e 000c movel %fp@(12),%d4 4e1c0: 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 ) 4e1c4: 4a8c tstl %a4 4e1c6: 6700 0108 beqw 4e2d0 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4e1ca: 2679 0006 16a2 moveal 616a2 <_Per_CPU_Information+0xe>,%a3 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4e1d0: 4a2b 0070 tstb %a3@(112) 4e1d4: 57c2 seq %d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4e1d6: 246b 00f8 moveal %a3@(248),%a2 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4e1da: 49c2 extbl %d2 4e1dc: 0282 0000 0100 andil #256,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4e1e2: 4aab 0076 tstl %a3@(118) 4e1e6: 6704 beqs 4e1ec old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4e1e8: 08c2 0009 bset #9,%d2 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4e1ec: 4a2a 0008 tstb %a2@(8) 4e1f0: 57c5 seq %d5 old_mode |= _ISR_Get_level(); 4e1f2: 4eb9 0004 a760 jsr 4a760 <_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; 4e1f8: 49c5 extbl %d5 4e1fa: 0285 0000 0400 andil #1024,%d5 4e200: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); 4e202: 8082 orl %d2,%d0 4e204: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4e206: 0804 0008 btst #8,%d4 4e20a: 670e beqs 4e21a 4e20c: 2203 movel %d3,%d1 4e20e: 7001 moveq #1,%d0 4e210: e089 lsrl #8,%d1 4e212: b181 eorl %d0,%d1 4e214: c280 andl %d0,%d1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4e216: 1741 0070 moveb %d1,%a3@(112) if ( mask & RTEMS_TIMESLICE_MASK ) { 4e21a: 0804 0009 btst #9,%d4 4e21e: 671c beqs 4e23c if ( _Modes_Is_timeslice(mode_set) ) { 4e220: 0803 0009 btst #9,%d3 4e224: 6712 beqs 4e238 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4e226: 41f9 0006 14e2 lea 614e2 <_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; 4e22c: 7201 moveq #1,%d1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4e22e: 2750 0072 movel %a0@,%a3@(114) 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; 4e232: 2741 0076 movel %d1,%a3@(118) 4e236: 6004 bras 4e23c executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4e238: 42ab 0076 clrl %a3@(118) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4e23c: 7007 moveq #7,%d0 4e23e: c084 andl %d4,%d0 4e240: 6712 beqs 4e254 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4e242: 40c1 movew %sr,%d1 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4e244: 7007 moveq #7,%d0 4e246: c083 andl %d3,%d0 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4e248: 0281 0000 f8ff andil #63743,%d1 4e24e: e188 lsll #8,%d0 4e250: 8280 orl %d0,%d1 4e252: 46c1 movew %d1,%sr * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4e254: 0804 000a btst #10,%d4 4e258: 6742 beqs 4e29c is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 4e25a: 720a moveq #10,%d1 4e25c: 2003 movel %d3,%d0 4e25e: e2a8 lsrl %d1,%d0 4e260: 123c 0001 moveb #1,%d1 4e264: b380 eorl %d1,%d0 4e266: c081 andl %d1,%d0 if ( is_asr_enabled != asr->is_enabled ) { 4e268: 4281 clrl %d1 4e26a: 122a 0008 moveb %a2@(8),%d1 4e26e: b280 cmpl %d0,%d1 4e270: 672a beqs 4e29c asr->is_enabled = is_asr_enabled; 4e272: 1540 0008 moveb %d0,%a2@(8) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4e276: 203c 0000 0700 movel #1792,%d0 4e27c: 40c1 movew %sr,%d1 4e27e: 8081 orl %d1,%d0 4e280: 46c0 movew %d0,%sr _signals = information->signals_pending; 4e282: 202a 0016 movel %a2@(22),%d0 information->signals_pending = information->signals_posted; 4e286: 256a 0012 0016 movel %a2@(18),%a2@(22) information->signals_posted = _signals; 4e28c: 2540 0012 movel %d0,%a2@(18) _ISR_Enable( _level ); 4e290: 46c1 movew %d1,%sr _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 4e292: 4aaa 0012 tstl %a2@(18) 4e296: 56c0 sne %d0 4e298: 4480 negl %d0 4e29a: 6002 bras 4e29e /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4e29c: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4e29e: 7203 moveq #3,%d1 4e2a0: b2b9 0006 1690 cmpl 61690 <_System_state_Current>,%d1 4e2a6: 662c bnes 4e2d4 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 4e2a8: 2079 0006 16a2 moveal 616a2 <_Per_CPU_Information+0xe>,%a0 if ( are_signals_pending || 4e2ae: 4a00 tstb %d0 4e2b0: 660e bnes 4e2c0 4e2b2: b1f9 0006 16a6 cmpal 616a6 <_Per_CPU_Information+0x12>,%a0 4e2b8: 671a beqs 4e2d4 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 4e2ba: 4a28 0070 tstb %a0@(112) 4e2be: 6714 beqs 4e2d4 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 4e2c0: 7001 moveq #1,%d0 4e2c2: 13c0 0006 16a0 moveb %d0,616a0 <_Per_CPU_Information+0xc> if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 4e2c8: 4eb9 0004 9748 jsr 49748 <_Thread_Dispatch> 4e2ce: 6004 bras 4e2d4 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4e2d0: 7009 moveq #9,%d0 4e2d2: 6002 bras 4e2d6 if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 4e2d4: 4280 clrl %d0 } 4e2d6: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4e2dc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049df0 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 49df0: 4e56 fffc linkw %fp,#-4 49df4: 2f0a movel %a2,%sp@- 49df6: 246e 0010 moveal %fp@(16),%a2 49dfa: 2f02 movel %d2,%sp@- 49dfc: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 49e00: 670c beqs 49e0e 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 ) ); 49e02: 4280 clrl %d0 49e04: 1039 0005 fbbc moveb 5fbbc ,%d0 49e0a: b082 cmpl %d2,%d0 49e0c: 654e bcss 49e5c !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 49e0e: 4a8a tstl %a2 49e10: 674e beqs 49e60 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49e12: 486e fffc pea %fp@(-4) 49e16: 2f2e 0008 movel %fp@(8),%sp@- 49e1a: 4eb9 0004 bf04 jsr 4bf04 <_Thread_Get> switch ( location ) { 49e20: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49e22: 2040 moveal %d0,%a0 switch ( location ) { 49e24: 4aae fffc tstl %fp@(-4) 49e28: 663a bnes 49e64 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 49e2a: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 49e2e: 4a82 tstl %d2 49e30: 6720 beqs 49e52 the_thread->real_priority = new_priority; 49e32: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 49e36: 4aa8 001c tstl %a0@(28) 49e3a: 6706 beqs 49e42 49e3c: b4a8 0014 cmpl %a0@(20),%d2 49e40: 6410 bccs 49e52 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 49e42: 42a7 clrl %sp@- 49e44: 2f02 movel %d2,%sp@- 49e46: 2f08 movel %a0,%sp@- 49e48: 4eb9 0004 ba94 jsr 4ba94 <_Thread_Change_priority> 49e4e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 49e52: 4eb9 0004 bee4 jsr 4bee4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 49e58: 4280 clrl %d0 49e5a: 600a bras 49e66 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; 49e5c: 7013 moveq #19,%d0 49e5e: 6006 bras 49e66 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 49e60: 7009 moveq #9,%d0 49e62: 6002 bras 49e66 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 49e64: 7004 moveq #4,%d0 } 49e66: 242e fff4 movel %fp@(-12),%d2 49e6a: 246e fff8 moveal %fp@(-8),%a2 49e6e: 4e5e unlk %fp ... =============================================================================== 00044984 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 44984: 4e56 fffc linkw %fp,#-4 44988: 2f0a movel %a2,%sp@- 4498a: 246e 0010 moveal %fp@(16),%a2 4498e: 2f02 movel %d2,%sp@- 44990: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 44994: 6742 beqs 449d8 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !result ) 44996: 4a8a tstl %a2 44998: 673e beqs 449d8 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 4499a: 486e fffc pea %fp@(-4) 4499e: 2f2e 0008 movel %fp@(8),%sp@- 449a2: 4eb9 0004 63ac jsr 463ac <_Thread_Get> switch (location) { 449a8: 508f addql #8,%sp 449aa: 4aae fffc tstl %fp@(-4) 449ae: 662c bnes 449dc case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 449b0: 2240 moveal %d0,%a1 449b2: 2069 0104 moveal %a1@(260),%a0 while (tvp) { 449b6: 6016 bras 449ce if (tvp->ptr == ptr) { 449b8: b4a8 0004 cmpl %a0@(4),%d2 449bc: 660e bnes 449cc /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 449be: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 449c2: 4eb9 0004 638c jsr 4638c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 449c8: 4280 clrl %d0 449ca: 6012 bras 449de } tvp = (rtems_task_variable_t *)tvp->next; 449cc: 2050 moveal %a0@,%a0 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 449ce: 4a88 tstl %a0 449d0: 66e6 bnes 449b8 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 449d2: 4eb9 0004 638c jsr 4638c <_Thread_Enable_dispatch> Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 449d8: 7009 moveq #9,%d0 449da: 6002 bras 449de #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 449dc: 7004 moveq #4,%d0 } 449de: 242e fff4 movel %fp@(-12),%d2 449e2: 246e fff8 moveal %fp@(-8),%a2 449e6: 4e5e unlk %fp ... =============================================================================== 00052028 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 52028: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 5202c: 486e fffc pea %fp@(-4) 52030: 2f2e 0008 movel %fp@(8),%sp@- 52034: 4879 0007 623c pea 7623c <_Timer_Information> 5203a: 4eb9 0005 4b30 jsr 54b30 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 52040: 4fef 000c lea %sp@(12),%sp 52044: 4aae fffc tstl %fp@(-4) 52048: 6620 bnes 5206a case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 5204a: 7204 moveq #4,%d1 5204c: 2040 moveal %d0,%a0 5204e: b2a8 0038 cmpl %a0@(56),%d1 52052: 670c beqs 52060 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 52054: 4868 0010 pea %a0@(16) 52058: 4eb9 0005 64c8 jsr 564c8 <_Watchdog_Remove> 5205e: 588f addql #4,%sp _Thread_Enable_dispatch(); 52060: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 52066: 4280 clrl %d0 52068: 6002 bras 5206c #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5206a: 7004 moveq #4,%d0 } 5206c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000523a0 : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 523a0: 4e56 fffc linkw %fp,#-4 523a4: 2f0b movel %a3,%sp@- 523a6: 2f0a movel %a2,%sp@- 523a8: 486e fffc pea %fp@(-4) 523ac: 2f2e 0008 movel %fp@(8),%sp@- 523b0: 4879 0007 623c pea 7623c <_Timer_Information> 523b6: 4eb9 0005 4b30 jsr 54b30 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 523bc: 4fef 000c lea %sp@(12),%sp 523c0: 2440 moveal %d0,%a2 523c2: 4aae fffc tstl %fp@(-4) 523c6: 6656 bnes 5241e <== NEVER TAKEN case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 523c8: 202a 0038 movel %a2@(56),%d0 523cc: 661c bnes 523ea _Watchdog_Remove( &the_timer->Ticker ); 523ce: 45ea 0010 lea %a2@(16),%a2 523d2: 2f0a movel %a2,%sp@- 523d4: 4eb9 0005 64c8 jsr 564c8 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 523da: 2f0a movel %a2,%sp@- 523dc: 4879 0007 60de pea 760de <_Watchdog_Ticks_chain> 523e2: 4eb9 0005 63a4 jsr 563a4 <_Watchdog_Insert> 523e8: 6020 bras 5240a } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 523ea: 7201 moveq #1,%d1 523ec: b280 cmpl %d0,%d1 523ee: 6622 bnes 52412 <== NEVER TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 523f0: 486a 0010 pea %a2@(16) case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { Timer_server_Control *timer_server = _Timer_server; 523f4: 2679 0007 6274 moveal 76274 <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 523fa: 4eb9 0005 64c8 jsr 564c8 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 52400: 2f0a movel %a2,%sp@- 52402: 2f0b movel %a3,%sp@- 52404: 206b 0004 moveal %a3@(4),%a0 52408: 4e90 jsr %a0@ 5240a: 4fef 000c lea %sp@(12),%sp rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 5240e: 95ca subal %a2,%a2 52410: 6004 bras 52416 /* * Must be dormant or time of day timer (e.g. TIMER_DORMANT, * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; 52412: 347c 000b moveaw #11,%a2 } _Thread_Enable_dispatch(); 52416: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> 5241c: 6004 bras 52422 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5241e: 347c 0004 moveaw #4,%a2 } 52422: 200a movel %a2,%d0 52424: 246e fff4 moveal %fp@(-12),%a2 52428: 266e fff8 moveal %fp@(-8),%a3 5242c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000524f0 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 524f0: 4e56 ffe4 linkw %fp,#-28 524f4: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 524f8: 262e 0008 movel %fp@(8),%d3 524fc: 242e 000c movel %fp@(12),%d2 52500: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 52504: 2679 0007 6274 moveal 76274 <_Timer_server>,%a3 if ( !timer_server ) 5250a: 4a8b tstl %a3 5250c: 6700 00cc beqw 525da return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 52510: 4a39 0007 5ff8 tstb 75ff8 <_TOD+0x14> 52516: 6700 00c6 beqw 525de return RTEMS_NOT_DEFINED; if ( !routine ) 5251a: 4a84 tstl %d4 5251c: 6700 00c4 beqw 525e2 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 52520: 2f02 movel %d2,%sp@- 52522: 4eb9 0004 f77c jsr 4f77c <_TOD_Validate> 52528: 588f addql #4,%sp 5252a: 4a00 tstb %d0 5252c: 6606 bnes 52534 return RTEMS_INVALID_CLOCK; 5252e: 7014 moveq #20,%d0 52530: 6000 00b6 braw 525e8 seconds = _TOD_To_seconds( wall_time ); 52534: 2f02 movel %d2,%sp@- 52536: 49f9 0006 618c lea 6618c <__divdi3>,%a4 5253c: 4eb9 0004 f6d8 jsr 4f6d8 <_TOD_To_seconds> 52542: 2400 movel %d0,%d2 52544: 2f3c 3b9a ca00 movel #1000000000,%sp@- 5254a: 42a7 clrl %sp@- 5254c: 2f39 0007 5fe8 movel 75fe8 <_TOD+0x4>,%sp@- 52552: 2f39 0007 5fe4 movel 75fe4 <_TOD>,%sp@- 52558: 4e94 jsr %a4@ if ( seconds <= _TOD_Seconds_since_epoch() ) 5255a: 4fef 0014 lea %sp@(20),%sp 5255e: b282 cmpl %d2,%d1 52560: 64cc bccs 5252e 52562: 486e fffc pea %fp@(-4) 52566: 2f03 movel %d3,%sp@- 52568: 4879 0007 623c pea 7623c <_Timer_Information> 5256e: 4eb9 0005 4b30 jsr 54b30 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 52574: 4fef 000c lea %sp@(12),%sp 52578: 2440 moveal %d0,%a2 5257a: 4aae fffc tstl %fp@(-4) 5257e: 6666 bnes 525e6 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 52580: 486a 0010 pea %a2@(16) 52584: 4eb9 0005 64c8 jsr 564c8 <_Watchdog_Remove> the_watchdog->user_data = user_data; 5258a: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 52590: 7003 moveq #3,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 52592: 42aa 0018 clrl %a2@(24) 52596: 2540 0038 movel %d0,%a2@(56) the_watchdog->routine = routine; 5259a: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 5259e: 2543 0030 movel %d3,%a2@(48) 525a2: 2f3c 3b9a ca00 movel #1000000000,%sp@- 525a8: 42a7 clrl %sp@- 525aa: 2f39 0007 5fe8 movel 75fe8 <_TOD+0x4>,%sp@- 525b0: 2f39 0007 5fe4 movel 75fe4 <_TOD>,%sp@- 525b6: 4e94 jsr %a4@ 525b8: 4fef 0010 lea %sp@(16),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 525bc: 9481 subl %d1,%d2 525be: 2542 001c movel %d2,%a2@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 525c2: 2f0a movel %a2,%sp@- 525c4: 2f0b movel %a3,%sp@- 525c6: 206b 0004 moveal %a3@(4),%a0 525ca: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 525cc: 4eb9 0005 5774 jsr 55774 <_Thread_Enable_dispatch> 525d2: 4fef 000c lea %sp@(12),%sp return RTEMS_SUCCESSFUL; 525d6: 4280 clrl %d0 525d8: 600e bras 525e8 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 525da: 700e moveq #14,%d0 525dc: 600a bras 525e8 if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; 525de: 700b moveq #11,%d0 <== NOT EXECUTED 525e0: 6006 bras 525e8 <== NOT EXECUTED if ( !routine ) return RTEMS_INVALID_ADDRESS; 525e2: 7009 moveq #9,%d0 525e4: 6002 bras 525e8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 525e6: 7004 moveq #4,%d0 } 525e8: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 525ee: 4e5e unlk %fp ... =============================================================================== 00046d18 : void rtems_workspace_greedy_free( void *opaque ) { 46d18: 4e56 0000 linkw %fp,#0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 46d1c: 2239 0005 e6fa movel 5e6fa <_Thread_Dispatch_disable_level>,%d1 ++level; 46d22: 5281 addql #1,%d1 46d24: 202e 0008 movel %fp@(8),%d0 _Thread_Dispatch_disable_level = level; 46d28: 23c1 0005 e6fa movel %d1,5e6fa <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Heap_Greedy_free( &_Workspace_Area, opaque ); 46d2e: 2f00 movel %d0,%sp@- 46d30: 4879 0005 e70a pea 5e70a <_Workspace_Area> 46d36: 4eb9 0004 7764 jsr 47764 <_Heap_Greedy_free> _Thread_Enable_dispatch(); 46d3c: 508f addql #8,%sp } 46d3e: 4e5e unlk %fp void rtems_workspace_greedy_free( void *opaque ) { _Thread_Disable_dispatch(); _Heap_Greedy_free( &_Workspace_Area, opaque ); _Thread_Enable_dispatch(); 46d40: 4ef9 0004 8bd0 jmp 48bd0 <_Thread_Enable_dispatch> ...