=============================================================================== 0004d1fc : * 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; 4d1fc: 41f9 0006 1a24 lea 61a24 ,%a0 #include uint32_t TOD_MICROSECONDS_TO_TICKS( uint32_t microseconds ) { 4d202: 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; 4d206: 202e 0008 movel %fp@(8),%d0 4d20a: 4c50 0001 remul %a0@,%d1,%d0 4d20e: 4c50 0000 remul %a0@,%d0,%d0 if ( (microseconds % microseconds_per_tick) != 0 ) 4d212: 4a81 tstl %d1 4d214: 6702 beqs 4d218 <== ALWAYS TAKEN ticks += 1; 4d216: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 4d218: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048cdc : #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 48cdc: 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(); 48ce0: 2039 0005 d6c4 movel 5d6c4 ,%d0 #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 48ce6: 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(); 48ce8: 243c 0000 03e8 movel #1000,%d2 48cee: 4c42 0000 remul %d2,%d0,%d0 ticks = milliseconds / milliseconds_per_tick; 48cf2: 242e 0008 movel %fp@(8),%d2 48cf6: 4c40 2001 remul %d0,%d1,%d2 48cfa: 4c40 2002 remul %d0,%d2,%d2 48cfe: 2002 movel %d2,%d0 if ( (milliseconds % milliseconds_per_tick) != 0 ) 48d00: 4a81 tstl %d1 48d02: 6702 beqs 48d06 <== ALWAYS TAKEN ticks += 1; 48d04: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 48d06: 241f movel %sp@+,%d2 48d08: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047f08 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 47f08: 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; 47f0c: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 ++level; 47f12: 5280 addql #1,%d0 47f14: 206e 0008 moveal %fp@(8),%a0 _Thread_Dispatch_disable_level = level; 47f18: 23c0 0005 fa06 movel %d0,5fa06 <_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( 47f1e: 42a7 clrl %sp@- 47f20: 2f28 0008 movel %a0@(8),%sp@- 47f24: 4868 0010 pea %a0@(16) 47f28: 4eb9 0004 8298 jsr 48298 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 47f2e: 4fef 000c lea %sp@(12),%sp } 47f32: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 47f34: 4ef9 0004 9c44 jmp 49c44 <_Thread_Enable_dispatch> ... =============================================================================== 00047de2 <_API_extensions_Add_post_switch>: void _API_extensions_Add_post_switch( API_extensions_Post_switch_control *post_switch ) { 47de2: 4e56 0000 linkw %fp,#0 47de6: 206e 0008 moveal %fp@(8),%a0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 47dea: 4a90 tstl %a0@ 47dec: 6704 beqs 47df2 <_API_extensions_Add_post_switch+0x10> _Chain_Append_if_is_off_chain_unprotected( &_API_extensions_Post_switch_list, &post_switch->Node ); } 47dee: 4e5e unlk %fp 47df0: 4e75 rts 47df2: 4aa8 0004 tstl %a0@(4) 47df6: 66f6 bnes 47dee <_API_extensions_Add_post_switch+0xc><== NEVER TAKEN Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 47df8: 2279 0005 fa82 moveal 5fa82 <_API_extensions_Post_switch_list+0x8>,%a1 47dfe: 4e5e unlk %fp the_node->next = tail; 47e00: 20bc 0005 fa7e movel #391806,%a0@ tail->previous = the_node; 47e06: 23c8 0005 fa82 movel %a0,5fa82 <_API_extensions_Post_switch_list+0x8> old_last->next = the_node; 47e0c: 2288 movel %a0,%a1@ the_node->previous = old_last; 47e0e: 2149 0004 movel %a1,%a0@(4) =============================================================================== 00047e14 <_API_extensions_Run_postdriver>: } } #endif void _API_extensions_Run_postdriver( void ) { 47e14: 4e56 0000 linkw %fp,#0 47e18: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 47e1a: 2479 0005 fb2a moveal 5fb2a <_API_extensions_List>,%a2 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 47e20: b5fc 0005 fb2e cmpal #391982,%a2 47e26: 6710 beqs 47e38 <_API_extensions_Run_postdriver+0x24><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 47e28: 206a 0008 moveal %a2@(8),%a0 47e2c: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 47e2e: 2452 moveal %a2@,%a2 void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 47e30: b5fc 0005 fb2e cmpal #391982,%a2 47e36: 66f0 bnes 47e28 <_API_extensions_Run_postdriver+0x14><== NEVER TAKEN #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 47e38: 246e fffc moveal %fp@(-4),%a2 47e3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f30c <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4f30c: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4f312: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4f316: 2279 0006 2092 moveal 62092 <_Per_CPU_Information+0xe>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4f31c: 48d7 001c moveml %d2-%d4,%sp@ 4f320: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4f324: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4f328: 242e 000c movel %fp@(12),%d2 4f32c: 262e 0014 movel %fp@(20),%d3 4f330: 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 ); 4f334: 40c1 movew %sr,%d1 4f336: 8081 orl %d1,%d0 4f338: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4f33a: 2028 0048 movel %a0@(72),%d0 4f33e: 5280 addql #1,%d0 4f340: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4f344: 4aa8 0040 tstl %a0@(64) 4f348: 6606 bnes 4f350 <_CORE_barrier_Wait+0x44> if ( the_barrier->number_of_waiting_threads == 4f34a: b0a8 0044 cmpl %a0@(68),%d0 4f34e: 672e beqs 4f37e <_CORE_barrier_Wait+0x72> 4f350: 7001 moveq #1,%d0 4f352: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4f356: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 4f35a: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 4f35e: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4f360: 2d43 000c movel %d3,%fp@(12) 4f364: 203c 0004 bee0 movel #311008,%d0 4f36a: 2d48 0008 movel %a0,%fp@(8) } 4f36e: 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 ); 4f372: 2d40 0010 movel %d0,%fp@(16) } 4f376: 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 ); 4f378: 4ef9 0004 bb10 jmp 4bb10 <_Thread_queue_Enqueue_with_handler> _ISR_Disable( level ); the_barrier->number_of_waiting_threads++; 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; 4f37e: 7001 moveq #1,%d0 4f380: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4f384: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4f386: 2d44 0010 movel %d4,%fp@(16) 4f38a: 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 ); } 4f38e: 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 ); 4f392: 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 ); } 4f396: 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 ); 4f398: 4ef9 0004 f2d0 jmp 4f2d0 <_CORE_barrier_Release> ... =============================================================================== 00058830 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 58830: 4e56 ffe4 linkw %fp,#-28 58834: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 58838: 266e 0008 moveal %fp@(8),%a3 5883c: 282e 000c movel %fp@(12),%d4 58840: 242e 0010 movel %fp@(16),%d2 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 58844: b4ab 004c cmpl %a3@(76),%d2 58848: 6266 bhis 588b0 <_CORE_message_queue_Broadcast+0x80> * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 5884a: 4aab 0048 tstl %a3@(72) 5884e: 664e bnes 5889e <_CORE_message_queue_Broadcast+0x6e> /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 58850: 2f0b movel %a3,%sp@- 58852: 49f9 0005 b554 lea 5b554 <_Thread_queue_Dequeue>,%a4 * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 58858: 4283 clrl %d3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 5885a: 4bf9 0005 fe18 lea 5fe18 ,%a5 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 58860: 4e94 jsr %a4@ 58862: 588f addql #4,%sp 58864: 2440 moveal %d0,%a2 58866: 4a80 tstl %d0 58868: 6722 beqs 5888c <_CORE_message_queue_Broadcast+0x5c> 5886a: 2f02 movel %d2,%sp@- _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 5886c: 5283 addql #1,%d3 5886e: 2f04 movel %d4,%sp@- 58870: 2f2a 002c movel %a2@(44),%sp@- 58874: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 58876: 206a 0028 moveal %a2@(40),%a0 5887a: 4fef 000c lea %sp@(12),%sp 5887e: 2082 movel %d2,%a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 58880: 2f0b movel %a3,%sp@- 58882: 4e94 jsr %a4@ 58884: 588f addql #4,%sp 58886: 2440 moveal %d0,%a2 58888: 4a80 tstl %d0 5888a: 66de bnes 5886a <_CORE_message_queue_Broadcast+0x3a><== NEVER TAKEN if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 5888c: 206e 001c moveal %fp@(28),%a0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 58890: 4280 clrl %d0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 58892: 2083 movel %d3,%a0@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 58894: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 5889a: 4e5e unlk %fp 5889c: 4e75 rts * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 5889e: 206e 001c moveal %fp@(28),%a0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 588a2: 4280 clrl %d0 #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 588a4: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 588aa: 4290 clrl %a0@ #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 588ac: 4e5e unlk %fp 588ae: 4e75 rts Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 588b0: 7001 moveq #1,%d0 #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 588b2: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 588b8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000552f4 <_CORE_message_queue_Close>: void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 552f4: 4e56 0000 linkw %fp,#0 552f8: 2f0a movel %a2,%sp@- /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 552fa: 2f2e 0010 movel %fp@(16),%sp@- 552fe: 2f2e 000c movel %fp@(12),%sp@- void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 55302: 246e 0008 moveal %fp@(8),%a2 /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 55306: 2f0a movel %a2,%sp@- 55308: 4eb9 0005 0118 jsr 50118 <_Thread_queue_Flush> * This removes all messages from the pending message queue. Since * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) 5530e: 4fef 000c lea %sp@(12),%sp 55312: 4aaa 0048 tstl %a2@(72) 55316: 6612 bnes 5532a <_CORE_message_queue_Close+0x36> (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 55318: 2d6a 005c 0008 movel %a2@(92),%fp@(8) } 5531e: 246e fffc moveal %fp@(-4),%a2 55322: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 55324: 4ef9 0005 09ec jmp 509ec <_Workspace_Free> * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 5532a: 2f0a movel %a2,%sp@- 5532c: 4eb9 0005 5348 jsr 55348 <_CORE_message_queue_Flush_support> (void) _Workspace_Free( the_message_queue->message_buffers ); 55332: 2d6a 005c 0008 movel %a2@(92),%fp@(8) * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 55338: 588f addql #4,%sp (void) _Workspace_Free( the_message_queue->message_buffers ); } 5533a: 246e fffc moveal %fp@(-4),%a2 5533e: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 55340: 4ef9 0005 09ec jmp 509ec <_Workspace_Free> ... =============================================================================== 000507c0 <_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)) { 507c0: 7203 moveq #3,%d1 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 ) { 507c2: 4e56 ffe4 linkw %fp,#-28 507c6: 202e 0014 movel %fp@(20),%d0 507ca: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 507ce: 246e 0008 moveal %fp@(8),%a2 507d2: 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)) { 507d6: c280 andl %d0,%d1 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 507d8: 2544 0044 movel %d4,%a2@(68) the_message_queue->number_of_pending_messages = 0; 507dc: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 507e0: 2540 004c movel %d0,%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)) { 507e4: 4a81 tstl %d1 507e6: 6718 beqs 50800 <_CORE_message_queue_Initialize+0x40> allocated_message_size += sizeof(uintptr_t); 507e8: 2200 movel %d0,%d1 507ea: 5881 addql #4,%d1 allocated_message_size &= ~(sizeof(uintptr_t) - 1); 507ec: 74fc moveq #-4,%d2 507ee: c282 andl %d2,%d1 /* * 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) 507f0: b280 cmpl %d0,%d1 507f2: 640e bccs 50802 <_CORE_message_queue_Initialize+0x42> STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 507f4: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 /* * 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) return false; 507fa: 4200 clrb %d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 507fc: 4e5e unlk %fp 507fe: 4e75 rts /* * 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)) { 50800: 2200 movel %d0,%d1 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 50802: 2a01 movel %d1,%d5 50804: 0685 0000 0010 addil #16,%d5 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 5080a: 2f05 movel %d5,%sp@- if ( x > SIZE_MAX ) 5080c: 4286 clrl %d6 5080e: 7eff moveq #-1,%d7 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 50810: 42a7 clrl %sp@- 50812: 2f04 movel %d4,%sp@- 50814: 42a7 clrl %sp@- 50816: 4eb9 0006 3584 jsr 63584 <__muldi3> 5081c: 4fef 0010 lea %sp@(16),%sp 50820: 2400 movel %d0,%d2 50822: 2601 movel %d1,%d3 if ( x > SIZE_MAX ) 50824: 9e83 subl %d3,%d7 50826: 9d82 subxl %d2,%d6 50828: 6dca blts 507f4 <_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 ); 5082a: 2f01 movel %d1,%sp@- 5082c: 4eb9 0005 3694 jsr 53694 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 50832: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 50834: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 50838: 67ba beqs 507f4 <_CORE_message_queue_Initialize+0x34><== NEVER TAKEN /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 5083a: 2f05 movel %d5,%sp@- */ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority( CORE_message_queue_Attributes *the_attribute ) { return 5083c: 7e01 moveq #1,%d7 5083e: 2f04 movel %d4,%sp@- 50840: 2f00 movel %d0,%sp@- 50842: 486a 0060 pea %a2@(96) 50846: 4eb9 0005 0758 jsr 50758 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 5084c: 4878 0006 pea 6 50850: 206e 000c moveal %fp@(12),%a0 50854: be90 cmpl %a0@,%d7 50856: 57c0 seq %d0 50858: 4878 0080 pea 80 5085c: 49c0 extbl %d0 5085e: 4480 negl %d0 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 ); 50860: 41ea 0054 lea %a2@(84),%a0 50864: 2f00 movel %d0,%sp@- 50866: 2548 0050 movel %a0,%a2@(80) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 5086a: 41ea 0050 lea %a2@(80),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 5086e: 42aa 0054 clrl %a2@(84) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 50872: 2548 0058 movel %a0,%a2@(88) 50876: 2f0a movel %a2,%sp@- 50878: 4eb9 0005 2e90 jsr 52e90 <_Thread_queue_Initialize> 5087e: 4fef 0020 lea %sp@(32),%sp STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 50882: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 50888: 7001 moveq #1,%d0 } 5088a: 4e5e unlk %fp ... =============================================================================== 00050890 <_CORE_message_queue_Seize>: CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 50890: 203c 0000 0700 movel #1792,%d0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 50896: 4e56 ffe4 linkw %fp,#-28 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 5089a: 2079 0006 91a6 moveal 691a6 <_Per_CPU_Information+0xe>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 508a0: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 508a4: 246e 0008 moveal %fp@(8),%a2 508a8: 282e 000c movel %fp@(12),%d4 508ac: 242e 0010 movel %fp@(16),%d2 508b0: 226e 0014 moveal %fp@(20),%a1 508b4: 2a2e 001c movel %fp@(28),%d5 508b8: 1c2e 001b moveb %fp@(27),%d6 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 508bc: 42a8 0034 clrl %a0@(52) _ISR_Disable( level ); 508c0: 40c1 movew %sr,%d1 508c2: 8081 orl %d1,%d0 508c4: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 508c6: 260a movel %a2,%d3 508c8: 200a movel %a2,%d0 508ca: 0683 0000 0050 addil #80,%d3 508d0: 0680 0000 0054 addil #84,%d0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 508d6: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 508da: b08b cmpl %a3,%d0 508dc: 674a beqs 50928 <_CORE_message_queue_Seize+0x98> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 508de: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 508e0: 2143 0004 movel %d3,%a0@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; 508e4: 53aa 0048 subql #1,%a2@(72) Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 508e8: 2548 0050 movel %a0,%a2@(80) _ISR_Enable( level ); 508ec: 46c1 movew %d1,%sr *size_p = the_message->Contents.size; 508ee: 22ab 0008 movel %a3@(8),%a1@ RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 508f2: 45ea 0060 lea %a2@(96),%a2 _Thread_Executing->Wait.count = 508f6: 2079 0006 91a6 moveal 691a6 <_Per_CPU_Information+0xe>,%a0 508fc: 42a8 0024 clrl %a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 50900: 2f11 movel %a1@,%sp@- 50902: 486b 000c pea %a3@(12) 50906: 2f02 movel %d2,%sp@- 50908: 4eb9 0005 76b8 jsr 576b8 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 5090e: 4fef 000c lea %sp@(12),%sp 50912: 2d4a 0008 movel %a2,%fp@(8) 50916: 2d4b 000c movel %a3,%fp@(12) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 5091a: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 50920: 4e5e unlk %fp 50922: 4ef9 0005 06e4 jmp 506e4 <_Chain_Append> return; } #endif } if ( !wait ) { 50928: 4a06 tstb %d6 5092a: 6612 bnes 5093e <_CORE_message_queue_Seize+0xae> _ISR_Enable( level ); 5092c: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 5092e: 7004 moveq #4,%d0 executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 50930: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 50936: 2140 0034 movel %d0,%a0@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 5093a: 4e5e unlk %fp 5093c: 4e75 rts RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 5093e: 7001 moveq #1,%d0 50940: 2540 0030 movel %d0,%a2@(48) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 50944: 2142 002c movel %d2,%a0@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 50948: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; 5094c: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 50950: 2149 0028 movel %a1,%a0@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 50954: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 50956: 2d45 000c movel %d5,%fp@(12) 5095a: 203c 0005 2f90 movel #339856,%d0 50960: 2d4a 0008 movel %a2,%fp@(8) } 50964: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 5096a: 2d40 0010 movel %d0,%fp@(16) } 5096e: 4e5e unlk %fp executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 50970: 4ef9 0005 2bc0 jmp 52bc0 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 000481ac <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 481ac: 4e56 0000 linkw %fp,#0 * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) 481b0: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 481b6: 2f0a movel %a2,%sp@- 481b8: 246e 0008 moveal %fp@(8),%a2 481bc: 2f02 movel %d2,%sp@- 481be: 142e 0013 moveb %fp@(19),%d2 481c2: 4a80 tstl %d0 481c4: 6768 beqs 4822e <_CORE_mutex_Seize+0x82> _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 481c6: 4a02 tstb %d2 481c8: 6700 0098 beqw 48262 <_CORE_mutex_Seize+0xb6> 481cc: 7001 moveq #1,%d0 481ce: b0b9 0005 fb6c cmpl 5fb6c <_System_state_Current>,%d0 481d4: 6500 00b2 bcsw 48288 <_CORE_mutex_Seize+0xdc> 481d8: 486e 0018 pea %fp@(24) 481dc: 2f0a movel %a2,%sp@- 481de: 4eb9 0004 c5ac jsr 4c5ac <_CORE_mutex_Seize_interrupt_trylock> 481e4: 508f addql #8,%sp 481e6: 4a80 tstl %d0 481e8: 6738 beqs 48222 <_CORE_mutex_Seize+0x76> <== ALWAYS 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; 481ea: 7001 moveq #1,%d0 481ec: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 481f2: 2540 0030 movel %d0,%a2@(48) * * 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; 481f6: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 ++level; 481fc: 5280 addql #1,%d0 481fe: 216e 000c 0020 movel %fp@(12),%a0@(32) 48204: 214a 0044 movel %a2,%a0@(68) _Thread_Dispatch_disable_level = level; 48208: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> 4820e: 202e 0018 movel %fp@(24),%d0 48212: 46c0 movew %d0,%sr 48214: 2f2e 0014 movel %fp@(20),%sp@- 48218: 2f0a movel %a2,%sp@- 4821a: 4eb9 0004 8114 jsr 48114 <_CORE_mutex_Seize_interrupt_blocking> 48220: 508f addql #8,%sp } 48222: 242e fff8 movel %fp@(-8),%d2 48226: 246e fffc moveal %fp@(-4),%a2 4822a: 4e5e unlk %fp 4822c: 4e75 rts bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 4822e: 486e 0018 pea %fp@(24) 48232: 2f0a movel %a2,%sp@- 48234: 4eb9 0004 c5ac jsr 4c5ac <_CORE_mutex_Seize_interrupt_trylock> 4823a: 508f addql #8,%sp 4823c: 4a80 tstl %d0 4823e: 67e2 beqs 48222 <_CORE_mutex_Seize+0x76> 48240: 4a02 tstb %d2 48242: 66a6 bnes 481ea <_CORE_mutex_Seize+0x3e> 48244: 202e 0018 movel %fp@(24),%d0 48248: 46c0 movew %d0,%sr 4824a: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 48250: 7001 moveq #1,%d0 48252: 2140 0034 movel %d0,%a0@(52) } 48256: 242e fff8 movel %fp@(-8),%d2 4825a: 246e fffc moveal %fp@(-4),%a2 4825e: 4e5e unlk %fp 48260: 4e75 rts bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 48262: 486e 0018 pea %fp@(24) 48266: 2f0a movel %a2,%sp@- 48268: 4eb9 0004 c5ac jsr 4c5ac <_CORE_mutex_Seize_interrupt_trylock> 4826e: 508f addql #8,%sp 48270: 4a80 tstl %d0 48272: 67ae beqs 48222 <_CORE_mutex_Seize+0x76> <== ALWAYS TAKEN 48274: 202e 0018 movel %fp@(24),%d0 <== NOT EXECUTED 48278: 46c0 movew %d0,%sr <== NOT EXECUTED 4827a: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 <== NOT EXECUTED 48280: 7001 moveq #1,%d0 <== NOT EXECUTED 48282: 2140 0034 movel %d0,%a0@(52) <== NOT EXECUTED 48286: 60ce bras 48256 <_CORE_mutex_Seize+0xaa> <== NOT EXECUTED 48288: 4878 0012 pea 12 4828c: 42a7 clrl %sp@- 4828e: 42a7 clrl %sp@- 48290: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> ... =============================================================================== 000483ec <_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 ) { 483ec: 4e56 0000 linkw %fp,#0 483f0: 2f0a movel %a2,%sp@- 483f2: 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)) ) { 483f6: 2f0a movel %a2,%sp@- 483f8: 4eb9 0004 9fb0 jsr 49fb0 <_Thread_queue_Dequeue> 483fe: 588f addql #4,%sp 48400: 4a80 tstl %d0 48402: 670a beqs 4840e <_CORE_semaphore_Surrender+0x22> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 48404: 246e fffc moveal %fp@(-4),%a2 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 48408: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 4840a: 4e5e unlk %fp 4840c: 4e75 rts if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 4840e: 303c 0700 movew #1792,%d0 48412: 40c1 movew %sr,%d1 48414: 8081 orl %d1,%d0 48416: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 48418: 202a 0048 movel %a2@(72),%d0 4841c: b0aa 0040 cmpl %a2@(64),%d0 48420: 6412 bccs 48434 <_CORE_semaphore_Surrender+0x48> <== NEVER TAKEN the_semaphore->count += 1; 48422: 5280 addql #1,%d0 48424: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 48428: 4280 clrl %d0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 4842a: 46c1 movew %d1,%sr } return status; } 4842c: 246e fffc moveal %fp@(-4),%a2 48430: 4e5e unlk %fp 48432: 4e75 rts } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 48434: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 48436: 46c1 movew %d1,%sr <== NOT EXECUTED 48438: 60f2 bras 4842c <_CORE_semaphore_Surrender+0x40> <== NOT EXECUTED ... =============================================================================== 00047fb0 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 47fb0: 4e56 ffec linkw %fp,#-20 47fb4: 202e 0010 movel %fp@(16),%d0 47fb8: 48d7 043c moveml %d2-%d5/%a2,%sp@ 47fbc: 246e 0008 moveal %fp@(8),%a2 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 47fc0: 2600 movel %d0,%d3 size_t node_size ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 47fc2: 280a movel %a2,%d4 47fc4: 5884 addql #4,%d4 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 47fc6: 5383 subql #1,%d3 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 47fc8: 242e 000c movel %fp@(12),%d2 47fcc: 222e 0014 movel %fp@(20),%d1 Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 47fd0: 42aa 0004 clrl %a2@(4) while ( count-- ) { 47fd4: 4a80 tstl %d0 47fd6: 672e beqs 48006 <_Chain_Initialize+0x56> <== NEVER TAKEN 47fd8: 2003 movel %d3,%d0 47fda: 2042 moveal %d2,%a0 47fdc: 224a moveal %a2,%a1 current->next = next; 47fde: 2288 movel %a0,%a1@ Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 47fe0: 5380 subql #1,%d0 47fe2: 7aff moveq #-1,%d5 current->next = next; next->previous = current; 47fe4: 2149 0004 movel %a1,%a0@(4) 47fe8: 2248 moveal %a0,%a1 current = next; next = (Chain_Node *) 47fea: d1c1 addal %d1,%a0 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 47fec: ba80 cmpl %d0,%d5 47fee: 66ee bnes 47fde <_Chain_Initialize+0x2e> #include #include #include #include void _Chain_Initialize( 47ff0: 4c03 1800 mulsl %d3,%d1 47ff4: 2042 moveal %d2,%a0 47ff6: d1c1 addal %d1,%a0 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 47ff8: 2084 movel %d4,%a0@ tail->previous = current; 47ffa: 2548 0008 movel %a0,%a2@(8) } 47ffe: 4cd7 043c moveml %sp@,%d2-%d5/%a2 48002: 4e5e unlk %fp 48004: 4e75 rts ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 48006: 204a moveal %a2,%a0 <== NOT EXECUTED current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 48008: 2084 movel %d4,%a0@ <== NOT EXECUTED tail->previous = current; 4800a: 2548 0008 movel %a0,%a2@(8) <== NOT EXECUTED } 4800e: 4cd7 043c moveml %sp@,%d2-%d5/%a2 <== NOT EXECUTED 48012: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 00046fa8 <_Event_Surrender>: rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 46fa8: 223c 0000 0700 movel #1792,%d1 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 46fae: 4e56 ffe4 linkw %fp,#-28 46fb2: 202e 000c movel %fp@(12),%d0 46fb6: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 46fba: 246e 0008 moveal %fp@(8),%a2 46fbe: 206e 0010 moveal %fp@(16),%a0 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; 46fc2: 2a2a 0030 movel %a2@(48),%d5 rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 46fc6: 226e 0014 moveal %fp@(20),%a1 46fca: 282e 0018 movel %fp@(24),%d4 rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 46fce: 40c3 movew %sr,%d3 46fd0: 8283 orl %d3,%d1 46fd2: 46c1 movew %d1,%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; 46fd4: 8090 orl %a0@,%d0 46fd6: 2080 movel %d0,%a0@ _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 46fd8: 242a 0024 movel %a2@(36),%d2 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 ); 46fdc: 2200 movel %d0,%d1 46fde: c282 andl %d2,%d1 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 46fe0: 6700 0090 beqw 47072 <_Event_Surrender+0xca> /* * 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() && 46fe4: 4ab9 0005 fb78 tstl 5fb78 <_Per_CPU_Information+0x8> 46fea: 6708 beqs 46ff4 <_Event_Surrender+0x4c> 46fec: b5f9 0005 fb7e cmpal 5fb7e <_Per_CPU_Information+0xe>,%a2 46ff2: 6754 beqs 47048 <_Event_Surrender+0xa0> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 46ff4: c8aa 0010 andl %a2@(16),%d4 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 46ff8: 6778 beqs 47072 <_Event_Surrender+0xca> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 46ffa: b282 cmpl %d2,%d1 46ffc: 6706 beqs 47004 <_Event_Surrender+0x5c> 46ffe: 0805 0001 btst #1,%d5 47002: 676e beqs 47072 <_Event_Surrender+0xca> <== NEVER TAKEN 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) ); 47004: 2401 movel %d1,%d2 47006: 4682 notl %d2 47008: c480 andl %d0,%d2 4700a: 2082 movel %d2,%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; 4700c: 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; 47010: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 47014: 2081 movel %d1,%a0@ _ISR_Flash( level ); 47016: 203c 0000 0700 movel #1792,%d0 4701c: 46c3 movew %d3,%sr 4701e: 8083 orl %d3,%d0 47020: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 47022: 7002 moveq #2,%d0 47024: b0aa 0050 cmpl %a2@(80),%d0 47028: 6754 beqs 4707e <_Event_Surrender+0xd6> _ISR_Enable( level ); 4702a: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4702c: 2d4a 0008 movel %a2,%fp@(8) 47030: 2e3c 1007 fff8 movel #268959736,%d7 47036: 2d47 000c movel %d7,%fp@(12) } return; } } _ISR_Enable( level ); } 4703a: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 47040: 4e5e unlk %fp 47042: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 47048: 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 ) && 4704a: 7e01 moveq #1,%d7 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 4704c: 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 ) && 4704e: be86 cmpl %d6,%d7 47050: 65a2 bcss 46ff4 <_Event_Surrender+0x4c> <== 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) ) { 47052: b282 cmpl %d2,%d1 47054: 6706 beqs 4705c <_Event_Surrender+0xb4> 47056: 0805 0001 btst #1,%d5 4705a: 6716 beqs 47072 <_Event_Surrender+0xca> <== NEVER TAKEN 4705c: 2401 movel %d1,%d2 4705e: 4682 notl %d2 47060: c480 andl %d0,%d2 pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 47062: 7003 moveq #3,%d0 47064: 2082 movel %d2,%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; 47066: 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; 4706a: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4706e: 2081 movel %d1,%a0@ *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 47070: 2280 movel %d0,%a1@ _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 47072: 46c3 movew %d3,%sr } 47074: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 4707a: 4e5e unlk %fp 4707c: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4707e: 7003 moveq #3,%d0 47080: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 47084: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 47086: 486a 0048 pea %a2@(72) 4708a: 2e3c 1007 fff8 movel #268959736,%d7 47090: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 47096: 588f addql #4,%sp 47098: 2d47 000c movel %d7,%fp@(12) 4709c: 2d4a 0008 movel %a2,%fp@(8) } return; } } _ISR_Enable( level ); } 470a0: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 470a6: 4e5e unlk %fp 470a8: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> ... =============================================================================== 000470b0 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 470b0: 4e56 fffc linkw %fp,#-4 470b4: 2f02 movel %d2,%sp@- ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 470b6: 486e fffc pea %fp@(-4) 470ba: 2f2e 0008 movel %fp@(8),%sp@- 470be: 4eb9 0004 9c64 jsr 49c64 <_Thread_Get> switch ( location ) { 470c4: 508f addql #8,%sp 470c6: 4aae fffc tstl %fp@(-4) 470ca: 6642 bnes 4710e <_Event_Timeout+0x5e> <== 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 ); 470cc: 223c 0000 0700 movel #1792,%d1 470d2: 40c2 movew %sr,%d2 470d4: 8282 orl %d2,%d1 470d6: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 470d8: 2040 moveal %d0,%a0 470da: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 470de: b0b9 0005 fb7e cmpl 5fb7e <_Per_CPU_Information+0xe>,%d0 470e4: 6730 beqs 47116 <_Event_Timeout+0x66> if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 470e6: 7206 moveq #6,%d1 470e8: 2040 moveal %d0,%a0 470ea: 2141 0034 movel %d1,%a0@(52) _ISR_Enable( level ); 470ee: 46c2 movew %d2,%sr 470f0: 2f3c 1007 fff8 movel #268959736,%sp@- 470f6: 2f00 movel %d0,%sp@- 470f8: 4eb9 0004 9844 jsr 49844 <_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; 470fe: 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; 47100: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 --level; 47106: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 47108: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 4710e: 242e fff8 movel %fp@(-8),%d2 47112: 4e5e unlk %fp 47114: 4e75 rts } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 47116: 206e 000c moveal %fp@(12),%a0 4711a: 7201 moveq #1,%d1 4711c: b290 cmpl %a0@,%d1 4711e: 66c6 bnes 470e6 <_Event_Timeout+0x36> *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 47120: 7202 moveq #2,%d1 47122: 2081 movel %d1,%a0@ } the_thread->Wait.return_code = RTEMS_TIMEOUT; 47124: 7206 moveq #6,%d1 47126: 2040 moveal %d0,%a0 47128: 2141 0034 movel %d1,%a0@(52) _ISR_Enable( level ); 4712c: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4712e: 2f3c 1007 fff8 movel #268959736,%sp@- 47134: 2f00 movel %d0,%sp@- 47136: 4eb9 0004 9844 jsr 49844 <_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; 4713c: 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; 4713e: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 --level; 47144: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 47146: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> 4714c: 60c0 bras 4710e <_Event_Timeout+0x5e> ... =============================================================================== 0004c6b0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4c6b0: 4e56 ffc4 linkw %fp,#-60 4c6b4: 226e 000c moveal %fp@(12),%a1 4c6b8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4c6bc: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 4c6c0: 2c09 movel %a1,%d6 4c6c2: 5886 addql #4,%d6 - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 4c6c4: 202a 0010 movel %a2@(16),%d0 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4c6c8: 262e 0010 movel %fp@(16),%d3 4c6cc: 2a2e 0014 movel %fp@(20),%d5 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 4c6d0: 2d40 fffc movel %d0,%fp@(-4) Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 4c6d4: bc89 cmpl %a1,%d6 4c6d6: 6500 0164 bcsw 4c83c <_Heap_Allocate_aligned_with_boundary+0x18c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4c6da: 4a85 tstl %d5 4c6dc: 670c beqs 4c6ea <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4c6de: ba89 cmpl %a1,%d5 4c6e0: 6500 015a bcsw 4c83c <_Heap_Allocate_aligned_with_boundary+0x18c> return NULL; } if ( alignment == 0 ) { 4c6e4: 4a83 tstl %d3 4c6e6: 6602 bnes 4c6ea <_Heap_Allocate_aligned_with_boundary+0x3a> alignment = page_size; 4c6e8: 2600 movel %d0,%d3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4c6ea: 206a 0008 moveal %a2@(8),%a0 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4c6ee: 4284 clrl %d4 4c6f0: b1ca cmpal %a2,%a0 4c6f2: 6732 beqs 4c726 <_Heap_Allocate_aligned_with_boundary+0x76> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4c6f4: 222e fffc movel %fp@(-4),%d1 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4c6f8: 7404 moveq #4,%d2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4c6fa: 5e81 addql #7,%d1 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4c6fc: 9489 subl %a1,%d2 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4c6fe: 2d41 fff8 movel %d1,%fp@(-8) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4c702: 2d42 fff4 movel %d2,%fp@(-12) /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4c706: 2028 0004 movel %a0@(4),%d0 4c70a: b086 cmpl %d6,%d0 4c70c: 632e blss 4c73c <_Heap_Allocate_aligned_with_boundary+0x8c> if ( alignment == 0 ) { 4c70e: 4a83 tstl %d3 4c710: 6636 bnes 4c748 <_Heap_Allocate_aligned_with_boundary+0x98> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4c712: 2408 movel %a0,%d2 4c714: 5082 addql #8,%d2 ); } } /* Statistics */ ++search_count; 4c716: 5284 addql #1,%d4 if ( alloc_begin != 0 ) { 4c718: 4a82 tstl %d2 4c71a: 6600 00f4 bnew 4c810 <_Heap_Allocate_aligned_with_boundary+0x160> break; } block = block->next; 4c71e: 2068 0008 moveal %a0@(8),%a0 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4c722: b1ca cmpal %a2,%a0 4c724: 66e0 bnes 4c706 <_Heap_Allocate_aligned_with_boundary+0x56> ); } } /* Statistics */ ++search_count; 4c726: 4280 clrl %d0 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4c728: b8aa 0044 cmpl %a2@(68),%d4 4c72c: 6304 blss 4c732 <_Heap_Allocate_aligned_with_boundary+0x82> stats->max_search = search_count; 4c72e: 2544 0044 movel %d4,%a2@(68) } return (void *) alloc_begin; } 4c732: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 4c738: 4e5e unlk %fp 4c73a: 4e75 rts if ( alloc_begin != 0 ) { break; } block = block->next; 4c73c: 2068 0008 moveal %a0@(8),%a0 ); } } /* Statistics */ ++search_count; 4c740: 5284 addql #1,%d4 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4c742: b1ca cmpal %a2,%a0 4c744: 66c0 bnes 4c706 <_Heap_Allocate_aligned_with_boundary+0x56> 4c746: 60de bras 4c726 <_Heap_Allocate_aligned_with_boundary+0x76> - 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; 4c748: 7efe moveq #-2,%d7 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4c74a: 49e8 0008 lea %a0@(8),%a4 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4c74e: c087 andl %d7,%d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4c750: 266a 0014 moveal %a2@(20),%a3 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4c754: d088 addl %a0,%d0 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4c756: 222e fff8 movel %fp@(-8),%d1 4c75a: 928b subl %a3,%d1 uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 4c75c: 242e fff4 movel %fp@(-12),%d2 4c760: d480 addl %d0,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4c762: 2e02 movel %d2,%d7 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4c764: d081 addl %d1,%d0 4c766: 4c43 7001 remul %d3,%d1,%d7 4c76a: 9481 subl %d1,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4c76c: b480 cmpl %d0,%d2 4c76e: 630a blss 4c77a <_Heap_Allocate_aligned_with_boundary+0xca> 4c770: 2400 movel %d0,%d2 4c772: 4c43 2001 remul %d3,%d1,%d2 4c776: 2400 movel %d0,%d2 4c778: 9481 subl %d1,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4c77a: 4a85 tstl %d5 4c77c: 6766 beqs 4c7e4 <_Heap_Allocate_aligned_with_boundary+0x134> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4c77e: 2202 movel %d2,%d1 4c780: d289 addl %a1,%d1 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4c782: 4bf4 9800 lea %a4@(00000000,%a1:l),%a5 4c786: 2001 movel %d1,%d0 4c788: 4c45 0007 remul %d5,%d7,%d0 4c78c: 2d4d ffec movel %a5,%fp@(-20) 4c790: 2a41 moveal %d1,%a5 4c792: 9bc7 subal %d7,%a5 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4c794: bbc2 cmpal %d2,%a5 4c796: 634c blss 4c7e4 <_Heap_Allocate_aligned_with_boundary+0x134> 4c798: bbc1 cmpal %d1,%a5 4c79a: 6448 bccs 4c7e4 <_Heap_Allocate_aligned_with_boundary+0x134> if ( boundary_line < boundary_floor ) { 4c79c: bbee ffec cmpal %fp@(-20),%a5 4c7a0: 6500 008e bcsw 4c830 <_Heap_Allocate_aligned_with_boundary+0x180> 4c7a4: 200d movel %a5,%d0 4c7a6: 2a44 moveal %d4,%a5 4c7a8: 2e2e ffec movel %fp@(-20),%d7 return 0; } alloc_begin = boundary_line - alloc_size; 4c7ac: 9089 subl %a1,%d0 4c7ae: 2400 movel %d0,%d2 4c7b0: 4c43 2001 remul %d3,%d1,%d2 4c7b4: 2400 movel %d0,%d2 4c7b6: 9481 subl %d1,%d2 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4c7b8: 2202 movel %d2,%d1 4c7ba: d289 addl %a1,%d1 4c7bc: 2801 movel %d1,%d4 4c7be: 4c45 4000 remul %d5,%d0,%d4 4c7c2: 2801 movel %d1,%d4 4c7c4: 9880 subl %d0,%d4 4c7c6: 2004 movel %d4,%d0 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4c7c8: b882 cmpl %d2,%d4 4c7ca: 6316 blss 4c7e2 <_Heap_Allocate_aligned_with_boundary+0x132> 4c7cc: b881 cmpl %d1,%d4 4c7ce: 6412 bccs 4c7e2 <_Heap_Allocate_aligned_with_boundary+0x132> if ( boundary_line < boundary_floor ) { 4c7d0: b087 cmpl %d7,%d0 4c7d2: 64d8 bccs 4c7ac <_Heap_Allocate_aligned_with_boundary+0xfc><== ALWAYS TAKEN 4c7d4: 280d movel %a5,%d4 <== NOT EXECUTED return 0; 4c7d6: 4282 clrl %d2 <== NOT EXECUTED ); } } /* Statistics */ ++search_count; 4c7d8: 5284 addql #1,%d4 <== NOT EXECUTED if ( alloc_begin != 0 ) { 4c7da: 4a82 tstl %d2 <== NOT EXECUTED 4c7dc: 6700 ff40 beqw 4c71e <_Heap_Allocate_aligned_with_boundary+0x6e><== NOT EXECUTED 4c7e0: 602e bras 4c810 <_Heap_Allocate_aligned_with_boundary+0x160><== NOT EXECUTED 4c7e2: 280d movel %a5,%d4 boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 4c7e4: b48c cmpl %a4,%d2 4c7e6: 6548 bcss 4c830 <_Heap_Allocate_aligned_with_boundary+0x180> 4c7e8: 70f8 moveq #-8,%d0 4c7ea: 9088 subl %a0,%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4c7ec: 2a40 moveal %d0,%a5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4c7ee: 2e02 movel %d2,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4c7f0: dbc2 addal %d2,%a5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4c7f2: 202e fffc movel %fp@(-4),%d0 4c7f6: 4c40 7001 remul %d0,%d1,%d7 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4c7fa: 9bc1 subal %d1,%a5 if ( free_size >= min_block_size || free_size == 0 ) { 4c7fc: bbcb cmpal %a3,%a5 4c7fe: 6400 ff16 bccw 4c716 <_Heap_Allocate_aligned_with_boundary+0x66> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; 4c802: 4a8d tstl %a5 4c804: 57c0 seq %d0 ); } } /* Statistics */ ++search_count; 4c806: 5284 addql #1,%d4 uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; 4c808: 49c0 extbl %d0 4c80a: c480 andl %d0,%d2 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 4c80c: 6700 ff10 beqw 4c71e <_Heap_Allocate_aligned_with_boundary+0x6e> if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4c810: 2f09 movel %a1,%sp@- search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 4c812: 52aa 0048 addql #1,%a2@(72) stats->searches += search_count; 4c816: d9aa 004c addl %d4,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4c81a: 2f02 movel %d2,%sp@- 4c81c: 2f08 movel %a0,%sp@- 4c81e: 2f0a movel %a2,%sp@- 4c820: 4eb9 0004 8800 jsr 48800 <_Heap_Block_allocate> 4c826: 4fef 0010 lea %sp@(16),%sp 4c82a: 2002 movel %d2,%d0 4c82c: 6000 fefa braw 4c728 <_Heap_Allocate_aligned_with_boundary+0x78> uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; 4c830: 4282 clrl %d2 ); } } /* Statistics */ ++search_count; 4c832: 5284 addql #1,%d4 if ( alloc_begin != 0 ) { 4c834: 4a82 tstl %d2 4c836: 6700 fee6 beqw 4c71e <_Heap_Allocate_aligned_with_boundary+0x6e> 4c83a: 60d4 bras 4c810 <_Heap_Allocate_aligned_with_boundary+0x160><== NOT EXECUTED uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 4c83c: 4280 clrl %d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4c83e: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 4c844: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c848 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4c848: 4e56 ffe8 linkw %fp,#-24 4c84c: 206e 0008 moveal %fp@(8),%a0 4c850: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4c854: 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 ) { 4c858: 6700 00ba beqw 4c914 <_Heap_Free+0xcc> 4c85c: 2240 moveal %d0,%a1 4c85e: 5189 subql #8,%a1 4c860: 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 4c866: 2028 0020 movel %a0@(32),%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4c86a: 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; 4c86c: b089 cmpl %a1,%d0 4c86e: 6200 009a bhiw 4c90a <_Heap_Free+0xc2> 4c872: 2228 0024 movel %a0@(36),%d1 4c876: b289 cmpl %a1,%d1 4c878: 6500 0090 bcsw 4c90a <_Heap_Free+0xc2> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c87c: 2829 0004 movel %a1@(4),%d4 - 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; 4c880: 74fe moveq #-2,%d2 4c882: c484 andl %d4,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4c884: 45f1 2800 lea %a1@(00000000,%d2: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; 4c888: b5c0 cmpal %d0,%a2 4c88a: 657e bcss 4c90a <_Heap_Free+0xc2> <== NEVER TAKEN 4c88c: b5c1 cmpal %d1,%a2 4c88e: 627a bhis 4c90a <_Heap_Free+0xc2> <== NEVER TAKEN 4c890: 262a 0004 movel %a2@(4),%d3 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4c894: 0803 0000 btst #0,%d3 4c898: 6770 beqs 4c90a <_Heap_Free+0xc2> <== NEVER TAKEN - 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; 4c89a: 7afe moveq #-2,%d5 4c89c: c685 andl %d5,%d3 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4c89e: b5c1 cmpal %d1,%a2 4c8a0: 6700 00b2 beqw 4c954 <_Heap_Free+0x10c> 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; 4c8a4: 7a01 moveq #1,%d5 4c8a6: cab2 3804 andl %a2@(00000004,%d3:l),%d5 4c8aa: 6600 00a8 bnew 4c954 <_Heap_Free+0x10c> if ( !_Heap_Is_prev_used( block ) ) { 4c8ae: 0804 0000 btst #0,%d4 4c8b2: 666a bnes 4c91e <_Heap_Free+0xd6> 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 4c8b4: 7a01 moveq #1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; 4c8b6: 2811 movel %a1@,%d4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4c8b8: 93c4 subal %d4,%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; 4c8ba: b3c0 cmpal %d0,%a1 4c8bc: 654c bcss 4c90a <_Heap_Free+0xc2> <== NEVER TAKEN 4c8be: b3c1 cmpal %d1,%a1 4c8c0: 6248 bhis 4c90a <_Heap_Free+0xc2> <== 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; 4c8c2: 7001 moveq #1,%d0 4c8c4: c0a9 0004 andl %a1@(4),%d0 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) ) { 4c8c8: 6740 beqs 4c90a <_Heap_Free+0xc2> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4c8ca: 4a05 tstb %d5 4c8cc: 6700 00de beqw 4c9ac <_Heap_Free+0x164> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c8d0: 266a 0008 moveal %a2@(8),%a3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4c8d4: d882 addl %d2,%d4 4c8d6: d684 addl %d4,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c8d8: 7001 moveq #1,%d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c8da: 246a 000c moveal %a2@(12),%a2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4c8de: 254b 0008 movel %a3,%a2@(8) 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; 4c8e2: 8083 orl %d3,%d0 next->prev = prev; 4c8e4: 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; 4c8e8: 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; 4c8ec: 2383 3800 movel %d3,%a1@(00000000,%d3: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; 4c8f0: 2340 0004 movel %d0,%a1@(4) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c8f4: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4c8f8: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4c8fc: d5a8 0030 addl %d2,%a0@(48) return( true ); 4c900: 7001 moveq #1,%d0 } 4c902: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4c906: 4e5e unlk %fp 4c908: 4e75 rts 4c90a: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 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; 4c90e: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c910: 4e5e unlk %fp 4c912: 4e75 rts 4c914: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 * 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; 4c918: 7001 moveq #1,%d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c91a: 4e5e unlk %fp 4c91c: 4e75 rts 4c91e: 266a 0008 moveal %a2@(8),%a3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 4c922: d682 addl %d2,%d3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c924: 7001 moveq #1,%d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4c926: 246a 000c moveal %a2@(12),%a2 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; 4c92a: 8083 orl %d3,%d0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4c92c: 234b 0008 movel %a3,%a1@(8) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4c930: 2383 3800 movel %d3,%a1@(00000000,%d3:l) new_block->prev = prev; 4c934: 234a 000c movel %a2,%a1@(12) 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; 4c938: 2340 0004 movel %d0,%a1@(4) /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4c93c: 7001 moveq #1,%d0 next->prev = new_block; prev->next = new_block; 4c93e: 2549 0008 movel %a1,%a2@(8) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4c942: 2749 000c movel %a1,%a3@(12) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c946: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4c94a: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4c94e: d5a8 0030 addl %d2,%a0@(48) 4c952: 60ae bras 4c902 <_Heap_Free+0xba> next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4c954: 0804 0000 btst #0,%d4 4c958: 6606 bnes 4c960 <_Heap_Free+0x118> 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 4c95a: 4205 clrb %d5 4c95c: 6000 ff58 braw 4c8b6 <_Heap_Free+0x6e> 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; /* Statistics */ ++stats->free_blocks; 4c960: 2028 0038 movel %a0@(56),%d0 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; 4c964: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c966: 7afe moveq #-2,%d5 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4c968: 5280 addql #1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4c96a: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4c96e: 2348 000c movel %a0,%a1@(12) 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; 4c972: 8282 orl %d2,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4c974: 234b 0008 movel %a3,%a1@(8) 4c978: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c97c: cbaa 0004 andl %d5,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4c980: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4c984: 2482 movel %d2,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4c986: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4c98a: 2140 0038 movel %d0,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4c98e: b0a8 003c cmpl %a0@(60),%d0 4c992: 6300 ff60 blsw 4c8f4 <_Heap_Free+0xac> stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c996: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4c99a: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4c99e: d5a8 0030 addl %d2,%a0@(48) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 4c9a2: 2140 003c movel %d0,%a0@(60) /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4c9a6: 7001 moveq #1,%d0 4c9a8: 6000 ff58 braw 4c902 <_Heap_Free+0xba> 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; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 4c9ac: d882 addl %d2,%d4 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c9ae: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c9b0: 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; 4c9b2: 8284 orl %d4,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4c9b4: 2484 movel %d4,%a2@ /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4c9b6: 7001 moveq #1,%d0 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; 4c9b8: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c9bc: cbaa 0004 andl %d5,%a2@(4) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c9c0: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4c9c4: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4c9c8: d5a8 0030 addl %d2,%a0@(48) 4c9cc: 6000 ff34 braw 4c902 <_Heap_Free+0xba> =============================================================================== 00051b08 <_Heap_Get_free_information>: void _Heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { 51b08: 4e56 fff0 linkw %fp,#-16 51b0c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 51b10: 266e 0008 moveal %fp@(8),%a3 51b14: 246e 000c moveal %fp@(12),%a2 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 51b18: 206b 0008 moveal %a3@(8),%a0 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 51b1c: 4292 clrl %a2@ info->largest = 0; 51b1e: 42aa 0004 clrl %a2@(4) info->total = 0; 51b22: 42aa 0008 clrl %a2@(8) for(the_block = _Heap_Free_list_first(the_heap); 51b26: b1cb cmpal %a3,%a0 51b28: 6732 beqs 51b5c <_Heap_Get_free_information+0x54><== NEVER TAKEN 51b2a: 327c 0001 moveaw #1,%a1 51b2e: 4282 clrl %d2 51b30: 4281 clrl %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; 51b32: 70fe moveq #-2,%d0 51b34: 2609 movel %a1,%d3 51b36: 5283 addql #1,%d3 51b38: c0a8 0004 andl %a0@(4),%d0 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 51b3c: d280 addl %d0,%d1 if ( info->largest < the_size ) 51b3e: b480 cmpl %d0,%d2 51b40: 6404 bccs 51b46 <_Heap_Get_free_information+0x3e> info->largest = the_size; 51b42: 2540 0004 movel %d0,%a2@(4) info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 51b46: 2068 0008 moveal %a0@(8),%a0 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 51b4a: b1cb cmpal %a3,%a0 51b4c: 6708 beqs 51b56 <_Heap_Get_free_information+0x4e> 51b4e: 242a 0004 movel %a2@(4),%d2 51b52: 2243 moveal %d3,%a1 51b54: 60dc bras 51b32 <_Heap_Get_free_information+0x2a> 51b56: 2489 movel %a1,%a2@ 51b58: 2541 0008 movel %d1,%a2@(8) info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 51b5c: 4cd7 0c0c moveml %sp@,%d2-%d3/%a2-%a3 51b60: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004aa48 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4aa48: 4e56 ffe8 linkw %fp,#-24 4aa4c: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4aa50: 246e 0008 moveal %fp@(8),%a2 4aa54: 242e 0010 movel %fp@(16),%d2 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4aa58: 6700 00ca beqw 4ab24 <_Heap_Greedy_allocate+0xdc> 4aa5c: 2a6e 000c moveal %fp@(12),%a5 4aa60: 97cb subal %a3,%a3 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; 4aa62: 99cc subal %a4,%a4 4aa64: 263c 0005 1610 movel #333328,%d3 * @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 ); 4aa6a: 42a7 clrl %sp@- 4aa6c: 2043 moveal %d3,%a0 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4aa6e: 528b addql #1,%a3 4aa70: 42a7 clrl %sp@- 4aa72: 2f1d movel %a5@+,%sp@- 4aa74: 2f0a movel %a2,%sp@- 4aa76: 4e90 jsr %a0@ void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 4aa78: 4fef 0010 lea %sp@(16),%sp RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4aa7c: 2040 moveal %d0,%a0 4aa7e: 5188 subql #8,%a0 4aa80: 4a80 tstl %d0 4aa82: 670e beqs 4aa92 <_Heap_Greedy_allocate+0x4a> <== NEVER TAKEN 4aa84: 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); 4aa8a: 91c1 subal %d1,%a0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 4aa8c: 214c 0008 movel %a4,%a0@(8) 4aa90: 2848 moveal %a0,%a4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4aa92: b48b cmpl %a3,%d2 4aa94: 66d4 bnes 4aa6a <_Heap_Greedy_allocate+0x22> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4aa96: 266a 0008 moveal %a2@(8),%a3 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4aa9a: b7ca cmpal %a2,%a3 4aa9c: 6700 008c beqw 4ab2a <_Heap_Greedy_allocate+0xe2> - 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; 4aaa0: 70fe moveq #-2,%d0 4aaa2: 4bf9 0004 ae20 lea 4ae20 <_Heap_Block_allocate>,%a5 4aaa8: 4282 clrl %d2 4aaaa: c0ab 0004 andl %a3@(4),%d0 _Heap_Block_allocate( 4aaae: 2040 moveal %d0,%a0 4aab0: 4868 fff8 pea %a0@(-8) 4aab4: 486b 0008 pea %a3@(8) 4aab8: 2f0b movel %a3,%sp@- 4aaba: 2f0a movel %a2,%sp@- 4aabc: 4e95 jsr %a5@ next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4aabe: 4fef 0010 lea %sp@(16),%sp current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 4aac2: 2742 0008 movel %d2,%a3@(8) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4aac6: 202a 0008 movel %a2@(8),%d0 4aaca: 240b movel %a3,%d2 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4aacc: b08a cmpl %a2,%d0 4aace: 672a beqs 4aafa <_Heap_Greedy_allocate+0xb2> 4aad0: 2640 moveal %d0,%a3 - 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; 4aad2: 70fe moveq #-2,%d0 4aad4: c0ab 0004 andl %a3@(4),%d0 _Heap_Block_allocate( 4aad8: 2040 moveal %d0,%a0 4aada: 4868 fff8 pea %a0@(-8) 4aade: 486b 0008 pea %a3@(8) 4aae2: 2f0b movel %a3,%sp@- 4aae4: 2f0a movel %a2,%sp@- 4aae6: 4e95 jsr %a5@ next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4aae8: 4fef 0010 lea %sp@(16),%sp current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 4aaec: 2742 0008 movel %d2,%a3@(8) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4aaf0: 202a 0008 movel %a2@(8),%d0 4aaf4: 240b movel %a3,%d2 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4aaf6: b08a cmpl %a2,%d0 4aaf8: 66d6 bnes 4aad0 <_Heap_Greedy_allocate+0x88> 4aafa: 4bf9 0005 17a8 lea 517a8 <_Heap_Free>,%a5 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4ab00: 4a8c tstl %a4 4ab02: 6714 beqs 4ab18 <_Heap_Greedy_allocate+0xd0> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 4ab04: 222c 0008 movel %a4@(8),%d1 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4ab08: 486c 0008 pea %a4@(8) blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 4ab0c: 2841 moveal %d1,%a4 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4ab0e: 2f0a movel %a2,%sp@- 4ab10: 4e95 jsr %a5@ current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4ab12: 508f addql #8,%sp 4ab14: 4a8c tstl %a4 4ab16: 66ec bnes 4ab04 <_Heap_Greedy_allocate+0xbc> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 4ab18: 200b movel %a3,%d0 4ab1a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4ab20: 4e5e unlk %fp 4ab22: 4e75 rts 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; 4ab24: 99cc subal %a4,%a4 4ab26: 6000 ff6e braw 4aa96 <_Heap_Greedy_allocate+0x4e> next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4ab2a: 97cb subal %a3,%a3 <== NOT EXECUTED 4ab2c: 4bf9 0005 17a8 lea 517a8 <_Heap_Free>,%a5 <== NOT EXECUTED current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4ab32: 4a8c tstl %a4 <== NOT EXECUTED 4ab34: 66ce bnes 4ab04 <_Heap_Greedy_allocate+0xbc> <== NOT EXECUTED 4ab36: 60e0 bras 4ab18 <_Heap_Greedy_allocate+0xd0> <== NOT EXECUTED =============================================================================== 0004ab38 <_Heap_Greedy_free>: void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { 4ab38: 4e56 fff4 linkw %fp,#-12 4ab3c: 206e 000c moveal %fp@(12),%a0 4ab40: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ab44: 262e 0008 movel %fp@(8),%d3 4ab48: 45f9 0005 17a8 lea 517a8 <_Heap_Free>,%a2 while ( blocks != NULL ) { 4ab4e: 4a88 tstl %a0 4ab50: 6714 beqs 4ab66 <_Heap_Greedy_free+0x2e> <== NEVER TAKEN Heap_Block *current = blocks; blocks = blocks->next; 4ab52: 2428 0008 movel %a0@(8),%d2 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4ab56: 4868 0008 pea %a0@(8) 4ab5a: 2f03 movel %d3,%sp@- 4ab5c: 4e92 jsr %a2@ void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 4ab5e: 508f addql #8,%sp Heap_Block *current = blocks; blocks = blocks->next; 4ab60: 2042 moveal %d2,%a0 void _Heap_Greedy_free( Heap_Control *heap, Heap_Block *blocks ) { while ( blocks != NULL ) { 4ab62: 4a82 tstl %d2 4ab64: 66ec bnes 4ab52 <_Heap_Greedy_free+0x1a> Heap_Block *current = blocks; blocks = blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } } 4ab66: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ab6c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00051bc0 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 51bc0: 4e56 fff0 linkw %fp,#-16 51bc4: 226e 0008 moveal %fp@(8),%a1 51bc8: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 51bcc: 266e 000c moveal %fp@(12),%a3 51bd0: 262e 0010 movel %fp@(16),%d3 Heap_Block *current = heap->first_block; 51bd4: 2069 0020 moveal %a1@(32),%a0 Heap_Block *end = heap->last_block; 51bd8: 2429 0024 movel %a1@(36),%d2 bool stop = false; while ( !stop && current != end ) { 51bdc: b488 cmpl %a0,%d2 51bde: 6728 beqs 51c08 <_Heap_Iterate+0x48> <== NEVER TAKEN 51be0: 70fe moveq #-2,%d0 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 ); 51be2: 7201 moveq #1,%d1 51be4: c0a8 0004 andl %a0@(4),%d0 51be8: 2f03 movel %d3,%sp@- RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 51bea: 45f0 0800 lea %a0@(00000000,%d0:l),%a2 51bee: c2aa 0004 andl %a2@(4),%d1 51bf2: 2f01 movel %d1,%sp@- 51bf4: 2f00 movel %d0,%sp@- 51bf6: 2f08 movel %a0,%sp@- 51bf8: 4e93 jsr %a3@ { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 51bfa: 4fef 0010 lea %sp@(16),%sp 51bfe: 204a moveal %a2,%a0 51c00: 4a00 tstb %d0 51c02: 6604 bnes 51c08 <_Heap_Iterate+0x48> <== NEVER TAKEN 51c04: b5c2 cmpal %d2,%a2 51c06: 66d8 bnes 51be0 <_Heap_Iterate+0x20> stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 51c08: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 51c0e: 4e5e unlk %fp ... =============================================================================== 0005c2b0 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5c2b0: 4e56 0000 linkw %fp,#0 5c2b4: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5c2b8: 2040 moveal %d0,%a0 5c2ba: 5188 subql #8,%a0 5c2bc: 226e 0008 moveal %fp@(8),%a1 5c2c0: 2f02 movel %d2,%sp@- 5c2c2: 2400 movel %d0,%d2 5c2c4: 4c69 2001 0010 remul %a1@(16),%d1,%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5c2ca: 91c1 subal %d1,%a0 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 5c2cc: 2229 0020 movel %a1@(32),%d1 && (uintptr_t) block <= (uintptr_t) heap->last_block; 5c2d0: b288 cmpl %a0,%d1 5c2d2: 6238 bhis 5c30c <_Heap_Size_of_alloc_area+0x5c> 5c2d4: 2269 0024 moveal %a1@(36),%a1 5c2d8: b3c8 cmpal %a0,%a1 5c2da: 6530 bcss 5c30c <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN - 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; 5c2dc: 74fe moveq #-2,%d2 5c2de: c4a8 0004 andl %a0@(4),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5c2e2: 41f0 2800 lea %a0@(00000000,%d2: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; 5c2e6: b1c1 cmpal %d1,%a0 5c2e8: 6522 bcss 5c30c <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN 5c2ea: b1c9 cmpal %a1,%a0 5c2ec: 621e bhis 5c30c <_Heap_Size_of_alloc_area+0x5c> <== 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; 5c2ee: 7201 moveq #1,%d1 5c2f0: c2a8 0004 andl %a0@(4),%d1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5c2f4: 6716 beqs 5c30c <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5c2f6: 7204 moveq #4,%d1 5c2f8: 9280 subl %d0,%d1 5c2fa: 2001 movel %d1,%d0 5c2fc: d088 addl %a0,%d0 5c2fe: 226e 0010 moveal %fp@(16),%a1 return true; } 5c302: 241f movel %sp@+,%d2 5c304: 4e5e unlk %fp || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5c306: 2280 movel %d0,%a1@ return true; 5c308: 7001 moveq #1,%d0 } 5c30a: 4e75 rts 5c30c: 241f movel %sp@+,%d2 5c30e: 4e5e unlk %fp 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; 5c310: 4200 clrb %d0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } =============================================================================== 000490ce <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 490ce: 4e56 ffc8 linkw %fp,#-56 490d2: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 490d6: 246e 0008 moveal %fp@(8),%a2 uintptr_t const page_size = heap->page_size; 490da: 242a 0010 movel %a2@(16),%d2 uintptr_t const min_block_size = heap->min_block_size; 490de: 262a 0014 movel %a2@(20),%d3 Heap_Block *const first_block = heap->first_block; 490e2: 266a 0020 moveal %a2@(32),%a3 Heap_Block *const last_block = heap->last_block; 490e6: 2a6a 0024 moveal %a2@(36),%a5 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 490ea: 4a2e 0013 tstb %fp@(19) 490ee: 671a beqs 4910a <_Heap_Walk+0x3c> 490f0: 49fa ff86 lea %pc@(49078 <_Heap_Walk_print>),%a4 if ( !_System_state_Is_up( _System_state_Get() ) ) { 490f4: 7003 moveq #3,%d0 490f6: b0b9 0006 1d44 cmpl 61d44 <_System_state_Current>,%d0 490fc: 671a beqs 49118 <_Heap_Walk+0x4a> <== ALWAYS TAKEN block = next_block; } while ( block != first_block ); return true; } 490fe: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 } block = next_block; } while ( block != first_block ); return true; 49104: 7001 moveq #1,%d0 } 49106: 4e5e unlk %fp 49108: 4e75 rts uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 4910a: 49fa ff64 lea %pc@(49070 <_Heap_Walk_print_nothing>),%a4 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4910e: 7003 moveq #3,%d0 49110: b0b9 0006 1d44 cmpl 61d44 <_System_state_Current>,%d0 49116: 66e6 bnes 490fe <_Heap_Walk+0x30> 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)( 49118: 2f2a 000c movel %a2@(12),%sp@- 4911c: 2f2a 0008 movel %a2@(8),%sp@- 49120: 2f0d movel %a5,%sp@- 49122: 2f0b movel %a3,%sp@- 49124: 2f2a 001c movel %a2@(28),%sp@- 49128: 2f2a 0018 movel %a2@(24),%sp@- 4912c: 2f03 movel %d3,%sp@- 4912e: 2f02 movel %d2,%sp@- 49130: 4879 0005 e292 pea 5e292 <_Copyright_Notice+0x94> 49136: 42a7 clrl %sp@- 49138: 2f2e 000c movel %fp@(12),%sp@- 4913c: 4e94 jsr %a4@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4913e: 4fef 002c lea %sp@(44),%sp 49142: 4a82 tstl %d2 49144: 677e beqs 491c4 <_Heap_Walk+0xf6> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 49146: 7003 moveq #3,%d0 49148: c082 andl %d2,%d0 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 4914a: 6600 0090 bnew 491dc <_Heap_Walk+0x10e> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4914e: 2203 movel %d3,%d1 49150: 4c42 1000 remul %d2,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 49154: 4a80 tstl %d0 49156: 6600 009e bnew 491f6 <_Heap_Walk+0x128> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4915a: 200b movel %a3,%d0 4915c: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4915e: 4c42 0001 remul %d2,%d1,%d0 ); return false; } if ( 49162: 4a81 tstl %d1 49164: 6600 00aa bnew 49210 <_Heap_Walk+0x142> block = next_block; } while ( block != first_block ); return true; } 49168: 202b 0004 movel %a3@(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; 4916c: 7801 moveq #1,%d4 4916e: c880 andl %d0,%d4 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 49170: 6700 00ba beqw 4922c <_Heap_Walk+0x15e> - 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; 49174: 72fe moveq #-2,%d1 49176: c2ad 0004 andl %a5@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4917a: 41f5 1800 lea %a5@(00000000,%d1:l),%a0 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; 4917e: 7201 moveq #1,%d1 49180: c2a8 0004 andl %a0@(4),%d1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 49184: 6726 beqs 491ac <_Heap_Walk+0xde> ); return false; } if ( 49186: b1cb cmpal %a3,%a0 49188: 6700 00bc beqw 49246 <_Heap_Walk+0x178> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 4918c: 4879 0005 e3ec pea 5e3ec <_Copyright_Notice+0x1ee> 49192: 4878 0001 pea 1 49196: 2f2e 000c movel %fp@(12),%sp@- 4919a: 4e94 jsr %a4@ 4919c: 4fef 000c lea %sp@(12),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 491a0: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 491a2: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 491a8: 4e5e unlk %fp 491aa: 4e75 rts return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 491ac: 4879 0005 e3d7 pea 5e3d7 <_Copyright_Notice+0x1d9> 491b2: 4878 0001 pea 1 491b6: 2f2e 000c movel %fp@(12),%sp@- 491ba: 4e94 jsr %a4@ 491bc: 4fef 000c lea %sp@(12),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 491c0: 4200 clrb %d0 491c2: 60de bras 491a2 <_Heap_Walk+0xd4> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 491c4: 4879 0005 e323 pea 5e323 <_Copyright_Notice+0x125> 491ca: 4878 0001 pea 1 491ce: 2f2e 000c movel %fp@(12),%sp@- 491d2: 4e94 jsr %a4@ 491d4: 4fef 000c lea %sp@(12),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 491d8: 4200 clrb %d0 491da: 60c6 bras 491a2 <_Heap_Walk+0xd4> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 491dc: 2f02 movel %d2,%sp@- 491de: 4879 0005 e336 pea 5e336 <_Copyright_Notice+0x138> 491e4: 4878 0001 pea 1 491e8: 2f2e 000c movel %fp@(12),%sp@- 491ec: 4e94 jsr %a4@ 491ee: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 491f2: 4200 clrb %d0 491f4: 60ac bras 491a2 <_Heap_Walk+0xd4> return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 491f6: 2f03 movel %d3,%sp@- 491f8: 4879 0005 e354 pea 5e354 <_Copyright_Notice+0x156> 491fe: 4878 0001 pea 1 49202: 2f2e 000c movel %fp@(12),%sp@- 49206: 4e94 jsr %a4@ 49208: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 4920c: 4200 clrb %d0 4920e: 6092 bras 491a2 <_Heap_Walk+0xd4> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 49210: 2f0b movel %a3,%sp@- 49212: 4879 0005 e378 pea 5e378 <_Copyright_Notice+0x17a> 49218: 4878 0001 pea 1 4921c: 2f2e 000c movel %fp@(12),%sp@- 49220: 4e94 jsr %a4@ 49222: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49226: 4200 clrb %d0 49228: 6000 ff78 braw 491a2 <_Heap_Walk+0xd4> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 4922c: 4879 0005 e3a9 pea 5e3a9 <_Copyright_Notice+0x1ab> 49232: 4878 0001 pea 1 49236: 2f2e 000c movel %fp@(12),%sp@- 4923a: 4e94 jsr %a4@ 4923c: 4fef 000c lea %sp@(12),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49240: 4200 clrb %d0 49242: 6000 ff5e braw 491a2 <_Heap_Walk+0xd4> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 49246: 222a 0010 movel %a2@(16),%d1 4924a: 2d41 fffc movel %d1,%fp@(-4) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4924e: 206a 0008 moveal %a2@(8),%a0 block = next_block; } while ( block != first_block ); return true; } 49252: 222a 0020 movel %a2@(32),%d1 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 ) { 49256: b1ca cmpal %a2,%a0 49258: 6700 00c6 beqw 49320 <_Heap_Walk+0x252> 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; 4925c: b1c1 cmpal %d1,%a0 4925e: 6500 009c bcsw 492fc <_Heap_Walk+0x22e> 49262: 2a2a 0024 movel %a2@(36),%d5 49266: 2d45 fff0 movel %d5,%fp@(-16) 4926a: b1c5 cmpal %d5,%a0 4926c: 6200 008e bhiw 492fc <_Heap_Walk+0x22e> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 49270: 43e8 0008 lea %a0@(8),%a1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 49274: 2c09 movel %a1,%d6 49276: 2e2e fffc movel %fp@(-4),%d7 4927a: 4c47 6005 remul %d7,%d5,%d6 ); return false; } if ( 4927e: 4a85 tstl %d5 49280: 6600 02b8 bnew 4953a <_Heap_Walk+0x46c> - 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; 49284: 7afe moveq #-2,%d5 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; 49286: 7c01 moveq #1,%d6 - 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; 49288: caa8 0004 andl %a0@(4),%d5 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; 4928c: ccb0 5804 andl %a0@(00000004,%d5:l),%d6 ); return false; } if ( _Heap_Is_used( free_block ) ) { 49290: 664e bnes 492e0 <_Heap_Walk+0x212> <== NEVER TAKEN 49292: 2e2e fff0 movel %fp@(-16),%d7 49296: 224a moveal %a2,%a1 49298: 2c08 movel %a0,%d6 4929a: 2d42 fff8 movel %d2,%fp@(-8) 4929e: 2d40 fff4 movel %d0,%fp@(-12) ); return false; } if ( free_block->prev != prev_block ) { 492a2: 2a28 000c movel %a0@(12),%d5 492a6: b3c5 cmpal %d5,%a1 492a8: 6600 02ac bnew 49556 <_Heap_Walk+0x488> return false; } prev_block = free_block; free_block = free_block->next; 492ac: 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 ) { 492b0: b1ca cmpal %a2,%a0 492b2: 6764 beqs 49318 <_Heap_Walk+0x24a> 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; 492b4: b288 cmpl %a0,%d1 492b6: 6244 bhis 492fc <_Heap_Walk+0x22e> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 492b8: 2408 movel %a0,%d2 492ba: 5082 addql #8,%d2 492bc: 2246 moveal %d6,%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; 492be: be88 cmpl %a0,%d7 492c0: 653a bcss 492fc <_Heap_Walk+0x22e> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 492c2: 202e fffc movel %fp@(-4),%d0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 492c6: 2c08 movel %a0,%d6 492c8: 4c40 2005 remul %d0,%d5,%d2 ); return false; } if ( 492cc: 4a85 tstl %d5 492ce: 6600 026a bnew 4953a <_Heap_Walk+0x46c> - 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; 492d2: 74fe moveq #-2,%d2 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; 492d4: 7001 moveq #1,%d0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 492d6: c4a8 0004 andl %a0@(4),%d2 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; 492da: c0b0 2804 andl %a0@(00000004,%d2:l),%d0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 492de: 67c2 beqs 492a2 <_Heap_Walk+0x1d4> (*printer)( 492e0: 2f08 movel %a0,%sp@- 492e2: 4879 0005 e46b pea 5e46b <_Copyright_Notice+0x26d> 492e8: 4878 0001 pea 1 492ec: 2f2e 000c movel %fp@(12),%sp@- 492f0: 4e94 jsr %a4@ 492f2: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 492f6: 4200 clrb %d0 492f8: 6000 fea8 braw 491a2 <_Heap_Walk+0xd4> 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 ) ) { (*printer)( 492fc: 2f08 movel %a0,%sp@- 492fe: 4879 0005 e41b pea 5e41b <_Copyright_Notice+0x21d> 49304: 4878 0001 pea 1 49308: 2f2e 000c movel %fp@(12),%sp@- 4930c: 4e94 jsr %a4@ 4930e: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49312: 4200 clrb %d0 49314: 6000 fe8c braw 491a2 <_Heap_Walk+0xd4> 49318: 242e fff8 movel %fp@(-8),%d2 4931c: 202e fff4 movel %fp@(-12),%d0 49320: 2d42 fffc movel %d2,%fp@(-4) 49324: 2e00 movel %d0,%d7 - 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; 49326: 74fe moveq #-2,%d2 49328: 204d moveal %a5,%a0 4932a: 2a4b moveal %a3,%a5 4932c: 2a0b movel %a3,%d5 4932e: 264a moveal %a2,%a3 49330: ce82 andl %d2,%d7 49332: 2d48 fff8 movel %a0,%fp@(-8) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 49336: 45f5 7800 lea %a5@(00000000,%d7: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; 4933a: b5c1 cmpal %d1,%a2 4933c: 6568 bcss 493a6 <_Heap_Walk+0x2d8> <== NEVER TAKEN 4933e: b5eb 0024 cmpal %a3@(36),%a2 49342: 6262 bhis 493a6 <_Heap_Walk+0x2d8> 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; 49344: bbee fff8 cmpal %fp@(-8),%a5 49348: 56c0 sne %d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4934a: 2c2e fffc movel %fp@(-4),%d6 4934e: 2407 movel %d7,%d2 49350: 4480 negl %d0 49352: 4c46 2001 remul %d6,%d1,%d2 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 49356: 4a81 tstl %d1 49358: 6700 0084 beqw 493de <_Heap_Walk+0x310> 4935c: 4a00 tstb %d0 4935e: 6664 bnes 493c4 <_Heap_Walk+0x2f6> 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; 49360: 7001 moveq #1,%d0 49362: c0aa 0004 andl %a2@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 49366: 6700 00e8 beqw 49450 <_Heap_Walk+0x382> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4936a: 4a84 tstl %d4 4936c: 6700 00c6 beqw 49434 <_Heap_Walk+0x366> (*printer)( 49370: 2f07 movel %d7,%sp@- 49372: 2f0d movel %a5,%sp@- 49374: 4879 0005 e610 pea 5e610 <_Copyright_Notice+0x412> 4937a: 42a7 clrl %sp@- 4937c: 2f2e 000c movel %fp@(12),%sp@- 49380: 4e94 jsr %a4@ 49382: 4fef 0014 lea %sp@(20),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 49386: b5c5 cmpal %d5,%a2 49388: 6700 fd74 beqw 490fe <_Heap_Walk+0x30> 4938c: 2e2a 0004 movel %a2@(4),%d7 49390: 7801 moveq #1,%d4 - 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; 49392: 74fe moveq #-2,%d2 49394: 2a4a moveal %a2,%a5 49396: c887 andl %d7,%d4 49398: ce82 andl %d2,%d7 4939a: 222b 0020 movel %a3@(32),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4939e: 45f5 7800 lea %a5@(00000000,%d7: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; 493a2: b5c1 cmpal %d1,%a2 493a4: 6498 bccs 4933e <_Heap_Walk+0x270> <== ALWAYS TAKEN Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 493a6: 2f0a movel %a2,%sp@- 493a8: 2f0d movel %a5,%sp@- 493aa: 4879 0005 e4b9 pea 5e4b9 <_Copyright_Notice+0x2bb> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 493b0: 4878 0001 pea 1 493b4: 2f2e 000c movel %fp@(12),%sp@- 493b8: 4e94 jsr %a4@ "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 493ba: 4fef 0014 lea %sp@(20),%sp 493be: 4200 clrb %d0 493c0: 6000 fde0 braw 491a2 <_Heap_Walk+0xd4> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 493c4: 2f07 movel %d7,%sp@- 493c6: 2f0d movel %a5,%sp@- 493c8: 4879 0005 e4e6 pea 5e4e6 <_Copyright_Notice+0x2e8> 493ce: 4878 0001 pea 1 493d2: 2f2e 000c movel %fp@(12),%sp@- 493d6: 4e94 jsr %a4@ "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 493d8: 4fef 0014 lea %sp@(20),%sp 493dc: 60e0 bras 493be <_Heap_Walk+0x2f0> } if ( block_size < min_block_size && is_not_last_block ) { 493de: be83 cmpl %d3,%d7 493e0: 642c bccs 4940e <_Heap_Walk+0x340> 493e2: 4a00 tstb %d0 493e4: 6700 ff7a beqw 49360 <_Heap_Walk+0x292> (*printer)( 493e8: 2f03 movel %d3,%sp@- 493ea: 2f07 movel %d7,%sp@- 493ec: 2f0d movel %a5,%sp@- 493ee: 4879 0005 e514 pea 5e514 <_Copyright_Notice+0x316> 493f4: 4878 0001 pea 1 493f8: 2f2e 000c movel %fp@(12),%sp@- 493fc: 4e94 jsr %a4@ block, block_size, min_block_size ); return false; 493fe: 4fef 0018 lea %sp@(24),%sp block = next_block; } while ( block != first_block ); return true; } 49402: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 block, block_size, min_block_size ); return false; 49408: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 4940a: 4e5e unlk %fp 4940c: 4e75 rts ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 4940e: b5cd cmpal %a5,%a2 49410: 6200 ff4e bhiw 49360 <_Heap_Walk+0x292> 49414: 4a00 tstb %d0 49416: 6700 ff48 beqw 49360 <_Heap_Walk+0x292> (*printer)( 4941a: 2f0a movel %a2,%sp@- 4941c: 2f0d movel %a5,%sp@- 4941e: 4879 0005 e53f pea 5e53f <_Copyright_Notice+0x341> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 49424: 4878 0001 pea 1 49428: 2f2e 000c movel %fp@(12),%sp@- 4942c: 4e94 jsr %a4@ "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 4942e: 4fef 0014 lea %sp@(20),%sp 49432: 608a bras 493be <_Heap_Walk+0x2f0> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 49434: 2f15 movel %a5@,%sp@- 49436: 2f07 movel %d7,%sp@- 49438: 2f0d movel %a5,%sp@- 4943a: 4879 0005 e627 pea 5e627 <_Copyright_Notice+0x429> 49440: 42a7 clrl %sp@- 49442: 2f2e 000c movel %fp@(12),%sp@- 49446: 4e94 jsr %a4@ 49448: 4fef 0018 lea %sp@(24),%sp 4944c: 6000 ff38 braw 49386 <_Heap_Walk+0x2b8> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 49450: 206b 0008 moveal %a3@(8),%a0 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 49454: 222d 0008 movel %a5@(8),%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 49458: b2ab 000c cmpl %a3@(12),%d1 4945c: 6700 00b6 beqw 49514 <_Heap_Walk+0x446> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 49460: 43f9 0005 e13e lea 5e13e ,%a1 49466: b28b cmpl %a3,%d1 49468: 676e beqs 494d8 <_Heap_Walk+0x40a> 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 ? 4946a: 202d 000c movel %a5@(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)( 4946e: b088 cmpl %a0,%d0 49470: 6700 0098 beqw 4950a <_Heap_Walk+0x43c> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 49474: 41f9 0005 e13e lea 5e13e ,%a0 4947a: b08b cmpl %a3,%d0 4947c: 6762 beqs 494e0 <_Heap_Walk+0x412> 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)( 4947e: 2f09 movel %a1,%sp@- 49480: 2f01 movel %d1,%sp@- 49482: 2f08 movel %a0,%sp@- 49484: 2f00 movel %d0,%sp@- 49486: 2f07 movel %d7,%sp@- 49488: 2f0d movel %a5,%sp@- 4948a: 4879 0005 e573 pea 5e573 <_Copyright_Notice+0x375> 49490: 42a7 clrl %sp@- 49492: 2f2e 000c movel %fp@(12),%sp@- 49496: 4e94 jsr %a4@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 49498: 2012 movel %a2@,%d0 4949a: 4fef 0024 lea %sp@(36),%sp 4949e: b087 cmpl %d7,%d0 494a0: 6646 bnes 494e8 <_Heap_Walk+0x41a> ); return false; } if ( !prev_used ) { 494a2: 4a84 tstl %d4 494a4: 6778 beqs 4951e <_Heap_Walk+0x450> 494a6: 206b 0008 moveal %a3@(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 ) { 494aa: b1cb cmpal %a3,%a0 494ac: 670e beqs 494bc <_Heap_Walk+0x3ee> <== NEVER TAKEN if ( free_block == block ) { 494ae: b1cd cmpal %a5,%a0 494b0: 6700 fed4 beqw 49386 <_Heap_Walk+0x2b8> return true; } free_block = free_block->next; 494b4: 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 ) { 494b8: b1cb cmpal %a3,%a0 494ba: 66f2 bnes 494ae <_Heap_Walk+0x3e0> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 494bc: 2f0d movel %a5,%sp@- 494be: 4879 0005 e64c pea 5e64c <_Copyright_Notice+0x44e> 494c4: 4878 0001 pea 1 494c8: 2f2e 000c movel %fp@(12),%sp@- 494cc: 4e94 jsr %a4@ 494ce: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 494d2: 4200 clrb %d0 494d4: 6000 fccc braw 491a2 <_Heap_Walk+0xd4> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 494d8: 43f9 0005 e26e lea 5e26e <_Copyright_Notice+0x70>,%a1 494de: 608a bras 4946a <_Heap_Walk+0x39c> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 494e0: 41f9 0005 e288 lea 5e288 <_Copyright_Notice+0x8a>,%a0 494e6: 6096 bras 4947e <_Heap_Walk+0x3b0> " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 494e8: 2f0a movel %a2,%sp@- 494ea: 2f00 movel %d0,%sp@- 494ec: 2f07 movel %d7,%sp@- 494ee: 2f0d movel %a5,%sp@- 494f0: 4879 0005 e5a8 pea 5e5a8 <_Copyright_Notice+0x3aa> 494f6: 4878 0001 pea 1 494fa: 2f2e 000c movel %fp@(12),%sp@- 494fe: 4e94 jsr %a4@ 49500: 4fef 001c lea %sp@(28),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49504: 4200 clrb %d0 49506: 6000 fc9a braw 491a2 <_Heap_Walk+0xd4> 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)( 4950a: 41f9 0005 e278 lea 5e278 <_Copyright_Notice+0x7a>,%a0 49510: 6000 ff6c braw 4947e <_Heap_Walk+0x3b0> 49514: 43f9 0005 e25f lea 5e25f <_Copyright_Notice+0x61>,%a1 4951a: 6000 ff4e braw 4946a <_Heap_Walk+0x39c> return false; } if ( !prev_used ) { (*printer)( 4951e: 2f0d movel %a5,%sp@- 49520: 4879 0005 e5e1 pea 5e5e1 <_Copyright_Notice+0x3e3> 49526: 4878 0001 pea 1 4952a: 2f2e 000c movel %fp@(12),%sp@- 4952e: 4e94 jsr %a4@ 49530: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49534: 4200 clrb %d0 49536: 6000 fc6a braw 491a2 <_Heap_Walk+0xd4> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 4953a: 2f08 movel %a0,%sp@- 4953c: 4879 0005 e43b pea 5e43b <_Copyright_Notice+0x23d> 49542: 4878 0001 pea 1 49546: 2f2e 000c movel %fp@(12),%sp@- 4954a: 4e94 jsr %a4@ 4954c: 4fef 0010 lea %sp@(16),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 49550: 4200 clrb %d0 49552: 6000 fc4e braw 491a2 <_Heap_Walk+0xd4> return false; } if ( free_block->prev != prev_block ) { (*printer)( 49556: 2f05 movel %d5,%sp@- 49558: 2f08 movel %a0,%sp@- 4955a: 4879 0005 e487 pea 5e487 <_Copyright_Notice+0x289> 49560: 4878 0001 pea 1 49564: 2f2e 000c movel %fp@(12),%sp@- 49568: 4e94 jsr %a4@ 4956a: 4fef 0014 lea %sp@(20),%sp "block 0x%08x: block size %u not page aligned\n", block, block_size ); return false; 4956e: 4200 clrb %d0 49570: 6000 fc30 braw 491a2 <_Heap_Walk+0xd4> =============================================================================== 00047d00 <_IO_Initialize_all_drivers>: void _IO_Initialize_all_drivers( void ) { 47d00: 4e56 0000 linkw %fp,#0 47d04: 2f0a movel %a2,%sp@- 47d06: 2f02 movel %d2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 47d08: 4ab9 0005 fbf8 tstl 5fbf8 <_IO_Number_of_drivers> 47d0e: 671e beqs 47d2e <_IO_Initialize_all_drivers+0x2e><== NEVER TAKEN 47d10: 4282 clrl %d2 47d12: 45f9 0004 c53c lea 4c53c ,%a2 (void) rtems_io_initialize( major, 0, NULL ); 47d18: 42a7 clrl %sp@- 47d1a: 42a7 clrl %sp@- 47d1c: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 47d1e: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 47d20: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 47d22: 4fef 000c lea %sp@(12),%sp 47d26: b4b9 0005 fbf8 cmpl 5fbf8 <_IO_Number_of_drivers>,%d2 47d2c: 65ea bcss 47d18 <_IO_Initialize_all_drivers+0x18> (void) rtems_io_initialize( major, 0, NULL ); } 47d2e: 242e fff8 movel %fp@(-8),%d2 47d32: 246e fffc moveal %fp@(-4),%a2 47d36: 4e5e unlk %fp ... =============================================================================== 00047c60 <_IO_Manager_initialization>: #include #include void _IO_Manager_initialization(void) { 47c60: 4e56 fff0 linkw %fp,#-16 47c64: 48d7 003c moveml %d2-%d5,%sp@ uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = rtems_configuration_get_device_driver_table(); 47c68: 2439 0005 c610 movel 5c610 ,%d2 drivers_in_table = rtems_configuration_get_number_of_device_drivers(); 47c6e: 2839 0005 c60c movel 5c60c ,%d4 number_of_drivers = rtems_configuration_get_maximum_drivers(); 47c74: 2639 0005 c608 movel 5c608 ,%d3 /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 47c7a: b684 cmpl %d4,%d3 47c7c: 636c blss 47cea <_IO_Manager_initialization+0x8a> * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 47c7e: 2003 movel %d3,%d0 47c80: 2a03 movel %d3,%d5 47c82: e788 lsll #3,%d0 47c84: eb8d lsll #5,%d5 47c86: 9a80 subl %d0,%d5 47c88: 2f05 movel %d5,%sp@- 47c8a: 4eb9 0004 ac2a jsr 4ac2a <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 47c90: 2f05 movel %d5,%sp@- 47c92: 42a7 clrl %sp@- /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 47c94: 23c0 0005 fbfc movel %d0,5fbfc <_IO_Driver_address_table> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 47c9a: 2f00 movel %d0,%sp@- _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 47c9c: 23c3 0005 fbf8 movel %d3,5fbf8 <_IO_Number_of_drivers> memset( 47ca2: 4eb9 0004 e9d4 jsr 4e9d4 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 47ca8: 4fef 0010 lea %sp@(16),%sp 47cac: 4a84 tstl %d4 47cae: 6730 beqs 47ce0 <_IO_Manager_initialization+0x80><== NEVER TAKEN #include #include #include void _IO_Manager_initialization(void) 47cb0: 2a04 movel %d4,%d5 47cb2: 2204 movel %d4,%d1 47cb4: 4280 clrl %d0 47cb6: e78d lsll #3,%d5 47cb8: eb89 lsll #5,%d1 47cba: 2639 0005 fbfc movel 5fbfc <_IO_Driver_address_table>,%d3 47cc0: 9285 subl %d5,%d1 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 47cc2: 2242 moveal %d2,%a1 47cc4: 2043 moveal %d3,%a0 47cc6: d3c0 addal %d0,%a1 47cc8: d1c0 addal %d0,%a0 47cca: 0680 0000 0018 addil #24,%d0 47cd0: 20d9 movel %a1@+,%a0@+ 47cd2: 20d9 movel %a1@+,%a0@+ 47cd4: 20d9 movel %a1@+,%a0@+ 47cd6: 20d9 movel %a1@+,%a0@+ 47cd8: 20d9 movel %a1@+,%a0@+ 47cda: 2091 movel %a1@,%a0@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 47cdc: b280 cmpl %d0,%d1 47cde: 66e2 bnes 47cc2 <_IO_Manager_initialization+0x62> _IO_Driver_address_table[index] = driver_table[index]; } 47ce0: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 47ce6: 4e5e unlk %fp 47ce8: 4e75 rts * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 47cea: 23c2 0005 fbfc movel %d2,5fbfc <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 47cf0: 23c4 0005 fbf8 movel %d4,5fbf8 <_IO_Number_of_drivers> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } 47cf6: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 47cfc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004891c <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 4891c: 4e56 ffe8 linkw %fp,#-24 48920: 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 ); 48924: 4879 0004 a788 pea 4a788 <_User_extensions_Fatal_visitor> 4892a: 262e 0010 movel %fp@(16),%d3 4892e: 486e fff6 pea %fp@(-10) 48932: 282e 0008 movel %fp@(8),%d4 48936: 242e 000c movel %fp@(12),%d2 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 4893a: 2d44 fff6 movel %d4,%fp@(-10) 4893e: 1d42 fffa moveb %d2,%fp@(-6) 48942: 2d43 fffc movel %d3,%fp@(-4) _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 48946: 4eb9 0004 a7b8 jsr 4a7b8 <_User_extensions_Iterate> _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; 4894c: 13c2 0005 fb66 moveb %d2,5fb66 <_Internal_errors_What_happened+0x4><== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 48952: 2043 moveal %d3,%a0 <== NOT EXECUTED 48954: 243c 0000 0700 movel #1792,%d2 <== NOT EXECUTED Internal_errors_t the_error ) { _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 4895a: 23c4 0005 fb62 movel %d4,5fb62 <_Internal_errors_What_happened><== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 48960: 23c3 0005 fb68 movel %d3,5fb68 <_Internal_errors_What_happened+0x6><== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 48966: 40c0 movew %sr,%d0 <== NOT EXECUTED 48968: 8082 orl %d2,%d0 <== NOT EXECUTED 4896a: 46c0 movew %d0,%sr <== NOT EXECUTED 4896c: 2008 movel %a0,%d0 <== NOT EXECUTED 4896e: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 48974: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 48976: 7005 moveq #5,%d0 <== NOT EXECUTED 48978: 508f addql #8,%sp <== NOT EXECUTED 4897a: 23c0 0005 fb6c movel %d0,5fb6c <_System_state_Current> <== NOT EXECUTED 48980: 60fe bras 48980 <_Internal_error_Occurred+0x64> <== NOT EXECUTED ... =============================================================================== 000489e4 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 489e4: 4e56 fff0 linkw %fp,#-16 489e8: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 489ec: 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 ) 489f0: 4aaa 0014 tstl %a2@(20) 489f4: 6770 beqs 48a66 <_Objects_Allocate+0x82> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 489f6: 240a movel %a2,%d2 489f8: 0682 0000 001c addil #28,%d2 489fe: 47f9 0004 7f74 lea 47f74 <_Chain_Get>,%a3 48a04: 2f02 movel %d2,%sp@- 48a06: 4e93 jsr %a3@ if ( information->auto_extend ) { 48a08: 588f addql #4,%sp 48a0a: 4a2a 0010 tstb %a2@(16) 48a0e: 673a beqs 48a4a <_Objects_Allocate+0x66> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 48a10: 4a80 tstl %d0 48a12: 6740 beqs 48a54 <_Objects_Allocate+0x70> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 48a14: 2040 moveal %d0,%a0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 48a16: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 48a18: 2228 0008 movel %a0@(8),%d1 48a1c: 262a 0006 movel %a2@(6),%d3 48a20: 0281 0000 ffff andil #65535,%d1 48a26: 0283 0000 ffff andil #65535,%d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 48a2c: 342a 0012 movew %a2@(18),%d2 information->inactive_per_block[ block ]--; 48a30: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 48a34: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 48a36: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; information->inactive--; 48a3a: 326a 0028 moveaw %a2@(40),%a1 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 48a3e: e589 lsll #2,%d1 information->inactive--; 48a40: 5389 subql #1,%a1 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 48a42: d1c1 addal %d1,%a0 48a44: 5390 subql #1,%a0@ information->inactive--; 48a46: 3549 0028 movew %a1,%a2@(40) ); } #endif return the_object; } 48a4a: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 48a50: 4e5e unlk %fp 48a52: 4e75 rts * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 48a54: 2f0a movel %a2,%sp@- 48a56: 4eb9 0004 8aa0 jsr 48aa0 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 48a5c: 2f02 movel %d2,%sp@- 48a5e: 4e93 jsr %a3@ } if ( the_object ) { 48a60: 508f addql #8,%sp 48a62: 4a80 tstl %d0 48a64: 66ae bnes 48a14 <_Objects_Allocate+0x30> * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) return NULL; 48a66: 4280 clrl %d0 ); } #endif return the_object; } 48a68: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 48a6e: 4e5e unlk %fp ... =============================================================================== 00048a74 <_Objects_Close>: void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 48a74: 4e56 0000 linkw %fp,#0 48a78: 226e 000c moveal %fp@(12),%a1 48a7c: 206e 0008 moveal %fp@(8),%a0 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 48a80: 2029 0008 movel %a1@(8),%d0 48a84: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48a86: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 48a8a: 0280 0000 ffff andil #65535,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48a90: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 48a94: 245f moveal %sp@+,%a2 48a96: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 48a98: 4ef9 0004 9024 jmp 49024 <_Objects_Namespace_remove> ... =============================================================================== 00048aa0 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 48aa0: 4e56 ffc8 linkw %fp,#-56 48aa4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 48aa8: 246e 0008 moveal %fp@(8),%a2 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48aac: 2a2a 0006 movel %a2@(6),%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 48ab0: 206a 002e moveal %a2@(46),%a0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48ab4: 0285 0000 ffff andil #65535,%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 48aba: 4a88 tstl %a0 48abc: 6700 020c beqw 48cca <_Objects_Extend_information+0x22a> block_count = 0; else { block_count = information->maximum / information->allocation_size; 48ac0: 3e2a 000e movew %a2@(14),%d7 48ac4: 302a 0012 movew %a2@(18),%d0 48ac8: 3807 movew %d7,%d4 48aca: 0284 0000 ffff andil #65535,%d4 48ad0: 88c0 divuw %d0,%d4 48ad2: 0284 0000 ffff andil #65535,%d4 for ( ; block < block_count; block++ ) { 48ad8: 6700 0260 beqw 48d3a <_Objects_Extend_information+0x29a> if ( information->object_blocks[ block ] == NULL ) { 48adc: 4a90 tstl %a0@ 48ade: 6700 026c beqw 48d4c <_Objects_Extend_information+0x2ac> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 48ae2: 5888 addql #4,%a0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48ae4: 2605 movel %d5,%d3 index_base = minimum_index; block = 0; 48ae6: 4282 clrl %d2 48ae8: 0280 0000 ffff andil #65535,%d0 for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 48aee: d680 addl %d0,%d3 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 48af0: 5282 addql #1,%d2 48af2: b484 cmpl %d4,%d2 48af4: 6400 01ac bccw 48ca2 <_Objects_Extend_information+0x202> if ( information->object_blocks[ block ] == NULL ) { 48af8: 4a98 tstl %a0@+ 48afa: 66f2 bnes 48aee <_Objects_Extend_information+0x4e> do_extend = false; 48afc: 97cb subal %a3,%a3 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 48afe: 0287 0000 ffff andil #65535,%d7 48b04: de80 addl %d0,%d7 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 48b06: 0c87 0000 ffff cmpil #65535,%d7 48b0c: 6200 018a bhiw 48c98 <_Objects_Extend_information+0x1f8> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 48b10: 41ea 0014 lea %a2@(20),%a0 48b14: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 48b18: 4a2a 0010 tstb %a2@(16) 48b1c: 6700 018c beqw 48caa <_Objects_Extend_information+0x20a> new_object_block = _Workspace_Allocate( block_size ); 48b20: 2f00 movel %d0,%sp@- 48b22: 4eb9 0004 abf4 jsr 4abf4 <_Workspace_Allocate> if ( !new_object_block ) 48b28: 588f addql #4,%sp * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 48b2a: 2c00 movel %d0,%d6 if ( !new_object_block ) 48b2c: 6700 016a beqw 48c98 <_Objects_Extend_information+0x1f8> } /* * Do we need to grow the tables? */ if ( do_extend ) { 48b30: 300b movew %a3,%d0 48b32: 4a00 tstb %d0 48b34: 6700 00c4 beqw 48bfa <_Objects_Extend_information+0x15a> */ /* * Up the block count and maximum */ block_count++; 48b38: 2844 moveal %d4,%a4 48b3a: 528c addql #1,%a4 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); 48b3c: 2007 movel %d7,%d0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 48b3e: 41f4 ca00 lea %a4@(00000000,%a4:l:2),%a0 ((maximum + minimum_index) * sizeof(Objects_Control *)); 48b42: d088 addl %a0,%d0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 48b44: d085 addl %d5,%d0 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 48b46: e588 lsll #2,%d0 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 48b48: 4a2a 0010 tstb %a2@(16) 48b4c: 6700 016c beqw 48cba <_Objects_Extend_information+0x21a> object_blocks = _Workspace_Allocate( block_size ); 48b50: 2f00 movel %d0,%sp@- 48b52: 4eb9 0004 abf4 jsr 4abf4 <_Workspace_Allocate> if ( !object_blocks ) { 48b58: 588f addql #4,%sp */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); 48b5a: 2640 moveal %d0,%a3 if ( !object_blocks ) { 48b5c: 4a80 tstl %d0 48b5e: 6700 01c6 beqw 48d26 <_Objects_Extend_information+0x286> } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 48b62: 220c movel %a4,%d1 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 48b64: 4280 clrl %d0 } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 48b66: e589 lsll #2,%d1 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 48b68: 302a 000e movew %a2@(14),%d0 48b6c: 43f3 1800 lea %a3@(00000000,%d1:l),%a1 48b70: 49f1 1800 lea %a1@(00000000,%d1:l),%a4 48b74: b085 cmpl %d5,%d0 48b76: 6200 016a bhiw 48ce2 <_Objects_Extend_information+0x242> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 48b7a: 4a85 tstl %d5 48b7c: 670c beqs 48b8a <_Objects_Extend_information+0xea><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 48b7e: 204c moveal %a4,%a0 48b80: 4bf4 5c00 lea %a4@(00000000,%d5:l:4),%a5 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 48b84: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 48b86: bbc8 cmpal %a0,%a5 48b88: 66fa bnes 48b84 <_Objects_Extend_information+0xe4><== NEVER TAKEN 48b8a: e58c lsll #2,%d4 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 48b8c: 4280 clrl %d0 48b8e: 2203 movel %d3,%d1 48b90: 302a 0012 movew %a2@(18),%d0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 48b94: 42b3 4800 clrl %a3@(00000000,%d4:l) inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 48b98: d280 addl %d0,%d1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 48b9a: 42b1 4800 clrl %a1@(00000000,%d4:l) for ( index=index_base ; 48b9e: b283 cmpl %d3,%d1 48ba0: 630e blss 48bb0 <_Objects_Extend_information+0x110><== NEVER TAKEN * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 48ba2: 4281 clrl %d1 48ba4: 41f4 3c00 lea %a4@(00000000,%d3:l:4),%a0 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 48ba8: 4298 clrl %a0@+ 48baa: 5281 addql #1,%d1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 48bac: b081 cmpl %d1,%d0 48bae: 66f8 bnes 48ba8 <_Objects_Extend_information+0x108> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 48bb0: 203c 0000 0700 movel #1792,%d0 48bb6: 40c4 movew %sr,%d4 48bb8: 8084 orl %d4,%d0 48bba: 46c0 movew %d0,%sr uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48bbc: 2012 movel %a2@,%d0 48bbe: 7a18 moveq #24,%d5 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 48bc0: 4281 clrl %d1 48bc2: eba8 lsll %d5,%d0 48bc4: 322a 0004 movew %a2@(4),%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48bc8: 1a3c 001b moveb #27,%d5 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48bcc: 08c0 0010 bset #16,%d0 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48bd0: eba9 lsll %d5,%d1 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 48bd2: 206a 002e moveal %a2@(46),%a0 48bd6: 8081 orl %d1,%d0 information->object_blocks = object_blocks; 48bd8: 254b 002e movel %a3,%a2@(46) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48bdc: 8087 orl %d7,%d0 information->inactive_per_block = inactive_per_block; 48bde: 2549 002a movel %a1,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 48be2: 3547 000e movew %d7,%a2@(14) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 48be6: 254c 0018 movel %a4,%a2@(24) 48bea: 2540 000a movel %d0,%a2@(10) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 48bee: 46c4 movew %d4,%sr _Workspace_Free( old_tables ); 48bf0: 2f08 movel %a0,%sp@- 48bf2: 4eb9 0004 ac10 jsr 4ac10 <_Workspace_Free> 48bf8: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 48bfa: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 48bfe: 4280 clrl %d0 48c00: 280e movel %fp,%d4 48c02: 0684 ffff fff4 addil #-12,%d4 48c08: 47f9 0004 7f74 lea 47f74 <_Chain_Get>,%a3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 48c0e: 2a0a movel %a2,%d5 48c10: 0685 0000 001c addil #28,%d5 48c16: 49f9 0004 7f3c lea 47f3c <_Chain_Append>,%a4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 48c1c: e58a lsll #2,%d2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 48c1e: 302a 0012 movew %a2@(18),%d0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 48c22: 2186 2800 movel %d6,%a0@(00000000,%d2:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 48c26: 2f2a 0014 movel %a2@(20),%sp@- 48c2a: 206a 002e moveal %a2@(46),%a0 48c2e: 2f00 movel %d0,%sp@- 48c30: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 48c34: 2f04 movel %d4,%sp@- 48c36: 4eb9 0004 7fb0 jsr 47fb0 <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 48c3c: 4fef 0010 lea %sp@(16),%sp 48c40: 2f04 movel %d4,%sp@- 48c42: 4e93 jsr %a3@ 48c44: 588f addql #4,%sp 48c46: 4a80 tstl %d0 48c48: 6734 beqs 48c7e <_Objects_Extend_information+0x1de><== NEVER TAKEN 48c4a: 2212 movel %a2@,%d1 48c4c: 7e18 moveq #24,%d7 the_object->id = _Objects_Build_id( 48c4e: 4286 clrl %d6 48c50: 2040 moveal %d0,%a0 48c52: 3c2a 0004 movew %a2@(4),%d6 48c56: efa9 lsll %d7,%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48c58: 1e3c 001b moveb #27,%d7 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48c5c: 08c1 0010 bset #16,%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48c60: efae lsll %d7,%d6 48c62: 8286 orl %d6,%d1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48c64: 8283 orl %d3,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 48c66: 5283 addql #1,%d3 48c68: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 48c6c: 2f00 movel %d0,%sp@- 48c6e: 2f05 movel %d5,%sp@- 48c70: 4e94 jsr %a4@ index++; 48c72: 508f addql #8,%sp /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 48c74: 2f04 movel %d4,%sp@- 48c76: 4e93 jsr %a3@ 48c78: 588f addql #4,%sp 48c7a: 4a80 tstl %d0 48c7c: 66cc bnes 48c4a <_Objects_Extend_information+0x1aa> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 48c7e: 4281 clrl %d1 48c80: 302a 0012 movew %a2@(18),%d0 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 48c84: 326a 0028 moveaw %a2@(40),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 48c88: 206a 002a moveal %a2@(42),%a0 48c8c: 3200 movew %d0,%d1 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 48c8e: d089 addl %a1,%d0 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 48c90: 2181 2800 movel %d1,%a0@(00000000,%d2:l) information->inactive = 48c94: 3540 0028 movew %d0,%a2@(40) (Objects_Maximum)(information->inactive + information->allocation_size); } 48c98: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 48c9e: 4e5e unlk %fp 48ca0: 4e75 rts /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 48ca2: 367c 0001 moveaw #1,%a3 48ca6: 6000 fe56 braw 48afe <_Objects_Extend_information+0x5e> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 48caa: 2f00 movel %d0,%sp@- 48cac: 4eb9 0004 ac2a jsr 4ac2a <_Workspace_Allocate_or_fatal_error> 48cb2: 588f addql #4,%sp 48cb4: 2c00 movel %d0,%d6 48cb6: 6000 fe78 braw 48b30 <_Objects_Extend_information+0x90> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 48cba: 2f00 movel %d0,%sp@- 48cbc: 4eb9 0004 ac2a jsr 4ac2a <_Workspace_Allocate_or_fatal_error> 48cc2: 588f addql #4,%sp 48cc4: 2640 moveal %d0,%a3 48cc6: 6000 fe9a braw 48b62 <_Objects_Extend_information+0xc2> 48cca: 4280 clrl %d0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48ccc: 2605 movel %d5,%d3 index_base = minimum_index; block = 0; 48cce: 4282 clrl %d2 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 48cd0: 4284 clrl %d4 48cd2: 3e2a 000e movew %a2@(14),%d7 48cd6: 302a 0012 movew %a2@(18),%d0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 48cda: 367c 0001 moveaw #1,%a3 48cde: 6000 fe1e braw 48afe <_Objects_Extend_information+0x5e> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 48ce2: 4bf9 0004 e964 lea 4e964 ,%a5 48ce8: e58c lsll #2,%d4 48cea: 2f04 movel %d4,%sp@- 48cec: 2f2a 002e movel %a2@(46),%sp@- 48cf0: 2d49 fff0 movel %a1,%fp@(-16) 48cf4: 2f0b movel %a3,%sp@- 48cf6: 4e95 jsr %a5@ information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 48cf8: 226e fff0 moveal %fp@(-16),%a1 48cfc: 2f04 movel %d4,%sp@- 48cfe: 2f2a 002a movel %a2@(42),%sp@- 48d02: 2f09 movel %a1,%sp@- 48d04: 4e95 jsr %a5@ information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 48d06: 4280 clrl %d0 48d08: 302a 000e movew %a2@(14),%d0 48d0c: da80 addl %d0,%d5 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 48d0e: e58d lsll #2,%d5 48d10: 2f05 movel %d5,%sp@- 48d12: 2f2a 0018 movel %a2@(24),%sp@- 48d16: 2f0c movel %a4,%sp@- 48d18: 4e95 jsr %a5@ 48d1a: 226e fff0 moveal %fp@(-16),%a1 48d1e: 4fef 0024 lea %sp@(36),%sp 48d22: 6000 fe68 braw 48b8c <_Objects_Extend_information+0xec> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 48d26: 2f06 movel %d6,%sp@- 48d28: 4eb9 0004 ac10 jsr 4ac10 <_Workspace_Free> 48d2e: 588f addql #4,%sp } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 48d30: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 48d36: 4e5e unlk %fp 48d38: 4e75 rts /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48d3a: 2605 movel %d5,%d3 <== NOT EXECUTED index_base = minimum_index; block = 0; 48d3c: 4282 clrl %d2 <== NOT EXECUTED 48d3e: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 48d44: 367c 0001 moveaw #1,%a3 <== NOT EXECUTED 48d48: 6000 fdb4 braw 48afe <_Objects_Extend_information+0x5e><== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); 48d4c: 2605 movel %d5,%d3 <== NOT EXECUTED index_base = minimum_index; block = 0; 48d4e: 4282 clrl %d2 <== NOT EXECUTED 48d50: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 48d56: 97cb subal %a3,%a3 <== NOT EXECUTED 48d58: 6000 fda4 braw 48afe <_Objects_Extend_information+0x5e><== NOT EXECUTED =============================================================================== 00048e14 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 48e14: 4e56 0000 linkw %fp,#0 48e18: 2f03 movel %d3,%sp@- 48e1a: 262e 0008 movel %fp@(8),%d3 48e1e: 2f02 movel %d2,%sp@- 48e20: 342e 000e movew %fp@(14),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 48e24: 6740 beqs 48e66 <_Objects_Get_information+0x52> /* * 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 ); 48e26: 2f03 movel %d3,%sp@- 48e28: 4eb9 0004 c9d0 jsr 4c9d0 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 48e2e: 588f addql #4,%sp 48e30: 4a80 tstl %d0 48e32: 6732 beqs 48e66 <_Objects_Get_information+0x52> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 48e34: 0282 0000 ffff andil #65535,%d2 48e3a: b480 cmpl %d0,%d2 48e3c: 6228 bhis 48e66 <_Objects_Get_information+0x52> return NULL; if ( !_Objects_Information_table[ the_api ] ) 48e3e: 41f9 0005 f9c2 lea 5f9c2 <_Objects_Information_table>,%a0 48e44: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 48e48: 4a88 tstl %a0 48e4a: 671a beqs 48e66 <_Objects_Get_information+0x52> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 48e4c: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 48e50: 6714 beqs 48e66 <_Objects_Get_information+0x52> <== 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 ) 48e52: 2040 moveal %d0,%a0 48e54: 4a68 000e tstw %a0@(14) 48e58: 670c beqs 48e66 <_Objects_Get_information+0x52> return NULL; #endif return info; } 48e5a: 242e fff8 movel %fp@(-8),%d2 48e5e: 262e fffc movel %fp@(-4),%d3 48e62: 4e5e unlk %fp 48e64: 4e75 rts 48e66: 242e fff8 movel %fp@(-8),%d2 { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 48e6a: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 48e6c: 262e fffc movel %fp@(-4),%d3 48e70: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005598c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 5598c: 4e56 ffdc linkw %fp,#-36 55990: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 55994: 242e 000c movel %fp@(12),%d2 55998: 262e 0010 movel %fp@(16),%d3 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 5599c: 4a82 tstl %d2 5599e: 6700 00c6 beqw 55a66 <_Objects_Get_name_as_string+0xda> return NULL; if ( name == NULL ) 559a2: 4a83 tstl %d3 559a4: 6700 00c0 beqw 55a66 <_Objects_Get_name_as_string+0xda> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 559a8: 4aae 0008 tstl %fp@(8) 559ac: 6600 00b0 bnew 55a5e <_Objects_Get_name_as_string+0xd2> 559b0: 2079 0006 df62 moveal 6df62 <_Per_CPU_Information+0xe>,%a0 559b6: 2468 0008 moveal %a0@(8),%a2 information = _Objects_Get_information_id( tmpId ); 559ba: 2f0a movel %a2,%sp@- 559bc: 4eb9 0004 eac4 jsr 4eac4 <_Objects_Get_information_id> if ( !information ) 559c2: 588f addql #4,%sp 559c4: 4a80 tstl %d0 559c6: 6700 009e beqw 55a66 <_Objects_Get_name_as_string+0xda> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 559ca: 486e fff6 pea %fp@(-10) 559ce: 2f0a movel %a2,%sp@- 559d0: 2f00 movel %d0,%sp@- 559d2: 4eb9 0004 ebb8 jsr 4ebb8 <_Objects_Get> switch ( location ) { 559d8: 4fef 000c lea %sp@(12),%sp 559dc: 4aae fff6 tstl %fp@(-10) 559e0: 6600 0084 bnew 55a66 <_Objects_Get_name_as_string+0xda> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 559e4: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 559e6: 7818 moveq #24,%d4 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 559e8: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 559ec: 2200 movel %d0,%d1 559ee: e8a9 lsrl %d4,%d1 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 559f0: 2800 movel %d0,%d4 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 559f2: 2a00 movel %d0,%d5 lname[ 2 ] = (u32_name >> 8) & 0xff; 559f4: e08c lsrl #8,%d4 lname[ 3 ] = (u32_name >> 0) & 0xff; 559f6: 1d40 fffe moveb %d0,%fp@(-2) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 559fa: 4245 clrw %d5 559fc: 4845 swap %d5 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 559fe: 4200 clrb %d0 { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 55a00: 1d44 fffd moveb %d4,%fp@(-3) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 55a04: 7801 moveq #1,%d4 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 55a06: 1d41 fffb moveb %d1,%fp@(-5) lname[ 1 ] = (u32_name >> 16) & 0xff; 55a0a: 1d45 fffc moveb %d5,%fp@(-4) lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 55a0e: 1d40 ffff moveb %d0,%fp@(-1) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 55a12: b882 cmpl %d2,%d4 55a14: 675e beqs 55a74 <_Objects_Get_name_as_string+0xe8><== NEVER TAKEN 55a16: 4a01 tstb %d1 55a18: 675a beqs 55a74 <_Objects_Get_name_as_string+0xe8> * This method objects the name of an object and returns its name * in the form of a C string. It attempts to be careful about * overflowing the user's string and about returning unprintable characters. */ char *_Objects_Get_name_as_string( 55a1a: 43ee fffc lea %fp@(-4),%a1 55a1e: 2043 moveal %d3,%a0 55a20: 47f6 28fa lea %fp@(fffffffa,%d2:l),%a3 } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 55a24: 4282 clrl %d2 55a26: 1401 moveb %d1,%d2 55a28: 2479 0006 c074 moveal 6c074 <__ctype_ptr__>,%a2 55a2e: 1432 2801 moveb %a2@(00000001,%d2:l),%d2 55a32: 49c2 extbl %d2 55a34: 0282 0000 0097 andil #151,%d2 55a3a: 6602 bnes 55a3e <_Objects_Get_name_as_string+0xb2> 55a3c: 722a moveq #42,%d1 55a3e: 10c1 moveb %d1,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 55a40: 2448 moveal %a0,%a2 55a42: b7c9 cmpal %a1,%a3 55a44: 6704 beqs 55a4a <_Objects_Get_name_as_string+0xbe> 55a46: 1219 moveb %a1@+,%d1 55a48: 66da bnes 55a24 <_Objects_Get_name_as_string+0x98> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 55a4a: 4212 clrb %a2@ _Thread_Enable_dispatch(); 55a4c: 4eb9 0004 f9a8 jsr 4f9a8 <_Thread_Enable_dispatch> return name; } return NULL; /* unreachable path */ } 55a52: 2003 movel %d3,%d0 55a54: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 55a5a: 4e5e unlk %fp 55a5c: 4e75 rts return NULL; if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 55a5e: 246e 0008 moveal %fp@(8),%a2 55a62: 6000 ff56 braw 559ba <_Objects_Get_name_as_string+0x2e> #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* not supported */ #endif case OBJECTS_ERROR: return NULL; 55a66: 4283 clrl %d3 _Thread_Enable_dispatch(); return name; } return NULL; /* unreachable path */ } 55a68: 2003 movel %d3,%d0 55a6a: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 55a70: 4e5e unlk %fp 55a72: 4e75 rts s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 55a74: 2443 moveal %d3,%a2 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 55a76: 4212 clrb %a2@ _Thread_Enable_dispatch(); 55a78: 4eb9 0004 f9a8 jsr 4f9a8 <_Thread_Enable_dispatch> 55a7e: 60d2 bras 55a52 <_Objects_Get_name_as_string+0xc6> =============================================================================== 0005a440 <_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; 5a440: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 5a442: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5a444: 4e56 0000 linkw %fp,#0 5a448: 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; 5a44c: 90a8 0006 subl %a0@(6),%d0 5a450: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 5a454: 3228 000e movew %a0@(14),%d1 5a458: b280 cmpl %d0,%d1 5a45a: 6514 bcss 5a470 <_Objects_Get_no_protection+0x30> if ( (the_object = information->local_table[ index ]) != NULL ) { 5a45c: 2068 0018 moveal %a0@(24),%a0 5a460: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5a464: 670a beqs 5a470 <_Objects_Get_no_protection+0x30><== NEVER TAKEN *location = OBJECTS_LOCAL; 5a466: 206e 0010 moveal %fp@(16),%a0 * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; return NULL; } 5a46a: 4e5e unlk %fp */ index = id - information->minimum_id + 1; if ( information->maximum >= index ) { if ( (the_object = information->local_table[ index ]) != NULL ) { *location = OBJECTS_LOCAL; 5a46c: 4290 clrl %a0@ * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; return NULL; } 5a46e: 4e75 rts /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 5a470: 226e 0010 moveal %fp@(16),%a1 5a474: 7001 moveq #1,%d0 return NULL; } 5a476: 4e5e unlk %fp /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 5a478: 2280 movel %d0,%a1@ return NULL; 5a47a: 4280 clrl %d0 } ... =============================================================================== 0004ec20 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4ec20: 4e56 fffc linkw %fp,#-4 4ec24: 202e 0008 movel %fp@(8),%d0 4ec28: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4ec2a: 4a80 tstl %d0 4ec2c: 6676 bnes 4eca4 <_Objects_Id_to_name+0x84> 4ec2e: 2079 0006 df62 moveal 6df62 <_Per_CPU_Information+0xe>,%a0 4ec34: 2228 0008 movel %a0@(8),%d1 4ec38: 7418 moveq #24,%d2 4ec3a: 2001 movel %d1,%d0 4ec3c: e4a8 lsrl %d2,%d0 4ec3e: 143c 0007 moveb #7,%d2 4ec42: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4ec44: 143c 0002 moveb #2,%d2 4ec48: 2040 moveal %d0,%a0 4ec4a: 5388 subql #1,%a0 4ec4c: b488 cmpl %a0,%d2 4ec4e: 654a bcss 4ec9a <_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 ] ) 4ec50: 41f9 0006 dd6e lea 6dd6e <_Objects_Information_table>,%a0 4ec56: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 4ec5a: 4a88 tstl %a0 4ec5c: 673c beqs 4ec9a <_Objects_Id_to_name+0x7a> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 4ec5e: 2001 movel %d1,%d0 4ec60: 741b moveq #27,%d2 4ec62: e4a8 lsrl %d2,%d0 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4ec64: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 4ec68: 6730 beqs 4ec9a <_Objects_Id_to_name+0x7a> <== 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 ); 4ec6a: 486e fffc pea %fp@(-4) 4ec6e: 2f01 movel %d1,%sp@- 4ec70: 2f00 movel %d0,%sp@- 4ec72: 4eb9 0004 ebb8 jsr 4ebb8 <_Objects_Get> if ( !the_object ) 4ec78: 4fef 000c lea %sp@(12),%sp 4ec7c: 4a80 tstl %d0 4ec7e: 671a beqs 4ec9a <_Objects_Id_to_name+0x7a> return OBJECTS_INVALID_ID; *name = the_object->name; 4ec80: 206e 000c moveal %fp@(12),%a0 4ec84: 2240 moveal %d0,%a1 4ec86: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 4ec8a: 4eb9 0004 f9a8 jsr 4f9a8 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4ec90: 242e fff8 movel %fp@(-8),%d2 if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4ec94: 4280 clrl %d0 } 4ec96: 4e5e unlk %fp 4ec98: 4e75 rts 4ec9a: 242e fff8 movel %fp@(-8),%d2 tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4ec9e: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4eca0: 4e5e unlk %fp 4eca2: 4e75 rts /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4eca4: 2200 movel %d0,%d1 4eca6: 6090 bras 4ec38 <_Objects_Id_to_name+0x18> =============================================================================== 00048f44 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 48f44: 4e56 ffec linkw %fp,#-20 48f48: 202e 000c movel %fp@(12),%d0 48f4c: 48d7 043c moveml %d2-%d5/%a2,%sp@ information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 48f50: 45f9 0005 f9c2 lea 5f9c2 <_Objects_Information_table>,%a2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 48f56: 4282 clrl %d2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 48f58: 4283 clrl %d3 48f5a: 2472 0c00 moveal %a2@(00000000,%d0:l:4),%a2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 48f5e: 206e 0008 moveal %fp@(8),%a0 48f62: 342e 001a movew %fp@(26),%d2 48f66: 226e 0010 moveal %fp@(16),%a1 uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 48f6a: 2142 0014 movel %d2,%a0@(20) , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 48f6e: 222e 0014 movel %fp@(20),%d1 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 48f72: 4242 clrw %d2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 48f74: 3609 movew %a1,%d3 Objects_Maximum maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 48f76: 2080 movel %d0,%a0@ , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 48f78: 282e 0020 movel %fp@(32),%d4 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 48f7c: 3142 0028 movew %d2,%a0@(40) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 48f80: 3142 000e movew %d2,%a0@(14) * @retval true Unlimited objects are available. * @retval false The object count is fixed. */ RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum ) { return (maximum & OBJECTS_UNLIMITED_OBJECTS) != 0; 48f84: 2401 movel %d1,%d2 #endif information->the_api = the_api; information->the_class = the_class; information->size = size; information->local_table = 0; 48f86: 42a8 0018 clrl %a0@(24) #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 48f8a: 3149 0004 movew %a1,%a0@(4) information->size = size; information->local_table = 0; information->inactive_per_block = 0; 48f8e: 42a8 002a clrl %a0@(42) 48f92: d482 addl %d2,%d2 48f94: 9582 subxl %d2,%d2 48f96: 4482 negl %d2 information->object_blocks = 0; 48f98: 42a8 002e clrl %a0@(46) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 48f9c: 2588 3c00 movel %a0,%a2@(00000000,%d3:l:4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = _Objects_Is_unlimited( maximum ); 48fa0: 1142 0010 moveb %d2,%a0@(16) maximum_per_allocation = _Objects_Maximum_per_allocation( maximum ); /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 48fa4: 4a82 tstl %d2 48fa6: 6704 beqs 48fac <_Objects_Initialize_information+0x68> 48fa8: 4a41 tstw %d1 48faa: 6766 beqs 49012 <_Objects_Initialize_information+0xce> uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48fac: 7a18 moveq #24,%d5 information->local_table = &null_local_table; /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 48fae: 4a41 tstw %d1 48fb0: 56c2 sne %d2 48fb2: eba8 lsll %d5,%d0 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48fb4: 1a3c 001b moveb #27,%d5 information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 48fb8: 43f9 0005 f200 lea 5f200 ,%a1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 48fbe: 4482 negl %d2 48fc0: ebab lsll %d5,%d3 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48fc2: 08c0 0010 bset #16,%d0 information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 48fc6: 2149 0018 movel %a1,%a0@(24) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 48fca: 4285 clrl %d5 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 ); 48fcc: 43e8 0020 lea %a0@(32),%a1 48fd0: 1a02 moveb %d2,%d5 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48fd2: 8083 orl %d3,%d0 48fd4: 2149 001c movel %a1,%a0@(28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48fd8: 43e8 001c lea %a0@(28),%a1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48fdc: 8085 orl %d5,%d0 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 48fde: 3141 0012 movew %d1,%a0@(18) * NOTE: Either 4 bytes for Classic API names or an arbitrary * number for POSIX names which are strings that may be * an odd number of bytes. */ information->name_length = maximum_name_length; 48fe2: 3144 0032 movew %d4,%a0@(50) Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 48fe6: 42a8 0020 clrl %a0@(32) 48fea: 2140 0006 movel %d0,%a0@(6) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48fee: 2149 0024 movel %a1,%a0@(36) _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 48ff2: 4a02 tstb %d2 48ff4: 660a bnes 49000 <_Objects_Initialize_information+0xbc> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 48ff6: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 48ffc: 4e5e unlk %fp 48ffe: 4e75 rts /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 49000: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 49004: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4900a: 4e5e unlk %fp /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 4900c: 4ef9 0004 8aa0 jmp 48aa0 <_Objects_Extend_information> /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { _Internal_error_Occurred( 49012: 4878 0013 pea 13 49016: 4878 0001 pea 1 4901a: 42a7 clrl %sp@- 4901c: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> ... =============================================================================== 000490b4 <_Objects_Shrink_information>: /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 490b4: 4281 clrl %d1 #include void _Objects_Shrink_information( Objects_Information *information ) { 490b6: 4e56 ffec linkw %fp,#-20 490ba: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 490be: 246e 0008 moveal %fp@(8),%a2 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 490c2: 4283 clrl %d3 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 490c4: 242a 0006 movel %a2@(6),%d2 block_count = (information->maximum - index_base) / 490c8: 362a 000e movew %a2@(14),%d3 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 490cc: 0282 0000 ffff andil #65535,%d2 block_count = (information->maximum - index_base) / 490d2: 322a 0012 movew %a2@(18),%d1 490d6: 9682 subl %d2,%d3 490d8: 4c41 3003 remul %d1,%d3,%d3 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 490dc: 6778 beqs 49156 <_Objects_Shrink_information+0xa2><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 490de: 206a 002a moveal %a2@(42),%a0 490e2: b290 cmpl %a0@,%d1 490e4: 6700 0088 beqw 4916e <_Objects_Shrink_information+0xba> #include #include #include #include void _Objects_Shrink_information( 490e8: 5888 addql #4,%a0 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 490ea: 4280 clrl %d0 490ec: 5280 addql #1,%d0 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 490ee: d481 addl %d1,%d2 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 490f0: b680 cmpl %d0,%d3 490f2: 6762 beqs 49156 <_Objects_Shrink_information+0xa2> #include #include #include #include void _Objects_Shrink_information( 490f4: 2800 movel %d0,%d4 490f6: e58c lsll #2,%d4 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 490f8: b298 cmpl %a0@+,%d1 490fa: 66f0 bnes 490ec <_Objects_Shrink_information+0x38> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 490fc: 206a 001c moveal %a2@(28),%a0 */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 49100: 47f9 0004 c584 lea 4c584 <_Chain_Extract>,%a3 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); 49106: 2028 0008 movel %a0@(8),%d0 4910a: 0280 0000 ffff andil #65535,%d0 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 49110: 2610 movel %a0@,%d3 if ((index >= index_base) && 49112: b480 cmpl %d0,%d2 49114: 620c bhis 49122 <_Objects_Shrink_information+0x6e> (index < (index_base + information->allocation_size))) { 49116: 4281 clrl %d1 49118: 322a 0012 movew %a2@(18),%d1 4911c: d282 addl %d2,%d1 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 4911e: b280 cmpl %d0,%d1 49120: 623e bhis 49160 <_Objects_Shrink_information+0xac> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 49122: 2043 moveal %d3,%a0 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 49124: 4a83 tstl %d3 49126: 66de bnes 49106 <_Objects_Shrink_information+0x52> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 49128: 206a 002e moveal %a2@(46),%a0 4912c: 2f30 4800 movel %a0@(00000000,%d4:l),%sp@- 49130: 4eb9 0004 ac10 jsr 4ac10 <_Workspace_Free> information->object_blocks[ block ] = NULL; 49136: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 4913a: 588f addql #4,%sp /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 4913c: 42b0 4800 clrl %a0@(00000000,%d4:l) information->inactive_per_block[ block ] = 0; 49140: 206a 002a moveal %a2@(42),%a0 information->inactive -= information->allocation_size; 49144: 302a 0028 movew %a2@(40),%d0 49148: 322a 0012 movew %a2@(18),%d1 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 4914c: 42b0 4800 clrl %a0@(00000000,%d4:l) information->inactive -= information->allocation_size; 49150: 9081 subl %d1,%d0 49152: 3540 0028 movew %d0,%a2@(40) return; } index_base += information->allocation_size; } } 49156: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4915c: 4e5e unlk %fp 4915e: 4e75 rts */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 49160: 2f08 movel %a0,%sp@- 49162: 4e93 jsr %a3@ 49164: 588f addql #4,%sp index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 49166: 2043 moveal %d3,%a0 if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 49168: 4a83 tstl %d3 4916a: 669a bnes 49106 <_Objects_Shrink_information+0x52> 4916c: 60ba bras 49128 <_Objects_Shrink_information+0x74> 4916e: 206a 001c moveal %a2@(28),%a0 <== NOT EXECUTED index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 49172: 4284 clrl %d4 <== NOT EXECUTED */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 49174: 47f9 0004 c584 lea 4c584 <_Chain_Extract>,%a3 <== NOT EXECUTED 4917a: 608a bras 49106 <_Objects_Shrink_information+0x52><== NOT EXECUTED =============================================================================== 0004e298 <_Protected_heap_Walk>: bool _Protected_heap_Walk( Heap_Control *the_heap, int source, bool do_dump ) { 4e298: 4e56 fff0 linkw %fp,#-16 * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) 4e29c: 2039 0006 5fd2 movel 65fd2 <_Thread_Dispatch_disable_level>,%d0 4e2a2: 48d7 001c moveml %d2-%d4,%sp@ 4e2a6: 262e 0008 movel %fp@(8),%d3 4e2aa: 282e 000c movel %fp@(12),%d4 4e2ae: 142e 0013 moveb %fp@(19),%d2 4e2b2: 4a80 tstl %d0 4e2b4: 6640 bnes 4e2f6 <_Protected_heap_Walk+0x5e> * a critical section, it should be safe to walk it unlocked. * * NOTE: Dispatching is also disabled during initialization. */ if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); 4e2b6: 2f39 0006 6056 movel 66056 <_RTEMS_Allocator_Mutex>,%sp@- status = _Heap_Walk( the_heap, source, do_dump ); 4e2bc: 0282 0000 00ff andil #255,%d2 * a critical section, it should be safe to walk it unlocked. * * NOTE: Dispatching is also disabled during initialization. */ if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); 4e2c2: 4eb9 0004 c2a8 jsr 4c2a8 <_API_Mutex_Lock> status = _Heap_Walk( the_heap, source, do_dump ); 4e2c8: 2f02 movel %d2,%sp@- 4e2ca: 2f04 movel %d4,%sp@- 4e2cc: 2f03 movel %d3,%sp@- 4e2ce: 4eb9 0004 d3b2 jsr 4d3b2 <_Heap_Walk> _RTEMS_Unlock_allocator(); 4e2d4: 2f39 0006 6056 movel 66056 <_RTEMS_Allocator_Mutex>,%sp@- 4e2da: 2d40 fffc movel %d0,%fp@(-4) 4e2de: 4eb9 0004 c308 jsr 4c308 <_API_Mutex_Unlock> 4e2e4: 202e fffc movel %fp@(-4),%d0 4e2e8: 4fef 0014 lea %sp@(20),%sp } else { status = _Heap_Walk( the_heap, source, do_dump ); } return status; } 4e2ec: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4e2f2: 4e5e unlk %fp 4e2f4: 4e75 rts if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); status = _Heap_Walk( the_heap, source, do_dump ); _RTEMS_Unlock_allocator(); } else { status = _Heap_Walk( the_heap, source, do_dump ); 4e2f6: 2d44 000c movel %d4,%fp@(12) 4e2fa: 0282 0000 00ff andil #255,%d2 4e300: 2d43 0008 movel %d3,%fp@(8) 4e304: 2d42 0010 movel %d2,%fp@(16) } return status; } 4e308: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4e30e: 4e5e unlk %fp if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); status = _Heap_Walk( the_heap, source, do_dump ); _RTEMS_Unlock_allocator(); } else { status = _Heap_Walk( the_heap, source, do_dump ); 4e310: 4ef9 0004 d3b2 jmp 4d3b2 <_Heap_Walk> ... =============================================================================== 00049f3a <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 49f3a: 4e56 ffec linkw %fp,#-20 49f3e: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 49f42: 2a6e 0008 moveal %fp@(8),%a5 49f46: 266e 000c moveal %fp@(12),%a3 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 49f4a: 4a8b tstl %a3 49f4c: 6700 00b0 beqw 49ffe <_RBTree_Extract_unprotected+0xc4> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 49f50: b7ed 0008 cmpal %a5@(8),%a3 49f54: 6700 00d2 beqw 4a028 <_RBTree_Extract_unprotected+0xee> the_rbtree->first[RBT_LEFT] = next; } /* 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]) { 49f58: b7ed 000c cmpal %a5@(12),%a3 49f5c: 6700 00e4 beqw 4a042 <_RBTree_Extract_unprotected+0x108> * 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]) { 49f60: 246b 0004 moveal %a3@(4),%a2 49f64: 4a8a tstl %a2 49f66: 6700 00f4 beqw 4a05c <_RBTree_Extract_unprotected+0x122> 49f6a: 4aab 0008 tstl %a3@(8) 49f6e: 6700 0098 beqw 4a008 <_RBTree_Extract_unprotected+0xce> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 49f72: 202a 0008 movel %a2@(8),%d0 49f76: 6708 beqs 49f80 <_RBTree_Extract_unprotected+0x46> 49f78: 2440 moveal %d0,%a2 49f7a: 202a 0008 movel %a2@(8),%d0 49f7e: 66f8 bnes 49f78 <_RBTree_Extract_unprotected+0x3e> * 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]; 49f80: 286a 0004 moveal %a2@(4),%a4 if(leaf) { 49f84: 4a8c tstl %a4 49f86: 6700 00fc beqw 4a084 <_RBTree_Extract_unprotected+0x14a> leaf->parent = target->parent; 49f8a: 2892 movel %a2@,%a4@ } 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]; 49f8c: 2252 moveal %a2@,%a1 49f8e: b5e9 0004 cmpal %a1@(4),%a2 49f92: 56c0 sne %d0 target->parent->child[dir] = leaf; 49f94: 7201 moveq #1,%d1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; 49f96: 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]; 49f98: 49c0 extbl %d0 target->parent->child[dir] = leaf; 49f9a: 9280 subl %d0,%d1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 49f9c: 2053 moveal %a3@,%a0 /* 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]; target->parent->child[dir] = leaf; 49f9e: 238c 1c00 movel %a4,%a1@(00000000,%d1:l:4) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 49fa2: b7e8 0004 cmpal %a0@(4),%a3 49fa6: 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; 49fa8: 202a 000c movel %a2@(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]; 49fac: 49c1 extbl %d1 the_node->parent->child[dir] = target; 49fae: 9481 subl %d1,%d2 49fb0: 218a 2c00 movel %a2,%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]; 49fb4: 256b 0008 0008 movel %a3@(8),%a2@(8) if (the_node->child[RBT_RIGHT]) 49fba: 206b 0008 moveal %a3@(8),%a0 49fbe: 4a88 tstl %a0 49fc0: 6702 beqs 49fc4 <_RBTree_Extract_unprotected+0x8a><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 49fc2: 208a movel %a2,%a0@ target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 49fc4: 256b 0004 0004 movel %a3@(4),%a2@(4) if (the_node->child[RBT_LEFT]) 49fca: 206b 0004 moveal %a3@(4),%a0 49fce: 4a88 tstl %a0 49fd0: 6702 beqs 49fd4 <_RBTree_Extract_unprotected+0x9a> the_node->child[RBT_LEFT]->parent = target; 49fd2: 208a movel %a2,%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; 49fd4: 2493 movel %a3@,%a2@ target->color = the_node->color; 49fd6: 256b 000c 000c movel %a3@(12),%a2@(12) /* 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 */ 49fdc: 4a80 tstl %d0 49fde: 6608 bnes 49fe8 <_RBTree_Extract_unprotected+0xae> if (leaf) { 49fe0: 4a8c tstl %a4 49fe2: 6704 beqs 49fe8 <_RBTree_Extract_unprotected+0xae> leaf->color = RBT_BLACK; /* case 2 */ 49fe4: 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; 49fe8: 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; 49fec: 42ab 0008 clrl %a3@(8) 49ff0: 42ab 0004 clrl %a3@(4) 49ff4: 4293 clrl %a3@ 49ff6: 4a88 tstl %a0 49ff8: 6704 beqs 49ffe <_RBTree_Extract_unprotected+0xc4> 49ffa: 42a8 000c clrl %a0@(12) } 49ffe: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a004: 4e5e unlk %fp 4a006: 4e75 rts * 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]) { 4a008: 284a moveal %a2,%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; 4a00a: 2893 movel %a3@,%a4@ } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4a00c: 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]; 4a00e: 2053 moveal %a3@,%a0 4a010: b7e8 0004 cmpal %a0@(4),%a3 4a014: 56c1 sne %d1 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; 4a016: 202b 000c movel %a3@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4a01a: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4a01c: 9481 subl %d1,%d2 4a01e: 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 */ 4a022: 4a80 tstl %d0 4a024: 66c2 bnes 49fe8 <_RBTree_Extract_unprotected+0xae> 4a026: 60b8 bras 49fe0 <_RBTree_Extract_unprotected+0xa6> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 4a028: 4878 0001 pea 1 4a02c: 2f0b movel %a3,%sp@- 4a02e: 4eb9 0004 a33c jsr 4a33c <_RBTree_Next_unprotected> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4a034: 508f addql #8,%sp 4a036: 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]) { 4a03a: b7ed 000c cmpal %a5@(12),%a3 4a03e: 6600 ff20 bnew 49f60 <_RBTree_Extract_unprotected+0x26> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 4a042: 42a7 clrl %sp@- 4a044: 2f0b movel %a3,%sp@- 4a046: 4eb9 0004 a33c jsr 4a33c <_RBTree_Next_unprotected> * 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]) { 4a04c: 246b 0004 moveal %a3@(4),%a2 /* 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]) { RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 4a050: 508f addql #8,%sp 4a052: 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]) { 4a056: 4a8a tstl %a2 4a058: 6600 ff10 bnew 49f6a <_RBTree_Extract_unprotected+0x30> * 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]; 4a05c: 286b 0008 moveal %a3@(8),%a4 if( leaf ) { 4a060: 4a8c tstl %a4 4a062: 66a6 bnes 4a00a <_RBTree_Extract_unprotected+0xd0> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4a064: 2f0b movel %a3,%sp@- } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4a066: 7401 moveq #1,%d2 the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4a068: 4eba fcc2 jsr %pc@(49d2c <_RBTree_Extract_validate_unprotected>) } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4a06c: 2053 moveal %a3@,%a0 4a06e: b7e8 0004 cmpal %a0@(4),%a3 4a072: 56c1 sne %d1 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; 4a074: 202b 000c movel %a3@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4a078: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4a07a: 9481 subl %d1,%d2 the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4a07c: 588f addql #4,%sp } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4a07e: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4) 4a082: 609e bras 4a022 <_RBTree_Extract_unprotected+0xe8> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4a084: 2f0a movel %a2,%sp@- 4a086: 4eba fca4 jsr %pc@(49d2c <_RBTree_Extract_validate_unprotected>) 4a08a: 588f addql #4,%sp 4a08c: 6000 fefe braw 49f8c <_RBTree_Extract_unprotected+0x52> =============================================================================== 00049d2c <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 49d2c: 4e56 ffec linkw %fp,#-20 49d30: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 49d34: 266e 0008 moveal %fp@(8),%a3 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 49d38: 2053 moveal %a3@,%a0 if(!parent->parent) return; 49d3a: 4a90 tstl %a0@ 49d3c: 677e beqs 49dbc <_RBTree_Extract_validate_unprotected+0x90> { 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]) 49d3e: 2268 0004 moveal %a0@(4),%a1 49d42: b3cb cmpal %a3,%a1 49d44: 6700 01de beqw 49f24 <_RBTree_Extract_validate_unprotected+0x1f8> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 49d48: 7401 moveq #1,%d2 49d4a: b4ab 000c cmpl %a3@(12),%d2 49d4e: 6764 beqs 49db4 <_RBTree_Extract_validate_unprotected+0x88> sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 49d50: 4a90 tstl %a0@ 49d52: 6760 beqs 49db4 <_RBTree_Extract_validate_unprotected+0x88> 49d54: 4a89 tstl %a1 49d56: 670a beqs 49d62 <_RBTree_Extract_validate_unprotected+0x36><== NEVER TAKEN 49d58: 7001 moveq #1,%d0 49d5a: b0a9 000c cmpl %a1@(12),%d0 49d5e: 6700 011c beqw 49e7c <_RBTree_Extract_validate_unprotected+0x150> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 49d62: 2469 0008 moveal %a1@(8),%a2 49d66: 4a8a tstl %a2 49d68: 6708 beqs 49d72 <_RBTree_Extract_validate_unprotected+0x46> 49d6a: 7601 moveq #1,%d3 49d6c: b6aa 000c cmpl %a2@(12),%d3 49d70: 6752 beqs 49dc4 <_RBTree_Extract_validate_unprotected+0x98> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 49d72: 2469 0004 moveal %a1@(4),%a2 49d76: 4a8a tstl %a2 49d78: 6708 beqs 49d82 <_RBTree_Extract_validate_unprotected+0x56> 49d7a: 7001 moveq #1,%d0 49d7c: b0aa 000c cmpl %a2@(12),%d0 49d80: 6742 beqs 49dc4 <_RBTree_Extract_validate_unprotected+0x98> sibling->color = RBT_RED; 49d82: 7001 moveq #1,%d0 49d84: 2340 000c movel %d0,%a1@(12) 49d88: b0a8 000c cmpl %a0@(12),%d0 49d8c: 6700 019e beqw 49f2c <_RBTree_Extract_validate_unprotected+0x200> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 49d90: 2450 moveal %a0@,%a2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 49d92: 4a8a tstl %a2 49d94: 6700 0154 beqw 49eea <_RBTree_Extract_validate_unprotected+0x1be> if(!(the_node->parent->parent)) return NULL; 49d98: 4a92 tstl %a2@ 49d9a: 6700 014e beqw 49eea <_RBTree_Extract_validate_unprotected+0x1be> if(the_node == the_node->parent->child[RBT_LEFT]) 49d9e: 226a 0004 moveal %a2@(4),%a1 49da2: b3c8 cmpal %a0,%a1 49da4: 6700 0138 beqw 49ede <_RBTree_Extract_validate_unprotected+0x1b2> 49da8: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 49daa: 204a moveal %a2,%a0 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 49dac: 7401 moveq #1,%d2 49dae: b4ab 000c cmpl %a3@(12),%d2 49db2: 669c bnes 49d50 <_RBTree_Extract_validate_unprotected+0x24><== ALWAYS TAKEN sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 49db4: 2053 moveal %a3@,%a0 49db6: 4a90 tstl %a0@ 49db8: 6700 0140 beqw 49efa <_RBTree_Extract_validate_unprotected+0x1ce> } 49dbc: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 49dc0: 4e5e unlk %fp 49dc2: 4e75 rts * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 49dc4: b7e8 0004 cmpal %a0@(4),%a3 49dc8: 56c0 sne %d0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 49dca: 7201 moveq #1,%d1 49dcc: 4480 negl %d0 49dce: b181 eorl %d0,%d1 49dd0: 0280 0000 00ff andil #255,%d0 49dd6: 0281 0000 00ff andil #255,%d1 if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 49ddc: 5281 addql #1,%d1 49dde: 2471 1c00 moveal %a1@(00000000,%d1:l:4),%a2 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 49de2: 4a8a tstl %a2 49de4: 670a beqs 49df0 <_RBTree_Extract_validate_unprotected+0xc4> 49de6: 7401 moveq #1,%d2 49de8: b4aa 000c cmpl %a2@(12),%d2 49dec: 6700 0118 beqw 49f06 <_RBTree_Extract_validate_unprotected+0x1da> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 49df0: 5280 addql #1,%d0 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 49df2: 7401 moveq #1,%d2 sibling->child[dir]->color = RBT_BLACK; 49df4: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 49df8: 2342 000c movel %d2,%a1@(12) sibling->child[dir]->color = RBT_BLACK; 49dfc: 42aa 000c clrl %a2@(12) RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 49e00: 4a8a tstl %a2 49e02: 672c beqs 49e30 <_RBTree_Extract_validate_unprotected+0x104><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 49e04: 49f2 1c00 lea %a2@(00000000,%d1:l:4),%a4 49e08: 2394 0c00 movel %a4@,%a1@(00000000,%d0:l:4) if (c->child[dir]) 49e0c: 2872 1c00 moveal %a2@(00000000,%d1:l:4),%a4 49e10: 4a8c tstl %a4 49e12: 6702 beqs 49e16 <_RBTree_Extract_validate_unprotected+0xea> c->child[dir]->parent = the_node; 49e14: 2889 movel %a1,%a4@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49e16: 2851 moveal %a1@,%a4 49e18: 7601 moveq #1,%d3 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; 49e1a: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49e1e: b3ec 0004 cmpal %a4@(4),%a1 49e22: 56c2 sne %d2 c->parent = the_node->parent; 49e24: 248c movel %a4,%a2@ 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; 49e26: 49c2 extbl %d2 49e28: 9682 subl %d2,%d3 49e2a: 298a 3c00 movel %a2,%a4@(00000000,%d3:l:4) c->parent = the_node->parent; the_node->parent = c; 49e2e: 228a movel %a2,%a1@ _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 49e30: 2870 1c00 moveal %a0@(00000000,%d1:l:4),%a4 } sibling->color = parent->color; 49e34: 2968 000c 000c movel %a0@(12),%a4@(12) 49e3a: 2274 1c00 moveal %a4@(00000000,%d1:l:4),%a1 parent->color = RBT_BLACK; 49e3e: 42a8 000c clrl %a0@(12) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 49e42: 42a9 000c clrl %a1@(12) RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 49e46: 43f4 0c00 lea %a4@(00000000,%d0:l:4),%a1 49e4a: 2191 1c00 movel %a1@,%a0@(00000000,%d1:l:4) if (c->child[dir]) 49e4e: 2274 0c00 moveal %a4@(00000000,%d0:l:4),%a1 49e52: 4a89 tstl %a1 49e54: 6702 beqs 49e58 <_RBTree_Extract_validate_unprotected+0x12c> c->child[dir]->parent = the_node; 49e56: 2288 movel %a0,%a1@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49e58: 2250 moveal %a0@,%a1 49e5a: 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; 49e5c: 2988 0c00 movel %a0,%a4@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49e60: b1e9 0004 cmpal %a1@(4),%a0 49e64: 56c0 sne %d0 c->parent = the_node->parent; 49e66: 2889 movel %a1,%a4@ 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; 49e68: 49c0 extbl %d0 49e6a: 9280 subl %d0,%d1 c->parent = the_node->parent; the_node->parent = c; 49e6c: 208c movel %a4,%a0@ _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 49e6e: 2053 moveal %a3@,%a0 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; 49e70: 238c 1c00 movel %a4,%a1@(00000000,%d1:l:4) 49e74: 4a90 tstl %a0@ 49e76: 6600 ff44 bnew 49dbc <_RBTree_Extract_validate_unprotected+0x90> 49e7a: 607e bras 49efa <_RBTree_Extract_validate_unprotected+0x1ce><== NOT EXECUTED * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 49e7c: b7e8 0004 cmpal %a0@(4),%a3 49e80: 56c1 sne %d1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 49e82: 7001 moveq #1,%d0 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 49e84: 7601 moveq #1,%d3 sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 49e86: 4481 negl %d1 49e88: b380 eorl %d1,%d0 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 49e8a: 2143 000c movel %d3,%a0@(12) 49e8e: 0280 0000 00ff andil #255,%d0 sibling->color = RBT_BLACK; 49e94: 42a9 000c clrl %a1@(12) RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 49e98: 5280 addql #1,%d0 49e9a: 2470 0c00 moveal %a0@(00000000,%d0:l:4),%a2 dir = the_node != parent->child[0]; 49e9e: 0281 0000 00ff andil #255,%d1 49ea4: 4a8a tstl %a2 49ea6: 674c beqs 49ef4 <_RBTree_Extract_validate_unprotected+0x1c8><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 49ea8: 5281 addql #1,%d1 49eaa: 43f2 1c00 lea %a2@(00000000,%d1:l:4),%a1 49eae: 2191 0c00 movel %a1@,%a0@(00000000,%d0:l:4) if (c->child[dir]) 49eb2: 2272 1c00 moveal %a2@(00000000,%d1:l:4),%a1 49eb6: 4a89 tstl %a1 49eb8: 6702 beqs 49ebc <_RBTree_Extract_validate_unprotected+0x190><== NEVER TAKEN c->child[dir]->parent = the_node; 49eba: 2288 movel %a0,%a1@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49ebc: 2250 moveal %a0@,%a1 49ebe: 7401 moveq #1,%d2 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; 49ec0: 2588 1c00 movel %a0,%a2@(00000000,%d1:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 49ec4: b1e9 0004 cmpal %a1@(4),%a0 49ec8: 56c1 sne %d1 c->parent = the_node->parent; 49eca: 2489 movel %a1,%a2@ 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; 49ecc: 49c1 extbl %d1 49ece: 9481 subl %d1,%d2 49ed0: 238a 2c00 movel %a2,%a1@(00000000,%d2:l:4) 49ed4: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 c->parent = the_node->parent; the_node->parent = c; 49ed8: 208a movel %a2,%a0@ 49eda: 6000 fe86 braw 49d62 <_RBTree_Extract_validate_unprotected+0x36> 49ede: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 49ee0: 204a moveal %a2,%a0 if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 49ee2: 226a 0008 moveal %a2@(8),%a1 49ee6: 6000 fec4 braw 49dac <_RBTree_Extract_validate_unprotected+0x80> 49eea: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 49eec: 93c9 subal %a1,%a1 49eee: 204a moveal %a2,%a0 49ef0: 6000 feba braw 49dac <_RBTree_Extract_validate_unprotected+0x80> RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 49ef4: 93c9 subal %a1,%a1 <== NOT EXECUTED 49ef6: 6000 fe6a braw 49d62 <_RBTree_Extract_validate_unprotected+0x36><== NOT EXECUTED sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 49efa: 42ab 000c clrl %a3@(12) } 49efe: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 49f02: 4e5e unlk %fp 49f04: 4e75 rts 49f06: 2870 1c00 moveal %a0@(00000000,%d1:l:4),%a4 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; 49f0a: 2368 000c 000c movel %a0@(12),%a1@(12) parent->color = RBT_BLACK; 49f10: 42a8 000c clrl %a0@(12) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 49f14: 42aa 000c clrl %a2@(12) 49f18: 4a8c tstl %a4 49f1a: 6700 fe98 beqw 49db4 <_RBTree_Extract_validate_unprotected+0x88> 49f1e: 5280 addql #1,%d0 49f20: 6000 ff24 braw 49e46 <_RBTree_Extract_validate_unprotected+0x11a> 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]) return the_node->parent->child[RBT_RIGHT]; 49f24: 2268 0008 moveal %a0@(8),%a1 49f28: 6000 fe1e braw 49d48 <_RBTree_Extract_validate_unprotected+0x1c> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 49f2c: 42a8 000c clrl %a0@(12) sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 49f30: 2053 moveal %a3@,%a0 49f32: 4a90 tstl %a0@ 49f34: 6600 fe86 bnew 49dbc <_RBTree_Extract_validate_unprotected+0x90> 49f38: 60c0 bras 49efa <_RBTree_Extract_validate_unprotected+0x1ce><== NOT EXECUTED =============================================================================== 0004a59c <_RBTree_Find>: { ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 4a59c: 203c 0000 0700 movel #1792,%d0 RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 4a5a2: 4e56 ffec linkw %fp,#-20 4a5a6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4a5aa: 266e 0008 moveal %fp@(8),%a3 4a5ae: 242e 000c movel %fp@(12),%d2 ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 4a5b2: 40c4 movew %sr,%d4 4a5b4: 8084 orl %d4,%d0 4a5b6: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 4a5b8: 246b 0004 moveal %a3@(4),%a2 RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4a5bc: 4283 clrl %d3 4a5be: 4a8a tstl %a2 4a5c0: 672a beqs 4a5ec <_RBTree_Find+0x50> <== NEVER TAKEN compare_result = the_rbtree->compare_function(the_node, iter_node); 4a5c2: 2f0a movel %a2,%sp@- 4a5c4: 206b 0010 moveal %a3@(16),%a0 4a5c8: 2f02 movel %d2,%sp@- 4a5ca: 4e90 jsr %a0@ if ( _RBTree_Is_equal( compare_result ) ) { 4a5cc: 508f addql #8,%sp 4a5ce: 4a80 tstl %d0 4a5d0: 6608 bnes 4a5da <_RBTree_Find+0x3e> found = iter_node; if ( the_rbtree->is_unique ) 4a5d2: 260a movel %a2,%d3 4a5d4: 4a2b 0014 tstb %a3@(20) 4a5d8: 6612 bnes 4a5ec <_RBTree_Find+0x50> RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 4a5da: 4a80 tstl %d0 4a5dc: 5ec1 sgt %d1 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4a5de: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 4a5e0: 49c1 extbl %d1 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4a5e2: 9081 subl %d1,%d0 4a5e4: 2472 0c00 moveal %a2@(00000000,%d0:l:4),%a2 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 4a5e8: 4a8a tstl %a2 4a5ea: 66d6 bnes 4a5c2 <_RBTree_Find+0x26> return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 4a5ec: 46c4 movew %d4,%sr return return_node; } 4a5ee: 2003 movel %d3,%d0 4a5f0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4a5f6: 4e5e unlk %fp ... =============================================================================== 0004a55c <_RBTree_Find_header>: { ISR_Level level; RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); 4a55c: 203c 0000 0700 movel #1792,%d0 #include RBTree_Control *_RBTree_Find_header( RBTree_Node *the_node ) { 4a562: 4e56 0000 linkw %fp,#0 4a566: 206e 0008 moveal %fp@(8),%a0 4a56a: 2f02 movel %d2,%sp@- ISR_Level level; RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); 4a56c: 40c2 movew %sr,%d2 4a56e: 8082 orl %d2,%d0 4a570: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; 4a572: 4a88 tstl %a0 4a574: 671a beqs 4a590 <_RBTree_Find_header+0x34> if(!(the_node->parent)) return NULL; 4a576: 2050 moveal %a0@,%a0 4a578: 4a88 tstl %a0 4a57a: 670a beqs 4a586 <_RBTree_Find_header+0x2a> 4a57c: 2210 movel %a0@,%d1 while(the_node->parent) the_node = the_node->parent; 4a57e: 6706 beqs 4a586 <_RBTree_Find_header+0x2a> <== NEVER TAKEN 4a580: 2041 moveal %d1,%a0 4a582: 2210 movel %a0@,%d1 4a584: 66fa bnes 4a580 <_RBTree_Find_header+0x24> return_header = _RBTree_Find_header_unprotected( the_node ); _ISR_Enable( level ); 4a586: 46c2 movew %d2,%sr return return_header; } 4a588: 241f movel %sp@+,%d2 4a58a: 2008 movel %a0,%d0 4a58c: 4e5e unlk %fp 4a58e: 4e75 rts */ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; 4a590: 91c8 subal %a0,%a0 RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); return_header = _RBTree_Find_header_unprotected( the_node ); _ISR_Enable( level ); 4a592: 46c2 movew %d2,%sr return return_header; } 4a594: 241f movel %sp@+,%d2 4a596: 2008 movel %a0,%d0 4a598: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a8f0 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4a8f0: 4e56 ffec linkw %fp,#-20 4a8f4: 202e 001c movel %fp@(28),%d0 4a8f8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4a8fc: 246e 0008 moveal %fp@(8),%a2 4a900: 242e 0014 movel %fp@(20),%d2 4a904: 282e 0018 movel %fp@(24),%d4 size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4a908: 4a8a tstl %a2 4a90a: 6736 beqs 4a942 <_RBTree_Initialize+0x52> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4a90c: 4292 clrl %a2@ the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 4a90e: 256e 000c 0010 movel %fp@(12),%a2@(16) the_rbtree->is_unique = is_unique; 4a914: 1540 0014 moveb %d0,%a2@(20) RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; 4a918: 42aa 0004 clrl %a2@(4) the_rbtree->first[0] = NULL; 4a91c: 42aa 0008 clrl %a2@(8) the_rbtree->first[1] = NULL; 4a920: 42aa 000c clrl %a2@(12) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4a924: 4a82 tstl %d2 4a926: 671a beqs 4a942 <_RBTree_Initialize+0x52> <== NEVER TAKEN 4a928: 262e 0010 movel %fp@(16),%d3 4a92c: 47f9 0004 a638 lea 4a638 <_RBTree_Insert_unprotected>,%a3 _RBTree_Insert_unprotected(the_rbtree, next); 4a932: 2f03 movel %d3,%sp@- #include #include #include #include void _RBTree_Initialize( 4a934: d684 addl %d4,%d3 4a936: 5382 subql #1,%d2 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert_unprotected(the_rbtree, next); 4a938: 2f0a movel %a2,%sp@- 4a93a: 4e93 jsr %a3@ /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4a93c: 508f addql #8,%sp 4a93e: 4a82 tstl %d2 4a940: 66f0 bnes 4a932 <_RBTree_Initialize+0x42> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 4a942: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4a948: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a0bc <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4a0bc: 4e56 ffe4 linkw %fp,#-28 4a0c0: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 4a0c4: 286e 0008 moveal %fp@(8),%a4 4a0c8: 266e 000c moveal %fp@(12),%a3 if(!the_node) return (RBTree_Node*)-1; 4a0cc: 4a8b tstl %a3 4a0ce: 6700 01b6 beqw 4a286 <_RBTree_Insert_unprotected+0x1ca> RBTree_Node *iter_node = the_rbtree->root; 4a0d2: 246c 0004 moveal %a4@(4),%a2 int compare_result; if (!iter_node) { /* special case: first node inserted */ 4a0d6: 4a8a tstl %a2 4a0d8: 6700 01ba beqw 4a294 <_RBTree_Insert_unprotected+0x1d8> 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); 4a0dc: 2f0a movel %a2,%sp@- 4a0de: 206c 0010 moveal %a4@(16),%a0 4a0e2: 2f0b movel %a3,%sp@- 4a0e4: 4e90 jsr %a0@ if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4a0e6: 508f addql #8,%sp return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4a0e8: 2400 movel %d0,%d2 4a0ea: 4682 notl %d2 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); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4a0ec: 4a2c 0014 tstb %a4@(20) 4a0f0: 6706 beqs 4a0f8 <_RBTree_Insert_unprotected+0x3c> 4a0f2: 4a80 tstl %d0 4a0f4: 6700 0182 beqw 4a278 <_RBTree_Insert_unprotected+0x1bc> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4a0f8: d482 addl %d2,%d2 4a0fa: 9582 subxl %d2,%d2 4a0fc: 4482 negl %d2 if (!iter_node->child[dir]) { 4a0fe: 2202 movel %d2,%d1 4a100: 5281 addql #1,%d1 4a102: 2632 1c00 movel %a2@(00000000,%d1:l:4),%d3 4a106: 6704 beqs 4a10c <_RBTree_Insert_unprotected+0x50> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 4a108: 2443 moveal %d3,%a2 4a10a: 60d0 bras 4a0dc <_RBTree_Insert_unprotected+0x20> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; iter_node->child[dir] = the_node; the_node->parent = iter_node; /* update min/max */ compare_result = the_rbtree->compare_function( 4a10c: 206c 0010 moveal %a4@(16),%a0 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; 4a110: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4a112: 2a42 moveal %d2,%a5 4a114: 548d addql #2,%a5 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; 4a116: 42ab 0008 clrl %a3@(8) 4a11a: 42ab 0004 clrl %a3@(4) the_node->color = RBT_RED; iter_node->child[dir] = the_node; 4a11e: 258b 1c00 movel %a3,%a2@(00000000,%d1:l:4) 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; 4a122: 2740 000c movel %d0,%a3@(12) iter_node->child[dir] = the_node; the_node->parent = iter_node; 4a126: 268a movel %a2,%a3@ /* update min/max */ compare_result = the_rbtree->compare_function( 4a128: 2f34 dc00 movel %a4@(00000000,%a5:l:4),%sp@- 4a12c: 2f0b movel %a3,%sp@- 4a12e: 4e90 jsr %a0@ the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 4a130: 508f addql #8,%sp 4a132: 4a82 tstl %d2 4a134: 6600 0124 bnew 4a25a <_RBTree_Insert_unprotected+0x19e> 4a138: 4a80 tstl %d0 4a13a: 6d00 0124 bltw 4a260 <_RBTree_Insert_unprotected+0x1a4> _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 4a13e: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4a140: 2250 moveal %a0@,%a1 4a142: 2449 moveal %a1,%a2 4a144: 4a89 tstl %a1 4a146: 6700 00ee beqw 4a236 <_RBTree_Insert_unprotected+0x17a> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4a14a: 7801 moveq #1,%d4 4a14c: b8a8 000c cmpl %a0@(12),%d4 4a150: 670c beqs 4a15e <_RBTree_Insert_unprotected+0xa2> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a152: 2003 movel %d3,%d0 4a154: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4a15a: 4e5e unlk %fp 4a15c: 4e75 rts ) { 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; 4a15e: 4a91 tstl %a1@ 4a160: 6700 0106 beqw 4a268 <_RBTree_Insert_unprotected+0x1ac> { 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]) 4a164: 2229 0004 movel %a1@(4),%d1 4a168: b288 cmpl %a0,%d1 4a16a: 6700 0104 beqw 4a270 <_RBTree_Insert_unprotected+0x1b4> 4a16e: 2841 moveal %d1,%a4 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4a170: 4a8c tstl %a4 4a172: 670a beqs 4a17e <_RBTree_Insert_unprotected+0xc2> 4a174: 7401 moveq #1,%d2 4a176: b4ac 000c cmpl %a4@(12),%d2 4a17a: 6700 00ca beqw 4a246 <_RBTree_Insert_unprotected+0x18a> 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]; 4a17e: b7e8 0004 cmpal %a0@(4),%a3 4a182: 56c2 sne %d2 RBTree_Direction pdir = the_node->parent != g->child[0]; 4a184: b288 cmpl %a0,%d1 4a186: 56c1 sne %d1 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]; 4a188: 49c2 extbl %d2 RBTree_Direction pdir = the_node->parent != g->child[0]; 4a18a: 49c1 extbl %d1 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]; 4a18c: 2001 movel %d1,%d0 4a18e: 4480 negl %d0 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4a190: b282 cmpl %d2,%d1 4a192: 6748 beqs 4a1dc <_RBTree_Insert_unprotected+0x120> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4a194: 4a80 tstl %d0 4a196: 57c2 seq %d2 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4a198: 7801 moveq #1,%d4 4a19a: 2200 movel %d0,%d1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4a19c: 49c2 extbl %d2 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4a19e: 9882 subl %d2,%d4 4a1a0: 5281 addql #1,%d1 4a1a2: 2870 4c00 moveal %a0@(00000000,%d4:l:4),%a4 4a1a6: 4a8c tstl %a4 4a1a8: 672c beqs 4a1d6 <_RBTree_Insert_unprotected+0x11a><== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4a1aa: 4bf4 1c00 lea %a4@(00000000,%d1:l:4),%a5 4a1ae: 2195 4c00 movel %a5@,%a0@(00000000,%d4:l:4) if (c->child[dir]) 4a1b2: 2a74 1c00 moveal %a4@(00000000,%d1:l:4),%a5 4a1b6: 4a8d tstl %a5 4a1b8: 6704 beqs 4a1be <_RBTree_Insert_unprotected+0x102> c->child[dir]->parent = the_node; 4a1ba: 2a88 movel %a0,%a5@ 4a1bc: 2250 moveal %a0@,%a1 c->child[dir] = the_node; 4a1be: 2988 1c00 movel %a0,%a4@(00000000,%d1:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4a1c2: 7801 moveq #1,%d4 4a1c4: b1e9 0004 cmpal %a1@(4),%a0 4a1c8: 56c2 sne %d2 c->parent = the_node->parent; 4a1ca: 2889 movel %a1,%a4@ 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; 4a1cc: 49c2 extbl %d2 4a1ce: 9882 subl %d2,%d4 4a1d0: 238c 4c00 movel %a4,%a1@(00000000,%d4:l:4) c->parent = the_node->parent; the_node->parent = c; 4a1d4: 208c movel %a4,%a0@ _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 4a1d6: 2673 1c00 moveal %a3@(00000000,%d1:l:4),%a3 4a1da: 2053 moveal %a3@,%a0 } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4a1dc: 7201 moveq #1,%d1 4a1de: 9280 subl %d0,%d1 4a1e0: 2001 movel %d1,%d0 4a1e2: 7201 moveq #1,%d1 if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; 4a1e4: 7401 moveq #1,%d2 4a1e6: b181 eorl %d0,%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; 4a1e8: 42a8 000c clrl %a0@(12) RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4a1ec: 5281 addql #1,%d1 4a1ee: 2072 1c00 moveal %a2@(00000000,%d1:l:4),%a0 g->color = RBT_RED; 4a1f2: 2542 000c movel %d2,%a2@(12) 4a1f6: 4a88 tstl %a0 4a1f8: 6700 ff44 beqw 4a13e <_RBTree_Insert_unprotected+0x82> c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4a1fc: 5280 addql #1,%d0 4a1fe: 43f0 0c00 lea %a0@(00000000,%d0:l:4),%a1 4a202: 2591 1c00 movel %a1@,%a2@(00000000,%d1:l:4) if (c->child[dir]) 4a206: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 4a20a: 4a89 tstl %a1 4a20c: 6702 beqs 4a210 <_RBTree_Insert_unprotected+0x154> c->child[dir]->parent = the_node; 4a20e: 228a movel %a2,%a1@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4a210: 2252 moveal %a2@,%a1 4a212: 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; 4a214: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4a218: b5e9 0004 cmpal %a1@(4),%a2 4a21c: 56c0 sne %d0 c->parent = the_node->parent; 4a21e: 2089 movel %a1,%a0@ 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; 4a220: 49c0 extbl %d0 4a222: 9280 subl %d0,%d1 4a224: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) c->parent = the_node->parent; the_node->parent = c; 4a228: 2488 movel %a0,%a2@ _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 4a22a: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4a22c: 2250 moveal %a0@,%a1 4a22e: 2449 moveal %a1,%a2 4a230: 4a89 tstl %a1 4a232: 6600 ff16 bnew 4a14a <_RBTree_Insert_unprotected+0x8e> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a236: 2003 movel %d3,%d0 /* 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; 4a238: 42ab 000c clrl %a3@(12) /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a23c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4a242: 4e5e unlk %fp 4a244: 4e75 rts u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 4a246: 42a8 000c clrl %a0@(12) u->color = RBT_BLACK; g->color = RBT_RED; 4a24a: 7401 moveq #1,%d2 4a24c: 2649 moveal %a1,%a3 g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; 4a24e: 42ac 000c clrl %a4@(12) g->color = RBT_RED; 4a252: 2342 000c movel %d2,%a1@(12) 4a256: 6000 fee6 braw 4a13e <_RBTree_Insert_unprotected+0x82> compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 4a25a: 4a80 tstl %d0 4a25c: 6f00 fee0 blew 4a13e <_RBTree_Insert_unprotected+0x82> the_rbtree->first[dir] = the_node; 4a260: 298b dc00 movel %a3,%a4@(00000000,%a5:l:4) 4a264: 6000 fed8 braw 4a13e <_RBTree_Insert_unprotected+0x82> 4a268: 2229 0004 movel %a1@(4),%d1 <== NOT EXECUTED 4a26c: 6000 ff10 braw 4a17e <_RBTree_Insert_unprotected+0xc2><== NOT EXECUTED 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]) return the_node->parent->child[RBT_RIGHT]; 4a270: 2869 0008 moveal %a1@(8),%a4 4a274: 6000 fefa braw 4a170 <_RBTree_Insert_unprotected+0xb4> 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); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4a278: 260a movel %a2,%d3 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a27a: 2003 movel %d3,%d0 4a27c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4a282: 4e5e unlk %fp 4a284: 4e75 rts RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 4a286: 76ff moveq #-1,%d3 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a288: 2003 movel %d3,%d0 4a28a: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4a290: 4e5e unlk %fp 4a292: 4e75 rts RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; 4a294: 42ab 000c clrl %a3@(12) } /* while(iter_node) */ /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; 4a298: 4283 clrl %d3 } 4a29a: 2003 movel %d3,%d0 RBTree_Node *iter_node = the_rbtree->root; int compare_result; if (!iter_node) { /* special case: first node inserted */ the_node->color = RBT_BLACK; the_rbtree->root = the_node; 4a29c: 294b 0004 movel %a3,%a4@(4) the_rbtree->first[0] = the_rbtree->first[1] = the_node; 4a2a0: 294b 000c movel %a3,%a4@(12) 4a2a4: 294b 0008 movel %a3,%a4@(8) the_node->parent = (RBTree_Node *) the_rbtree; 4a2a8: 268c movel %a4,%a3@ the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4a2aa: 42ab 0008 clrl %a3@(8) 4a2ae: 42ab 0004 clrl %a3@(4) /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4a2b2: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4a2b8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a2e8 <_RBTree_Iterate_unprotected>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4a2e8: 7202 moveq #2,%d1 const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4a2ea: 4e56 ffe8 linkw %fp,#-24 4a2ee: 206e 0008 moveal %fp@(8),%a0 4a2f2: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4a2f6: 262e 000c movel %fp@(12),%d3 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4a2fa: 57c0 seq %d0 4a2fc: 246e 0010 moveal %fp@(16),%a2 4a300: 49c0 extbl %d0 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4a302: 9280 subl %d0,%d1 4a304: 47f9 0004 a33c lea 4a33c <_RBTree_Next_unprotected>,%a3 4a30a: 2430 1c00 movel %a0@(00000000,%d1:l:4),%d2 4a30e: 2a2e 0014 movel %fp@(20),%d5 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 4a312: 4a82 tstl %d2 4a314: 671a beqs 4a330 <_RBTree_Iterate_unprotected+0x48> stop = (*visitor)( current, dir, visitor_arg ); 4a316: 2f05 movel %d5,%sp@- 4a318: 2f03 movel %d3,%sp@- 4a31a: 2f02 movel %d2,%sp@- 4a31c: 4e92 jsr %a2@ current = _RBTree_Next_unprotected( current, dir ); 4a31e: 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 ); 4a320: 1800 moveb %d0,%d4 current = _RBTree_Next_unprotected( current, dir ); 4a322: 2f02 movel %d2,%sp@- 4a324: 4e93 jsr %a3@ { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 4a326: 4fef 0014 lea %sp@(20),%sp stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); 4a32a: 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 ) { 4a32c: 4a04 tstb %d4 4a32e: 67e2 beqs 4a312 <_RBTree_Iterate_unprotected+0x2a><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 4a330: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4a336: 4e5e unlk %fp ... =============================================================================== 0004a33c <_RBTree_Next_unprotected>: RBTree_Node *_RBTree_Next_unprotected( const RBTree_Node *node, RBTree_Direction dir ) { 4a33c: 4e56 0000 linkw %fp,#0 4a340: 222e 000c movel %fp@(12),%d1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4a344: 57c0 seq %d0 4a346: 226e 0008 moveal %fp@(8),%a1 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); RBTree_Node *current = node->child [dir]; 4a34a: 5281 addql #1,%d1 4a34c: 49c0 extbl %d0 4a34e: 4480 negl %d0 4a350: 2071 1c00 moveal %a1@(00000000,%d1:l:4),%a0 RBTree_Node *_RBTree_Next_unprotected( const RBTree_Node *node, RBTree_Direction dir ) { 4a354: 2f0a movel %a2,%sp@- RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); RBTree_Node *current = node->child [dir]; RBTree_Node *next = NULL; if ( current != NULL ) { 4a356: 4a88 tstl %a0 4a358: 6718 beqs 4a372 <_RBTree_Next_unprotected+0x36> 4a35a: 5280 addql #1,%d0 next = current; while ( (current = current->child [opp_dir]) != NULL ) { 4a35c: 2230 0c00 movel %a0@(00000000,%d0:l:4),%d1 4a360: 6708 beqs 4a36a <_RBTree_Next_unprotected+0x2e> 4a362: 2041 moveal %d1,%a0 4a364: 2230 0c00 movel %a0@(00000000,%d0:l:4),%d1 4a368: 66f8 bnes 4a362 <_RBTree_Next_unprotected+0x26> <== NEVER TAKEN } } } return next; } 4a36a: 245f moveal %sp@+,%a2 RBTree_Node *parent = node->parent; if ( parent->parent && node == parent->child [opp_dir] ) { next = parent; } else { while ( parent->parent && node == parent->child [dir] ) { 4a36c: 2008 movel %a0,%d0 } } } return next; } 4a36e: 4e5e unlk %fp 4a370: 4e75 rts next = current; while ( (current = current->child [opp_dir]) != NULL ) { next = current; } } else { RBTree_Node *parent = node->parent; 4a372: 2051 moveal %a1@,%a0 if ( parent->parent && node == parent->child [opp_dir] ) { 4a374: 2450 moveal %a0@,%a2 4a376: 4a8a tstl %a2 4a378: 6706 beqs 4a380 <_RBTree_Next_unprotected+0x44> 4a37a: b3f0 0c04 cmpal %a0@(00000004,%d0:l:4),%a1 4a37e: 67ea beqs 4a36a <_RBTree_Next_unprotected+0x2e> next = parent; } else { while ( parent->parent && node == parent->child [dir] ) { 4a380: 4a8a tstl %a2 4a382: 670e beqs 4a392 <_RBTree_Next_unprotected+0x56> 4a384: b3f0 1c00 cmpal %a0@(00000000,%d1:l:4),%a1 4a388: 66e0 bnes 4a36a <_RBTree_Next_unprotected+0x2e> 4a38a: 2248 moveal %a0,%a1 4a38c: 204a moveal %a2,%a0 4a38e: 2452 moveal %a2@,%a2 4a390: 60ee bras 4a380 <_RBTree_Next_unprotected+0x44> } } } return next; } 4a392: 245f moveal %sp@+,%a2 RBTree_Direction dir ) { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); RBTree_Node *current = node->child [dir]; RBTree_Node *next = NULL; 4a394: 4280 clrl %d0 } } } return next; } 4a396: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000486cc <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 486cc: 4e56 ffec linkw %fp,#-20 486d0: 206e 0008 moveal %fp@(8),%a0 486d4: 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 ]; 486d8: 2468 00f8 moveal %a0@(248),%a2 if ( !api ) 486dc: 4a8a tstl %a2 486de: 671a beqs 486fa <_RTEMS_signal_Post_switch_hook+0x2e><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 486e0: 203c 0000 0700 movel #1792,%d0 486e6: 40c1 movew %sr,%d1 486e8: 8081 orl %d1,%d0 486ea: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 486ec: 242a 0012 movel %a2@(18),%d2 asr->signals_posted = 0; 486f0: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 486f4: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 486f6: 4a82 tstl %d2 486f8: 660a bnes 48704 <_RTEMS_signal_Post_switch_hook+0x38> (*asr->handler)( signal_set ); asr->nest_level -= 1; rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); } 486fa: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 48700: 4e5e unlk %fp 48702: 4e75 rts if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 48704: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 48708: 260e movel %fp,%d3 4870a: 5983 subql #4,%d3 4870c: 47f9 0004 8b5c lea 48b5c ,%a3 48712: 2f03 movel %d3,%sp@- 48714: 2f3c 0000 ffff movel #65535,%sp@- 4871a: 2f2a 000e movel %a2@(14),%sp@- 4871e: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 48720: 2f02 movel %d2,%sp@- 48722: 206a 000a moveal %a2@(10),%a0 48726: 4e90 jsr %a0@ asr->nest_level -= 1; 48728: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4872c: 2f03 movel %d3,%sp@- 4872e: 2f3c 0000 ffff movel #65535,%sp@- 48734: 2f2e fffc movel %fp@(-4),%sp@- 48738: 4e93 jsr %a3@ 4873a: 4fef 001c lea %sp@(28),%sp } 4873e: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 48744: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c3d6 <_RTEMS_tasks_Create_extension>: static bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 4c3d6: 4e56 0000 linkw %fp,#0 4c3da: 2f0a movel %a2,%sp@- 4c3dc: 246e 000c moveal %fp@(12),%a2 /* * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) 4c3e0: 4a39 0005 e1a6 tstb 5e1a6 4c3e6: 675c beqs 4c444 <_RTEMS_tasks_Create_extension+0x6e> /* * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); 4c3e8: 705e moveq #94,%d0 if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4c3ea: 2f00 movel %d0,%sp@- 4c3ec: 4eb9 0004 abf4 jsr 4abf4 <_Workspace_Allocate> if ( !api ) 4c3f2: 588f addql #4,%sp */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4c3f4: 2040 moveal %d0,%a0 if ( !api ) 4c3f6: 4a80 tstl %d0 4c3f8: 675c beqs 4c456 <_RTEMS_tasks_Create_extension+0x80> return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4c3fa: 2540 00f8 movel %d0,%a2@(248) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 4c3fe: 4200 clrb %d0 4c400: 4290 clrl %a0@ 4c402: 1140 0008 moveb %d0,%a0@(8) 4c406: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4c40a: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4c40e: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 4c412: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 4c416: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4c41a: 42a8 001a clrl %a0@(26) _Event_Initialize( &api->Event ); _Event_Initialize( &api->System_event ); _ASR_Initialize( &api->Signal ); created->task_variables = NULL; 4c41e: 42aa 0104 clrl %a2@(260) if ( rtems_configuration_get_notepads_enabled() ) { 4c422: 4a39 0005 e1a6 tstb 5e1a6 4c428: 6710 beqs 4c43a <_RTEMS_tasks_Create_extension+0x64> * task is created via another API, then this routine is invoked * and this API given the opportunity to initialize its extension * area. */ static bool _RTEMS_tasks_Create_extension( 4c42a: 41e8 001e lea %a0@(30),%a0 4c42e: 4280 clrl %d0 _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4c430: 4298 clrl %a0@+ _Event_Initialize( &api->System_event ); _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) 4c432: 5280 addql #1,%d0 4c434: 7210 moveq #16,%d1 4c436: b280 cmpl %d0,%d1 4c438: 66f6 bnes 4c430 <_RTEMS_tasks_Create_extension+0x5a> api->Notepads[i] = 0; } return true; } 4c43a: 246e fffc moveal %fp@(-4),%a2 4c43e: 4e5e unlk %fp if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; 4c440: 7001 moveq #1,%d0 } 4c442: 4e75 rts * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); 4c444: 701e moveq #30,%d0 api = _Workspace_Allocate( to_allocate ); 4c446: 2f00 movel %d0,%sp@- 4c448: 4eb9 0004 abf4 jsr 4abf4 <_Workspace_Allocate> if ( !api ) 4c44e: 588f addql #4,%sp */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4c450: 2040 moveal %d0,%a0 if ( !api ) 4c452: 4a80 tstl %d0 4c454: 66a4 bnes 4c3fa <_RTEMS_tasks_Create_extension+0x24><== ALWAYS TAKEN for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4c456: 246e fffc moveal %fp@(-4),%a2 4c45a: 4e5e unlk %fp to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; 4c45c: 4200 clrb %d0 <== NOT EXECUTED for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } =============================================================================== 00047908 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 47908: 4e56 ffe4 linkw %fp,#-28 4790c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 47910: 2479 0005 e1cc moveal 5e1cc ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 47916: 2639 0005 e1c8 movel 5e1c8 ,%d3 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 4791c: 4a8a tstl %a2 4791e: 6754 beqs 47974 <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 47920: 4a83 tstl %d3 47922: 6750 beqs 47974 <_RTEMS_tasks_Initialize_user_tasks_body+0x6c><== NEVER TAKEN 47924: 280e movel %fp,%d4 47926: 4282 clrl %d2 47928: 5984 subql #4,%d4 4792a: 47f9 0004 76c4 lea 476c4 ,%a3 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 47930: 49f9 0004 7990 lea 47990 ,%a4 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 47936: 2f04 movel %d4,%sp@- 47938: 2f2a 000c movel %a2@(12),%sp@- 4793c: 2f2a 0014 movel %a2@(20),%sp@- 47940: 2f2a 0004 movel %a2@(4),%sp@- 47944: 2f2a 0008 movel %a2@(8),%sp@- 47948: 2f12 movel %a2@,%sp@- 4794a: 4e93 jsr %a3@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 4794c: 4fef 0018 lea %sp@(24),%sp 47950: 4a80 tstl %d0 47952: 662a bnes 4797e <_RTEMS_tasks_Initialize_user_tasks_body+0x76> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 47954: 2f2a 0018 movel %a2@(24),%sp@- 47958: 2f2a 0010 movel %a2@(16),%sp@- 4795c: 2f2e fffc movel %fp@(-4),%sp@- 47960: 4e94 jsr %a4@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 47962: 4fef 000c lea %sp@(12),%sp 47966: 4a80 tstl %d0 47968: 6614 bnes 4797e <_RTEMS_tasks_Initialize_user_tasks_body+0x76> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 4796a: 5282 addql #1,%d2 4796c: 45ea 001c lea %a2@(28),%a2 47970: b682 cmpl %d2,%d3 47972: 66c2 bnes 47936 <_RTEMS_tasks_Initialize_user_tasks_body+0x2e><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 47974: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 4797a: 4e5e unlk %fp 4797c: 4e75 rts id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 4797e: 2f00 movel %d0,%sp@- 47980: 4878 0001 pea 1 47984: 4878 0001 pea 1 47988: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> ... =============================================================================== 0004c336 <_RTEMS_tasks_Switch_extension>: static void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 4c336: 4e56 0000 linkw %fp,#0 4c33a: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 4c33e: 2068 0104 moveal %a0@(260),%a0 while (tvp) { 4c342: 4a88 tstl %a0 4c344: 6712 beqs 4c358 <_RTEMS_tasks_Switch_extension+0x22> tvp->tval = *tvp->ptr; 4c346: 2268 0004 moveal %a0@(4),%a1 4c34a: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 4c34e: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4c352: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 4c354: 4a88 tstl %a0 4c356: 66ee bnes 4c346 <_RTEMS_tasks_Switch_extension+0x10><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 4c358: 206e 000c moveal %fp@(12),%a0 4c35c: 2068 0104 moveal %a0@(260),%a0 while (tvp) { 4c360: 4a88 tstl %a0 4c362: 6712 beqs 4c376 <_RTEMS_tasks_Switch_extension+0x40> tvp->gval = *tvp->ptr; 4c364: 2268 0004 moveal %a0@(4),%a1 4c368: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 4c36c: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4c370: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 4c372: 4a88 tstl %a0 4c374: 66ee bnes 4c364 <_RTEMS_tasks_Switch_extension+0x2e><== NEVER TAKEN tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 4c376: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00073c48 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 73c48: 4e56 fffc linkw %fp,#-4 73c4c: 2f0a movel %a2,%sp@- 73c4e: 486e fffc pea %fp@(-4) 73c52: 2f2e 0008 movel %fp@(8),%sp@- 73c56: 4879 000a 01c0 pea a01c0 <_Rate_monotonic_Information> 73c5c: 4eb9 0004 8c00 jsr 48c00 <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 73c62: 4fef 000c lea %sp@(12),%sp 73c66: 2440 moveal %d0,%a2 73c68: 4aae fffc tstl %fp@(-4) 73c6c: 6636 bnes 73ca4 <_Rate_monotonic_Timeout+0x5c> <== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 73c6e: 206a 0040 moveal %a2@(64),%a0 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 73c72: 2028 0010 movel %a0@(16),%d0 73c76: 0280 0000 4000 andil #16384,%d0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 73c7c: 670a beqs 73c88 <_Rate_monotonic_Timeout+0x40> 73c7e: 202a 0008 movel %a2@(8),%d0 73c82: b0a8 0020 cmpl %a0@(32),%d0 73c86: 675e beqs 73ce6 <_Rate_monotonic_Timeout+0x9e> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 73c88: 7001 moveq #1,%d0 73c8a: b0aa 0038 cmpl %a2@(56),%d0 73c8e: 671c beqs 73cac <_Rate_monotonic_Timeout+0x64> _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 73c90: 7004 moveq #4,%d0 73c92: 2540 0038 movel %d0,%a2@(56) * * 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; 73c96: 2039 0009 fe7a movel 9fe7a <_Thread_Dispatch_disable_level>,%d0 --level; 73c9c: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 73c9e: 23c0 0009 fe7a movel %d0,9fe7a <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 73ca4: 246e fff8 moveal %fp@(-8),%a2 73ca8: 4e5e unlk %fp 73caa: 4e75 rts _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 73cac: 103c 0003 moveb #3,%d0 73cb0: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 73cb4: 2f0a movel %a2,%sp@- 73cb6: 4eb9 0007 3984 jsr 73984 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 73cbc: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 73cc2: 486a 0010 pea %a2@(16) 73cc6: 4879 0009 ff16 pea 9ff16 <_Watchdog_Ticks_chain> 73ccc: 4eb9 0004 a548 jsr 4a548 <_Watchdog_Insert> 73cd2: 4fef 000c lea %sp@(12),%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; 73cd6: 2039 0009 fe7a movel 9fe7a <_Thread_Dispatch_disable_level>,%d0 --level; 73cdc: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 73cde: 23c0 0009 fe7a movel %d0,9fe7a <_Thread_Dispatch_disable_level> 73ce4: 60be bras 73ca4 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 73ce6: 2f3c 1007 fff8 movel #268959736,%sp@- 73cec: 2f08 movel %a0,%sp@- 73cee: 4eb9 0004 94e8 jsr 494e8 <_Thread_Clear_state> the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 73cf4: 2f0a movel %a2,%sp@- 73cf6: 4eb9 0007 3984 jsr 73984 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 73cfc: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 73d02: 486a 0010 pea %a2@(16) 73d06: 4879 0009 ff16 pea 9ff16 <_Watchdog_Ticks_chain> 73d0c: 4eb9 0004 a548 jsr 4a548 <_Watchdog_Insert> 73d12: 4fef 0014 lea %sp@(20),%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; 73d16: 2039 0009 fe7a movel 9fe7a <_Thread_Dispatch_disable_level>,%d0 --level; 73d1c: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 73d1e: 23c0 0009 fe7a movel %d0,9fe7a <_Thread_Dispatch_disable_level> 73d24: 6000 ff7e braw 73ca4 <_Rate_monotonic_Timeout+0x5c> =============================================================================== 00049bc0 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 49bc0: 4e56 0000 linkw %fp,#0 49bc4: 2f0a movel %a2,%sp@- void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 49bc6: 4878 001c pea 1c #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 49bca: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 49bce: 4eb9 0004 b5e8 jsr 4b5e8 <_Workspace_Allocate> if ( sched ) { 49bd4: 588f addql #4,%sp 49bd6: 4a80 tstl %d0 49bd8: 6712 beqs 49bec <_Scheduler_CBS_Allocate+0x2c> <== NEVER TAKEN the_thread->scheduler_info = sched; 49bda: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 49bde: 2040 moveal %d0,%a0 schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49be0: 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; 49be2: 208a movel %a2,%a0@ schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49be4: 2141 0014 movel %d1,%a0@(20) schinfo->cbs_server = NULL; 49be8: 42a8 0018 clrl %a0@(24) } return sched; } 49bec: 246e fffc moveal %fp@(-4),%a2 49bf0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b2f8 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4b2f8: 4e56 fffc linkw %fp,#-4 4b2fc: 2f0a movel %a2,%sp@- 4b2fe: 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; 4b302: 202a 00a8 movel %a2@(168),%d0 if ( the_thread->real_priority != new_priority ) 4b306: b0aa 0018 cmpl %a2@(24),%d0 4b30a: 6704 beqs 4b310 <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN the_thread->real_priority = new_priority; 4b30c: 2540 0018 movel %d0,%a2@(24) if ( the_thread->current_priority != new_priority ) 4b310: b0aa 0014 cmpl %a2@(20),%d0 4b314: 6712 beqs 4b328 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 4b316: 4878 0001 pea 1 4b31a: 2f00 movel %d0,%sp@- 4b31c: 2f0a movel %a2,%sp@- 4b31e: 4eb9 0004 b8d0 jsr 4b8d0 <_Thread_Change_priority> 4b324: 4fef 000c lea %sp@(12),%sp /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4b328: 246a 0086 moveal %a2@(134),%a2 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4b32c: 206a 0018 moveal %a2@(24),%a0 4b330: 4aa8 000c tstl %a0@(12) 4b334: 671e beqs 4b354 <_Scheduler_CBS_Budget_callout+0x5c> _Scheduler_CBS_Get_server_id( 4b336: 486e fffc pea %fp@(-4) 4b33a: 2f10 movel %a0@,%sp@- 4b33c: 4eb9 0004 b2b4 jsr 4b2b4 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 4b342: 206a 0018 moveal %a2@(24),%a0 4b346: 2f2e fffc movel %fp@(-4),%sp@- 4b34a: 2068 000c moveal %a0@(12),%a0 4b34e: 4e90 jsr %a0@ 4b350: 4fef 000c lea %sp@(12),%sp } } 4b354: 246e fff8 moveal %fp@(-8),%a2 4b358: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004aeb0 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 4aeb0: 4e56 0000 linkw %fp,#0 4aeb4: 2079 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a0 4aeba: 2f0a movel %a2,%sp@- 4aebc: 2f02 movel %d2,%sp@- unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4aebe: 4ab9 0006 18fc tstl 618fc <_Scheduler_CBS_Maximum_servers> 4aec4: 6724 beqs 4aeea <_Scheduler_CBS_Cleanup+0x3a> <== NEVER TAKEN 4aec6: 4282 clrl %d2 if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); 4aec8: 45f9 0004 afb8 lea 4afb8 <_Scheduler_CBS_Destroy_server>,%a2 int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[ i ] ) 4aece: 4ab0 2c00 tstl %a0@(00000000,%d2:l:4) 4aed2: 670c beqs 4aee0 <_Scheduler_CBS_Cleanup+0x30> _Scheduler_CBS_Destroy_server( i ); 4aed4: 2f02 movel %d2,%sp@- 4aed6: 4e92 jsr %a2@ 4aed8: 2079 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a0 4aede: 588f addql #4,%sp int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4aee0: 5282 addql #1,%d2 4aee2: b4b9 0006 18fc cmpl 618fc <_Scheduler_CBS_Maximum_servers>,%d2 4aee8: 65e4 bcss 4aece <_Scheduler_CBS_Cleanup+0x1e> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 4aeea: 2f08 movel %a0,%sp@- 4aeec: 4eb9 0004 cd80 jsr 4cd80 <_Workspace_Free> return SCHEDULER_CBS_OK; } 4aef2: 242e fff8 movel %fp@(-8),%d2 4aef6: 4280 clrl %d0 4aef8: 246e fffc moveal %fp@(-4),%a2 4aefc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004af00 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4af00: 4e56 fff0 linkw %fp,#-16 4af04: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4af08: 266e 0008 moveal %fp@(8),%a3 4af0c: 246e 0010 moveal %fp@(16),%a2 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4af10: 4aab 0004 tstl %a3@(4) 4af14: 6f00 0088 blew 4af9e <_Scheduler_CBS_Create_server+0x9e> 4af18: 4a93 tstl %a3@ 4af1a: 6f00 0082 blew 4af9e <_Scheduler_CBS_Create_server+0x9e> 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++ ) { 4af1e: 2239 0006 18fc movel 618fc <_Scheduler_CBS_Maximum_servers>,%d1 4af24: 6766 beqs 4af8c <_Scheduler_CBS_Create_server+0x8c><== NEVER TAKEN if ( !_Scheduler_CBS_Server_list[i] ) 4af26: 2279 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a1 4af2c: 4a91 tstl %a1@ 4af2e: 6768 beqs 4af98 <_Scheduler_CBS_Create_server+0x98> #include #include #include #include int _Scheduler_CBS_Create_server ( 4af30: 41e9 0004 lea %a1@(4),%a0 4af34: 4280 clrl %d0 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++ ) { 4af36: 5280 addql #1,%d0 4af38: b280 cmpl %d0,%d1 4af3a: 6750 beqs 4af8c <_Scheduler_CBS_Create_server+0x8c> if ( !_Scheduler_CBS_Server_list[i] ) 4af3c: 4a98 tstl %a0@+ 4af3e: 66f6 bnes 4af36 <_Scheduler_CBS_Create_server+0x36> 4af40: 2200 movel %d0,%d1 4af42: e589 lsll #2,%d1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4af44: 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 *) 4af48: 49f1 1800 lea %a1@(00000000,%d1:l),%a4 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4af4c: 2480 movel %d0,%a2@ _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4af4e: 4eb9 0004 cd64 jsr 4cd64 <_Workspace_Allocate> the_server = _Scheduler_CBS_Server_list[*server_id]; 4af54: 2212 movel %a2@,%d1 if ( !the_server ) 4af56: 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 *) 4af58: 2880 movel %d0,%a4@ _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4af5a: 2079 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a0 4af60: 2070 1c00 moveal %a0@(00000000,%d1:l:4),%a0 if ( !the_server ) 4af64: 4a88 tstl %a0 4af66: 6742 beqs 4afaa <_Scheduler_CBS_Create_server+0xaa><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4af68: 4280 clrl %d0 _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; 4af6a: 2213 movel %a3@,%d1 4af6c: 242b 0004 movel %a3@(4),%d2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4af70: 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; 4af76: 2141 0004 movel %d1,%a0@(4) 4af7a: 2142 0008 movel %d2,%a0@(8) the_server->task_id = -1; 4af7e: 72ff moveq #-1,%d1 the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4af80: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; the_server->task_id = -1; 4af86: 2081 movel %d1,%a0@ the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4af88: 4e5e unlk %fp 4af8a: 4e75 rts if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 4af8c: 70e6 moveq #-26,%d0 the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4af8e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4af94: 4e5e unlk %fp 4af96: 4e75 rts 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++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 4af98: 4281 clrl %d1 4af9a: 4280 clrl %d0 4af9c: 60a6 bras 4af44 <_Scheduler_CBS_Create_server+0x44> 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; 4af9e: 70ee moveq #-18,%d0 the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4afa0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4afa6: 4e5e unlk %fp 4afa8: 4e75 rts *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; 4afaa: 70ef moveq #-17,%d0 <== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 4afac: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 <== NOT EXECUTED 4afb2: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0004b058 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4b058: 4e56 fff0 linkw %fp,#-16 4b05c: 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); 4b060: 486e fffc pea %fp@(-4) int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4b064: 242e 000c movel %fp@(12),%d2 4b068: 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); 4b06c: 2f02 movel %d2,%sp@- 4b06e: 4eb9 0004 bdd4 jsr 4bdd4 <_Thread_Get> /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4b074: 508f addql #8,%sp { Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4b076: 2440 moveal %d0,%a2 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4b078: 4a80 tstl %d0 4b07a: 674a beqs 4b0c6 <_Scheduler_CBS_Detach_thread+0x6e> _Thread_Enable_dispatch(); 4b07c: 4eb9 0004 bdb4 jsr 4bdb4 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4b082: b6b9 0006 18fc cmpl 618fc <_Scheduler_CBS_Maximum_servers>,%d3 4b088: 643c bccs 4b0c6 <_Scheduler_CBS_Detach_thread+0x6e> 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] ) 4b08a: 2079 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a0 4b090: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 4b094: 4a88 tstl %a0 4b096: 673a beqs 4b0d2 <_Scheduler_CBS_Detach_thread+0x7a> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4b098: b490 cmpl %a0@,%d2 4b09a: 662a bnes 4b0c6 <_Scheduler_CBS_Detach_thread+0x6e><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4b09c: 70ff moveq #-1,%d0 4b09e: 2080 movel %d0,%a0@ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4b0a0: 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; 4b0a4: 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; 4b0a6: 42a8 0018 clrl %a0@(24) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4b0aa: 256a 009c 0076 movel %a2@(156),%a2@(118) the_thread->budget_callout = the_thread->Start.budget_callout; 4b0b0: 256a 00a0 007a movel %a2@(160),%a2@(122) the_thread->is_preemptible = the_thread->Start.is_preemptible; 4b0b6: 156a 009a 0070 moveb %a2@(154),%a2@(112) return SCHEDULER_CBS_OK; } 4b0bc: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4b0c2: 4e5e unlk %fp 4b0c4: 4e75 rts if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4b0c6: 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; } 4b0c8: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4b0ce: 4e5e unlk %fp 4b0d0: 4e75 rts 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; 4b0d2: 70e7 moveq #-25,%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; } 4b0d4: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4b0da: 4e5e unlk %fp ... =============================================================================== 0004b2b4 <_Scheduler_CBS_Get_server_id>: int _Scheduler_CBS_Get_server_id ( rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { 4b2b4: 4e56 0000 linkw %fp,#0 unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4b2b8: 2239 0006 18fc movel 618fc <_Scheduler_CBS_Maximum_servers>,%d1 int _Scheduler_CBS_Get_server_id ( rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { 4b2be: 2f02 movel %d2,%sp@- 4b2c0: 242e 0008 movel %fp@(8),%d2 unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4b2c4: 4a81 tstl %d1 4b2c6: 6718 beqs 4b2e0 <_Scheduler_CBS_Get_server_id+0x2c><== NEVER TAKEN 4b2c8: 2279 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a1 4b2ce: 4280 clrl %d0 if ( _Scheduler_CBS_Server_list[i] && 4b2d0: 2059 moveal %a1@+,%a0 4b2d2: 4a88 tstl %a0 4b2d4: 6704 beqs 4b2da <_Scheduler_CBS_Get_server_id+0x26> 4b2d6: b490 cmpl %a0@,%d2 4b2d8: 670e beqs 4b2e8 <_Scheduler_CBS_Get_server_id+0x34> rtems_id task_id, Scheduler_CBS_Server_id *server_id ) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4b2da: 5280 addql #1,%d0 4b2dc: b280 cmpl %d0,%d1 4b2de: 66f0 bnes 4b2d0 <_Scheduler_CBS_Get_server_id+0x1c> *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 4b2e0: 241f movel %sp@+,%d2 _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; 4b2e2: 70e7 moveq #-25,%d0 } 4b2e4: 4e5e unlk %fp 4b2e6: 4e75 rts { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; 4b2e8: 206e 000c moveal %fp@(12),%a0 return SCHEDULER_CBS_OK; } } return SCHEDULER_CBS_ERROR_NOSERVER; } 4b2ec: 241f movel %sp@+,%d2 4b2ee: 4e5e unlk %fp { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( _Scheduler_CBS_Server_list[i] && _Scheduler_CBS_Server_list[i]->task_id == task_id ) { *server_id = i; 4b2f0: 2080 movel %d0,%a0@ return SCHEDULER_CBS_OK; 4b2f2: 4280 clrl %d0 } } return SCHEDULER_CBS_ERROR_NOSERVER; } ... =============================================================================== 0004b35c <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 4b35c: 4e56 0000 linkw %fp,#0 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4b360: 2039 0006 18fc movel 618fc <_Scheduler_CBS_Maximum_servers>,%d0 4b366: e588 lsll #2,%d0 4b368: 2f00 movel %d0,%sp@- 4b36a: 4eb9 0004 cd64 jsr 4cd64 <_Workspace_Allocate> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4b370: 588f addql #4,%sp } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4b372: 2040 moveal %d0,%a0 4b374: 23c0 0006 32d2 movel %d0,632d2 <_Scheduler_CBS_Server_list> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4b37a: 672c beqs 4b3a8 <_Scheduler_CBS_Initialize+0x4c> <== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4b37c: 2039 0006 18fc movel 618fc <_Scheduler_CBS_Maximum_servers>,%d0 4b382: 4281 clrl %d1 4b384: 4a80 tstl %d0 4b386: 671a beqs 4b3a2 <_Scheduler_CBS_Initialize+0x46> <== NEVER TAKEN _Scheduler_CBS_Server_list[i] = NULL; 4b388: 42b0 1c00 clrl %a0@(00000000,%d1: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++) { 4b38c: 5281 addql #1,%d1 4b38e: b081 cmpl %d1,%d0 4b390: 6710 beqs 4b3a2 <_Scheduler_CBS_Initialize+0x46> <== NEVER TAKEN 4b392: 2079 0006 32d2 moveal 632d2 <_Scheduler_CBS_Server_list>,%a0 _Scheduler_CBS_Server_list[i] = NULL; 4b398: 42b0 1c00 clrl %a0@(00000000,%d1: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++) { 4b39c: 5281 addql #1,%d1 4b39e: b081 cmpl %d1,%d0 4b3a0: 66f0 bnes 4b392 <_Scheduler_CBS_Initialize+0x36> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4b3a2: 4280 clrl %d0 } 4b3a4: 4e5e unlk %fp 4b3a6: 4e75 rts { 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; 4b3a8: 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; } 4b3aa: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 00049bf4 <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 49bf4: 4e56 0000 linkw %fp,#0 49bf8: 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; 49bfc: 2268 0086 moveal %a0@(134),%a1 ) { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 49c00: 2269 0018 moveal %a1@(24),%a1 (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 49c04: 4aae 000c tstl %fp@(12) 49c08: 6732 beqs 49c3c <_Scheduler_CBS_Release_job+0x48> /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 49c0a: 2039 0006 13a2 movel 613a2 <_Watchdog_Ticks_since_boot>,%d0 Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { /* Initializing or shifting deadline. */ if (serv_info) 49c10: 4a89 tstl %a1 49c12: 6738 beqs 49c4c <_Scheduler_CBS_Release_job+0x58><== NEVER TAKEN new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 49c14: d0a9 0004 addl %a1@(4),%d0 49c18: 0880 001f bclr #31,%d0 new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; 49c1c: 2169 0008 0072 movel %a1@(8),%a0@(114) the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 49c22: 4878 0001 pea 1 49c26: 2f00 movel %d0,%sp@- /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; the_thread->real_priority = new_priority; 49c28: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 49c2c: 2f08 movel %a0,%sp@- 49c2e: 4eb9 0004 a0c0 jsr 4a0c0 <_Thread_Change_priority> 49c34: 4fef 000c lea %sp@(12),%sp } 49c38: 4e5e unlk %fp 49c3a: 4e75 rts new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 49c3c: 2028 00a8 movel %a0@(168),%d0 } /* Budget replenishment for the next job. */ if (serv_info) 49c40: 4a89 tstl %a1 49c42: 67de beqs 49c22 <_Scheduler_CBS_Release_job+0x2e><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 49c44: 2169 0008 0072 movel %a1@(8),%a0@(114) 49c4a: 60d6 bras 49c22 <_Scheduler_CBS_Release_job+0x2e> /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 49c4c: d0ae 000c addl %fp@(12),%d0 /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 49c50: 4878 0001 pea 1 /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 49c54: 0880 001f bclr #31,%d0 /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 49c58: 2f00 movel %d0,%sp@- /* Budget replenishment for the next job. */ if (serv_info) the_thread->cpu_time_budget = serv_info->parameters.budget; the_thread->real_priority = new_priority; 49c5a: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 49c5e: 2f08 movel %a0,%sp@- 49c60: 4eb9 0004 a0c0 jsr 4a0c0 <_Thread_Change_priority> 49c66: 4fef 000c lea %sp@(12),%sp } 49c6a: 4e5e unlk %fp ... =============================================================================== 00049c70 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 49c70: 4e56 0000 linkw %fp,#0 49c74: 2f0a movel %a2,%sp@- 49c76: 246e 0008 moveal %fp@(8),%a2 49c7a: 2f02 movel %d2,%sp@- Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 49c7c: 2f0a movel %a2,%sp@- 49c7e: 4eb9 0004 9d94 jsr 49d94 <_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; 49c84: 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) { 49c88: 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; 49c8a: 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) { 49c8e: 4a88 tstl %a0 49c90: 6700 0094 beqw 49d26 <_Scheduler_CBS_Unblock+0xb6> 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 - 49c94: 222a 0018 movel %a2@(24),%d1 49c98: 2401 movel %d1,%d2 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 49c9a: 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 - 49c9e: 2039 0006 13a2 movel 613a2 <_Watchdog_Ticks_since_boot>,%d0 49ca4: 9480 subl %d0,%d2 49ca6: 2002 movel %d2,%d0 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 49ca8: 4c11 0800 mulsl %a1@,%d0 49cac: 43ea 0072 lea %a2@(114),%a1 49cb0: 2428 0008 movel %a0@(8),%d2 49cb4: 4c11 2800 mulsl %a1@,%d2 49cb8: b480 cmpl %d0,%d2 49cba: 6c6a bges 49d26 <_Scheduler_CBS_Unblock+0xb6> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 49cbc: 206a 00a8 moveal %a2@(168),%a0 if ( the_thread->real_priority != new_priority ) 49cc0: b1c1 cmpal %d1,%a0 49cc2: 6704 beqs 49cc8 <_Scheduler_CBS_Unblock+0x58> the_thread->real_priority = new_priority; 49cc4: 2548 0018 movel %a0,%a2@(24) if ( the_thread->current_priority != new_priority ) 49cc8: 202a 0014 movel %a2@(20),%d0 49ccc: b1c0 cmpal %d0,%a0 49cce: 6716 beqs 49ce6 <_Scheduler_CBS_Unblock+0x76> _Thread_Change_priority(the_thread, new_priority, true); 49cd0: 4878 0001 pea 1 49cd4: 2f08 movel %a0,%sp@- 49cd6: 2f0a movel %a2,%sp@- 49cd8: 4eb9 0004 a0c0 jsr 4a0c0 <_Thread_Change_priority> 49cde: 202a 0014 movel %a2@(20),%d0 49ce2: 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, 49ce6: 2079 0006 143a moveal 6143a <_Per_CPU_Information+0x12>,%a0 49cec: 2f28 0014 movel %a0@(20),%sp@- 49cf0: 2079 0005 faa0 moveal 5faa0 <_Scheduler+0x30>,%a0 49cf6: 2f00 movel %d0,%sp@- 49cf8: 4e90 jsr %a0@ 49cfa: 508f addql #8,%sp 49cfc: 4a80 tstl %d0 49cfe: 6f1a bles 49d1a <_Scheduler_CBS_Unblock+0xaa> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 49d00: 2079 0006 1436 moveal 61436 <_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; 49d06: 23ca 0006 143a movel %a2,6143a <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 49d0c: 4a28 0070 tstb %a0@(112) 49d10: 671a beqs 49d2c <_Scheduler_CBS_Unblock+0xbc> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 49d12: 7001 moveq #1,%d0 49d14: 13c0 0006 1434 moveb %d0,61434 <_Per_CPU_Information+0xc> } } 49d1a: 242e fff8 movel %fp@(-8),%d2 49d1e: 246e fffc moveal %fp@(-4),%a2 49d22: 4e5e unlk %fp 49d24: 4e75 rts 49d26: 202a 0014 movel %a2@(20),%d0 49d2a: 60ba bras 49ce6 <_Scheduler_CBS_Unblock+0x76> * 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; if ( _Thread_Executing->is_preemptible || 49d2c: 4aaa 0014 tstl %a2@(20) 49d30: 66e8 bnes 49d1a <_Scheduler_CBS_Unblock+0xaa> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 49d32: 7001 moveq #1,%d0 <== NOT EXECUTED 49d34: 13c0 0006 1434 moveb %d0,61434 <_Per_CPU_Information+0xc> <== NOT EXECUTED 49d3a: 60de bras 49d1a <_Scheduler_CBS_Unblock+0xaa> <== NOT EXECUTED =============================================================================== 00049bc0 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 49bc0: 4e56 0000 linkw %fp,#0 49bc4: 2f0a movel %a2,%sp@- void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 49bc6: 4878 0018 pea 18 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 49bca: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 49bce: 4eb9 0004 b55c jsr 4b55c <_Workspace_Allocate> if ( sched ) { 49bd4: 588f addql #4,%sp 49bd6: 4a80 tstl %d0 49bd8: 670e beqs 49be8 <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN the_thread->scheduler_info = sched; 49bda: 2540 0086 movel %d0,%a2@(134) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 49bde: 2040 moveal %d0,%a0 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49be0: 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; 49be2: 208a movel %a2,%a0@ schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49be4: 2141 0014 movel %d1,%a0@(20) } return sched; } 49be8: 246e fffc moveal %fp@(-4),%a2 49bec: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049d3c <_Scheduler_EDF_Block>: #include void _Scheduler_EDF_Block( Thread_Control *the_thread ) { 49d3c: 4e56 0000 linkw %fp,#0 49d40: 2f02 movel %d2,%sp@- 49d42: 242e 0008 movel %fp@(8),%d2 _Scheduler_EDF_Extract( the_thread ); 49d46: 2f02 movel %d2,%sp@- 49d48: 4eb9 0004 9dc4 jsr 49dc4 <_Scheduler_EDF_Extract> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 49d4e: 588f addql #4,%sp 49d50: b4b9 0006 143a cmpl 6143a <_Per_CPU_Information+0x12>,%d2 49d56: 6720 beqs 49d78 <_Scheduler_EDF_Block+0x3c> _Scheduler_EDF_Schedule(); if ( _Thread_Is_executing( the_thread ) ) 49d58: b4b9 0006 1436 cmpl 61436 <_Per_CPU_Information+0xe>,%d2 49d5e: 6708 beqs 49d68 <_Scheduler_EDF_Block+0x2c> <== NEVER TAKEN _Thread_Dispatch_necessary = true; } 49d60: 242e fffc movel %fp@(-4),%d2 49d64: 4e5e unlk %fp 49d66: 4e75 rts 49d68: 242e fffc movel %fp@(-4),%d2 49d6c: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_EDF_Schedule(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 49d6e: 7001 moveq #1,%d0 49d70: 13c0 0006 1434 moveb %d0,61434 <_Per_CPU_Information+0xc> } 49d76: 4e75 rts _Scheduler_EDF_Extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_EDF_Schedule(); 49d78: 4eb9 0004 9ea4 jsr 49ea4 <_Scheduler_EDF_Schedule> if ( _Thread_Is_executing( the_thread ) ) 49d7e: b4b9 0006 1436 cmpl 61436 <_Per_CPU_Information+0xe>,%d2 49d84: 66da bnes 49d60 <_Scheduler_EDF_Block+0x24> <== NEVER TAKEN 49d86: 60e0 bras 49d68 <_Scheduler_EDF_Block+0x2c> =============================================================================== 00049df0 <_Scheduler_EDF_Free>: #include void _Scheduler_EDF_Free( Thread_Control *the_thread ) { 49df0: 4e56 0000 linkw %fp,#0 49df4: 206e 0008 moveal %fp@(8),%a0 _Workspace_Free( the_thread->scheduler_info ); 49df8: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 49dfe: 4e5e unlk %fp void _Scheduler_EDF_Free( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 49e00: 4ef9 0004 b604 jmp 4b604 <_Workspace_Free> ... =============================================================================== 00049dc4 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 49dc4: 4e56 0000 linkw %fp,#0 49dc8: 2f0a movel %a2,%sp@- 49dca: 246e 0008 moveal %fp@(8),%a2 _Scheduler_EDF_Enqueue(the_thread); 49dce: 2f0a movel %a2,%sp@- 49dd0: 4eb9 0004 9c48 jsr 49c48 <_Scheduler_EDF_Enqueue> 49dd6: 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( 49dda: 2079 0006 13ba moveal 613ba <_Per_CPU_Information+0x12>,%a0 49de0: 2f28 0014 movel %a0@(20),%sp@- 49de4: 2079 0005 fa20 moveal 5fa20 <_Scheduler+0x30>,%a0 49dea: 4e90 jsr %a0@ 49dec: 4fef 000c lea %sp@(12),%sp 49df0: 4a80 tstl %d0 49df2: 6d08 blts 49dfc <_Scheduler_EDF_Unblock+0x38> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } 49df4: 246e fffc moveal %fp@(-4),%a2 49df8: 4e5e unlk %fp 49dfa: 4e75 rts */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 49dfc: 2079 0006 13b6 moveal 613b6 <_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; 49e02: 23ca 0006 13ba movel %a2,613ba <_Per_CPU_Information+0x12> if ( _Thread_Executing->is_preemptible || 49e08: 4a28 0070 tstb %a0@(112) 49e0c: 6710 beqs 49e1e <_Scheduler_EDF_Unblock+0x5a> the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 49e0e: 7001 moveq #1,%d0 49e10: 13c0 0006 13b4 moveb %d0,613b4 <_Per_CPU_Information+0xc> } } 49e16: 246e fffc moveal %fp@(-4),%a2 49e1a: 4e5e unlk %fp 49e1c: 4e75 rts */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 49e1e: 4aaa 0014 tstl %a2@(20) 49e22: 66d0 bnes 49df4 <_Scheduler_EDF_Unblock+0x30> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 49e24: 7001 moveq #1,%d0 <== NOT EXECUTED 49e26: 13c0 0006 13b4 moveb %d0,613b4 <_Per_CPU_Information+0xc> <== NOT EXECUTED 49e2c: 60e8 bras 49e16 <_Scheduler_EDF_Unblock+0x52> <== NOT EXECUTED ... =============================================================================== 00049204 <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 49204: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 49208: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 4920a: 2279 0005 e224 moveal 5e224 <_Scheduler+0x4>,%a1 49210: 4ed1 jmp %a1@ ... =============================================================================== 00049230 <_Scheduler_priority_Block>: #include void _Scheduler_priority_Block( Thread_Control *the_thread ) { 49230: 4e56 0000 linkw %fp,#0 49234: 206e 0008 moveal %fp@(8),%a0 49238: 2f0b movel %a3,%sp@- 4923a: 2f0a movel %a2,%sp@- ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 4923c: 2468 0086 moveal %a0@(134),%a2 ready = sched_info->ready_chain; 49240: 2252 moveal %a2@,%a1 if ( _Chain_Has_only_one_node( ready ) ) { 49242: 2029 0008 movel %a1@(8),%d0 49246: b091 cmpl %a1@,%d0 49248: 6700 0088 beqw 492d2 <_Scheduler_priority_Block+0xa2> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4924c: 2450 moveal %a0@,%a2 previous = the_node->previous; 4924e: 2268 0004 moveal %a0@(4),%a1 next->previous = previous; 49252: 2549 0004 movel %a1,%a2@(4) previous->next = next; 49256: 228a movel %a2,%a1@ _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 49258: b1f9 0005 fb82 cmpal 5fb82 <_Per_CPU_Information+0x12>,%a0 4925e: 6720 beqs 49280 <_Scheduler_priority_Block+0x50> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 49260: b1f9 0005 fb7e cmpal 5fb7e <_Per_CPU_Information+0xe>,%a0 49266: 6708 beqs 49270 <_Scheduler_priority_Block+0x40> _Thread_Dispatch_necessary = true; } 49268: 245f moveal %sp@+,%a2 4926a: 265f moveal %sp@+,%a3 4926c: 4e5e unlk %fp 4926e: 4e75 rts 49270: 245f moveal %sp@+,%a2 if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 49272: 7001 moveq #1,%d0 } 49274: 265f moveal %sp@+,%a3 49276: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 49278: 13c0 0005 fb7c moveb %d0,5fb7c <_Per_CPU_Information+0xc> } 4927e: 4e75 rts RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 49280: 3039 0005 fb94 movew 5fb94 <_Priority_Major_bit_map>,%d0 49286: 4840 swap %d0 49288: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4928a: 43f9 0005 fb98 lea 5fb98 <_Priority_Bit_map>,%a1 49290: 0280 0000 ffff andil #65535,%d0 49296: 3231 0a00 movew %a1@(00000000,%d0:l:2),%d1 4929a: 4841 swap %d1 4929c: 04c1 ff1 %d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4929e: 2279 0005 e220 moveal 5e220 <_Scheduler>,%a1 return (_Priority_Bits_index( major ) << 4) + 492a4: 0281 0000 ffff andil #65535,%d1 492aa: e988 lsll #4,%d0 492ac: d081 addl %d1,%d0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 492ae: 2200 movel %d0,%d1 492b0: e988 lsll #4,%d0 492b2: e589 lsll #2,%d1 492b4: 9081 subl %d1,%d0 492b6: d3c0 addal %d0,%a1 492b8: 2019 movel %a1@+,%d0 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 492ba: b3c0 cmpal %d0,%a1 492bc: 56c1 sne %d1 492be: 49c1 extbl %d1 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 492c0: c081 andl %d1,%d0 492c2: 23c0 0005 fb82 movel %d0,5fb82 <_Per_CPU_Information+0x12> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 492c8: b1f9 0005 fb7e cmpal 5fb7e <_Per_CPU_Information+0xe>,%a0 492ce: 6698 bnes 49268 <_Scheduler_priority_Block+0x38> 492d0: 609e bras 49270 <_Scheduler_priority_Block+0x40> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 492d2: 266a 0004 moveal %a2@(4),%a3 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 ); 492d6: 2209 movel %a1,%d1 492d8: 5881 addql #4,%d1 492da: 2281 movel %d1,%a1@ 492dc: 3013 movew %a3@,%d0 492de: 322a 000e movew %a2@(14),%d1 head->next = tail; head->previous = NULL; 492e2: 42a9 0004 clrl %a1@(4) 492e6: c081 andl %d1,%d0 tail->previous = head; 492e8: 2349 0008 movel %a1,%a1@(8) 492ec: 3680 movew %d0,%a3@ if ( *the_priority_map->minor == 0 ) 492ee: 6600 ff68 bnew 49258 <_Scheduler_priority_Block+0x28> _Priority_Major_bit_map &= the_priority_map->block_major; 492f2: 3239 0005 fb94 movew 5fb94 <_Priority_Major_bit_map>,%d1 492f8: 302a 000c movew %a2@(12),%d0 492fc: c081 andl %d1,%d0 492fe: 33c0 0005 fb94 movew %d0,5fb94 <_Priority_Major_bit_map> { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 49304: b1f9 0005 fb82 cmpal 5fb82 <_Per_CPU_Information+0x12>,%a0 4930a: 6600 ff54 bnew 49260 <_Scheduler_priority_Block+0x30> 4930e: 6000 ff70 braw 49280 <_Scheduler_priority_Block+0x50> ... =============================================================================== 00049408 <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 49408: 4e56 0000 linkw %fp,#0 4940c: 206e 0008 moveal %fp@(8),%a0 _Workspace_Free( the_thread->scheduler_info ); 49410: 2d68 0086 0008 movel %a0@(134),%fp@(8) } 49416: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 49418: 4ef9 0004 ac10 jmp 4ac10 <_Workspace_Free> ... =============================================================================== 00049c1c <_Scheduler_simple_Block>: #include void _Scheduler_simple_Block( Thread_Control *the_thread ) { 49c1c: 4e56 0000 linkw %fp,#0 49c20: 2f02 movel %d2,%sp@- 49c22: 242e 0008 movel %fp@(8),%d2 _Scheduler_simple_Extract(the_thread); 49c26: 2f02 movel %d2,%sp@- 49c28: 4eb9 0004 9c80 jsr 49c80 <_Scheduler_simple_Extract> if ( _Thread_Is_heir( the_thread ) ) 49c2e: 588f addql #4,%sp 49c30: b4b9 0006 0aca cmpl 60aca <_Per_CPU_Information+0x12>,%d2 49c36: 6720 beqs 49c58 <_Scheduler_simple_Block+0x3c> _Scheduler_simple_Schedule(); if ( _Thread_Is_executing( the_thread ) ) 49c38: b4b9 0006 0ac6 cmpl 60ac6 <_Per_CPU_Information+0xe>,%d2 49c3e: 6708 beqs 49c48 <_Scheduler_simple_Block+0x2c> <== NEVER TAKEN _Thread_Dispatch_necessary = true; } 49c40: 242e fffc movel %fp@(-4),%d2 49c44: 4e5e unlk %fp 49c46: 4e75 rts 49c48: 242e fffc movel %fp@(-4),%d2 49c4c: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_simple_Schedule(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 49c4e: 7001 moveq #1,%d0 49c50: 13c0 0006 0ac4 moveb %d0,60ac4 <_Per_CPU_Information+0xc> } 49c56: 4e75 rts ) { _Scheduler_simple_Extract(the_thread); if ( _Thread_Is_heir( the_thread ) ) _Scheduler_simple_Schedule(); 49c58: 4eb9 0004 9d7c jsr 49d7c <_Scheduler_simple_Schedule> if ( _Thread_Is_executing( the_thread ) ) 49c5e: b4b9 0006 0ac6 cmpl 60ac6 <_Per_CPU_Information+0xe>,%d2 49c64: 66da bnes 49c40 <_Scheduler_simple_Block+0x24> <== NEVER TAKEN 49c66: 60e0 bras 49c48 <_Scheduler_simple_Block+0x2c> =============================================================================== 00049bfc <_TOD_Set_with_timestamp>: #include void _TOD_Set_with_timestamp( const Timestamp_Control *tod ) { 49bfc: 4e56 ffec linkw %fp,#-20 49c00: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 49c04: 246e 0008 moveal %fp@(8),%a2 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 49c08: 47f9 0005 c83c lea 5c83c <__divdi3>,%a3 _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 49c0e: 2412 movel %a2@,%d2 49c10: 262a 0004 movel %a2@(4),%d3 static inline uint32_t _Timestamp64_implementation_Get_nanoseconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time % 1000000000L); 49c14: 2f3c 3b9a ca00 movel #1000000000,%sp@- 49c1a: 42a7 clrl %sp@- 49c1c: 2f03 movel %d3,%sp@- 49c1e: 2f02 movel %d2,%sp@- 49c20: 4eb9 0005 cc9c jsr 5cc9c <__moddi3> 49c26: 4fef 0010 lea %sp@(16),%sp 49c2a: 2801 movel %d1,%d4 static inline uint32_t _Timestamp64_implementation_Get_seconds( const Timestamp64_Control *_time ) { return (uint32_t) (*_time / 1000000000L); 49c2c: 2f3c 3b9a ca00 movel #1000000000,%sp@- 49c32: 42a7 clrl %sp@- 49c34: 2f03 movel %d3,%sp@- 49c36: 2f02 movel %d2,%sp@- 49c38: 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; 49c3a: 2039 0006 24a6 movel 624a6 <_Thread_Dispatch_disable_level>,%d0 ++level; 49c40: 5280 addql #1,%d0 49c42: 4fef 0010 lea %sp@(16),%sp 49c46: 2401 movel %d1,%d2 _Thread_Dispatch_disable_level = level; 49c48: 23c0 0006 24a6 movel %d0,624a6 <_Thread_Dispatch_disable_level> 49c4e: 2f3c 3b9a ca00 movel #1000000000,%sp@- 49c54: 42a7 clrl %sp@- 49c56: 2f39 0006 244c movel 6244c <_TOD+0x4>,%sp@- 49c5c: 2f39 0006 2448 movel 62448 <_TOD>,%sp@- 49c62: 4e93 jsr %a3@ 49c64: 4fef 0010 lea %sp@(16),%sp _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds_now = _TOD_Seconds_since_epoch(); if ( seconds_next < seconds_now ) 49c68: b282 cmpl %d2,%d1 49c6a: 6244 bhis 49cb0 <_TOD_Set_with_timestamp+0xb4> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 49c6c: 9481 subl %d1,%d2 49c6e: 2f02 movel %d2,%sp@- 49c70: 42a7 clrl %sp@- 49c72: 4879 0006 2536 pea 62536 <_Watchdog_Seconds_chain> 49c78: 4eb9 0004 c28c jsr 4c28c <_Watchdog_Adjust> 49c7e: 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; 49c82: 2012 movel %a2@,%d0 49c84: 222a 0004 movel %a2@(4),%d1 _TOD.seconds_trigger = nanoseconds; 49c88: 23c4 0006 2458 movel %d4,62458 <_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; 49c8e: 23c0 0006 2448 movel %d0,62448 <_TOD> 49c94: 23c1 0006 244c movel %d1,6244c <_TOD+0x4> _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 49c9a: 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; 49ca0: 7201 moveq #1,%d1 _TOD_Activate(); _Thread_Enable_dispatch(); } 49ca2: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 49ca4: 13c1 0006 245c moveb %d1,6245c <_TOD+0x14> _TOD_Activate(); _Thread_Enable_dispatch(); 49caa: 4ef9 0004 b54c jmp 4b54c <_Thread_Enable_dispatch> 49cb0: 9282 subl %d2,%d1 49cb2: 2f01 movel %d1,%sp@- 49cb4: 4878 0001 pea 1 49cb8: 4879 0006 2536 pea 62536 <_Watchdog_Seconds_chain> 49cbe: 4eb9 0004 c28c jsr 4c28c <_Watchdog_Adjust> 49cc4: 4fef 000c lea %sp@(12),%sp 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; 49cc8: 2012 movel %a2@,%d0 49cca: 222a 0004 movel %a2@(4),%d1 _TOD.seconds_trigger = nanoseconds; 49cce: 23c4 0006 2458 movel %d4,62458 <_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; 49cd4: 23c0 0006 2448 movel %d0,62448 <_TOD> 49cda: 23c1 0006 244c movel %d1,6244c <_TOD+0x4> _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 49ce0: 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; 49ce6: 7201 moveq #1,%d1 _TOD_Activate(); _Thread_Enable_dispatch(); } 49ce8: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); _TOD.now = *tod; _TOD.seconds_trigger = nanoseconds; _TOD.is_set = true; 49cea: 13c1 0006 245c moveb %d1,6245c <_TOD+0x14> _TOD_Activate(); _Thread_Enable_dispatch(); 49cf0: 4ef9 0004 b54c jmp 4b54c <_Thread_Enable_dispatch> ... =============================================================================== 00048218 <_TOD_Validate>: ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 48218: 43f9 0005 e70e lea 5e70e ,%a1 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 4821e: 4e56 0000 linkw %fp,#0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 48222: 203c 000f 4240 movel #1000000,%d0 }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 48228: 206e 0008 moveal %fp@(8),%a0 4822c: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 4822e: 4c51 0000 remul %a1@,%d0,%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 48232: 4a88 tstl %a0 48234: 6758 beqs 4828e <_TOD_Validate+0x76> <== NEVER TAKEN 48236: b0a8 0018 cmpl %a0@(24),%d0 4823a: 6352 blss 4828e <_TOD_Validate+0x76> (the_tod->ticks >= ticks_per_second) || 4823c: 703b moveq #59,%d0 4823e: b0a8 0014 cmpl %a0@(20),%d0 48242: 654a bcss 4828e <_TOD_Validate+0x76> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 48244: b0a8 0010 cmpl %a0@(16),%d0 48248: 6544 bcss 4828e <_TOD_Validate+0x76> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 4824a: 7217 moveq #23,%d1 4824c: b2a8 000c cmpl %a0@(12),%d1 48250: 653c bcss 4828e <_TOD_Validate+0x76> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 48252: 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) || 48256: 6736 beqs 4828e <_TOD_Validate+0x76> <== NEVER TAKEN (the_tod->month == 0) || 48258: 740c moveq #12,%d2 4825a: b480 cmpl %d0,%d2 4825c: 6530 bcss 4828e <_TOD_Validate+0x76> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 4825e: 2210 movel %a0@,%d1 (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) || 48260: 0c81 0000 07c3 cmpil #1987,%d1 48266: 6326 blss 4828e <_TOD_Validate+0x76> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 48268: 2068 0008 moveal %a0@(8),%a0 (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) || 4826c: 4a88 tstl %a0 4826e: 671e beqs 4828e <_TOD_Validate+0x76> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 48270: 143c 0003 moveb #3,%d2 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 48274: 43f9 0005 fa98 lea 5fa98 <_TOD_Days_per_month>,%a1 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 4827a: c282 andl %d2,%d1 4827c: 6618 bnes 48296 <_TOD_Validate+0x7e> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4827e: 2031 0c34 movel %a1@(00000034,%d0:l:4),%d0 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; if ( the_tod->day > days_in_month ) 48282: b1c0 cmpal %d0,%a0 48284: 53c0 sls %d0 48286: 4480 negl %d0 return false; return true; } 48288: 241f movel %sp@+,%d2 4828a: 4e5e unlk %fp 4828c: 4e75 rts 4828e: 241f movel %sp@+,%d2 48290: 4e5e unlk %fp (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; 48292: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 48294: 4e75 rts return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 48296: 2031 0c00 movel %a1@(00000000,%d0:l:4),%d0 if ( the_tod->day > days_in_month ) 4829a: b1c0 cmpal %d0,%a0 4829c: 53c0 sls %d0 4829e: 4480 negl %d0 482a0: 60e6 bras 48288 <_TOD_Validate+0x70> ... =============================================================================== 00049760 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 49760: 4e56 fff0 linkw %fp,#-16 49764: 48d7 041c moveml %d2-%d4/%a2,%sp@ 49768: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 4976c: 262a 0010 movel %a2@(16),%d3 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 49770: 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 ); 49774: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 49776: 182e 0013 moveb %fp@(19),%d4 /* * 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 ); 4977a: 4eb9 0004 a58c jsr 4a58c <_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 ) 49780: 588f addql #4,%sp 49782: b4aa 0014 cmpl %a2@(20),%d2 49786: 670c beqs 49794 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 49788: 2f02 movel %d2,%sp@- 4978a: 2f0a movel %a2,%sp@- 4978c: 4eb9 0004 a528 jsr 4a528 <_Thread_Set_priority> 49792: 508f addql #8,%sp _ISR_Disable( level ); 49794: 203c 0000 0700 movel #1792,%d0 4979a: 40c2 movew %sr,%d2 4979c: 8082 orl %d2,%d0 4979e: 46c0 movew %d0,%sr /* * 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; 497a0: 202a 0010 movel %a2@(16),%d0 if ( state != STATES_TRANSIENT ) { 497a4: 7204 moveq #4,%d1 497a6: b280 cmpl %d0,%d1 497a8: 6738 beqs 497e2 <_Thread_Change_priority+0x82> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 497aa: 44c3 movew %d3,%ccr 497ac: 6708 beqs 497b6 <_Thread_Change_priority+0x56> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 497ae: 72fb moveq #-5,%d1 497b0: c280 andl %d0,%d1 497b2: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 497b6: 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); 497b8: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 497be: 660a bnes 497ca <_Thread_Change_priority+0x6a> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 497c0: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 497c6: 4e5e unlk %fp 497c8: 4e75 rts /* 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 ); 497ca: 2d4a 000c movel %a2,%fp@(12) 497ce: 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 ); } 497d4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 497da: 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 ); 497dc: 4ef9 0004 a478 jmp 4a478 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 497e2: 44c3 movew %d3,%ccr 497e4: 6714 beqs 497fa <_Thread_Change_priority+0x9a> <== 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 ); 497e6: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 497ea: 4a04 tstb %d4 497ec: 6748 beqs 49836 <_Thread_Change_priority+0xd6> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 497ee: 2f0a movel %a2,%sp@- 497f0: 2079 0005 e248 moveal 5e248 <_Scheduler+0x28>,%a0 497f6: 4e90 jsr %a0@ 497f8: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 497fa: 203c 0000 0700 movel #1792,%d0 49800: 46c2 movew %d2,%sr 49802: 8082 orl %d2,%d0 49804: 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(); 49806: 2079 0005 e228 moveal 5e228 <_Scheduler+0x8>,%a0 4980c: 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 ); 4980e: 2079 0005 fb7e moveal 5fb7e <_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() && 49814: b1f9 0005 fb82 cmpal 5fb82 <_Per_CPU_Information+0x12>,%a0 4981a: 670e beqs 4982a <_Thread_Change_priority+0xca> 4981c: 4a28 0070 tstb %a0@(112) 49820: 6708 beqs 4982a <_Thread_Change_priority+0xca> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 49822: 7001 moveq #1,%d0 49824: 13c0 0005 fb7c moveb %d0,5fb7c <_Per_CPU_Information+0xc> _ISR_Enable( level ); 4982a: 46c2 movew %d2,%sr } 4982c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 49832: 4e5e unlk %fp 49834: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 49836: 2f0a movel %a2,%sp@- 49838: 2079 0005 e244 moveal 5e244 <_Scheduler+0x24>,%a0 4983e: 4e90 jsr %a0@ 49840: 588f addql #4,%sp 49842: 60b6 bras 497fa <_Thread_Change_priority+0x9a> =============================================================================== 000498a0 <_Thread_Close>: void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { 498a0: 4e56 0000 linkw %fp,#0 498a4: 2f0b movel %a3,%sp@- 498a6: 266e 0008 moveal %fp@(8),%a3 498aa: 2f0a movel %a2,%sp@- 498ac: 246e 000c moveal %fp@(12),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 498b0: 202a 0008 movel %a2@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 498b4: 206b 0018 moveal %a3@(24),%a0 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 498b8: 0280 0000 ffff andil #65535,%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 498be: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) return ctx.ok; } static inline void _User_extensions_Thread_delete( Thread_Control *deleted ) { _User_extensions_Iterate( 498c2: 4879 0004 a710 pea 4a710 <_User_extensions_Thread_delete_visitor> * * 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; 498c8: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 --level; 498ce: 5380 subql #1,%d0 498d0: 2f0a movel %a2,%sp@- _Thread_Dispatch_disable_level = level; 498d2: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> 498d8: 4eb9 0004 a7b8 jsr 4a7b8 <_User_extensions_Iterate> * * 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; 498de: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 ++level; 498e4: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 498e6: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> /* * Now we are in a dispatching critical section again and we * can take the thread OUT of the published set. It is invalid * to use this thread's Id OR name after this call. */ _Objects_Close( information, &the_thread->Object ); 498ec: 2f0a movel %a2,%sp@- 498ee: 2f0b movel %a3,%sp@- 498f0: 4eb9 0004 8a74 jsr 48a74 <_Objects_Close> /* * By setting the dormant state, the thread will not be considered * for scheduling when we remove any blocking states. */ _Thread_Set_state( the_thread, STATES_DORMANT ); 498f6: 4878 0001 pea 1 498fa: 2f0a movel %a2,%sp@- 498fc: 4eb9 0004 a540 jsr 4a540 <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 49902: 2f0a movel %a2,%sp@- 49904: 4eb9 0004 a384 jsr 4a384 <_Thread_queue_Extract_with_proxy> 4990a: 4fef 001c lea %sp@(28),%sp 4990e: 4a00 tstb %d0 49910: 660a bnes 4991c <_Thread_Close+0x7c> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 49912: 7002 moveq #2,%d0 49914: b0aa 0050 cmpl %a2@(80),%d0 49918: 6700 0088 beqw 499a2 <_Thread_Close+0x102> */ RTEMS_INLINE_ROUTINE void _Scheduler_Free( Thread_Control *the_thread ) { return _Scheduler.Operations.free( the_thread ); 4991c: 2f0a movel %a2,%sp@- 4991e: 2079 0005 e23c moveal 5e23c <_Scheduler+0x1c>,%a0 49924: 4e90 jsr %a0@ /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 49926: 588f addql #4,%sp 49928: b5f9 0005 fa72 cmpal 5fa72 <_Thread_Allocated_fp>,%a2 4992e: 6736 beqs 49966 <_Thread_Close+0xc6> _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; _Workspace_Free( the_thread->Start.fp_context ); 49930: 2f2a 00b4 movel %a2@(180),%sp@- 49934: 47f9 0004 ac10 lea 4ac10 <_Workspace_Free>,%a3 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 4993a: 42aa 00f0 clrl %a2@(240) _Workspace_Free( the_thread->Start.fp_context ); 4993e: 4e93 jsr %a3@ /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 49940: 2f0a movel %a2,%sp@- 49942: 4eb9 0004 a610 jsr 4a610 <_Thread_Stack_Free> the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); 49948: 2f2a 0100 movel %a2@(256),%sp@- /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 4994c: 42aa 00b8 clrl %a2@(184) _Workspace_Free( the_thread->extensions ); 49950: 4e93 jsr %a3@ the_thread->extensions = NULL; } 49952: 266e fffc moveal %fp@(-4),%a3 */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); the_thread->extensions = NULL; 49956: 4fef 000c lea %sp@(12),%sp 4995a: 42aa 0100 clrl %a2@(256) } 4995e: 246e fff8 moveal %fp@(-8),%a2 49962: 4e5e unlk %fp 49964: 4e75 rts if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; _Workspace_Free( the_thread->Start.fp_context ); 49966: 2f2a 00b4 movel %a2@(180),%sp@- 4996a: 47f9 0004 ac10 lea 4ac10 <_Workspace_Free>,%a3 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 49970: 42aa 00f0 clrl %a2@(240) */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) { _Thread_Allocated_fp = NULL; 49974: 42b9 0005 fa72 clrl 5fa72 <_Thread_Allocated_fp> _Workspace_Free( the_thread->Start.fp_context ); 4997a: 4e93 jsr %a3@ /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 4997c: 2f0a movel %a2,%sp@- 4997e: 4eb9 0004 a610 jsr 4a610 <_Thread_Stack_Free> the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); 49984: 2f2a 0100 movel %a2@(256),%sp@- /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 49988: 42aa 00b8 clrl %a2@(184) _Workspace_Free( the_thread->extensions ); 4998c: 4e93 jsr %a3@ the_thread->extensions = NULL; } 4998e: 266e fffc moveal %fp@(-4),%a3 */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); the_thread->extensions = NULL; 49992: 4fef 000c lea %sp@(12),%sp 49996: 42aa 0100 clrl %a2@(256) } 4999a: 246e fff8 moveal %fp@(-8),%a2 4999e: 4e5e unlk %fp 499a0: 4e75 rts */ _Thread_Set_state( the_thread, STATES_DORMANT ); if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 499a2: 486a 0048 pea %a2@(72) 499a6: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 499ac: 588f addql #4,%sp 499ae: 2079 0005 e23c moveal 5e23c <_Scheduler+0x1c>,%a0 499b4: 2f0a movel %a2,%sp@- 499b6: 4e90 jsr %a0@ /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 499b8: 588f addql #4,%sp 499ba: b5f9 0005 fa72 cmpal 5fa72 <_Thread_Allocated_fp>,%a2 499c0: 6600 ff6e bnew 49930 <_Thread_Close+0x90> 499c4: 60a0 bras 49966 <_Thread_Close+0xc6> <== NOT EXECUTED ... =============================================================================== 00049a74 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 49a74: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 49a78: 486e fffc pea %fp@(-4) 49a7c: 2f2e 0008 movel %fp@(8),%sp@- 49a80: 4eb9 0004 9c64 jsr 49c64 <_Thread_Get> switch ( location ) { 49a86: 508f addql #8,%sp 49a88: 4aae fffc tstl %fp@(-4) 49a8c: 661e bnes 49aac <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 49a8e: 2f3c 1000 0018 movel #268435480,%sp@- 49a94: 2f00 movel %d0,%sp@- 49a96: 4eb9 0004 9844 jsr 49844 <_Thread_Clear_state> 49a9c: 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; 49a9e: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 --level; 49aa4: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 49aa6: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 49aac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049ab0 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 49ab0: 4e56 ffd0 linkw %fp,#-48 49ab4: 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 ); 49ab8: 283c 0000 0700 movel #1792,%d4 49abe: 2004 movel %d4,%d0 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 49ac0: 2479 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 49ac6: 40c1 movew %sr,%d1 49ac8: 8081 orl %d1,%d0 49aca: 46c0 movew %d0,%sr while ( _Thread_Dispatch_necessary == true ) { 49acc: 1039 0005 fb7c moveb 5fb7c <_Per_CPU_Information+0xc>,%d0 49ad2: 6700 012e beqw 49c02 <_Thread_Dispatch+0x152> * 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; 49ad6: 7001 moveq #1,%d0 heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 49ad8: 4207 clrb %d7 * 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; 49ada: 2679 0005 fb82 moveal 5fb82 <_Per_CPU_Information+0x12>,%a3 49ae0: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 49ae6: 13c7 0005 fb7c moveb %d7,5fb7c <_Per_CPU_Information+0xc> _Thread_Executing = heir; 49aec: 23cb 0005 fb7e movel %a3,5fb7e <_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 ) 49af2: b7ca cmpal %a2,%a3 49af4: 6700 010c beqw 49c02 <_Thread_Dispatch+0x152> 49af8: 2a0e movel %fp,%d5 49afa: 5185 subql #8,%d5 49afc: 4bf9 0004 843c lea 4843c <_TOD_Get_with_nanoseconds>,%a5 #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 ); 49b02: 2c3c 0004 adc8 movel #306632,%d6 */ #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 ) 49b08: 7001 moveq #1,%d0 49b0a: b0ab 0076 cmpl %a3@(118),%d0 49b0e: 6700 0126 beqw 49c36 <_Thread_Dispatch+0x186> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 49b12: 46c1 movew %d1,%sr */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 49b14: 4879 0005 f9b0 pea 5f9b0 <_TOD+0x8> 49b1a: 2f05 movel %d5,%sp@- 49b1c: 4e95 jsr %a5@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 49b1e: 2079 0005 fa76 moveal 5fa76 <_Thread_libc_reent>,%a0 49b24: 508f addql #8,%sp #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 49b26: 202e fff8 movel %fp@(-8),%d0 49b2a: 222e fffc movel %fp@(-4),%d1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 49b2e: 2400 movel %d0,%d2 49b30: 2601 movel %d1,%d3 49b32: 2e39 0005 fb8a movel 5fb8a <_Per_CPU_Information+0x1a>,%d7 49b38: 96b9 0005 fb8e subl 5fb8e <_Per_CPU_Information+0x1e>,%d3 49b3e: 9587 subxl %d7,%d2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 49b40: d7aa 0082 addl %d3,%a2@(130) 49b44: 2e2a 007e movel %a2@(126),%d7 49b48: df82 addxl %d2,%d7 49b4a: 2547 007e movel %d7,%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; 49b4e: 23c0 0005 fb8a movel %d0,5fb8a <_Per_CPU_Information+0x1a> 49b54: 23c1 0005 fb8e movel %d1,5fb8e <_Per_CPU_Information+0x1e> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 49b5a: 4a88 tstl %a0 49b5c: 6708 beqs 49b66 <_Thread_Dispatch+0xb6> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 49b5e: 2550 00f4 movel %a0@,%a2@(244) *_Thread_libc_reent = heir->libc_reent; 49b62: 20ab 00f4 movel %a3@(244),%a0@ */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 49b66: 2879 0005 e348 moveal 5e348 <_User_extensions_Switches_list>,%a4 { 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 ) { 49b6c: b9fc 0005 e34c cmpal #385868,%a4 49b72: 6716 beqs 49b8a <_Thread_Dispatch+0xda> <== NEVER TAKEN const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 49b74: 2f0b movel %a3,%sp@- 49b76: 2f0a movel %a2,%sp@- 49b78: 206c 0008 moveal %a4@(8),%a0 49b7c: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 49b7e: 2854 moveal %a4@,%a4 { 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 ) { 49b80: 508f addql #8,%sp 49b82: b9fc 0005 e34c cmpal #385868,%a4 49b88: 66ea bnes 49b74 <_Thread_Dispatch+0xc4> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 49b8a: 486b 00bc pea %a3@(188) 49b8e: 486a 00bc pea %a2@(188) 49b92: 4eb9 0004 ac60 jsr 4ac60 <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 49b98: 508f addql #8,%sp 49b9a: 4aaa 00f0 tstl %a2@(240) 49b9e: 672a beqs 49bca <_Thread_Dispatch+0x11a> #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 ); 49ba0: 2079 0005 fa72 moveal 5fa72 <_Thread_Allocated_fp>,%a0 49ba6: b1ca cmpal %a2,%a0 49ba8: 6720 beqs 49bca <_Thread_Dispatch+0x11a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 49baa: 4a88 tstl %a0 49bac: 670c beqs 49bba <_Thread_Dispatch+0x10a> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 49bae: 4868 00f0 pea %a0@(240) 49bb2: 4eb9 0004 ad90 jsr 4ad90 <_CPU_Context_save_fp> 49bb8: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 49bba: 486a 00f0 pea %a2@(240) 49bbe: 2046 moveal %d6,%a0 49bc0: 4e90 jsr %a0@ _Thread_Allocated_fp = executing; 49bc2: 588f addql #4,%sp 49bc4: 23ca 0005 fa72 movel %a2,5fa72 <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 49bca: 2479 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a2 _ISR_Disable( level ); 49bd0: 2004 movel %d4,%d0 49bd2: 40c1 movew %sr,%d1 49bd4: 8081 orl %d1,%d0 49bd6: 46c0 movew %d0,%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 ) { 49bd8: 1039 0005 fb7c moveb 5fb7c <_Per_CPU_Information+0xc>,%d0 49bde: 6722 beqs 49c02 <_Thread_Dispatch+0x152> * 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; 49be0: 7001 moveq #1,%d0 heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 49be2: 4207 clrb %d7 * 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; 49be4: 2679 0005 fb82 moveal 5fb82 <_Per_CPU_Information+0x12>,%a3 49bea: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 49bf0: 13c7 0005 fb7c moveb %d7,5fb7c <_Per_CPU_Information+0xc> _Thread_Executing = heir; 49bf6: 23cb 0005 fb7e movel %a3,5fb7e <_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 ) 49bfc: b5cb cmpal %a3,%a2 49bfe: 6600 ff08 bnew 49b08 <_Thread_Dispatch+0x58> 49c02: 42b9 0005 fa06 clrl 5fa06 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 49c08: 46c1 movew %d1,%sr 49c0a: 2679 0005 fa7a moveal 5fa7a <_API_extensions_Post_switch_list>,%a3 { 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 ) { 49c10: b7fc 0005 fa7e cmpal #391806,%a3 49c16: 6714 beqs 49c2c <_Thread_Dispatch+0x17c> const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 49c18: 2f0a movel %a2,%sp@- 49c1a: 206b 0008 moveal %a3@(8),%a0 49c1e: 4e90 jsr %a0@ #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 49c20: 2653 moveal %a3@,%a3 { 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 ) { 49c22: 588f addql #4,%sp 49c24: b7fc 0005 fa7e cmpal #391806,%a3 49c2a: 66ec bnes 49c18 <_Thread_Dispatch+0x168> <== NEVER TAKEN 49c2c: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 49c32: 4e5e unlk %fp 49c34: 4e75 rts #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 ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 49c36: 41f9 0005 f9be lea 5f9be <_Thread_Ticks_per_timeslice>,%a0 49c3c: 2750 0072 movel %a0@,%a3@(114) 49c40: 6000 fed0 braw 49b12 <_Thread_Dispatch+0x62> =============================================================================== 0004df68 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4df68: 4e56 fff4 linkw %fp,#-12 4df6c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4df70: 2479 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a2 /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4df76: 222a 00a4 movel %a2@(164),%d1 _ISR_Set_level(level); 4df7a: 40c0 movew %sr,%d0 4df7c: e189 lsll #8,%d1 4df7e: 0280 0000 f8ff andil #63743,%d0 4df84: 8081 orl %d1,%d0 4df86: 46c0 movew %d0,%sr && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; doneConstructors = true; 4df88: 7001 moveq #1,%d0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4df8a: 1439 0005 f208 moveb 5f208 ,%d2 doneConstructors = true; 4df90: 13c0 0005 f208 moveb %d0,5f208 #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4df96: 4aaa 00f0 tstl %a2@(240) 4df9a: 6720 beqs 4dfbc <_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 ); 4df9c: 2079 0005 fa72 moveal 5fa72 <_Thread_Allocated_fp>,%a0 4dfa2: b1ca cmpal %a2,%a0 4dfa4: 6716 beqs 4dfbc <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4dfa6: 4a88 tstl %a0 4dfa8: 670c beqs 4dfb6 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4dfaa: 4868 00f0 pea %a0@(240) 4dfae: 4eb9 0004 ad90 jsr 4ad90 <_CPU_Context_save_fp> 4dfb4: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4dfb6: 23ca 0005 fa72 movel %a2,5fa72 <_Thread_Allocated_fp> ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4dfbc: 4879 0004 a758 pea 4a758 <_User_extensions_Thread_begin_visitor> 4dfc2: 47f9 0004 a7b8 lea 4a7b8 <_User_extensions_Iterate>,%a3 4dfc8: 2f0a movel %a2,%sp@- 4dfca: 4e93 jsr %a3@ _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4dfcc: 4eb9 0004 9c44 jsr 49c44 <_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) */ { 4dfd2: 508f addql #8,%sp 4dfd4: 4a02 tstb %d2 4dfd6: 674a beqs 4e022 <_Thread_Handler+0xba> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4dfd8: 4aaa 008e tstl %a2@(142) 4dfdc: 671a beqs 4dff8 <_Thread_Handler+0x90> <== ALWAYS TAKEN } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4dfde: 4879 0004 a770 pea 4a770 <_User_extensions_Thread_exitted_visitor><== NOT EXECUTED 4dfe4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4dfe6: 4e93 jsr %a3@ <== NOT EXECUTED * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4dfe8: 4878 0005 pea 5 <== NOT EXECUTED 4dfec: 4878 0001 pea 1 <== NOT EXECUTED 4dff0: 42a7 clrl %sp@- <== NOT EXECUTED 4dff2: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> <== NOT EXECUTED } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4dff8: 2f2a 0096 movel %a2@(150),%sp@- 4dffc: 206a 008a moveal %a2@(138),%a0 4e000: 4e90 jsr %a0@ #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4e002: 588f addql #4,%sp 4e004: 2540 0028 movel %d0,%a2@(40) 4e008: 4879 0004 a770 pea 4a770 <_User_extensions_Thread_exitted_visitor> 4e00e: 2f0a movel %a2,%sp@- 4e010: 4e93 jsr %a3@ * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4e012: 4878 0005 pea 5 4e016: 4878 0001 pea 1 4e01a: 42a7 clrl %sp@- 4e01c: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> * _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) */ { INIT_NAME (); 4e022: 4eb9 0005 c3a8 jsr 5c3a8 <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e028: 4aaa 008e tstl %a2@(142) 4e02c: 66b0 bnes 4dfde <_Thread_Handler+0x76> <== NEVER TAKEN 4e02e: 60c8 bras 4dff8 <_Thread_Handler+0x90> =============================================================================== 00049f1c <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 49f1c: 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 = 49f20: 2079 0005 c5f8 moveal 5c5f8 ,%a0 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 49f26: 4ab9 0005 c5fc tstl 5c5fc 49f2c: 6772 beqs 49fa0 <_Thread_Handler_initialization+0x84><== NEVER TAKEN 49f2e: 4ab9 0005 c600 tstl 5c600 49f34: 676a beqs 49fa0 <_Thread_Handler_initialization+0x84> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 49f36: 4a88 tstl %a0 49f38: 670a beqs 49f44 <_Thread_Handler_initialization+0x28> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 49f3a: 2f39 0005 c5d8 movel 5c5d8 ,%sp@- 49f40: 4e90 jsr %a0@ 49f42: 588f addql #4,%sp #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49f44: 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; 49f48: 41f9 0005 c5dc lea 5c5dc ,%a0 49f4e: 23d0 0005 fa86 movel %a0@,5fa86 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 49f54: 41f9 0005 c5e8 lea 5c5e8 ,%a0 49f5a: 23d0 0005 f9be movel %a0@,5f9be <_Thread_Ticks_per_timeslice> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 49f60: 4200 clrb %d0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49f62: 42a7 clrl %sp@- 49f64: 4878 0108 pea 108 49f68: 4878 0001 pea 1 49f6c: 4878 0001 pea 1 49f70: 4878 0001 pea 1 49f74: 4879 0005 faf2 pea 5faf2 <_Thread_Internal_information> ); if ( stack_allocate_init_hook != NULL ) (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); _Thread_Dispatch_necessary = false; 49f7a: 13c0 0005 fb7c moveb %d0,5fb7c <_Per_CPU_Information+0xc> _Thread_Executing = NULL; 49f80: 42b9 0005 fb7e clrl 5fb7e <_Per_CPU_Information+0xe> _Thread_Heir = NULL; 49f86: 42b9 0005 fb82 clrl 5fb82 <_Per_CPU_Information+0x12> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 49f8c: 42b9 0005 fa72 clrl 5fa72 <_Thread_Allocated_fp> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49f92: 4eb9 0004 8f44 jsr 48f44 <_Objects_Initialize_information> 49f98: 4fef 001c lea %sp@(28),%sp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 49f9c: 4e5e unlk %fp 49f9e: 4e75 rts _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 49fa0: 4878 000e pea e 49fa4: 4878 0001 pea 1 49fa8: 42a7 clrl %sp@- 49faa: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> =============================================================================== 0004d614 <_Thread_Reset>: void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4d614: 4e56 0000 linkw %fp,#0 4d618: 2f0a movel %a2,%sp@- 4d61a: 246e 0008 moveal %fp@(8),%a2 the_thread->resource_count = 0; the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4d61e: 256a 009c 0076 movel %a2@(156),%a2@(118) the_thread->budget_callout = the_thread->Start.budget_callout; 4d624: 256a 00a0 007a movel %a2@(160),%a2@(122) the_thread->Start.pointer_argument = pointer_argument; 4d62a: 256e 000c 0092 movel %fp@(12),%a2@(146) the_thread->Start.numeric_argument = numeric_argument; 4d630: 256e 0010 0096 movel %fp@(16),%a2@(150) void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; the_thread->is_preemptible = the_thread->Start.is_preemptible; 4d636: 156a 009a 0070 moveb %a2@(154),%a2@(112) Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; 4d63c: 42aa 001c clrl %a2@(28) the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 4d640: 2f0a movel %a2,%sp@- 4d642: 4eb9 0004 ac18 jsr 4ac18 <_Thread_queue_Extract_with_proxy> 4d648: 588f addql #4,%sp 4d64a: 4a00 tstb %d0 4d64c: 6608 bnes 4d656 <_Thread_Reset+0x42> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4d64e: 7002 moveq #2,%d0 4d650: b0aa 0050 cmpl %a2@(80),%d0 4d654: 672a beqs 4d680 <_Thread_Reset+0x6c> (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { 4d656: 202a 00a8 movel %a2@(168),%d0 4d65a: b0aa 0014 cmpl %a2@(20),%d0 4d65e: 6718 beqs 4d678 <_Thread_Reset+0x64> the_thread->real_priority = the_thread->Start.initial_priority; 4d660: 2540 0018 movel %d0,%a2@(24) _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d664: 2d4a 0008 movel %a2,%fp@(8) } } 4d668: 246e fffc moveal %fp@(-4),%a2 (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d66c: 2d40 000c movel %d0,%fp@(12) } } 4d670: 4e5e unlk %fp (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d672: 4ef9 0004 ae4c jmp 4ae4c <_Thread_Set_priority> } } 4d678: 246e fffc moveal %fp@(-4),%a2 4d67c: 4e5e unlk %fp 4d67e: 4e75 rts the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4d680: 486a 0048 pea %a2@(72) 4d684: 4eb9 0004 b2f8 jsr 4b2f8 <_Watchdog_Remove> 4d68a: 588f addql #4,%sp 4d68c: 60c8 bras 4d656 <_Thread_Reset+0x42> ... =============================================================================== 0004adbc <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 4adbc: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4adbe: 4e56 0000 linkw %fp,#0 4adc2: 2f0a movel %a2,%sp@- 4adc4: 246e 0008 moveal %fp@(8),%a2 4adc8: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 4adcc: 670a beqs 4add8 <_Thread_Restart+0x1c> _Thread_Restart_self(); return true; } return false; 4adce: 4200 clrb %d0 } 4add0: 246e fffc moveal %fp@(-4),%a2 4add4: 4e5e unlk %fp 4add6: 4e75 rts Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 4add8: 2f0a movel %a2,%sp@- 4adda: 4eb9 0004 aeb0 jsr 4aeb0 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 4ade0: 2f2e 0010 movel %fp@(16),%sp@- 4ade4: 2f2e 000c movel %fp@(12),%sp@- 4ade8: 2f0a movel %a2,%sp@- 4adea: 4eb9 0004 d614 jsr 4d614 <_Thread_Reset> _Thread_Load_environment( the_thread ); 4adf0: 2f0a movel %a2,%sp@- 4adf2: 4eb9 0004 d318 jsr 4d318 <_Thread_Load_environment> _Thread_Ready( the_thread ); 4adf8: 2f0a movel %a2,%sp@- 4adfa: 4eb9 0004 d5e4 jsr 4d5e4 <_Thread_Ready> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( 4ae00: 4879 0004 b064 pea 4b064 <_User_extensions_Thread_restart_visitor> 4ae06: 2f0a movel %a2,%sp@- 4ae08: 4eb9 0004 b0dc jsr 4b0dc <_User_extensions_Iterate> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 4ae0e: 4fef 0020 lea %sp@(32),%sp _Thread_Restart_self(); return true; 4ae12: 7001 moveq #1,%d0 _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 4ae14: b5f9 0006 06d6 cmpal 606d6 <_Per_CPU_Information+0xe>,%a2 4ae1a: 66b4 bnes 4add0 <_Thread_Restart+0x14> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 4ae1c: 4aaa 00f0 tstl %a2@(240) 4ae20: 6712 beqs 4ae34 <_Thread_Restart+0x78> _Context_Restore_fp( &_Thread_Executing->fp_context ); 4ae22: 486a 00f0 pea %a2@(240) 4ae26: 4eb9 0004 b6ec jsr 4b6ec <_CPU_Context_restore_fp> 4ae2c: 2479 0006 06d6 moveal 606d6 <_Per_CPU_Information+0xe>,%a2 4ae32: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 4ae34: 486a 00bc pea %a2@(188) 4ae38: 4eb9 0004 b59a jsr 4b59a <_CPU_Context_Restart_self> return true; } return false; } 4ae3e: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 4ae42: 588f addql #4,%sp <== NOT EXECUTED 4ae44: 4e5e unlk %fp <== NOT EXECUTED _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 4ae46: 7001 moveq #1,%d0 <== NOT EXECUTED } return false; } ... =============================================================================== 000496f8 <_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 ) ) { 496f8: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 496fa: 4e56 0000 linkw %fp,#0 496fe: 202e 0010 movel %fp@(16),%d0 49702: 2f0a movel %a2,%sp@- 49704: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 49708: 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 ) ) { 4970c: b2aa 0050 cmpl %a2@(80),%d1 49710: 671c beqs 4972e <_Thread_blocking_operation_Cancel+0x36> _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 49712: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 49714: 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 } 49718: 246e fffc moveal %fp@(-4),%a2 4971c: 203c 1007 fff8 movel #268959736,%d0 49722: 2d40 000c movel %d0,%fp@(12) 49726: 4e5e unlk %fp 49728: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4972e: 123c 0003 moveb #3,%d1 49732: 2541 0050 movel %d1,%a2@(80) * 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 ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 49736: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 49738: 486a 0048 pea %a2@(72) 4973c: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 49742: 588f addql #4,%sp 49744: 203c 1007 fff8 movel #268959736,%d0 4974a: 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 } 4974e: 246e fffc moveal %fp@(-4),%a2 49752: 2d40 000c movel %d0,%fp@(12) 49756: 4e5e unlk %fp 49758: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> ... =============================================================================== 0004a02c <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 4a02c: 203c 0000 0700 movel #1792,%d0 #include Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 4a032: 4e56 ffe8 linkw %fp,#-24 4a036: 226e 0008 moveal %fp@(8),%a1 4a03a: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 4a03e: 40c3 movew %sr,%d3 4a040: 8083 orl %d3,%d0 4a042: 46c0 movew %d0,%sr for( index=0 ; 4a044: 4281 clrl %d1 index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { 4a046: 2401 movel %d1,%d2 4a048: 2001 movel %d1,%d0 Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 4a04a: 5281 addql #1,%d1 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { 4a04c: e58a lsll #2,%d2 4a04e: e988 lsll #4,%d0 4a050: 9082 subl %d2,%d0 4a052: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 4a056: 2458 moveal %a0@+,%a2 4a058: b1ca cmpal %a2,%a0 4a05a: 6616 bnes 4a072 <_Thread_queue_Dequeue_priority+0x46> Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 4a05c: 7004 moveq #4,%d0 4a05e: b081 cmpl %d1,%d0 4a060: 66e4 bnes 4a046 <_Thread_queue_Dequeue_priority+0x1a> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 4a062: 46c3 movew %d3,%sr return NULL; 4a064: 95ca subal %a2,%a2 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 4a066: 200a movel %a2,%d0 4a068: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a06e: 4e5e unlk %fp 4a070: 4e75 rts RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4a072: 200a movel %a2,%d0 4a074: 0680 0000 003c addil #60,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a07a: 206a 0038 moveal %a2@(56),%a0 dequeue: the_thread->Wait.queue = NULL; new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 4a07e: 2252 moveal %a2@,%a1 previous_node = the_thread->Object.Node.previous; 4a080: 266a 0004 moveal %a2@(4),%a3 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 4a084: 42aa 0044 clrl %a2@(68) new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; previous_node = the_thread->Object.Node.previous; if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 4a088: b088 cmpl %a0,%d0 4a08a: 6700 008a beqw 4a116 <_Thread_queue_Dequeue_priority+0xea> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4a08e: 286a 0040 moveal %a2@(64),%a4 last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; 4a092: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4a094: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; 4a098: 2688 movel %a0,%a3@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4a09a: 214b 0004 movel %a3,%a0@(4) last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 4a09e: 2089 movel %a1,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4a0a0: 226a 0040 moveal %a2@(64),%a1 4a0a4: b3ea 0038 cmpal %a2@(56),%a1 4a0a8: 6716 beqs 4a0c0 <_Thread_queue_Dequeue_priority+0x94> /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; 4a0aa: 214d 0038 movel %a5,%a0@(56) new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4a0ae: 43e8 003c lea %a0@(60),%a1 4a0b2: 2889 movel %a1,%a4@ new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); 4a0b4: 43e8 0038 lea %a0@(56),%a1 4a0b8: 2b49 0004 movel %a1,%a5@(4) tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; tail->previous = last_node; 4a0bc: 214c 0040 movel %a4,%a0@(64) } else { previous_node->next = next_node; next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a0c0: 7002 moveq #2,%d0 4a0c2: b0aa 0050 cmpl %a2@(80),%d0 4a0c6: 671e beqs 4a0e6 <_Thread_queue_Dequeue_priority+0xba> _ISR_Enable( level ); 4a0c8: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4a0ca: 2f3c 1007 fff8 movel #268959736,%sp@- 4a0d0: 2f0a movel %a2,%sp@- 4a0d2: 4eb9 0004 9844 jsr 49844 <_Thread_Clear_state> 4a0d8: 508f addql #8,%sp #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 4a0da: 200a movel %a2,%d0 4a0dc: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a0e2: 4e5e unlk %fp 4a0e4: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4a0e6: 7003 moveq #3,%d0 4a0e8: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4a0ec: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4a0ee: 486a 0048 pea %a2@(72) 4a0f2: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 4a0f8: 2f3c 1007 fff8 movel #268959736,%sp@- 4a0fe: 2f0a movel %a2,%sp@- 4a100: 4eb9 0004 9844 jsr 49844 <_Thread_Clear_state> 4a106: 4fef 000c lea %sp@(12),%sp #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 4a10a: 200a movel %a2,%d0 4a10c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a112: 4e5e unlk %fp 4a114: 4e75 rts head->next = new_second_node; tail->previous = last_node; last_node->next = tail; } } else { previous_node->next = next_node; 4a116: 2689 movel %a1,%a3@ next_node->previous = previous_node; 4a118: 234b 0004 movel %a3,%a1@(4) 4a11c: 60a2 bras 4a0c0 <_Thread_queue_Dequeue_priority+0x94> ... =============================================================================== 0004a1cc <_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 ) { 4a1cc: 4e56 ffe0 linkw %fp,#-32 4a1d0: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 4a1d4: 266e 000c moveal %fp@(12),%a3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4a1d8: 45eb 0038 lea %a3@(56),%a2 Chain_Node *tail = _Chain_Tail( the_chain ); 4a1dc: 41eb 003c lea %a3@(60),%a0 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 4a1e0: 222b 0014 movel %a3@(20),%d1 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 4a1e4: 2001 movel %d1,%d0 4a1e6: ec88 lsrl #6,%d0 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 4a1e8: 2400 movel %d0,%d2 4a1ea: e988 lsll #4,%d0 4a1ec: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 4a1ee: 286e 0008 moveal %fp@(8),%a4 _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 ]; 4a1f2: 9082 subl %d2,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4a1f4: 274a 0040 movel %a2,%a3@(64) block_state = the_thread_queue->state; 4a1f8: 242c 0038 movel %a4@(56),%d2 _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 ]; 4a1fc: 45f4 0800 lea %a4@(00000000,%d0:l),%a2 Chain_Node *tail = _Chain_Tail( the_chain ); 4a200: 2748 0038 movel %a0,%a3@(56) head->next = tail; head->previous = NULL; 4a204: 42ab 003c clrl %a3@(60) block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 4a208: 0801 0005 btst #5,%d1 4a20c: 6656 bnes 4a264 <_Thread_queue_Enqueue_priority+0x98> 4a20e: 2c0a movel %a2,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 4a210: 2a3c 0000 0700 movel #1792,%d5 4a216: 5886 addql #4,%d6 4a218: 2005 movel %d5,%d0 4a21a: 40c3 movew %sr,%d3 4a21c: 8083 orl %d3,%d0 4a21e: 46c0 movew %d0,%sr 4a220: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a222: 2052 moveal %a2@,%a0 search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4a224: bc88 cmpl %a0,%d6 4a226: 6700 0148 beqw 4a370 <_Thread_queue_Enqueue_priority+0x1a4> search_priority = search_thread->current_priority; 4a22a: 2268 0014 moveal %a0@(20),%a1 if ( priority <= search_priority ) 4a22e: b3c1 cmpal %d1,%a1 4a230: 6418 bccs 4a24a <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 4a232: 2005 movel %d5,%d0 4a234: 46c3 movew %d3,%sr 4a236: 8083 orl %d3,%d0 4a238: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 4a23a: 2002 movel %d2,%d0 4a23c: c0a8 0010 andl %a0@(16),%d0 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4a240: 6700 0092 beqw 4a2d4 <_Thread_queue_Enqueue_priority+0x108> _ISR_Enable( level ); goto restart_forward_search; } search_thread = 4a244: 2050 moveal %a0@,%a0 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 ) ) { 4a246: bc88 cmpl %a0,%d6 4a248: 66e0 bnes 4a22a <_Thread_queue_Enqueue_priority+0x5e> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4a24a: 202c 0030 movel %a4@(48),%d0 4a24e: 7401 moveq #1,%d2 4a250: b480 cmpl %d0,%d2 4a252: 6700 00b6 beqw 4a30a <_Thread_queue_Enqueue_priority+0x13e> * 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; 4a256: 206e 0010 moveal %fp@(16),%a0 4a25a: 2084 movel %d4,%a0@ return the_thread_queue->sync_state; } 4a25c: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 4a260: 4e5e unlk %fp 4a262: 4e75 rts return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 4a264: 2a3c 0000 0700 movel #1792,%d5 4a26a: 2005 movel %d5,%d0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4a26c: 1c39 0005 e19c moveb 5e19c ,%d6 _ISR_Disable( level ); 4a272: 40c3 movew %sr,%d3 4a274: 8083 orl %d3,%d0 4a276: 46c0 movew %d0,%sr 4a278: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4a27a: 206a 0008 moveal %a2@(8),%a0 search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4a27e: b5c8 cmpal %a0,%a2 4a280: 6700 00d4 beqw 4a356 <_Thread_queue_Enqueue_priority+0x18a> search_priority = search_thread->current_priority; 4a284: 2268 0014 moveal %a0@(20),%a1 if ( priority >= search_priority ) 4a288: b3c1 cmpal %d1,%a1 4a28a: 6318 blss 4a2a4 <_Thread_queue_Enqueue_priority+0xd8> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 4a28c: 2005 movel %d5,%d0 4a28e: 46c3 movew %d3,%sr 4a290: 8083 orl %d3,%d0 4a292: 46c0 movew %d0,%sr 4a294: 2002 movel %d2,%d0 4a296: c0a8 0010 andl %a0@(16),%d0 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4a29a: 6750 beqs 4a2ec <_Thread_queue_Enqueue_priority+0x120> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 4a29c: 2068 0004 moveal %a0@(4),%a0 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 ) ) { 4a2a0: b5c8 cmpal %a0,%a2 4a2a2: 66e0 bnes 4a284 <_Thread_queue_Enqueue_priority+0xb8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 4a2a4: 202c 0030 movel %a4@(48),%d0 4a2a8: 7401 moveq #1,%d2 4a2aa: b480 cmpl %d0,%d2 4a2ac: 66a8 bnes 4a256 <_Thread_queue_Enqueue_priority+0x8a><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4a2ae: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 4a2b2: b3c1 cmpal %d1,%a1 4a2b4: 677c beqs 4a332 <_Thread_queue_Enqueue_priority+0x166> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 4a2b6: 2250 moveal %a0@,%a1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 4a2b8: 2748 0004 movel %a0,%a3@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 4a2bc: 2689 movel %a1,%a3@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; 4a2be: 234b 0004 movel %a3,%a1@(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; 4a2c2: 208b movel %a3,%a0@ next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4a2c4: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 4a2c8: 46c3 movew %d3,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4a2ca: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 4a2cc: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 4a2d0: 4e5e unlk %fp 4a2d2: 4e75 rts if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 4a2d4: 46c3 movew %d3,%sr if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 4a2d6: 2005 movel %d5,%d0 4a2d8: 40c3 movew %sr,%d3 4a2da: 8083 orl %d3,%d0 4a2dc: 46c0 movew %d0,%sr 4a2de: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a2e0: 2052 moveal %a2@,%a0 search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4a2e2: bc88 cmpl %a0,%d6 4a2e4: 6600 ff44 bnew 4a22a <_Thread_queue_Enqueue_priority+0x5e> 4a2e8: 6000 0086 braw 4a370 <_Thread_queue_Enqueue_priority+0x1a4> if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 4a2ec: 46c3 movew %d3,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 4a2ee: 2005 movel %d5,%d0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4a2f0: 1c39 0005 e19c moveb 5e19c ,%d6 _ISR_Disable( level ); 4a2f6: 40c3 movew %sr,%d3 4a2f8: 8083 orl %d3,%d0 4a2fa: 46c0 movew %d0,%sr 4a2fc: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4a2fe: 206a 0008 moveal %a2@(8),%a0 search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4a302: b5c8 cmpal %a0,%a2 4a304: 6600 ff7e bnew 4a284 <_Thread_queue_Enqueue_priority+0xb8> 4a308: 604c bras 4a356 <_Thread_queue_Enqueue_priority+0x18a> if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4a30a: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 4a30e: b3c1 cmpal %d1,%a1 4a310: 6720 beqs 4a332 <_Thread_queue_Enqueue_priority+0x166> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 4a312: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 4a316: 2688 movel %a0,%a3@ the_node->previous = previous_node; 4a318: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; 4a31c: 228b movel %a3,%a1@ search_node->previous = the_node; 4a31e: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; 4a322: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 4a326: 46c3 movew %d3,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4a328: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 4a32a: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 4a32e: 4e5e unlk %fp 4a330: 4e75 rts _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 4a332: 2268 0040 moveal %a0@(64),%a1 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 ); 4a336: 45e8 003c lea %a0@(60),%a2 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 4a33a: 2749 0004 movel %a1,%a3@(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 ); 4a33e: 268a movel %a2,%a3@ 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; 4a340: 214b 0040 movel %a3,%a0@(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; 4a344: 228b movel %a3,%a1@ search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4a346: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 4a34a: 46c4 movew %d4,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4a34c: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 4a34e: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 4a352: 4e5e unlk %fp 4a354: 4e75 rts } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 4a356: 202c 0030 movel %a4@(48),%d0 4a35a: 7401 moveq #1,%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; 4a35c: 0286 0000 00ff andil #255,%d6 4a362: 2246 moveal %d6,%a1 4a364: 5289 addql #1,%a1 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 4a366: b480 cmpl %d0,%d2 4a368: 6600 feec bnew 4a256 <_Thread_queue_Enqueue_priority+0x8a> 4a36c: 6000 ff40 braw 4a2ae <_Thread_queue_Enqueue_priority+0xe2> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4a370: 202c 0030 movel %a4@(48),%d0 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 4a374: 327c ffff moveaw #-1,%a1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4a378: 7401 moveq #1,%d2 4a37a: b480 cmpl %d0,%d2 4a37c: 6600 fed8 bnew 4a256 <_Thread_queue_Enqueue_priority+0x8a> 4a380: 6088 bras 4a30a <_Thread_queue_Enqueue_priority+0x13e> ... =============================================================================== 0004e030 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4e030: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4e036: 4e56 0000 linkw %fp,#0 4e03a: 2f0a movel %a2,%sp@- 4e03c: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4e040: 40c1 movew %sr,%d1 4e042: 8081 orl %d1,%d0 4e044: 46c0 movew %d0,%sr 4e046: 202a 0010 movel %a2@(16),%d0 4e04a: 0280 0003 bee0 andil #245472,%d0 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4e050: 6734 beqs 4e086 <_Thread_queue_Extract_fifo+0x56> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4e052: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e054: 7002 moveq #2,%d0 previous = the_node->previous; 4e056: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4e05a: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4e05e: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4e060: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e064: b0aa 0050 cmpl %a2@(80),%d0 4e068: 6726 beqs 4e090 <_Thread_queue_Extract_fifo+0x60> _ISR_Enable( level ); 4e06a: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4e06c: 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 } 4e070: 246e fffc moveal %fp@(-4),%a2 4e074: 203c 1007 fff8 movel #268959736,%d0 4e07a: 2d40 000c movel %d0,%fp@(12) 4e07e: 4e5e unlk %fp 4e080: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> ISR_Level level; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4e086: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4e088: 246e fffc moveal %fp@(-4),%a2 4e08c: 4e5e unlk %fp 4e08e: 4e75 rts 4e090: 7003 moveq #3,%d0 4e092: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4e096: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4e098: 486a 0048 pea %a2@(72) 4e09c: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 4e0a2: 588f addql #4,%sp 4e0a4: 203c 1007 fff8 movel #268959736,%d0 4e0aa: 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 } 4e0ae: 246e fffc moveal %fp@(-4),%a2 4e0b2: 2d40 000c movel %d0,%fp@(12) 4e0b6: 4e5e unlk %fp 4e0b8: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> ... =============================================================================== 0004cb94 <_Thread_queue_Extract_priority_helper>: Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4cb94: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 4cb9a: 4e56 ffec linkw %fp,#-20 4cb9e: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4cba2: 246e 000c moveal %fp@(12),%a2 4cba6: 142e 0013 moveb %fp@(19),%d2 Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4cbaa: 40c1 movew %sr,%d1 4cbac: 8081 orl %d1,%d0 4cbae: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 4cbb0: 202a 0010 movel %a2@(16),%d0 4cbb4: 0280 0003 bee0 andil #245472,%d0 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4cbba: 6772 beqs 4cc2e <_Thread_queue_Extract_priority_helper+0x9a> RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4cbbc: 200a movel %a2,%d0 4cbbe: 0680 0000 003c addil #60,%d0 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 4cbc4: 2252 moveal %a2@,%a1 previous_node = the_node->previous; 4cbc6: 266a 0004 moveal %a2@(4),%a3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4cbca: 206a 0038 moveal %a2@(56),%a0 if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 4cbce: b088 cmpl %a0,%d0 4cbd0: 6768 beqs 4cc3a <_Thread_queue_Extract_priority_helper+0xa6> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4cbd2: 286a 0040 moveal %a2@(64),%a4 new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; 4cbd6: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4cbd8: 2348 0004 movel %a0,%a1@(4) new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; 4cbdc: 2688 movel %a0,%a3@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4cbde: 214b 0004 movel %a3,%a0@(4) if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4cbe2: 202a 0040 movel %a2@(64),%d0 last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 4cbe6: 2089 movel %a1,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4cbe8: b0aa 0038 cmpl %a2@(56),%d0 4cbec: 6716 beqs 4cc04 <_Thread_queue_Extract_priority_helper+0x70> /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; 4cbee: 214d 0038 movel %a5,%a0@(56) new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4cbf2: 43e8 003c lea %a0@(60),%a1 4cbf6: 2889 movel %a1,%a4@ new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); 4cbf8: 43e8 0038 lea %a0@(56),%a1 4cbfc: 2b49 0004 movel %a1,%a5@(4) tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; tail->previous = last_node; 4cc00: 214c 0040 movel %a4,%a0@(64) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4cc04: 4a02 tstb %d2 4cc06: 6626 bnes 4cc2e <_Thread_queue_Extract_priority_helper+0x9a> _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4cc08: 7002 moveq #2,%d0 4cc0a: b0aa 0050 cmpl %a2@(80),%d0 4cc0e: 6736 beqs 4cc46 <_Thread_queue_Extract_priority_helper+0xb2> _ISR_Enable( level ); 4cc10: 46c1 movew %d1,%sr 4cc12: 2d4a 0008 movel %a2,%fp@(8) 4cc16: 227c 1007 fff8 moveal #268959736,%a1 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4cc1c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4cc22: 2d49 000c movel %a1,%fp@(12) 4cc26: 4e5e unlk %fp 4cc28: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { _ISR_Enable( level ); 4cc2e: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4cc30: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4cc36: 4e5e unlk %fp 4cc38: 4e75 rts head->next = new_second_node; tail->previous = last_node; last_node->next = tail; } } else { previous_node->next = next_node; 4cc3a: 2689 movel %a1,%a3@ next_node->previous = previous_node; 4cc3c: 234b 0004 movel %a3,%a1@(4) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4cc40: 4a02 tstb %d2 4cc42: 67c4 beqs 4cc08 <_Thread_queue_Extract_priority_helper+0x74> 4cc44: 60e8 bras 4cc2e <_Thread_queue_Extract_priority_helper+0x9a> 4cc46: 7003 moveq #3,%d0 4cc48: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4cc4c: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4cc4e: 486a 0048 pea %a2@(72) 4cc52: 4eb9 0004 a9d4 jsr 4a9d4 <_Watchdog_Remove> 4cc58: 588f addql #4,%sp 4cc5a: 227c 1007 fff8 moveal #268959736,%a1 4cc60: 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 } 4cc64: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4cc6a: 2d49 000c movel %a1,%fp@(12) 4cc6e: 4e5e unlk %fp 4cc70: 4ef9 0004 9844 jmp 49844 <_Thread_Clear_state> ... =============================================================================== 0004a3f0 <_Thread_queue_Initialize>: the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 4a3f0: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 4a3f2: 4e56 0000 linkw %fp,#0 4a3f6: 206e 0008 moveal %fp@(8),%a0 4a3fa: 2f02 movel %d2,%sp@- 4a3fc: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; 4a400: 216e 0010 0038 movel %fp@(16),%a0@(56) the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 4a406: 216e 0014 003c movel %fp@(20),%a0@(60) States_Control state, uint32_t timeout_status ) { the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; 4a40c: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4a410: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 4a414: b280 cmpl %d0,%d1 4a416: 6714 beqs 4a42c <_Thread_queue_Initialize+0x3c> 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 ); 4a418: 2008 movel %a0,%d0 4a41a: 5880 addql #4,%d0 head->next = tail; head->previous = NULL; 4a41c: 42a8 0004 clrl %a0@(4) 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 ); 4a420: 2080 movel %d0,%a0@ head->next = tail; head->previous = NULL; tail->previous = head; 4a422: 2148 0008 movel %a0,%a0@(8) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo ); } } 4a426: 241f movel %sp@+,%d2 4a428: 4e5e unlk %fp 4a42a: 4e75 rts the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 4a42c: 4280 clrl %d0 uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 4a42e: 2400 movel %d0,%d2 4a430: 2200 movel %d0,%d1 if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) 4a432: 5280 addql #1,%d0 _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 4a434: e58a lsll #2,%d2 4a436: e989 lsll #4,%d1 4a438: 9282 subl %d2,%d1 4a43a: 43f0 1800 lea %a0@(00000000,%d1:l),%a1 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 ); 4a43e: 2209 movel %a1,%d1 4a440: 5881 addql #4,%d1 4a442: 2281 movel %d1,%a1@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 4a444: 7204 moveq #4,%d1 head->next = tail; head->previous = NULL; 4a446: 42a9 0004 clrl %a1@(4) tail->previous = head; 4a44a: 2349 0008 movel %a1,%a1@(8) 4a44e: b280 cmpl %d0,%d1 4a450: 67d4 beqs 4a426 <_Thread_queue_Initialize+0x36> <== NEVER TAKEN index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 4a452: 2400 movel %d0,%d2 4a454: 2200 movel %d0,%d1 if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) 4a456: 5280 addql #1,%d0 _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 4a458: e58a lsll #2,%d2 4a45a: e989 lsll #4,%d1 4a45c: 9282 subl %d2,%d1 4a45e: 43f0 1800 lea %a0@(00000000,%d1:l),%a1 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 ); 4a462: 2209 movel %a1,%d1 4a464: 5881 addql #4,%d1 4a466: 2281 movel %d1,%a1@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 4a468: 7204 moveq #4,%d1 head->next = tail; head->previous = NULL; 4a46a: 42a9 0004 clrl %a1@(4) tail->previous = head; 4a46e: 2349 0008 movel %a1,%a1@(8) 4a472: b280 cmpl %d0,%d1 4a474: 66b8 bnes 4a42e <_Thread_queue_Initialize+0x3e> 4a476: 60ae bras 4a426 <_Thread_queue_Initialize+0x36> =============================================================================== 0004cc78 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4cc78: 4e56 0000 linkw %fp,#0 4cc7c: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4cc80: 2268 0044 moveal %a0@(68),%a1 * 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 && 4cc84: 2029 0030 movel %a1@(48),%d0 4cc88: 6708 beqs 4cc92 <_Thread_queue_Process_timeout+0x1a> 4cc8a: b1f9 0005 fb7e cmpal 5fb7e <_Per_CPU_Information+0xe>,%a0 4cc90: 6716 beqs 4cca8 <_Thread_queue_Process_timeout+0x30><== ALWAYS TAKEN if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4cc92: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4cc98: 2f08 movel %a0,%sp@- 4cc9a: 2f09 movel %a1,%sp@- 4cc9c: 4eb9 0004 cb5c jsr 4cb5c <_Thread_queue_Extract> 4cca2: 508f addql #8,%sp } } 4cca4: 4e5e unlk %fp 4cca6: 4e75 rts * a timeout is not allowed to occur. */ 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 ) { 4cca8: 7203 moveq #3,%d1 4ccaa: b280 cmpl %d0,%d1 4ccac: 67f6 beqs 4cca4 <_Thread_queue_Process_timeout+0x2c> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4ccae: 7002 moveq #2,%d0 } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); } } 4ccb0: 4e5e unlk %fp */ 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; 4ccb2: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4ccb8: 2340 0030 movel %d0,%a1@(48) } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); } } ... =============================================================================== 0004a478 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4a478: 4e56 fffc linkw %fp,#-4 4a47c: 2f0a movel %a2,%sp@- 4a47e: 246e 0008 moveal %fp@(8),%a2 4a482: 2f02 movel %d2,%sp@- /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 4a484: 4a8a tstl %a2 4a486: 6708 beqs 4a490 <_Thread_queue_Requeue+0x18> <== 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 ) { 4a488: 7001 moveq #1,%d0 4a48a: b0aa 0034 cmpl %a2@(52),%d0 4a48e: 670c beqs 4a49c <_Thread_queue_Requeue+0x24> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 4a490: 242e fff4 movel %fp@(-12),%d2 <== NOT EXECUTED 4a494: 246e fff8 moveal %fp@(-8),%a2 <== NOT EXECUTED 4a498: 4e5e unlk %fp <== NOT EXECUTED 4a49a: 4e75 rts <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4a49c: 303c 0700 movew #1792,%d0 4a4a0: 40c2 movew %sr,%d2 4a4a2: 8082 orl %d2,%d0 4a4a4: 46c0 movew %d0,%sr 4a4a6: 206e 000c moveal %fp@(12),%a0 4a4aa: 2028 0010 movel %a0@(16),%d0 4a4ae: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4a4b4: 660e bnes 4a4c4 <_Thread_queue_Requeue+0x4c> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 4a4b6: 46c2 movew %d2,%sr <== NOT EXECUTED } } 4a4b8: 242e fff4 movel %fp@(-12),%d2 4a4bc: 246e fff8 moveal %fp@(-8),%a2 4a4c0: 4e5e unlk %fp 4a4c2: 4e75 rts ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4a4c4: 4878 0001 pea 1 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; 4a4c8: 7001 moveq #1,%d0 4a4ca: 2f08 movel %a0,%sp@- 4a4cc: 2540 0030 movel %d0,%a2@(48) 4a4d0: 2f0a movel %a2,%sp@- 4a4d2: 4eb9 0004 cb94 jsr 4cb94 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4a4d8: 486e fffc pea %fp@(-4) 4a4dc: 2f2e 000c movel %fp@(12),%sp@- 4a4e0: 2f0a movel %a2,%sp@- 4a4e2: 4eb9 0004 a1cc jsr 4a1cc <_Thread_queue_Enqueue_priority> 4a4e8: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 4a4ec: 46c2 movew %d2,%sr 4a4ee: 60c8 bras 4a4b8 <_Thread_queue_Requeue+0x40> =============================================================================== 0004a4f0 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4a4f0: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4a4f4: 486e fffc pea %fp@(-4) 4a4f8: 2f2e 0008 movel %fp@(8),%sp@- 4a4fc: 4eb9 0004 9c64 jsr 49c64 <_Thread_Get> switch ( location ) { 4a502: 508f addql #8,%sp 4a504: 4aae fffc tstl %fp@(-4) 4a508: 6618 bnes 4a522 <_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 ); 4a50a: 2f00 movel %d0,%sp@- 4a50c: 4eb9 0004 cc78 jsr 4cc78 <_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; 4a512: 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; 4a514: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 --level; 4a51a: 5380 subql #1,%d0 _Thread_Dispatch_disable_level = level; 4a51c: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 4a522: 4e5e unlk %fp ... =============================================================================== 00057cc4 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 57cc4: 4e56 ffb0 linkw %fp,#-80 Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 57cc8: 41ee ffe8 lea %fp@(-24),%a0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 57ccc: 200e movel %fp,%d0 57cce: 5180 subql #8,%d0 57cd0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 57cd4: 246e 0008 moveal %fp@(8),%a2 57cd8: 2a0e movel %fp,%d5 57cda: 2c0e movel %fp,%d6 57cdc: 0685 ffff fff4 addil #-12,%d5 57ce2: 0686 ffff ffec addil #-20,%d6 57ce8: 260a movel %a2,%d3 57cea: 240a movel %a2,%d2 57cec: 4bf9 0005 bf6c lea 5bf6c <_Watchdog_Adjust_to_chain>,%a5 57cf2: 0683 0000 0030 addil #48,%d3 57cf8: 0682 0000 0068 addil #104,%d2 57cfe: 47f9 0005 878c lea 5878c <_Chain_Get>,%a3 57d04: 49f9 0005 bff8 lea 5bff8 <_Watchdog_Insert>,%a4 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 57d0a: 283c 0000 0700 movel #1792,%d4 head->previous = NULL; tail->previous = head; 57d10: 2d48 fff0 movel %a0,%fp@(-16) 57d14: 41ea 0008 lea %a2@(8),%a0 57d18: 2d48 ffe0 movel %a0,%fp@(-32) 57d1c: 41ea 0040 lea %a2@(64),%a0 57d20: 2d48 ffe4 movel %a0,%fp@(-28) { /* * 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; 57d24: 41ee ffe8 lea %fp@(-24),%a0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 57d28: 2d40 fff4 movel %d0,%fp@(-12) head->previous = NULL; 57d2c: 42ae ffec clrl %fp@(-20) 57d30: 42ae fff8 clrl %fp@(-8) tail->previous = head; 57d34: 2d45 fffc movel %d5,%fp@(-4) 57d38: 2d40 ffd8 movel %d0,%fp@(-40) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 57d3c: 2d46 ffe8 movel %d6,%fp@(-24) 57d40: 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; 57d44: 2039 0007 c3e6 movel 7c3e6 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 57d4a: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 57d4e: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 57d52: 9081 subl %d1,%d0 57d54: 2f05 movel %d5,%sp@- 57d56: 2f00 movel %d0,%sp@- 57d58: 2f03 movel %d3,%sp@- 57d5a: 4e95 jsr %a5@ 57d5c: 2f3c 3b9a ca00 movel #1000000000,%sp@- 57d62: 42a7 clrl %sp@- 57d64: 2f39 0007 c2a8 movel 7c2a8 <_TOD+0x4>,%sp@- 57d6a: 2f39 0007 c2a4 movel 7c2a4 <_TOD>,%sp@- 57d70: 4eb9 0006 c3c0 jsr 6c3c0 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 57d76: 202a 0074 movel %a2@(116),%d0 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 57d7a: 4fef 001c lea %sp@(28),%sp 57d7e: b081 cmpl %d1,%d0 57d80: 6500 009a bcsw 57e1c <_Timer_server_Body+0x158> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 57d84: b081 cmpl %d1,%d0 57d86: 6200 00b8 bhiw 57e40 <_Timer_server_Body+0x17c> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 57d8a: 2541 0074 movel %d1,%a2@(116) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 57d8e: 202a 0078 movel %a2@(120),%d0 57d92: 2f00 movel %d0,%sp@- 57d94: 4e93 jsr %a3@ if ( timer == NULL ) { 57d96: 588f addql #4,%sp 57d98: 4a80 tstl %d0 57d9a: 672e beqs 57dca <_Timer_server_Body+0x106> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 57d9c: 2040 moveal %d0,%a0 57d9e: 7e01 moveq #1,%d7 57da0: 2228 0038 movel %a0@(56),%d1 57da4: be81 cmpl %d1,%d7 57da6: 6700 00bc beqw 57e64 <_Timer_server_Body+0x1a0> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 57daa: 7e03 moveq #3,%d7 57dac: be81 cmpl %d1,%d7 57dae: 66de bnes 57d8e <_Timer_server_Body+0xca> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 57db0: 2040 moveal %d0,%a0 57db2: 4868 0010 pea %a0@(16) 57db6: 2f02 movel %d2,%sp@- 57db8: 4e94 jsr %a4@ } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 57dba: 202a 0078 movel %a2@(120),%d0 ) { 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 ); 57dbe: 508f addql #8,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 57dc0: 2f00 movel %d0,%sp@- 57dc2: 4e93 jsr %a3@ if ( timer == NULL ) { 57dc4: 588f addql #4,%sp 57dc6: 4a80 tstl %d0 57dc8: 66d2 bnes 57d9c <_Timer_server_Body+0xd8> <== NEVER TAKEN * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 57dca: 2004 movel %d4,%d0 57dcc: 40c1 movew %sr,%d1 57dce: 8081 orl %d1,%d0 57dd0: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 57dd2: bcae ffe8 cmpl %fp@(-24),%d6 57dd6: 6700 009a beqw 57e72 <_Timer_server_Body+0x1ae> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 57dda: 46c1 movew %d1,%sr <== NOT EXECUTED static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 57ddc: 2039 0007 c3e6 movel 7c3e6 <_Watchdog_Ticks_since_boot>,%d0<== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 57de2: 222a 003c movel %a2@(60),%d1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; 57de6: 2540 003c movel %d0,%a2@(60) <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 57dea: 9081 subl %d1,%d0 <== NOT EXECUTED 57dec: 2f05 movel %d5,%sp@- <== NOT EXECUTED 57dee: 2f00 movel %d0,%sp@- <== NOT EXECUTED 57df0: 2f03 movel %d3,%sp@- <== NOT EXECUTED 57df2: 4e95 jsr %a5@ <== NOT EXECUTED 57df4: 2f3c 3b9a ca00 movel #1000000000,%sp@- <== NOT EXECUTED 57dfa: 42a7 clrl %sp@- <== NOT EXECUTED 57dfc: 2f39 0007 c2a8 movel 7c2a8 <_TOD+0x4>,%sp@- <== NOT EXECUTED 57e02: 2f39 0007 c2a4 movel 7c2a4 <_TOD>,%sp@- <== NOT EXECUTED 57e08: 4eb9 0006 c3c0 jsr 6c3c0 <__divdi3> <== NOT EXECUTED Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 57e0e: 202a 0074 movel %a2@(116),%d0 <== NOT EXECUTED /* * 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 ) { 57e12: 4fef 001c lea %sp@(28),%sp <== NOT EXECUTED 57e16: b081 cmpl %d1,%d0 <== NOT EXECUTED 57e18: 6400 ff6a bccw 57d84 <_Timer_server_Body+0xc0> <== NOT EXECUTED /* * 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 ); 57e1c: 2f05 movel %d5,%sp@- 57e1e: 2e01 movel %d1,%d7 57e20: 9e80 subl %d0,%d7 57e22: 2f07 movel %d7,%sp@- 57e24: 2d41 ffdc movel %d1,%fp@(-36) 57e28: 2f02 movel %d2,%sp@- 57e2a: 4eb9 0005 bf6c jsr 5bf6c <_Watchdog_Adjust_to_chain> 57e30: 222e ffdc movel %fp@(-36),%d1 57e34: 4fef 000c lea %sp@(12),%sp */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 57e38: 2541 0074 movel %d1,%a2@(116) 57e3c: 6000 ff50 braw 57d8e <_Timer_server_Body+0xca> /* * 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 ); 57e40: 9081 subl %d1,%d0 57e42: 2f00 movel %d0,%sp@- 57e44: 4878 0001 pea 1 57e48: 2d41 ffdc movel %d1,%fp@(-36) 57e4c: 2f02 movel %d2,%sp@- 57e4e: 4eb9 0005 bed8 jsr 5bed8 <_Watchdog_Adjust> 57e54: 222e ffdc movel %fp@(-36),%d1 57e58: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 57e5c: 2541 0074 movel %d1,%a2@(116) 57e60: 6000 ff2c braw 57d8e <_Timer_server_Body+0xca> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 57e64: 4868 0010 pea %a0@(16) 57e68: 2f03 movel %d3,%sp@- 57e6a: 4e94 jsr %a4@ 57e6c: 508f addql #8,%sp 57e6e: 6000 ff1e braw 57d8e <_Timer_server_Body+0xca> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 57e72: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 57e76: 46c1 movew %d1,%sr _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 ) ) { 57e78: 2e2e ffd8 movel %fp@(-40),%d7 57e7c: beae fff4 cmpl %fp@(-12),%d7 57e80: 6758 beqs 57eda <_Timer_server_Body+0x216> /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 57e82: 2004 movel %d4,%d0 57e84: 40c1 movew %sr,%d1 57e86: 8081 orl %d1,%d0 57e88: 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; 57e8a: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 57e8e: be88 cmpl %a0,%d7 57e90: 673a beqs 57ecc <_Timer_server_Body+0x208> <== NEVER TAKEN 57e92: 2e0a movel %a2,%d7 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 57e94: 2250 moveal %a0@,%a1 head->next = new_first; new_first->previous = head; 57e96: 45ee fff4 lea %fp@(-12),%a2 57e9a: 234a 0004 movel %a2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 57e9e: 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; 57ea2: 2d49 fff4 movel %a1,%fp@(-12) _ISR_Enable( level ); 57ea6: 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 ); 57ea8: 2f28 0024 movel %a0@(36),%sp@- 57eac: 2f28 0020 movel %a0@(32),%sp@- 57eb0: 2068 001c moveal %a0@(28),%a0 57eb4: 4e90 jsr %a0@ /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 57eb6: 2004 movel %d4,%d0 57eb8: 40c1 movew %sr,%d1 57eba: 8081 orl %d1,%d0 57ebc: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 57ebe: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57ec0: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 57ec4: b1ee ffd8 cmpal %fp@(-40),%a0 57ec8: 66ca bnes 57e94 <_Timer_server_Body+0x1d0> 57eca: 2447 moveal %d7,%a2 watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 57ecc: 46c1 movew %d1,%sr { /* * 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; 57ece: 41ee ffe8 lea %fp@(-24),%a0 57ed2: 2548 0078 movel %a0,%a2@(120) 57ed6: 6000 fe6c braw 57d44 <_Timer_server_Body+0x80> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 57eda: 4200 clrb %d0 57edc: 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; 57ee0: 2039 0007 c302 movel 7c302 <_Thread_Dispatch_disable_level>,%d0 ++level; 57ee6: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 57ee8: 23c0 0007 c302 movel %d0,7c302 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 57eee: 4878 0008 pea 8 57ef2: 2f12 movel %a2@,%sp@- _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 57ef4: 7e01 moveq #1,%d7 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 57ef6: 4eb9 0005 bb74 jsr 5bb74 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 57efc: 2f0a movel %a2,%sp@- 57efe: 4eba fb7c jsr %pc@(57a7c <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 57f02: 2f0a movel %a2,%sp@- 57f04: 4eba fbe0 jsr %pc@(57ae6 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 57f08: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> ts->active = true; 57f0e: 1547 007c moveb %d7,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 57f12: 2f2e ffe0 movel %fp@(-32),%sp@- 57f16: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 57f1c: 2f2e ffe4 movel %fp@(-28),%sp@- 57f20: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> 57f26: 4fef 0018 lea %sp@(24),%sp { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 57f2a: 41ee ffe8 lea %fp@(-24),%a0 57f2e: 2548 0078 movel %a0,%a2@(120) 57f32: 6000 fe10 braw 57d44 <_Timer_server_Body+0x80> =============================================================================== 00057b54 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 57b54: 4e56 fff0 linkw %fp,#-16 57b58: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 57b5c: 246e 0008 moveal %fp@(8),%a2 57b60: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 57b64: 202a 0078 movel %a2@(120),%d0 57b68: 671a beqs 57b84 <_Timer_server_Schedule_operation_method+0x30> * 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 ); 57b6a: 246a 0078 moveal %a2@(120),%a2 57b6e: 2d4b 000c movel %a3,%fp@(12) 57b72: 2d4a 0008 movel %a2,%fp@(8) } } 57b76: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 57b7c: 4e5e unlk %fp * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 57b7e: 4ef9 0005 8754 jmp 58754 <_Chain_Append> * * 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; 57b84: 2039 0007 c302 movel 7c302 <_Thread_Dispatch_disable_level>,%d0 ++level; 57b8a: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 57b8c: 23c0 0007 c302 movel %d0,7c302 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 57b92: 202b 0038 movel %a3@(56),%d0 57b96: 7201 moveq #1,%d1 57b98: b280 cmpl %d0,%d1 57b9a: 6700 009e beqw 57c3a <_Timer_server_Schedule_operation_method+0xe6> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 57b9e: 7603 moveq #3,%d3 57ba0: b680 cmpl %d0,%d3 57ba2: 670e beqs 57bb2 <_Timer_server_Schedule_operation_method+0x5e> * 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 ); } } 57ba4: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 57baa: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57bac: 4ef9 0005 b1e8 jmp 5b1e8 <_Thread_Enable_dispatch> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 57bb2: 203c 0000 0700 movel #1792,%d0 57bb8: 40c2 movew %sr,%d2 57bba: 8082 orl %d2,%d0 57bbc: 46c0 movew %d0,%sr 57bbe: 2f3c 3b9a ca00 movel #1000000000,%sp@- 57bc4: 42a7 clrl %sp@- 57bc6: 2f39 0007 c2a8 movel 7c2a8 <_TOD+0x4>,%sp@- 57bcc: 2f39 0007 c2a4 movel 7c2a4 <_TOD>,%sp@- 57bd2: 4eb9 0006 c3c0 jsr 6c3c0 <__divdi3> snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 57bd8: 202a 0074 movel %a2@(116),%d0 57bdc: 4fef 0010 lea %sp@(16),%sp RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 57be0: 43ea 006c lea %a2@(108),%a1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57be4: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 57be8: b3c8 cmpal %a0,%a1 57bea: 671c beqs 57c08 <_Timer_server_Schedule_operation_method+0xb4> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 57bec: 2268 0010 moveal %a0@(16),%a1 if ( snapshot > last_snapshot ) { 57bf0: b081 cmpl %d1,%d0 57bf2: 6400 00ba bccw 57cae <_Timer_server_Schedule_operation_method+0x15a> /* * We advanced in time. */ delta = snapshot - last_snapshot; 57bf6: 2601 movel %d1,%d3 57bf8: 9680 subl %d0,%d3 if (delta_interval > delta) { 57bfa: b689 cmpl %a1,%d3 57bfc: 6400 00bc bccw 57cba <_Timer_server_Schedule_operation_method+0x166> delta_interval -= delta; 57c00: 93c3 subal %d3,%a1 57c02: 2009 movel %a1,%d0 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 57c04: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 57c08: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 57c0c: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 57c0e: 486b 0010 pea %a3@(16) 57c12: 486a 0068 pea %a2@(104) 57c16: 4eb9 0005 bff8 jsr 5bff8 <_Watchdog_Insert> if ( !ts->active ) { 57c1c: 508f addql #8,%sp 57c1e: 102a 007c moveb %a2@(124),%d0 57c22: 6680 bnes 57ba4 <_Timer_server_Schedule_operation_method+0x50><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 57c24: 2f0a movel %a2,%sp@- 57c26: 4eba febe jsr %pc@(57ae6 <_Timer_server_Reset_tod_system_watchdog>) 57c2a: 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 ); } } 57c2c: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 57c32: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57c34: 4ef9 0005 b1e8 jmp 5b1e8 <_Thread_Enable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 57c3a: 203c 0000 0700 movel #1792,%d0 57c40: 40c2 movew %sr,%d2 57c42: 8082 orl %d2,%d0 57c44: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 57c46: 2039 0007 c3e6 movel 7c3e6 <_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 ); 57c4c: 220a movel %a2,%d1 57c4e: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 57c54: 262a 003c movel %a2@(60),%d3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57c58: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 57c5c: b288 cmpl %a0,%d1 57c5e: 6712 beqs 57c72 <_Timer_server_Schedule_operation_method+0x11e> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 57c60: 2200 movel %d0,%d1 57c62: 9283 subl %d3,%d1 delta_interval = first_watchdog->delta_interval; 57c64: 2268 0010 moveal %a0@(16),%a1 if (delta_interval > delta) { 57c68: b3c1 cmpal %d1,%a1 57c6a: 633a blss 57ca6 <_Timer_server_Schedule_operation_method+0x152> delta_interval -= delta; 57c6c: 93c1 subal %d1,%a1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 57c6e: 2149 0010 movel %a1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 57c72: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 57c76: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 57c78: 486b 0010 pea %a3@(16) 57c7c: 486a 0030 pea %a2@(48) 57c80: 4eb9 0005 bff8 jsr 5bff8 <_Watchdog_Insert> if ( !ts->active ) { 57c86: 508f addql #8,%sp 57c88: 102a 007c moveb %a2@(124),%d0 57c8c: 6600 ff16 bnew 57ba4 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_interval_system_watchdog( ts ); 57c90: 2f0a movel %a2,%sp@- 57c92: 4eba fde8 jsr %pc@(57a7c <_Timer_server_Reset_interval_system_watchdog>) 57c96: 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 ); } } 57c98: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 57c9e: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57ca0: 4ef9 0005 b1e8 jmp 5b1e8 <_Thread_Enable_dispatch> delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 57ca6: 93c9 subal %a1,%a1 } first_watchdog->delta_interval = delta_interval; 57ca8: 2149 0010 movel %a1,%a0@(16) 57cac: 60c4 bras 57c72 <_Timer_server_Schedule_operation_method+0x11e> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 57cae: d089 addl %a1,%d0 delta_interval += delta; 57cb0: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 57cb2: 2140 0010 movel %d0,%a0@(16) 57cb6: 6000 ff50 braw 57c08 <_Timer_server_Schedule_operation_method+0xb4> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 57cba: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 57cbc: 2140 0010 movel %d0,%a0@(16) <== NOT EXECUTED 57cc0: 6000 ff46 braw 57c08 <_Timer_server_Schedule_operation_method+0xb4><== NOT EXECUTED =============================================================================== 0004ac84 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 4ac84: 4e56 0000 linkw %fp,#0 4ac88: 226e 000c moveal %fp@(12),%a1 4ac8c: 2f0a movel %a2,%sp@- 4ac8e: 246e 0008 moveal %fp@(8),%a2 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 4ac92: 206a 0004 moveal %a2@(4),%a0 4ac96: d1e9 0004 addal %a1@(4),%a0 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4ac9a: 2208 movel %a0,%d1 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 4ac9c: 2011 movel %a1@,%d0 /* Add the basics */ time->tv_sec += add->tv_sec; 4ac9e: d192 addl %d0,%a2@ time->tv_nsec += add->tv_nsec; 4aca0: 2548 0004 movel %a0,%a2@(4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4aca4: b1fc 3b9a c9ff cmpal #999999999,%a0 4acaa: 6320 blss 4accc <_Timespec_Add_to+0x48> 4acac: 2052 moveal %a2@,%a0 4acae: 5288 addql #1,%a0 #include #include #include #include uint32_t _Timespec_Add_to( 4acb0: 91c0 subal %d0,%a0 4acb2: 43f0 0800 lea %a0@(00000000,%d0:l),%a1 time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 4acb6: 0681 c465 3600 addil #-1000000000,%d1 time->tv_sec++; seconds++; 4acbc: 5280 addql #1,%d0 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4acbe: 0c81 3b9a c9ff cmpil #999999999,%d1 4acc4: 62ec bhis 4acb2 <_Timespec_Add_to+0x2e> <== NEVER TAKEN 4acc6: 2541 0004 movel %d1,%a2@(4) 4acca: 2489 movel %a1,%a2@ time->tv_sec++; seconds++; } return seconds; } 4accc: 245f moveal %sp@+,%a2 4acce: 4e5e unlk %fp ... =============================================================================== 0004bfe0 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4bfe0: 4e56 fff4 linkw %fp,#-12 Timestamp64_Control answer; if ( *_rhs == 0 ) { 4bfe4: 206e 000c moveal %fp@(12),%a0 const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4bfe8: 48d7 040c moveml %d2-%d3/%a2,%sp@ Timestamp64_Control answer; if ( *_rhs == 0 ) { 4bfec: 2410 movel %a0@,%d2 4bfee: 2628 0004 movel %a0@(4),%d3 4bff2: 2002 movel %d2,%d0 4bff4: 8083 orl %d3,%d0 4bff6: 676e beqs 4c066 <_Timestamp64_Divide+0x86> <== NEVER TAKEN * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4bff8: 206e 0008 moveal %fp@(8),%a0 4bffc: 45f9 0005 c83c lea 5c83c <__divdi3>,%a2 4c002: 2f3c 0001 86a0 movel #100000,%sp@- 4c008: 42a7 clrl %sp@- 4c00a: 2f28 0004 movel %a0@(4),%sp@- 4c00e: 2f10 movel %a0@,%sp@- 4c010: 4eb9 0005 c7d4 jsr 5c7d4 <__muldi3> 4c016: 4fef 000c lea %sp@(12),%sp 4c01a: 2e83 movel %d3,%sp@ 4c01c: 2f02 movel %d2,%sp@- 4c01e: 2f01 movel %d1,%sp@- 4c020: 2f00 movel %d0,%sp@- 4c022: 4e92 jsr %a2@ 4c024: 4fef 0010 lea %sp@(16),%sp 4c028: 2400 movel %d0,%d2 *_ival_percentage = answer / 1000; 4c02a: 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; 4c02e: 2601 movel %d1,%d3 *_ival_percentage = answer / 1000; 4c030: 42a7 clrl %sp@- 4c032: 2f01 movel %d1,%sp@- 4c034: 2f02 movel %d2,%sp@- 4c036: 4e92 jsr %a2@ 4c038: 4fef 0010 lea %sp@(16),%sp *_fval_percentage = answer % 1000; 4c03c: 4878 03e8 pea 3e8 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4c040: 206e 0010 moveal %fp@(16),%a0 *_fval_percentage = answer % 1000; 4c044: 42a7 clrl %sp@- * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4c046: 2081 movel %d1,%a0@ *_fval_percentage = answer % 1000; 4c048: 2f03 movel %d3,%sp@- 4c04a: 2f02 movel %d2,%sp@- 4c04c: 4eb9 0005 cc9c jsr 5cc9c <__moddi3> 4c052: 206e 0014 moveal %fp@(20),%a0 4c056: 4fef 0010 lea %sp@(16),%sp } 4c05a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; 4c060: 2081 movel %d1,%a0@ } 4c062: 4e5e unlk %fp 4c064: 4e75 rts ) { Timestamp64_Control answer; if ( *_rhs == 0 ) { *_ival_percentage = 0; 4c066: 206e 0010 moveal %fp@(16),%a0 <== NOT EXECUTED 4c06a: 4290 clrl %a0@ <== NOT EXECUTED *_fval_percentage = 0; 4c06c: 206e 0014 moveal %fp@(20),%a0 <== NOT EXECUTED answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; } 4c070: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED { Timestamp64_Control answer; if ( *_rhs == 0 ) { *_ival_percentage = 0; *_fval_percentage = 0; 4c076: 4290 clrl %a0@ <== NOT EXECUTED answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; *_fval_percentage = answer % 1000; } 4c078: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a86c <_User_extensions_Handler_initialization>: void _User_extensions_Handler_initialization(void) { 4a86c: 4e56 fffc linkw %fp,#-4 uint32_t number_of_initial_extensions = 4a870: 2039 0005 c614 movel 5c614 ,%d0 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4a876: 6604 bnes 4a87c <_User_extensions_Handler_initialization+0x10><== ALWAYS TAKEN ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); } } 4a878: 4e5e unlk %fp <== NOT EXECUTED 4a87a: 4e75 rts <== NOT EXECUTED 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 = _Workspace_Allocate_or_fatal_error( 4a87c: 2200 movel %d0,%d1 4a87e: e988 lsll #4,%d0 4a880: 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 = 4a882: 9081 subl %d1,%d0 4a884: 2f00 movel %d0,%sp@- 4a886: 4eb9 0004 ac2a jsr 4ac2a <_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 }; 4a88c: 204e moveal %fp,%a0 4a88e: 2100 movel %d0,%a0@- _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4a890: 487a ff9a pea %pc@(4a82c <_User_extensions_Switch_visitor>) 4a894: 2f08 movel %a0,%sp@- 4a896: 4eb9 0004 a7b8 jsr 4a7b8 <_User_extensions_Iterate> 4a89c: 4fef 000c lea %sp@(12),%sp } } 4a8a0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a7b8 <_User_extensions_Iterate>: void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 4a7b8: 4e56 ffec linkw %fp,#-20 Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 4a7bc: 2039 0005 c614 movel 5c614 ,%d0 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 4a7c2: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); 4a7c6: eb88 lsll #5,%d0 void *arg, User_extensions_Visitor visitor ) { Thread_Control *executing = _Thread_Executing; const User_extensions_Table *callouts_current = 4a7c8: 2439 0005 c618 movel 5c618 ,%d2 rtems_configuration_get_user_extension_table(); const User_extensions_Table *callouts_end = 4a7ce: 2442 moveal %d2,%a2 4a7d0: d5c0 addal %d0,%a2 void _User_extensions_Iterate( void *arg, User_extensions_Visitor visitor ) { 4a7d2: 282e 0008 movel %fp@(8),%d4 4a7d6: 266e 000c moveal %fp@(12),%a3 Thread_Control *executing = _Thread_Executing; 4a7da: 2639 0005 fb7e movel 5fb7e <_Per_CPU_Information+0xe>,%d3 const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 4a7e0: b5c2 cmpal %d2,%a2 4a7e2: 6716 beqs 4a7fa <_User_extensions_Iterate+0x42> <== NEVER TAKEN (*visitor)( executing, arg, callouts_current ); 4a7e4: 2f02 movel %d2,%sp@- ++callouts_current; 4a7e6: 0682 0000 0020 addil #32,%d2 callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { (*visitor)( executing, arg, callouts_current ); 4a7ec: 2f04 movel %d4,%sp@- 4a7ee: 2f03 movel %d3,%sp@- 4a7f0: 4e93 jsr %a3@ const User_extensions_Table *callouts_end = callouts_current + rtems_configuration_get_number_of_initial_extensions(); const Chain_Node *node; const Chain_Node *tail; while ( callouts_current != callouts_end ) { 4a7f2: 4fef 000c lea %sp@(12),%sp 4a7f6: b48a cmpl %a2,%d2 4a7f8: 66ea bnes 4a7e4 <_User_extensions_Iterate+0x2c> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4a7fa: 2479 0005 e33c moveal 5e33c <_User_extensions_List>,%a2 ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 4a800: b5fc 0005 e340 cmpal #385856,%a2 4a806: 6718 beqs 4a820 <_User_extensions_Iterate+0x68> const User_extensions_Control *extension = (const User_extensions_Control *) node; (*visitor)( executing, arg, &extension->Callouts ); 4a808: 486a 0014 pea %a2@(20) 4a80c: 2f04 movel %d4,%sp@- 4a80e: 2f03 movel %d3,%sp@- 4a810: 4e93 jsr %a3@ node = _Chain_Immutable_next( node ); } } 4a812: 2452 moveal %a2@,%a2 ++callouts_current; } node = _Chain_Immutable_first( &_User_extensions_List ); tail = _Chain_Immutable_tail( &_User_extensions_List ); while ( node != tail ) { 4a814: 4fef 000c lea %sp@(12),%sp 4a818: b5fc 0005 e340 cmpal #385856,%a2 4a81e: 66e8 bnes 4a808 <_User_extensions_Iterate+0x50> (*visitor)( executing, arg, &extension->Callouts ); node = _Chain_Immutable_next( node ); } } 4a820: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4a826: 4e5e unlk %fp ... =============================================================================== 0004c28c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4c28c: 4e56 ffe8 linkw %fp,#-24 4c290: 226e 000c moveal %fp@(12),%a1 4c294: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ ISR_Level level; _ISR_Disable( level ); 4c298: 263c 0000 0700 movel #1792,%d3 4c29e: 2003 movel %d3,%d0 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4c2a0: 266e 0008 moveal %fp@(8),%a3 4c2a4: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4c2a8: 40c1 movew %sr,%d1 4c2aa: 8081 orl %d1,%d0 4c2ac: 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; 4c2ae: 244b moveal %a3,%a2 4c2b0: 205a moveal %a2@+,%a0 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4c2b2: b5c8 cmpal %a0,%a2 4c2b4: 6746 beqs 4c2fc <_Watchdog_Adjust+0x70> switch ( direction ) { 4c2b6: 4a89 tstl %a1 4c2b8: 664e bnes 4c308 <_Watchdog_Adjust+0x7c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4c2ba: 4a82 tstl %d2 4c2bc: 673e beqs 4c2fc <_Watchdog_Adjust+0x70> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4c2be: 2028 0010 movel %a0@(16),%d0 4c2c2: b082 cmpl %d2,%d0 4c2c4: 6230 bhis 4c2f6 <_Watchdog_Adjust+0x6a> <== NEVER TAKEN 4c2c6: 49f9 0004 c4f0 lea 4c4f0 <_Watchdog_Tickle>,%a4 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4c2cc: 7801 moveq #1,%d4 while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4c2ce: 9480 subl %d0,%d2 _Watchdog_First( header )->delta_interval = 1; 4c2d0: 2144 0010 movel %d4,%a0@(16) _ISR_Enable( level ); 4c2d4: 46c1 movew %d1,%sr _Watchdog_Tickle( header ); 4c2d6: 2f0b movel %a3,%sp@- 4c2d8: 4e94 jsr %a4@ _ISR_Disable( level ); 4c2da: 2003 movel %d3,%d0 4c2dc: 40c1 movew %sr,%d1 4c2de: 8081 orl %d1,%d0 4c2e0: 46c0 movew %d0,%sr if ( _Chain_Is_empty( header ) ) 4c2e2: 588f addql #4,%sp 4c2e4: 2053 moveal %a3@,%a0 4c2e6: b1ca cmpal %a2,%a0 4c2e8: 6712 beqs 4c2fc <_Watchdog_Adjust+0x70> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4c2ea: 4a82 tstl %d2 4c2ec: 670e beqs 4c2fc <_Watchdog_Adjust+0x70> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4c2ee: 2028 0010 movel %a0@(16),%d0 4c2f2: b480 cmpl %d0,%d2 4c2f4: 64d6 bccs 4c2cc <_Watchdog_Adjust+0x40> _Watchdog_First( header )->delta_interval -= units; 4c2f6: 9082 subl %d2,%d0 4c2f8: 2140 0010 movel %d0,%a0@(16) } break; } } _ISR_Enable( level ); 4c2fc: 46c1 movew %d1,%sr } 4c2fe: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4c304: 4e5e unlk %fp 4c306: 4e75 rts * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4c308: 7001 moveq #1,%d0 4c30a: b089 cmpl %a1,%d0 4c30c: 66ee bnes 4c2fc <_Watchdog_Adjust+0x70> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4c30e: d5a8 0010 addl %d2,%a0@(16) } break; } } _ISR_Enable( level ); 4c312: 46c1 movew %d1,%sr } 4c314: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4c31a: 4e5e unlk %fp ... =============================================================================== 0005bf6c <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 5bf6c: 4e56 ffe4 linkw %fp,#-28 5bf70: 226e 0010 moveal %fp@(16),%a1 5bf74: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; _ISR_Disable( level ); 5bf78: 263c 0000 0700 movel #1792,%d3 5bf7e: 2003 movel %d3,%d0 Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 5bf80: 242e 0008 movel %fp@(8),%d2 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; _ISR_Disable( level ); 5bf84: 40c1 movew %sr,%d1 5bf86: 8081 orl %d1,%d0 5bf88: 46c0 movew %d0,%sr 5bf8a: 2a42 moveal %d2,%a5 Watchdog_Interval units_arg, Chain_Control *to_fire ) { Watchdog_Interval units = units_arg; 5bf8c: 282e 000c movel %fp@(12),%d4 5bf90: 205d moveal %a5@+,%a0 Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Chain_Is_empty( header ) ) { 5bf92: b1cd cmpal %a5,%a0 5bf94: 6748 beqs 5bfde <_Watchdog_Adjust_to_chain+0x72> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 5bf96: 2028 0010 movel %a0@(16),%d0 5bf9a: b084 cmpl %d4,%d0 5bf9c: 624a bhis 5bfe8 <_Watchdog_Adjust_to_chain+0x7c> /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; 5bf9e: 9880 subl %d0,%d4 first->delta_interval = 0; 5bfa0: 42a8 0010 clrl %a0@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 5bfa4: 2850 moveal %a0@,%a4 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 5bfa6: 2009 movel %a1,%d0 5bfa8: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 5bfaa: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; 5bfae: 294b 0004 movel %a3,%a4@(4) Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 5bfb2: 2469 0008 moveal %a1@(8),%a2 Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 5bfb6: 268c movel %a4,%a3@ { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 5bfb8: 2348 0008 movel %a0,%a1@(8) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 5bfbc: 2080 movel %d0,%a0@ Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; 5bfbe: 214a 0004 movel %a2,%a0@(4) Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; old_last->next = the_node; 5bfc2: 2488 movel %a0,%a2@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 5bfc4: 2003 movel %d3,%d0 5bfc6: 46c1 movew %d1,%sr 5bfc8: 8081 orl %d1,%d0 5bfca: 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; 5bfcc: 2442 moveal %d2,%a2 5bfce: 2052 moveal %a2@,%a0 if ( _Chain_Is_empty( header ) ) 5bfd0: b1cd cmpal %a5,%a0 5bfd2: 67be beqs 5bf92 <_Watchdog_Adjust_to_chain+0x26> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 5bfd4: 4aa8 0010 tstl %a0@(16) 5bfd8: 67ca beqs 5bfa4 <_Watchdog_Adjust_to_chain+0x38> Watchdog_Control *first; _ISR_Disable( level ); while ( 1 ) { if ( _Chain_Is_empty( header ) ) { 5bfda: b1cd cmpal %a5,%a0 5bfdc: 66b8 bnes 5bf96 <_Watchdog_Adjust_to_chain+0x2a> <== ALWAYS TAKEN if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5bfde: 46c1 movew %d1,%sr } 5bfe0: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5 5bfe4: 4e5e unlk %fp 5bfe6: 4e75 rts /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; 5bfe8: 9084 subl %d4,%d0 5bfea: 2140 0010 movel %d0,%a0@(16) if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5bfee: 46c1 movew %d1,%sr } 5bff0: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5 5bff4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a8a4 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 4a8a4: 4e56 fff0 linkw %fp,#-16 4a8a8: 226e 000c moveal %fp@(12),%a1 4a8ac: 48d7 041c moveml %d2-%d4/%a2,%sp@ Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 4a8b0: 283c 0000 0700 movel #1792,%d4 4a8b6: 2004 movel %d4,%d0 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 4a8b8: 2639 0005 fb78 movel 5fb78 <_Per_CPU_Information+0x8>,%d3 _ISR_Disable( level ); 4a8be: 40c2 movew %sr,%d2 4a8c0: 8082 orl %d2,%d0 4a8c2: 46c0 movew %d0,%sr /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 4a8c4: 4aa9 0008 tstl %a1@(8) 4a8c8: 6600 009c bnew 4a966 <_Watchdog_Insert+0xc2> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 4a8cc: 2039 0005 fae6 movel 5fae6 <_Watchdog_Sync_count>,%d0 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 4a8d2: 7201 moveq #1,%d1 _Watchdog_Sync_count++; 4a8d4: 5280 addql #1,%d0 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 4a8d6: 2341 0008 movel %d1,%a1@(8) _Watchdog_Sync_count++; 4a8da: 23c0 0005 fae6 movel %d0,5fae6 <_Watchdog_Sync_count> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a8e0: 246e 0008 moveal %fp@(8),%a2 restart: delta_interval = the_watchdog->initial; 4a8e4: 2029 000c movel %a1@(12),%d0 4a8e8: 2052 moveal %a2@,%a0 for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 4a8ea: 6740 beqs 4a92c <_Watchdog_Insert+0x88> 4a8ec: 4a90 tstl %a0@ 4a8ee: 673c beqs 4a92c <_Watchdog_Insert+0x88> break; if ( delta_interval < after->delta_interval ) { 4a8f0: 2228 0010 movel %a0@(16),%d1 4a8f4: b280 cmpl %d0,%d1 4a8f6: 622e bhis 4a926 <_Watchdog_Insert+0x82> after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 4a8f8: 9081 subl %d1,%d0 _ISR_Flash( level ); 4a8fa: 2204 movel %d4,%d1 4a8fc: 46c2 movew %d2,%sr 4a8fe: 8282 orl %d2,%d1 4a900: 46c1 movew %d1,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 4a902: 7201 moveq #1,%d1 4a904: b2a9 0008 cmpl %a1@(8),%d1 4a908: 6648 bnes 4a952 <_Watchdog_Insert+0xae> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 4a90a: 2239 0005 fa8e movel 5fa8e <_Watchdog_Sync_level>,%d1 4a910: b283 cmpl %d3,%d1 4a912: 625c bhis 4a970 <_Watchdog_Insert+0xcc> exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 4a914: 2050 moveal %a0@,%a0 for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 4a916: 4a80 tstl %d0 4a918: 6712 beqs 4a92c <_Watchdog_Insert+0x88> 4a91a: 4a90 tstl %a0@ 4a91c: 670e beqs 4a92c <_Watchdog_Insert+0x88> break; if ( delta_interval < after->delta_interval ) { 4a91e: 2228 0010 movel %a0@(16),%d1 4a922: b081 cmpl %d1,%d0 4a924: 64d2 bccs 4a8f8 <_Watchdog_Insert+0x54> after->delta_interval -= delta_interval; 4a926: 9280 subl %d0,%d1 4a928: 2141 0010 movel %d1,%a0@(16) _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 4a92c: 2068 0004 moveal %a0@(4),%a0 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 4a930: 7202 moveq #2,%d1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4a932: 2450 moveal %a0@,%a2 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 4a934: 2340 0010 movel %d0,%a1@(16) _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 4a938: 2039 0005 faea movel 5faea <_Watchdog_Ticks_since_boot>,%d0 4a93e: 2341 0008 movel %d1,%a1@(8) 4a942: 2340 0014 movel %d0,%a1@(20) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4a946: 2348 0004 movel %a0,%a1@(4) before_node = after_node->next; after_node->next = the_node; 4a94a: 2089 movel %a1,%a0@ the_node->next = before_node; before_node->previous = the_node; 4a94c: 2549 0004 movel %a1,%a2@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 4a950: 228a movel %a2,%a1@ exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 4a952: 23c3 0005 fa8e movel %d3,5fa8e <_Watchdog_Sync_level> _Watchdog_Sync_count--; 4a958: 2039 0005 fae6 movel 5fae6 <_Watchdog_Sync_count>,%d0 4a95e: 5380 subql #1,%d0 4a960: 23c0 0005 fae6 movel %d0,5fae6 <_Watchdog_Sync_count> _ISR_Enable( level ); 4a966: 46c2 movew %d2,%sr } 4a968: 4cd7 041c moveml %sp@,%d2-%d4/%a2 4a96c: 4e5e unlk %fp 4a96e: 4e75 rts if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { _Watchdog_Sync_level = insert_isr_nest_level; 4a970: 23c3 0005 fa8e movel %d3,5fa8e <_Watchdog_Sync_level> goto restart; 4a976: 6000 ff68 braw 4a8e0 <_Watchdog_Insert+0x3c> ... =============================================================================== 0004a9d4 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4a9d4: 203c 0000 0700 movel #1792,%d0 #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4a9da: 4e56 0000 linkw %fp,#0 4a9de: 206e 0008 moveal %fp@(8),%a0 4a9e2: 2f0a movel %a2,%sp@- 4a9e4: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4a9e6: 40c1 movew %sr,%d1 4a9e8: 8081 orl %d1,%d0 4a9ea: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 4a9ec: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 4a9f0: 7401 moveq #1,%d2 4a9f2: b480 cmpl %d0,%d2 4a9f4: 6764 beqs 4aa5a <_Watchdog_Remove+0x86> 4a9f6: 6314 blss 4aa0c <_Watchdog_Remove+0x38> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4a9f8: 2439 0005 faea movel 5faea <_Watchdog_Ticks_since_boot>,%d2 4a9fe: 2142 0018 movel %d2,%a0@(24) _ISR_Enable( level ); 4aa02: 46c1 movew %d1,%sr return( previous_state ); } 4aa04: 241f movel %sp@+,%d2 4aa06: 245f moveal %sp@+,%a2 4aa08: 4e5e unlk %fp 4aa0a: 4e75 rts Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 4aa0c: 143c 0003 moveb #3,%d2 4aa10: b480 cmpl %d0,%d2 4aa12: 65e4 bcss 4a9f8 <_Watchdog_Remove+0x24> <== NEVER TAKEN } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 4aa14: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4aa16: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4aa1a: 4a91 tstl %a1@ 4aa1c: 6708 beqs 4aa26 <_Watchdog_Remove+0x52> next_watchdog->delta_interval += the_watchdog->delta_interval; 4aa1e: 2428 0010 movel %a0@(16),%d2 4aa22: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 4aa26: 2479 0005 fae6 moveal 5fae6 <_Watchdog_Sync_count>,%a2 4aa2c: 4a8a tstl %a2 4aa2e: 670c beqs 4aa3c <_Watchdog_Remove+0x68> _Watchdog_Sync_level = _ISR_Nest_level; 4aa30: 45f9 0005 fb78 lea 5fb78 <_Per_CPU_Information+0x8>,%a2 4aa36: 23d2 0005 fa8e movel %a2@,5fa8e <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4aa3c: 2468 0004 moveal %a0@(4),%a2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4aa40: 2439 0005 faea movel 5faea <_Watchdog_Ticks_since_boot>,%d2 next->previous = previous; 4aa46: 234a 0004 movel %a2,%a1@(4) previous->next = next; 4aa4a: 2489 movel %a1,%a2@ 4aa4c: 2142 0018 movel %d2,%a0@(24) _ISR_Enable( level ); 4aa50: 46c1 movew %d1,%sr return( previous_state ); } 4aa52: 241f movel %sp@+,%d2 4aa54: 245f moveal %sp@+,%a2 4aa56: 4e5e unlk %fp 4aa58: 4e75 rts _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4aa5a: 2439 0005 faea movel 5faea <_Watchdog_Ticks_since_boot>,%d2 /* * 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; 4aa60: 42a8 0008 clrl %a0@(8) _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4aa64: 2142 0018 movel %d2,%a0@(24) _ISR_Enable( level ); 4aa68: 46c1 movew %d1,%sr return( previous_state ); } 4aa6a: 241f movel %sp@+,%d2 4aa6c: 245f moveal %sp@+,%a2 4aa6e: 4e5e unlk %fp ... =============================================================================== 0004bbcc <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4bbcc: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4bbd2: 4e56 ffe8 linkw %fp,#-24 4bbd6: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4bbda: 242e 0008 movel %fp@(8),%d2 4bbde: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4bbe2: 40c3 movew %sr,%d3 4bbe4: 8083 orl %d3,%d0 4bbe6: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4bbe8: 2f0b movel %a3,%sp@- 4bbea: 4bf9 0004 4990 lea 44990 ,%a5 4bbf0: 2f02 movel %d2,%sp@- 4bbf2: 4879 0005 f213 pea 5f213 <_Copyright_Notice+0x4b> 4bbf8: 4e95 jsr %a5@ */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4bbfa: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 4bbfc: 4fef 000c lea %sp@(12),%sp 4bc00: b7ca cmpal %a2,%a3 4bc02: 672c beqs 4bc30 <_Watchdog_Report_chain+0x64> 4bc04: 49f9 0004 bc48 lea 4bc48 <_Watchdog_Report>,%a4 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4bc0a: 2f0a movel %a2,%sp@- 4bc0c: 42a7 clrl %sp@- 4bc0e: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 4bc10: 2452 moveal %a2@,%a2 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 4bc12: 508f addql #8,%sp 4bc14: b7ca cmpal %a2,%a3 4bc16: 66f2 bnes 4bc0a <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4bc18: 2f02 movel %d2,%sp@- 4bc1a: 4879 0005 f22a pea 5f22a <_Copyright_Notice+0x62> 4bc20: 4e95 jsr %a5@ 4bc22: 508f addql #8,%sp } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 4bc24: 46c3 movew %d3,%sr } 4bc26: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4bc2c: 4e5e unlk %fp 4bc2e: 4e75 rts _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4bc30: 4879 0005 f239 pea 5f239 <_Copyright_Notice+0x71> 4bc36: 4e95 jsr %a5@ 4bc38: 588f addql #4,%sp } _ISR_Enable( level ); 4bc3a: 46c3 movew %d3,%sr } 4bc3c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4bc42: 4e5e unlk %fp ... =============================================================================== 0004aa74 <_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 ); 4aa74: 203c 0000 0700 movel #1792,%d0 #include void _Watchdog_Tickle( Chain_Control *header ) { 4aa7a: 4e56 ffe8 linkw %fp,#-24 4aa7e: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4aa82: 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 ); 4aa86: 40c2 movew %sr,%d2 4aa88: 8082 orl %d2,%d0 4aa8a: 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; 4aa8c: 264c moveal %a4,%a3 4aa8e: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 4aa90: b7ca cmpal %a2,%a3 4aa92: 673c beqs 4aad0 <_Watchdog_Tickle+0x5c> * 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) { 4aa94: 202a 0010 movel %a2@(16),%d0 4aa98: 6708 beqs 4aaa2 <_Watchdog_Tickle+0x2e> <== NEVER TAKEN the_watchdog->delta_interval--; 4aa9a: 5380 subql #1,%d0 4aa9c: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 4aaa0: 662e bnes 4aad0 <_Watchdog_Tickle+0x5c> 4aaa2: 4bf9 0004 a9d4 lea 4a9d4 <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4aaa8: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4aaae: 2f0a movel %a2,%sp@- 4aab0: 4e95 jsr %a5@ _ISR_Enable( level ); 4aab2: 46c2 movew %d2,%sr switch( watchdog_state ) { 4aab4: 7202 moveq #2,%d1 4aab6: 588f addql #4,%sp 4aab8: b280 cmpl %d0,%d1 4aaba: 6720 beqs 4aadc <_Watchdog_Tickle+0x68> <== ALWAYS TAKEN case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4aabc: 2003 movel %d3,%d0 4aabe: 40c2 movew %sr,%d2 4aac0: 8082 orl %d2,%d0 4aac2: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4aac4: 2454 moveal %a4@,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4aac6: b5cb cmpal %a3,%a2 4aac8: 6706 beqs 4aad0 <_Watchdog_Tickle+0x5c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4aaca: 4aaa 0010 tstl %a2@(16) 4aace: 67de beqs 4aaae <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4aad0: 46c2 movew %d2,%sr } 4aad2: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4aad8: 4e5e unlk %fp 4aada: 4e75 rts _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4aadc: 2f2a 0024 movel %a2@(36),%sp@- 4aae0: 2f2a 0020 movel %a2@(32),%sp@- 4aae4: 206a 001c moveal %a2@(28),%a0 4aae8: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 4aaea: 508f addql #8,%sp 4aaec: 60ce bras 4aabc <_Watchdog_Tickle+0x48> ... =============================================================================== 0004ac2a <_Workspace_Allocate_or_fatal_error>: void *_Workspace_Allocate_or_fatal_error( size_t size ) { 4ac2a: 4e56 0000 linkw %fp,#0 4ac2e: 42a7 clrl %sp@- 4ac30: 42a7 clrl %sp@- 4ac32: 2f2e 0008 movel %fp@(8),%sp@- 4ac36: 4879 0005 fa16 pea 5fa16 <_Workspace_Area> 4ac3c: 4eb9 0004 c6b0 jsr 4c6b0 <_Heap_Allocate_aligned_with_boundary> __builtin_return_address( 1 ), memory ); #endif if ( memory == NULL ) 4ac42: 4fef 0010 lea %sp@(16),%sp 4ac46: 4a80 tstl %d0 4ac48: 6704 beqs 4ac4e <_Workspace_Allocate_or_fatal_error+0x24> true, INTERNAL_ERROR_WORKSPACE_ALLOCATION ); return memory; } 4ac4a: 4e5e unlk %fp 4ac4c: 4e75 rts memory ); #endif if ( memory == NULL ) _Internal_error_Occurred( 4ac4e: 4878 0003 pea 3 4ac52: 4878 0001 pea 1 4ac56: 42a7 clrl %sp@- 4ac58: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> ... =============================================================================== 0004aaf0 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4aaf0: 4e56 ffd8 linkw %fp,#-40 4aaf4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4aaf8: 266e 0008 moveal %fp@(8),%a3 4aafc: 2c2e 000c movel %fp@(12),%d6 4ab00: 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(); 4ab04: 4a39 0005 c606 tstb 5c606 4ab0a: 6600 00d2 bnew 4abde <_Workspace_Handler_initialization+0xee> 4ab0e: 2839 0005 c5d8 movel 5c5d8 ,%d4 4ab14: d8b9 0005 c5d4 addl 5c5d4 ,%d4 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 4ab1a: 1e39 0005 c604 moveb 5c604 ,%d7 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) { 4ab20: 4a86 tstl %d6 4ab22: 6768 beqs 4ab8c <_Workspace_Handler_initialization+0x9c><== NEVER TAKEN /* #define DEBUG_WORKSPACE */ #if defined(DEBUG_WORKSPACE) #include #endif void _Workspace_Handler_initialization( 4ab24: 45eb 0004 lea %a3@(4),%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) { 4ab28: 4283 clrl %d3 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4ab2a: 49f9 0004 86b0 lea 486b0 <_Heap_Initialize>,%a4 for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 4ab30: 4bf9 0004 e9d4 lea 4e9d4 ,%a5 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4ab36: 4a07 tstb %d7 4ab38: 6660 bnes 4ab9a <_Workspace_Handler_initialization+0xaa><== NEVER TAKEN memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 4ab3a: 2412 movel %a2@,%d2 4ab3c: 700e moveq #14,%d0 4ab3e: b082 cmpl %d2,%d0 4ab40: 6440 bccs 4ab82 <_Workspace_Handler_initialization+0x92> uintptr_t space_available; uintptr_t size; if ( unified ) { 4ab42: 4a39 0005 c605 tstb 5c605 4ab48: 6618 bnes 4ab62 <_Workspace_Handler_initialization+0x72> size = area->size; } else { if ( remaining > 0 ) { 4ab4a: 4a84 tstl %d4 4ab4c: 675a beqs 4aba8 <_Workspace_Handler_initialization+0xb8><== NEVER TAKEN size = remaining < area->size - overhead ? 4ab4e: 2002 movel %d2,%d0 4ab50: 0680 ffff fff2 addil #-14,%d0 remaining + overhead : area->size; 4ab56: b880 cmpl %d0,%d4 4ab58: 6408 bccs 4ab62 <_Workspace_Handler_initialization+0x72><== NEVER TAKEN 4ab5a: 2404 movel %d4,%d2 4ab5c: 0682 0000 000e addil #14,%d2 } else { size = 0; } } space_available = (*init_or_extend)( 4ab62: 4878 0004 pea 4 4ab66: 2f02 movel %d2,%sp@- 4ab68: 2f13 movel %a3@,%sp@- 4ab6a: 4879 0005 fa16 pea 5fa16 <_Workspace_Area> 4ab70: 4e94 jsr %a4@ ); area->begin = (char *) area->begin + size; area->size -= size; if ( space_available < remaining ) { 4ab72: 4fef 0010 lea %sp@(16),%sp area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4ab76: d593 addl %d2,%a3@ area->size -= size; 4ab78: 9592 subl %d2,%a2@ if ( space_available < remaining ) { 4ab7a: b880 cmpl %d0,%d4 4ab7c: 634e blss 4abcc <_Workspace_Handler_initialization+0xdc><== ALWAYS TAKEN remaining -= space_available; 4ab7e: 9880 subl %d0,%d4 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4ab80: 2845 moveal %d5,%a4 <== NOT EXECUTED 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) { 4ab82: 5283 addql #1,%d3 4ab84: 508a addql #8,%a2 4ab86: 508b addql #8,%a3 4ab88: bc83 cmpl %d3,%d6 4ab8a: 66aa bnes 4ab36 <_Workspace_Handler_initialization+0x46><== NEVER TAKEN init_or_extend = extend; } } if ( remaining > 0 ) { 4ab8c: 4a84 tstl %d4 4ab8e: 6654 bnes 4abe4 <_Workspace_Handler_initialization+0xf4> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 4ab90: 4cee 3cfc ffd8 moveml %fp@(-40),%d2-%d7/%a2-%a5 4ab96: 4e5e unlk %fp 4ab98: 4e75 rts for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { memset( area->begin, 0, area->size ); 4ab9a: 2f12 movel %a2@,%sp@- 4ab9c: 42a7 clrl %sp@- 4ab9e: 2f13 movel %a3@,%sp@- 4aba0: 4e95 jsr %a5@ 4aba2: 4fef 000c lea %sp@(12),%sp 4aba6: 6092 bras 4ab3a <_Workspace_Handler_initialization+0x4a> } else { size = 0; } } space_available = (*init_or_extend)( 4aba8: 4878 0004 pea 4 <== NOT EXECUTED 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) { 4abac: 5283 addql #1,%d3 <== NOT EXECUTED 4abae: 508a addql #8,%a2 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( 4abb0: 42a7 clrl %sp@- <== NOT EXECUTED 4abb2: 2f13 movel %a3@,%sp@- <== NOT EXECUTED 4abb4: 508b addql #8,%a3 <== NOT EXECUTED 4abb6: 4879 0005 fa16 pea 5fa16 <_Workspace_Area> <== NOT EXECUTED 4abbc: 4e94 jsr %a4@ <== NOT EXECUTED 4abbe: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4abc2: 2845 moveal %d5,%a4 <== NOT EXECUTED 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) { 4abc4: bc83 cmpl %d3,%d6 <== NOT EXECUTED 4abc6: 6600 ff6e bnew 4ab36 <_Workspace_Handler_initialization+0x46><== NOT EXECUTED 4abca: 60c0 bras 4ab8c <_Workspace_Handler_initialization+0x9c><== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4abcc: 2845 moveal %d5,%a4 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4abce: 4284 clrl %d4 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) { 4abd0: 5283 addql #1,%d3 4abd2: 508a addql #8,%a2 4abd4: 508b addql #8,%a3 4abd6: bc83 cmpl %d3,%d6 4abd8: 6600 ff5c bnew 4ab36 <_Workspace_Handler_initialization+0x46> 4abdc: 60ae bras 4ab8c <_Workspace_Handler_initialization+0x9c> size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4abde: 4284 clrl %d4 4abe0: 6000 ff32 braw 4ab14 <_Workspace_Handler_initialization+0x24> init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 4abe4: 4878 0002 pea 2 4abe8: 4878 0001 pea 1 4abec: 42a7 clrl %sp@- 4abee: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> =============================================================================== 0004aefc <_Workspace_String_duplicate>: char *_Workspace_String_duplicate( const char *string, size_t len ) { 4aefc: 4e56 0000 linkw %fp,#0 4af00: 2f0b movel %a3,%sp@- 4af02: 266e 000c moveal %fp@(12),%a3 4af06: 2f0a movel %a2,%sp@- char *dup = _Workspace_Allocate(len + 1); 4af08: 486b 0001 pea %a3@(1) 4af0c: 4eb9 0004 ae90 jsr 4ae90 <_Workspace_Allocate> if (dup != NULL) { 4af12: 588f addql #4,%sp char *_Workspace_String_duplicate( const char *string, size_t len ) { char *dup = _Workspace_Allocate(len + 1); 4af14: 2440 moveal %d0,%a2 if (dup != NULL) { 4af16: 4a80 tstl %d0 4af18: 6718 beqs 4af32 <_Workspace_String_duplicate+0x36><== NEVER TAKEN dup [len] = '\0'; 4af1a: 4200 clrb %d0 4af1c: 1580 b800 moveb %d0,%a2@(00000000,%a3:l) memcpy(dup, string, len); 4af20: 2f0b movel %a3,%sp@- 4af22: 2f2e 0008 movel %fp@(8),%sp@- 4af26: 2f0a movel %a2,%sp@- 4af28: 4eb9 0004 ecf4 jsr 4ecf4 4af2e: 4fef 000c lea %sp@(12),%sp } return dup; } 4af32: 200a movel %a2,%d0 4af34: 246e fff8 moveal %fp@(-8),%a2 4af38: 266e fffc moveal %fp@(-4),%a3 4af3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048538 : rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 48538: 72f8 moveq #-8,%d1 rtems_chain_control *free_chain, rtems_rbtree_control *chunk_tree, rtems_rbheap_chunk *a, rtems_rbheap_chunk *b ) { 4853a: 4e56 fff4 linkw %fp,#-12 4853e: 202e 000c movel %fp@(12),%d0 48542: 48d7 1c00 moveml %a2-%a4,%sp@ 48546: 266e 0008 moveal %fp@(8),%a3 4854a: 226e 0010 moveal %fp@(16),%a1 4854e: 206e 0014 moveal %fp@(20),%a0 if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) { 48552: b288 cmpl %a0,%d1 48554: 6754 beqs 485aa */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 48556: 2450 moveal %a0@,%a2 48558: 4a8a tstl %a2 4855a: 6748 beqs 485a4 if (b->begin < a->begin) { 4855c: 2229 0018 movel %a1@(24),%d1 48560: b2a8 0018 cmpl %a0@(24),%d1 48564: 6308 blss 4856e 48566: 2451 moveal %a1@,%a2 48568: 2209 movel %a1,%d1 4856a: 2248 moveal %a0,%a1 4856c: 2041 moveal %d1,%a0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4856e: 2868 0004 moveal %a0@(4),%a4 a = b; b = t; } a->size += b->size; 48572: 2228 001c movel %a0@(28),%d1 48576: d3a9 001c addl %d1,%a1@(28) next->previous = previous; previous->next = next; 4857a: 288a movel %a2,%a4@ ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4857c: 2253 moveal %a3@,%a1 Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4857e: 254c 0004 movel %a4,%a2@(4) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; 48582: 2688 movel %a0,%a3@ Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 48584: 214b 0004 movel %a3,%a0@(4) rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } 48588: 4cd7 1c00 moveml %sp@,%a2-%a4 before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 4858c: 2089 movel %a1,%a0@ before_node->previous = the_node; 4858e: 2348 0004 movel %a0,%a1@(4) } a->size += b->size; rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 48592: 5088 addql #8,%a0 48594: 2d40 0008 movel %d0,%fp@(8) 48598: 2d48 000c movel %a0,%fp@(12) } } 4859c: 4e5e unlk %fp } a->size += b->size; rtems_chain_extract_unprotected(&b->chain_node); add_to_chain(free_chain, b); _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); 4859e: 4ef9 0004 9f3a jmp 49f3a <_RBTree_Extract_unprotected> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 485a4: 4aa8 0004 tstl %a0@(4) 485a8: 66b2 bnes 4855c <== NEVER TAKEN } } 485aa: 4cd7 1c00 moveml %sp@,%a2-%a4 485ae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047ee0 : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 47ee0: 4e56 0000 linkw %fp,#0 47ee4: 2f03 movel %d3,%sp@- 47ee6: 262e 0014 movel %fp@(20),%d3 47eea: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Append_with_empty_check( chain, node ); 47eec: 2f2e 000c movel %fp@(12),%sp@- 47ef0: 2f2e 0008 movel %fp@(8),%sp@- 47ef4: 242e 0010 movel %fp@(16),%d2 47ef8: 4eb9 0004 8498 jsr 48498 <_Chain_Append_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { 47efe: 508f addql #8,%sp 47f00: 4a00 tstb %d0 47f02: 660e bnes 47f12 sc = rtems_event_send( task, events ); } return sc; } 47f04: 242e fff8 movel %fp@(-8),%d2 47f08: 4280 clrl %d0 47f0a: 262e fffc movel %fp@(-4),%d3 47f0e: 4e5e unlk %fp 47f10: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 47f12: 2d43 000c movel %d3,%fp@(12) } return sc; } 47f16: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 47f1a: 2d42 0008 movel %d2,%fp@(8) } return sc; } 47f1e: 242e fff8 movel %fp@(-8),%d2 47f22: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 47f24: 4ef9 0004 73ac jmp 473ac ... =============================================================================== 00047f2c : rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node ) { 47f2c: 4e56 0000 linkw %fp,#0 47f30: 2f03 movel %d3,%sp@- 47f32: 262e 0010 movel %fp@(16),%d3 47f36: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node ) { return _Chain_Get_with_empty_check( chain, node ); 47f38: 2f2e 0014 movel %fp@(20),%sp@- 47f3c: 2f2e 0008 movel %fp@(8),%sp@- 47f40: 242e 000c movel %fp@(12),%d2 47f44: 4eb9 0004 8510 jsr 48510 <_Chain_Get_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { 47f4a: 508f addql #8,%sp 47f4c: 4a00 tstb %d0 47f4e: 660e bnes 47f5e sc = rtems_event_send( task, events ); } return sc; } 47f50: 242e fff8 movel %fp@(-8),%d2 47f54: 4280 clrl %d0 47f56: 262e fffc movel %fp@(-4),%d3 47f5a: 4e5e unlk %fp 47f5c: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 47f5e: 2d43 000c movel %d3,%fp@(12) } return sc; } 47f62: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 47f66: 2d42 0008 movel %d2,%fp@(8) } return sc; } 47f6a: 242e fff8 movel %fp@(-8),%d2 47f6e: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 47f70: 4ef9 0004 73ac jmp 473ac ... =============================================================================== 00047f78 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 47f78: 4e56 ffe0 linkw %fp,#-32 47f7c: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 47f80: 2c0e movel %fp,%d6 47f82: 45f9 0004 855c lea 4855c <_Chain_Get>,%a2 47f88: 5986 subql #4,%d6 47f8a: 47f9 0004 7200 lea 47200 ,%a3 rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 47f90: 262e 0008 movel %fp@(8),%d3 47f94: 2a2e 000c movel %fp@(12),%d5 47f98: 282e 0010 movel %fp@(16),%d4 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 47f9c: 2f03 movel %d3,%sp@- 47f9e: 4e92 jsr %a2@ rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 47fa0: 588f addql #4,%sp 47fa2: 2400 movel %d0,%d2 47fa4: 6622 bnes 47fc8 ) { rtems_event_set out; sc = rtems_event_receive( 47fa6: 2f06 movel %d6,%sp@- 47fa8: 2f04 movel %d4,%sp@- 47faa: 42a7 clrl %sp@- 47fac: 2f05 movel %d5,%sp@- 47fae: 4e93 jsr %a3@ ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 47fb0: 4fef 0010 lea %sp@(16),%sp 47fb4: 4a80 tstl %d0 47fb6: 67e4 beqs 47f9c <== NEVER TAKEN timeout, &out ); } *node_ptr = node; 47fb8: 206e 0014 moveal %fp@(20),%a0 47fbc: 2082 movel %d2,%a0@ return sc; } 47fbe: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 47fc4: 4e5e unlk %fp 47fc6: 4e75 rts timeout, &out ); } *node_ptr = node; 47fc8: 206e 0014 moveal %fp@(20),%a0 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 47fcc: 4280 clrl %d0 timeout, &out ); } *node_ptr = node; 47fce: 2082 movel %d2,%a0@ return sc; } 47fd0: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 47fd6: 4e5e unlk %fp ... =============================================================================== 00047fdc : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 47fdc: 4e56 0000 linkw %fp,#0 47fe0: 2f03 movel %d3,%sp@- 47fe2: 262e 0014 movel %fp@(20),%d3 47fe6: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Prepend_with_empty_check( chain, node ); 47fe8: 2f2e 000c movel %fp@(12),%sp@- 47fec: 2f2e 0008 movel %fp@(8),%sp@- 47ff0: 242e 0010 movel %fp@(16),%d2 47ff4: 4eb9 0004 8630 jsr 48630 <_Chain_Prepend_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { 47ffa: 508f addql #8,%sp 47ffc: 4a00 tstb %d0 47ffe: 660e bnes 4800e sc = rtems_event_send( task, events ); } return sc; } 48000: 242e fff8 movel %fp@(-8),%d2 48004: 4280 clrl %d0 48006: 262e fffc movel %fp@(-4),%d3 4800a: 4e5e unlk %fp 4800c: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 4800e: 2d43 000c movel %d3,%fp@(12) } return sc; } 48012: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 48016: 2d42 0008 movel %d2,%fp@(8) } return sc; } 4801a: 242e fff8 movel %fp@(-8),%d2 4801e: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 48020: 4ef9 0004 73ac jmp 473ac ... =============================================================================== 00050878 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 50878: 4e56 0000 linkw %fp,#0 5087c: 206e 0014 moveal %fp@(20),%a0 50880: 2f0a movel %a2,%sp@- rtems_status_code sc; if ( event_out != NULL ) { 50882: 4a88 tstl %a0 50884: 671e beqs 508a4 <== NEVER TAKEN Thread_Control *executing = _Thread_Executing; 50886: 2479 0006 4162 moveal 64162 <_Per_CPU_Information+0xe>,%a2 RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; 5088c: 226a 00f8 moveal %a2@(248),%a1 Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 50890: 4aae 0008 tstl %fp@(8) 50894: 6618 bnes 508ae <== ALWAYS TAKEN } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 50896: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; sc = RTEMS_SUCCESSFUL; 5089a: 4280 clrl %d0 <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 5089c: 4e5e unlk %fp <== NOT EXECUTED ); _Thread_Enable_dispatch(); sc = executing->Wait.return_code; } else { *event_out = event->pending_events; 5089e: 20a9 0004 movel %a1@(4),%a0@ <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 508a2: 4e75 rts <== NOT EXECUTED 508a4: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED } else { *event_out = event->pending_events; sc = RTEMS_SUCCESSFUL; } } else { sc = RTEMS_INVALID_ADDRESS; 508a8: 7009 moveq #9,%d0 <== NOT EXECUTED } return sc; } 508aa: 4e5e unlk %fp <== NOT EXECUTED 508ac: 4e75 rts <== NOT EXECUTED * * 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; 508ae: 2039 0006 3fea movel 63fea <_Thread_Dispatch_disable_level>,%d0 ++level; 508b4: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 508b6: 23c0 0006 3fea movel %d0,63fea <_Thread_Dispatch_disable_level> RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { _Thread_Disable_dispatch(); _Event_Seize( 508bc: 2f3c 0004 0000 movel #262144,%sp@- 508c2: 4879 0006 419c pea 6419c <_System_event_Sync_state> 508c8: 4869 0004 pea %a1@(4) 508cc: 2f0a movel %a2,%sp@- 508ce: 2f08 movel %a0,%sp@- 508d0: 2f2e 0010 movel %fp@(16),%sp@- 508d4: 2f2e 000c movel %fp@(12),%sp@- 508d8: 2f2e 0008 movel %fp@(8),%sp@- 508dc: 4eb9 0004 861c jsr 4861c <_Event_Seize> executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 508e2: 4fef 0020 lea %sp@(32),%sp 508e6: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> sc = executing->Wait.return_code; 508ec: 202a 0034 movel %a2@(52),%d0 } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 508f0: 246e fffc moveal %fp@(-4),%a2 508f4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047670 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 47670: 4e56 fffc linkw %fp,#-4 rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 47674: 486e fffc pea %fp@(-4) 47678: 2f2e 0008 movel %fp@(8),%sp@- 4767c: 4eb9 0004 9c64 jsr 49c64 <_Thread_Get> switch ( location ) { 47682: 508f addql #8,%sp 47684: 4aae fffc tstl %fp@(-4) 47688: 6632 bnes 476bc <== NEVER TAKEN case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 4768a: 2040 moveal %d0,%a0 4768c: 2f3c 0004 0000 movel #262144,%sp@- 47692: 4879 0005 fbb8 pea 5fbb8 <_System_event_Sync_state> 47698: 2228 00f8 movel %a0@(248),%d1 4769c: 5881 addql #4,%d1 4769e: 2f01 movel %d1,%sp@- 476a0: 2f2e 000c movel %fp@(12),%sp@- 476a4: 2f00 movel %d0,%sp@- 476a6: 4eb9 0004 6fa8 jsr 46fa8 <_Event_Surrender> event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 476ac: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> sc = RTEMS_SUCCESSFUL; break; 476b2: 4fef 0014 lea %sp@(20),%sp &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); sc = RTEMS_SUCCESSFUL; 476b6: 4280 clrl %d0 sc = RTEMS_INVALID_ID; break; } return sc; } 476b8: 4e5e unlk %fp 476ba: 4e75 rts case OBJECTS_REMOTE: sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT; break; #endif default: sc = RTEMS_INVALID_ID; 476bc: 7004 moveq #4,%d0 <== NOT EXECUTED break; } return sc; } 476be: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 00047b8c : 47b8c: 7002 moveq #2,%d0 } void rtems_initialize_start_multitasking(void) { 47b8e: 4e56 0000 linkw %fp,#0 47b92: 23c0 0005 fb6c movel %d0,5fb6c <_System_state_Current> uint32_t status; _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); _Thread_Start_multitasking(); 47b98: 4eb9 0004 a628 jsr 4a628 <_Thread_Start_multitasking> ****** RETURNS WHEN SYSTEM IS SHUT DOWN ****** ******************************************************************* ******************************************************************* *******************************************************************/ status = _Per_CPU_Information[0].idle->Wait.return_code; 47b9e: 2079 0005 fb86 moveal 5fb86 <_Per_CPU_Information+0x16>,%a0 rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status ); 47ba4: 2f28 0034 movel %a0@(52),%sp@- 47ba8: 4878 0005 pea 5 47bac: 4eb9 0004 7c38 jsr 47c38 ... =============================================================================== 000494dc : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 494dc: 4e56 0000 linkw %fp,#0 494e0: 226e 000c moveal %fp@(12),%a1 494e4: 2f0a movel %a2,%sp@- 494e6: 206e 0010 moveal %fp@(16),%a0 494ea: 2f02 movel %d2,%sp@- 494ec: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 494f0: 2039 0006 41dc movel 641dc <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 494f6: 4ab9 0006 415c tstl 6415c <_Per_CPU_Information+0x8> 494fc: 670e beqs 4950c _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 494fe: 242e fff8 movel %fp@(-8),%d2 ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 49502: 7012 moveq #18,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 49504: 246e fffc moveal %fp@(-4),%a2 49508: 4e5e unlk %fp 4950a: 4e75 rts rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 4950c: 4a88 tstl %a0 4950e: 6722 beqs 49532 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 49510: 2080 movel %d0,%a0@ if ( driver_table == NULL ) 49512: 4a89 tstl %a1 49514: 671c beqs 49532 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 49516: 4a91 tstl %a1@ 49518: 6712 beqs 4952c return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 4951a: b480 cmpl %d0,%d2 4951c: 6522 bcss 49540 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4951e: 242e fff8 movel %fp@(-8),%d2 if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 49522: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 49524: 246e fffc moveal %fp@(-4),%a2 49528: 4e5e unlk %fp 4952a: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4952c: 4aa9 0004 tstl %a1@(4) 49530: 66e8 bnes 4951a _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 49532: 242e fff8 movel %fp@(-8),%d2 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 49536: 7009 moveq #9,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 49538: 246e fffc moveal %fp@(-4),%a2 4953c: 4e5e unlk %fp 4953e: 4e75 rts * * 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; 49540: 2039 0006 3fea movel 63fea <_Thread_Dispatch_disable_level>,%d0 ++level; 49546: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 49548: 23c0 0006 3fea movel %d0,63fea <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 4954e: 4a82 tstl %d2 49550: 676a beqs 495bc _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 49552: 2202 movel %d2,%d1 49554: 2002 movel %d2,%d0 49556: e789 lsll #3,%d1 49558: eb88 lsll #5,%d0 4955a: 2479 0006 41e0 moveal 641e0 <_IO_Driver_address_table>,%a2 49560: 9081 subl %d1,%d0 49562: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 49564: 4a92 tstl %a2@ 49566: 6714 beqs 4957c major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 49568: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4956e: 242e fff8 movel %fp@(-8),%d2 } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; 49572: 700c moveq #12,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 49574: 246e fffc moveal %fp@(-4),%a2 49578: 4e5e unlk %fp 4957a: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4957c: 4aaa 0004 tstl %a2@(4) 49580: 66e6 bnes 49568 49582: 2239 0006 41e0 movel 641e0 <_IO_Driver_address_table>,%d1 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 49588: 2082 movel %d2,%a0@ } _IO_Driver_address_table [major] = *driver_table; 4958a: 2041 moveal %d1,%a0 4958c: d1c0 addal %d0,%a0 4958e: 20d9 movel %a1@+,%a0@+ 49590: 20d9 movel %a1@+,%a0@+ 49592: 20d9 movel %a1@+,%a0@+ 49594: 20d9 movel %a1@+,%a0@+ 49596: 20d9 movel %a1@+,%a0@+ 49598: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 4959a: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 495a0: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 495a4: 2d42 0008 movel %d2,%fp@(8) } 495a8: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 495ac: 42ae 0010 clrl %fp@(16) 495b0: 42ae 000c clrl %fp@(12) } 495b4: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 495b6: 4ef9 0005 0ca8 jmp 50ca8 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 495bc: 2039 0006 41dc movel 641dc <_IO_Number_of_drivers>,%d0 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 495c2: 6770 beqs 49634 <== NEVER TAKEN 495c4: 2239 0006 41e0 movel 641e0 <_IO_Driver_address_table>,%d1 495ca: 2441 moveal %d1,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 495cc: 4a92 tstl %a2@ 495ce: 6720 beqs 495f0 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 495d0: 5282 addql #1,%d2 495d2: 45ea 0018 lea %a2@(24),%a2 495d6: b082 cmpl %d2,%d0 495d8: 66f2 bnes 495cc if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 495da: 2082 movel %d2,%a0@ if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 495dc: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 495e2: 7005 moveq #5,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 495e4: 242e fff8 movel %fp@(-8),%d2 495e8: 246e fffc moveal %fp@(-4),%a2 495ec: 4e5e unlk %fp 495ee: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 495f0: 4aaa 0004 tstl %a2@(4) 495f4: 66da bnes 495d0 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 495f6: 2082 movel %d2,%a0@ if ( m != n ) 495f8: b480 cmpl %d0,%d2 495fa: 67e0 beqs 495dc <== NEVER TAKEN 495fc: 7018 moveq #24,%d0 495fe: 4c02 0800 mulsl %d2,%d0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 49602: 2041 moveal %d1,%a0 49604: d1c0 addal %d0,%a0 49606: 20d9 movel %a1@+,%a0@+ 49608: 20d9 movel %a1@+,%a0@+ 4960a: 20d9 movel %a1@+,%a0@+ 4960c: 20d9 movel %a1@+,%a0@+ 4960e: 20d9 movel %a1@+,%a0@+ 49610: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 49612: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 49618: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4961c: 2d42 0008 movel %d2,%fp@(8) } 49620: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 49624: 42ae 0010 clrl %fp@(16) 49628: 42ae 000c clrl %fp@(12) } 4962c: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4962e: 4ef9 0005 0ca8 jmp 50ca8 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 49634: 4290 clrl %a0@ <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 49636: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> <== NOT EXECUTED *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 4963c: 7005 moveq #5,%d0 <== NOT EXECUTED 4963e: 60a4 bras 495e4 <== NOT EXECUTED =============================================================================== 0004a21c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 4a21c: 4e56 fff0 linkw %fp,#-16 4a220: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4a224: 266e 0008 moveal %fp@(8),%a3 4a228: 49f9 0006 2466 lea 62466 <_Objects_Information_table+0x4>,%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 4a22e: 4a8b tstl %a3 4a230: 673c beqs 4a26e <== 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 ] ) 4a232: 205c moveal %a4@+,%a0 4a234: 4a88 tstl %a0 4a236: 672e beqs 4a266 continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 4a238: 2468 0004 moveal %a0@(4),%a2 if ( !information ) 4a23c: 4a8a tstl %a2 4a23e: 6726 beqs 4a266 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4a240: 4a6a 000e tstw %a2@(14) 4a244: 6720 beqs 4a266 <== NEVER TAKEN 4a246: 7401 moveq #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; 4a248: 206a 0018 moveal %a2@(24),%a0 4a24c: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4a250: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 4a252: 4a80 tstl %d0 4a254: 6706 beqs 4a25c <== NEVER TAKEN continue; (*routine)(the_thread); 4a256: 2f00 movel %d0,%sp@- 4a258: 4e93 jsr %a3@ 4a25a: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4a25c: 4280 clrl %d0 4a25e: 302a 000e movew %a2@(14),%d0 4a262: b480 cmpl %d0,%d2 4a264: 63e2 blss 4a248 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 4a266: b9fc 0006 2472 cmpal #402546,%a4 4a26c: 66c4 bnes 4a232 (*routine)(the_thread); } } } 4a26e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4a274: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048d9c : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 48d9c: 4e56 0000 linkw %fp,#0 48da0: 2f0a movel %a2,%sp@- 48da2: 246e 0010 moveal %fp@(16),%a2 48da6: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 48da8: 4a8a tstl %a2 48daa: 6768 beqs 48e14 return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 48dac: 3f2e 000e movew %fp@(14),%sp@- 48db0: 4267 clrw %sp@- 48db2: 2f2e 0008 movel %fp@(8),%sp@- 48db6: 4eb9 0004 ac44 jsr 4ac44 <_Objects_Get_information> if ( !obj_info ) 48dbc: 508f addql #8,%sp * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 48dbe: 2040 moveal %d0,%a0 if ( !obj_info ) 48dc0: 4a80 tstl %d0 48dc2: 675e beqs 48e22 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 48dc4: 24a8 0006 movel %a0@(6),%a2@ info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 48dc8: 4282 clrl %d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 48dca: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 48dd0: 3428 000e movew %a0@(14),%d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 48dd4: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 48dda: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 48dde: 6750 beqs 48e30 <== NEVER TAKEN 48de0: 2068 0018 moveal %a0@(24),%a0 48de4: 7201 moveq #1,%d1 48de6: 7001 moveq #1,%d0 48de8: 93c9 subal %a1,%a1 48dea: 5280 addql #1,%d0 if ( !obj_info->local_table[i] ) 48dec: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4) 48df0: 6718 beqs 48e0a info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 48df2: 2200 movel %d0,%d1 48df4: b082 cmpl %d2,%d0 48df6: 63f2 blss 48dea <== ALWAYS TAKEN if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 48df8: 2549 000e movel %a1,%a2@(14) return RTEMS_SUCCESSFUL; 48dfc: 4280 clrl %d0 } 48dfe: 242e fff8 movel %fp@(-8),%d2 48e02: 246e fffc moveal %fp@(-4),%a2 48e06: 4e5e unlk %fp 48e08: 4e75 rts info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; 48e0a: 5289 addql #1,%a1 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 48e0c: 2200 movel %d0,%d1 48e0e: b082 cmpl %d2,%d0 48e10: 63d8 blss 48dea <== NEVER TAKEN 48e12: 60e4 bras 48df8 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48e14: 242e fff8 movel %fp@(-8),%d2 /* * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; 48e18: 7009 moveq #9,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48e1a: 246e fffc moveal %fp@(-4),%a2 48e1e: 4e5e unlk %fp 48e20: 4e75 rts 48e22: 242e fff8 movel %fp@(-8),%d2 if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) return RTEMS_INVALID_NUMBER; 48e26: 700a moveq #10,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48e28: 246e fffc moveal %fp@(-4),%a2 48e2c: 4e5e unlk %fp 48e2e: 4e75 rts info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 48e30: 93c9 subal %a1,%a1 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; 48e32: 4280 clrl %d0 <== NOT EXECUTED for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 48e34: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED 48e38: 60c4 bras 48dfe <== NOT EXECUTED ... =============================================================================== 00048ea4 : */ rtems_status_code rtems_object_set_name( rtems_id id, const char *name ) { 48ea4: 4e56 fffc linkw %fp,#-4 48ea8: 2f03 movel %d3,%sp@- 48eaa: 2f02 movel %d2,%sp@- Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 48eac: 4aae 000c tstl %fp@(12) 48eb0: 677c beqs 48f2e return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 48eb2: 4aae 0008 tstl %fp@(8) 48eb6: 6656 bnes 48f0e 48eb8: 2079 0006 2aa6 moveal 62aa6 <_Per_CPU_Information+0xe>,%a0 48ebe: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 48ec2: 2f03 movel %d3,%sp@- 48ec4: 4eb9 0004 ac18 jsr 4ac18 <_Objects_Get_information_id> if ( !information ) 48eca: 588f addql #4,%sp if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 48ecc: 2400 movel %d0,%d2 if ( !information ) 48ece: 6750 beqs 48f20 <== NEVER TAKEN return RTEMS_INVALID_ID; the_object = _Objects_Get( information, tmpId, &location ); 48ed0: 486e fffc pea %fp@(-4) 48ed4: 2f03 movel %d3,%sp@- 48ed6: 2f00 movel %d0,%sp@- 48ed8: 4eb9 0004 ae00 jsr 4ae00 <_Objects_Get> switch ( location ) { 48ede: 4fef 000c lea %sp@(12),%sp 48ee2: 4aae fffc tstl %fp@(-4) 48ee6: 6638 bnes 48f20 case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); 48ee8: 2f2e 000c movel %fp@(12),%sp@- 48eec: 2f00 movel %d0,%sp@- 48eee: 2f02 movel %d2,%sp@- 48ef0: 4eb9 0004 afe0 jsr 4afe0 <_Objects_Set_name> _Thread_Enable_dispatch(); 48ef6: 4eb9 0004 bc20 jsr 4bc20 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48efc: 242e fff4 movel %fp@(-12),%d2 the_object = _Objects_Get( information, tmpId, &location ); switch ( location ) { case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); _Thread_Enable_dispatch(); 48f00: 4fef 000c lea %sp@(12),%sp return RTEMS_SUCCESSFUL; 48f04: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48f06: 262e fff8 movel %fp@(-8),%d3 48f0a: 4e5e unlk %fp 48f0c: 4e75 rts Objects_Id tmpId; if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 48f0e: 262e 0008 movel %fp@(8),%d3 information = _Objects_Get_information_id( tmpId ); 48f12: 2f03 movel %d3,%sp@- 48f14: 4eb9 0004 ac18 jsr 4ac18 <_Objects_Get_information_id> if ( !information ) 48f1a: 588f addql #4,%sp if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 48f1c: 2400 movel %d0,%d2 if ( !information ) 48f1e: 66b0 bnes 48ed0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48f20: 242e fff4 movel %fp@(-12),%d2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 48f24: 7004 moveq #4,%d0 } 48f26: 262e fff8 movel %fp@(-8),%d3 48f2a: 4e5e unlk %fp 48f2c: 4e75 rts 48f2e: 242e fff4 movel %fp@(-12),%d2 Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) return RTEMS_INVALID_ADDRESS; 48f32: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48f34: 262e fff8 movel %fp@(-8),%d3 48f38: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00054f90 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 54f90: 4e56 0000 linkw %fp,#0 54f94: 2f0a movel %a2,%sp@- 54f96: 2f02 movel %d2,%sp@- register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 54f98: 4aae 0008 tstl %fp@(8) 54f9c: 660e bnes 54fac ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54f9e: 242e fff8 movel %fp@(-8),%d2 ) { register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 54fa2: 7003 moveq #3,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54fa4: 246e fffc moveal %fp@(-4),%a2 54fa8: 4e5e unlk %fp 54faa: 4e75 rts register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 54fac: 4aae 000c tstl %fp@(12) 54fb0: 671a beqs 54fcc return RTEMS_INVALID_ADDRESS; if ( !id ) 54fb2: 4aae 001c tstl %fp@(28) 54fb6: 6714 beqs 54fcc <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 54fb8: 4aae 0010 tstl %fp@(16) 54fbc: 661c bnes 54fda ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54fbe: 242e fff8 movel %fp@(-8),%d2 if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 54fc2: 7008 moveq #8,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54fc4: 246e fffc moveal %fp@(-4),%a2 54fc8: 4e5e unlk %fp 54fca: 4e75 rts 54fcc: 242e fff8 movel %fp@(-8),%d2 if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 54fd0: 7009 moveq #9,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54fd2: 246e fffc moveal %fp@(-4),%a2 54fd6: 4e5e unlk %fp 54fd8: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 54fda: 4aae 0014 tstl %fp@(20) 54fde: 67de beqs 54fbe 54fe0: 202e 0014 movel %fp@(20),%d0 54fe4: b0ae 0010 cmpl %fp@(16),%d0 54fe8: 62d4 bhis 54fbe */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 54fea: 7003 moveq #3,%d0 54fec: c0ae 0014 andl %fp@(20),%d0 54ff0: 66cc bnes 54fbe ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 54ff2: 103c 0003 moveb #3,%d0 54ff6: c0ae 000c andl %fp@(12),%d0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 54ffa: 66d0 bnes 54fcc * * 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; 54ffc: 2039 0007 c302 movel 7c302 <_Thread_Dispatch_disable_level>,%d0 ++level; 55002: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 55004: 23c0 0007 c302 movel %d0,7c302 <_Thread_Dispatch_disable_level> * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 5500a: 4879 0007 c18c pea 7c18c <_Partition_Information> 55010: 4eb9 0005 9f48 jsr 59f48 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 55016: 588f addql #4,%sp 55018: 2440 moveal %d0,%a2 5501a: 4a80 tstl %d0 5501c: 6776 beqs 55094 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 5501e: 242e 0010 movel %fp@(16),%d2 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 55022: 2002 movel %d2,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 55024: 2542 0014 movel %d2,%a2@(20) the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 55028: 242e 0014 movel %fp@(20),%d2 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 5502c: 222e 000c movel %fp@(12),%d1 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 55030: 256e 0018 001c movel %fp@(24),%a2@(28) _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 55036: 2541 0010 movel %d1,%a2@(16) the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 5503a: 4c42 0000 remul %d2,%d0,%d0 } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 5503e: 2542 0018 movel %d2,%a2@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 55042: 42aa 0020 clrl %a2@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 55046: 2f02 movel %d2,%sp@- 55048: 2f00 movel %d0,%sp@- 5504a: 2f2e 000c movel %fp@(12),%sp@- 5504e: 486a 0024 pea %a2@(36) 55052: 4eb9 0005 87c8 jsr 587c8 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 55058: 202a 0008 movel %a2@(8),%d0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 5505c: 2200 movel %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5505e: 2079 0007 c1a4 moveal 7c1a4 <_Partition_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 55064: 0281 0000 ffff andil #65535,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5506a: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 5506e: 206e 0008 moveal %fp@(8),%a0 55072: 2548 000c movel %a0,%a2@(12) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 55076: 206e 001c moveal %fp@(28),%a0 5507a: 2080 movel %d0,%a0@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 5507c: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 55082: 242e fff8 movel %fp@(-8),%d2 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 55086: 4fef 0010 lea %sp@(16),%sp 5508a: 4280 clrl %d0 } 5508c: 246e fffc moveal %fp@(-4),%a2 55090: 4e5e unlk %fp 55092: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 55094: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 5509a: 242e fff8 movel %fp@(-8),%d2 the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; 5509e: 7005 moveq #5,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 550a0: 246e fffc moveal %fp@(-4),%a2 550a4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000551d0 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 551d0: 4e56 fff8 linkw %fp,#-8 551d4: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 551d6: 486e fffc pea %fp@(-4) 551da: 2f2e 0008 movel %fp@(8),%sp@- 551de: 4879 0007 c18c pea 7c18c <_Partition_Information> 551e4: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 551ea: 4fef 000c lea %sp@(12),%sp 551ee: 4aae fffc tstl %fp@(-4) 551f2: 6660 bnes 55254 ) { void *starting; void *ending; starting = the_partition->starting_address; 551f4: 2040 moveal %d0,%a0 551f6: 2228 0010 movel %a0@(16),%d1 ending = _Addresses_Add_offset( starting, the_partition->length ); 551fa: 2068 0014 moveal %a0@(20),%a0 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 551fe: b2ae 000c cmpl %fp@(12),%d1 55202: 625a bhis 5525e RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 55204: 41f0 1800 lea %a0@(00000000,%d1:l),%a0 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 55208: b1ee 000c cmpal %fp@(12),%a0 5520c: 6550 bcss 5525e <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 5520e: 242e 000c movel %fp@(12),%d2 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 55212: 2040 moveal %d0,%a0 55214: 9481 subl %d1,%d2 55216: 2202 movel %d2,%d1 55218: 41e8 0018 lea %a0@(24),%a0 5521c: 4c50 1002 remul %a0@,%d2,%d1 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 55220: 4a82 tstl %d2 55222: 663a bnes 5525e RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 55224: 2f2e 000c movel %fp@(12),%sp@- 55228: 2240 moveal %d0,%a1 5522a: 4869 0024 pea %a1@(36) 5522e: 2d40 fff8 movel %d0,%fp@(-8) 55232: 4eb9 0005 8754 jsr 58754 <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 55238: 202e fff8 movel %fp@(-8),%d0 5523c: 2040 moveal %d0,%a0 5523e: 53a8 0020 subql #1,%a0@(32) _Thread_Enable_dispatch(); 55242: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 55248: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); 5524c: 508f addql #8,%sp return RTEMS_SUCCESSFUL; 5524e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 55250: 4e5e unlk %fp 55252: 4e75 rts 55254: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 55258: 7004 moveq #4,%d0 } 5525a: 4e5e unlk %fp 5525c: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 5525e: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 55264: 242e fff4 movel %fp@(-12),%d2 the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 55268: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5526a: 4e5e unlk %fp ... =============================================================================== 00054640 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 54640: 4e56 fffc linkw %fp,#-4 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 54644: 4aae 0010 tstl %fp@(16) 54648: 6748 beqs 54692 RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 5464a: 486e fffc pea %fp@(-4) 5464e: 2f2e 0008 movel %fp@(8),%sp@- 54652: 4879 0007 c154 pea 7c154 <_Dual_ported_memory_Information> 54658: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 5465e: 4fef 000c lea %sp@(12),%sp 54662: 4aae fffc tstl %fp@(-4) 54666: 6624 bnes 5468c RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 54668: 222e 000c movel %fp@(12),%d1 5466c: 2040 moveal %d0,%a0 5466e: 92a8 0014 subl %a0@(20),%d1 case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) 54672: b2a8 0018 cmpl %a0@(24),%d1 54676: 6320 blss 54698 *internal = external; 54678: 206e 0010 moveal %fp@(16),%a0 5467c: 20ae 000c movel %fp@(12),%a0@ else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 54680: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 54686: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54688: 4e5e unlk %fp 5468a: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5468c: 7004 moveq #4,%d0 } 5468e: 4e5e unlk %fp 54690: 4e75 rts register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) return RTEMS_INVALID_ADDRESS; 54692: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54694: 4e5e unlk %fp 54696: 4e75 rts RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 54698: 2040 moveal %d0,%a0 5469a: d2a8 0010 addl %a0@(16),%d1 5469e: 206e 0010 moveal %fp@(16),%a0 546a2: 2081 movel %d1,%a0@ if ( ending > the_port->length ) *internal = external; else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 546a4: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 546aa: 4280 clrl %d0 546ac: 60da bras 54688 ... =============================================================================== 000546d8 : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 546d8: 4e56 fffc linkw %fp,#-4 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 546dc: 4aae 0010 tstl %fp@(16) 546e0: 6748 beqs 5472a 546e2: 486e fffc pea %fp@(-4) 546e6: 2f2e 0008 movel %fp@(8),%sp@- 546ea: 4879 0007 c154 pea 7c154 <_Dual_ported_memory_Information> 546f0: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 546f6: 4fef 000c lea %sp@(12),%sp 546fa: 4aae fffc tstl %fp@(-4) 546fe: 6624 bnes 54724 RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 54700: 222e 000c movel %fp@(12),%d1 54704: 2040 moveal %d0,%a0 54706: 92a8 0010 subl %a0@(16),%d1 case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) 5470a: b2a8 0018 cmpl %a0@(24),%d1 5470e: 6320 blss 54730 *external = internal; 54710: 206e 0010 moveal %fp@(16),%a0 54714: 20ae 000c movel %fp@(12),%a0@ else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 54718: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5471e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54720: 4e5e unlk %fp 54722: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 54724: 7004 moveq #4,%d0 } 54726: 4e5e unlk %fp 54728: 4e75 rts register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) return RTEMS_INVALID_ADDRESS; 5472a: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5472c: 4e5e unlk %fp 5472e: 4e75 rts RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 54730: 2040 moveal %d0,%a0 54732: d2a8 0014 addl %a0@(20),%d1 54736: 206e 0010 moveal %fp@(16),%a0 5473a: 2081 movel %d1,%a0@ if ( ending > the_port->length ) *external = internal; else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 5473c: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 54742: 4280 clrl %d0 54744: 60da bras 54720 ... =============================================================================== 00073a24 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 73a24: 4e56 fff8 linkw %fp,#-8 73a28: 2f03 movel %d3,%sp@- 73a2a: 2f02 movel %d2,%sp@- 73a2c: 486e fffc pea %fp@(-4) 73a30: 2f2e 0008 movel %fp@(8),%sp@- 73a34: 4879 000a 01c0 pea a01c0 <_Rate_monotonic_Information> 73a3a: 4eb9 0004 8c00 jsr 48c00 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 73a40: 4fef 000c lea %sp@(12),%sp 73a44: 4aae fffc tstl %fp@(-4) 73a48: 6624 bnes 73a6e case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 73a4a: 2279 0009 fff2 moveal 9fff2 <_Per_CPU_Information+0xe>,%a1 73a50: 2040 moveal %d0,%a0 73a52: b3e8 0040 cmpal %a0@(64),%a1 73a56: 6726 beqs 73a7e _Thread_Enable_dispatch(); 73a58: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 73a5e: 7417 moveq #23,%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73a60: 2002 movel %d2,%d0 73a62: 242e fff0 movel %fp@(-16),%d2 73a66: 262e fff4 movel %fp@(-12),%d3 73a6a: 4e5e unlk %fp 73a6c: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 73a6e: 7404 moveq #4,%d2 } 73a70: 2002 movel %d2,%d0 73a72: 242e fff0 movel %fp@(-16),%d2 73a76: 262e fff4 movel %fp@(-12),%d3 73a7a: 4e5e unlk %fp 73a7c: 4e75 rts if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 73a7e: 4aae 000c tstl %fp@(12) 73a82: 6700 008a beqw 73b0e } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 73a86: 223c 0000 0700 movel #1792,%d1 73a8c: 40c2 movew %sr,%d2 73a8e: 8282 orl %d2,%d1 73a90: 46c1 movew %d1,%sr if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 73a92: 2040 moveal %d0,%a0 73a94: 2228 0038 movel %a0@(56),%d1 73a98: 6700 00a8 beqw 73b42 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 73a9c: 7602 moveq #2,%d3 73a9e: b681 cmpl %d1,%d3 73aa0: 6700 010e beqw 73bb0 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 73aa4: 7604 moveq #4,%d3 73aa6: b681 cmpl %d1,%d3 73aa8: 66c4 bnes 73a6e <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 73aaa: 2f00 movel %d0,%sp@- 73aac: 2d40 fff8 movel %d0,%fp@(-8) 73ab0: 4eba fe08 jsr %pc@(738ba <_Rate_monotonic_Update_statistics>) _ISR_Enable( level ); 73ab4: 46c2 movew %d2,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 73ab6: 7202 moveq #2,%d1 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; 73ab8: 7406 moveq #6,%d2 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 73aba: 202e fff8 movel %fp@(-8),%d0 73abe: 2040 moveal %d0,%a0 the_period->next_length = length; 73ac0: 226e 000c moveal %fp@(12),%a1 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 73ac4: 2141 0038 movel %d1,%a0@(56) the_period->next_length = length; 73ac8: 2149 003c movel %a1,%a0@(60) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 73acc: 2149 001c movel %a1,%a0@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 73ad0: 4868 0010 pea %a0@(16) 73ad4: 4879 0009 ff16 pea 9ff16 <_Watchdog_Ticks_chain> 73ada: 4eb9 0004 a548 jsr 4a548 <_Watchdog_Insert> 73ae0: 202e fff8 movel %fp@(-8),%d0 73ae4: 2040 moveal %d0,%a0 73ae6: 2f28 003c movel %a0@(60),%sp@- 73aea: 2f28 0040 movel %a0@(64),%sp@- 73aee: 2079 0009 b1b0 moveal 9b1b0 <_Scheduler+0x34>,%a0 73af4: 4e90 jsr %a0@ _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 73af6: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73afc: 262e fff4 movel %fp@(-12),%d3 73b00: 2002 movel %d2,%d0 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(); 73b02: 4fef 0014 lea %sp@(20),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73b06: 242e fff0 movel %fp@(-16),%d2 73b0a: 4e5e unlk %fp 73b0c: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 73b0e: 2040 moveal %d0,%a0 73b10: 7204 moveq #4,%d1 73b12: 2028 0038 movel %a0@(56),%d0 73b16: b280 cmpl %d0,%d1 73b18: 651e bcss 73b38 <== NEVER TAKEN 73b1a: 41f9 0009 9958 lea 99958 ,%a0 73b20: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 73b24: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73b2a: 2002 movel %d2,%d0 73b2c: 242e fff0 movel %fp@(-16),%d2 73b30: 262e fff4 movel %fp@(-12),%d3 73b34: 4e5e unlk %fp 73b36: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 73b38: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 73b3a: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> <== NOT EXECUTED 73b40: 60e8 bras 73b2a <== NOT EXECUTED return( return_value ); } _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); 73b42: 46c2 movew %d2,%sr the_period->next_length = length; 73b44: 226e 000c moveal %fp@(12),%a1 NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 73b48: 4282 clrl %d2 _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); the_period->next_length = length; 73b4a: 2149 003c movel %a1,%a0@(60) /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 73b4e: 2f00 movel %d0,%sp@- 73b50: 2d40 fff8 movel %d0,%fp@(-8) 73b54: 4eb9 0007 3984 jsr 73984 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 73b5a: 202e fff8 movel %fp@(-8),%d0 73b5e: 43f9 0007 3c48 lea 73c48 <_Rate_monotonic_Timeout>,%a1 73b64: 2040 moveal %d0,%a0 the_period->state = RATE_MONOTONIC_ACTIVE; 73b66: 7202 moveq #2,%d1 73b68: 2149 002c movel %a1,%a0@(44) the_watchdog->id = id; 73b6c: 262e 0008 movel %fp@(8),%d3 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 73b70: 226e 000c moveal %fp@(12),%a1 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 73b74: 2143 0030 movel %d3,%a0@(48) 73b78: 2141 0038 movel %d1,%a0@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 73b7c: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 73b80: 42a8 0034 clrl %a0@(52) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 73b84: 2149 001c movel %a1,%a0@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 73b88: 4868 0010 pea %a0@(16) 73b8c: 4879 0009 ff16 pea 9ff16 <_Watchdog_Ticks_chain> 73b92: 4eb9 0004 a548 jsr 4a548 <_Watchdog_Insert> id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 73b98: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73b9e: 262e fff4 movel %fp@(-12),%d3 73ba2: 2002 movel %d2,%d0 id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 73ba4: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73ba8: 242e fff0 movel %fp@(-16),%d2 73bac: 4e5e unlk %fp 73bae: 4e75 rts if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 73bb0: 2f00 movel %d0,%sp@- 73bb2: 2d40 fff8 movel %d0,%fp@(-8) 73bb6: 4eba fd02 jsr %pc@(738ba <_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; 73bba: 202e fff8 movel %fp@(-8),%d0 73bbe: 7201 moveq #1,%d1 73bc0: 2040 moveal %d0,%a0 the_period->next_length = length; 73bc2: 226e 000c moveal %fp@(12),%a1 /* * 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; 73bc6: 2141 0038 movel %d1,%a0@(56) the_period->next_length = length; 73bca: 2149 003c movel %a1,%a0@(60) _ISR_Enable( level ); 73bce: 46c2 movew %d2,%sr _Thread_Executing->Wait.id = the_period->Object.id; 73bd0: 2079 0009 fff2 moveal 9fff2 <_Per_CPU_Information+0xe>,%a0 73bd6: 2240 moveal %d0,%a1 73bd8: 5089 addql #8,%a1 73bda: 2151 0020 movel %a1@,%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 73bde: 4878 4000 pea 4000 73be2: 2d40 fff8 movel %d0,%fp@(-8) 73be6: 2f08 movel %a0,%sp@- 73be8: 4eb9 0004 a1e4 jsr 4a1e4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 73bee: 223c 0000 0700 movel #1792,%d1 73bf4: 40c2 movew %sr,%d2 73bf6: 8282 orl %d2,%d1 73bf8: 46c1 movew %d1,%sr local_state = the_period->state; 73bfa: 202e fff8 movel %fp@(-8),%d0 73bfe: 2040 moveal %d0,%a0 73c00: 2228 0038 movel %a0@(56),%d1 the_period->state = RATE_MONOTONIC_ACTIVE; 73c04: 2143 0038 movel %d3,%a0@(56) _ISR_Enable( level ); 73c08: 46c2 movew %d2,%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 ) 73c0a: 7003 moveq #3,%d0 73c0c: 4fef 000c lea %sp@(12),%sp 73c10: b081 cmpl %d1,%d0 73c12: 6716 beqs 73c2a _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 73c14: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 73c1a: 4282 clrl %d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 73c1c: 2002 movel %d2,%d0 73c1e: 242e fff0 movel %fp@(-16),%d2 73c22: 262e fff4 movel %fp@(-12),%d3 73c26: 4e5e unlk %fp 73c28: 4e75 rts /* * 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 ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 73c2a: 4878 4000 pea 4000 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 73c2e: 4282 clrl %d2 /* * 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 ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 73c30: 2f39 0009 fff2 movel 9fff2 <_Per_CPU_Information+0xe>,%sp@- 73c36: 4eb9 0004 94e8 jsr 494e8 <_Thread_Clear_state> 73c3c: 508f addql #8,%sp _Thread_Enable_dispatch(); 73c3e: 4eb9 0004 98e8 jsr 498e8 <_Thread_Enable_dispatch> 73c44: 60d6 bras 73c1c ... =============================================================================== 000664e8 : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 664e8: 4e56 ff78 linkw %fp,#-136 664ec: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 664f0: 242e 0008 movel %fp@(8),%d2 664f4: 246e 000c moveal %fp@(12),%a2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 664f8: 4a8a tstl %a2 664fa: 6700 0082 beqw 6657e return; (*print)( context, "Period information by period\n" ); 664fe: 4879 0009 7050 pea 97050 <_TOD_Days_per_month+0x68> 66504: 2f02 movel %d2,%sp@- 66506: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 66508: 4879 0009 706e pea 9706e <_TOD_Days_per_month+0x86> 6650e: 2f02 movel %d2,%sp@- 66510: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 66512: 4879 0009 7090 pea 97090 <_TOD_Days_per_month+0xa8> 66518: 2f02 movel %d2,%sp@- 6651a: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 6651c: 4879 0009 70b3 pea 970b3 <_TOD_Days_per_month+0xcb> 66522: 2f02 movel %d2,%sp@- 66524: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 66526: 4fef 001c lea %sp@(28),%sp 6652a: 2ebc 0009 70fe movel #618750,%sp@ 66530: 2f02 movel %d2,%sp@- 66532: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 66534: 2e39 000a 01c6 movel a01c6 <_Rate_monotonic_Information+0x6>,%d7 6653a: 508f addql #8,%sp 6653c: beb9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d7 66542: 623a bhis 6657e <== NEVER TAKEN 66544: 260e movel %fp,%d3 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 66546: 2a0e movel %fp,%d5 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 66548: 280e movel %fp,%d4 6654a: 0683 ffff ffc8 addil #-56,%d3 66550: 47f9 0007 3538 lea 73538 ,%a3 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 66556: 0685 ffff ffb0 addil #-80,%d5 6655c: 4bf9 0007 36e4 lea 736e4 ,%a5 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 66562: 0684 ffff ffa3 addil #-93,%d4 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 66568: 2f03 movel %d3,%sp@- 6656a: 2f07 movel %d7,%sp@- 6656c: 4e93 jsr %a3@ if ( status != RTEMS_SUCCESSFUL ) 6656e: 508f addql #8,%sp 66570: 4a80 tstl %d0 66572: 6714 beqs 66588 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 66574: 5287 addql #1,%d7 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 66576: beb9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d7 6657c: 63ea blss 66568 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 6657e: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 66584: 4e5e unlk %fp 66586: 4e75 rts #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 66588: 2f05 movel %d5,%sp@- struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 6658a: 49f9 0006 7160 lea 67160 <_Timespec_Divide_by_integer>,%a4 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 66590: 2f07 movel %d7,%sp@- 66592: 4e95 jsr %a5@ #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 66594: 2f04 movel %d4,%sp@- 66596: 4878 0005 pea 5 6659a: 2f2e ffb0 movel %fp@(-80),%sp@- 6659e: 4eb9 0004 e620 jsr 4e620 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 665a4: 2f2e ffcc movel %fp@(-52),%sp@- 665a8: 2f2e ffc8 movel %fp@(-56),%sp@- 665ac: 2f04 movel %d4,%sp@- 665ae: 2f07 movel %d7,%sp@- 665b0: 4879 0009 714a pea 9714a <_TOD_Days_per_month+0x162> 665b6: 2f02 movel %d2,%sp@- 665b8: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 665ba: 202e ffc8 movel %fp@(-56),%d0 665be: 4fef 002c lea %sp@(44),%sp 665c2: 6618 bnes 665dc (*print)( context, "\n" ); 665c4: 4879 0009 20cb pea 920cb <_CPU_m68k_BFFFO_table+0x382> * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 665ca: 5287 addql #1,%d7 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 665cc: 2f02 movel %d2,%sp@- 665ce: 4e92 jsr %a2@ continue; 665d0: 508f addql #8,%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 665d2: beb9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d7 665d8: 638e blss 66568 <== ALWAYS TAKEN 665da: 60a2 bras 6657e <== NOT EXECUTED struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 665dc: 486e ffa8 pea %fp@(-88) * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 665e0: 5287 addql #1,%d7 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 665e2: 2f00 movel %d0,%sp@- 665e4: 486e ffe0 pea %fp@(-32) 665e8: 4e94 jsr %a4@ (*print)( context, 665ea: 202e ffac movel %fp@(-84),%d0 665ee: 223c 0000 03e8 movel #1000,%d1 665f4: 4c41 0800 remsl %d1,%d0,%d0 665f8: 2c2e ffdc movel %fp@(-36),%d6 665fc: 2f00 movel %d0,%sp@- 665fe: 2001 movel %d1,%d0 66600: 2f2e ffa8 movel %fp@(-88),%sp@- 66604: 4c40 6806 remsl %d0,%d6,%d6 66608: 202e ffd4 movel %fp@(-44),%d0 6660c: 2246 moveal %d6,%a1 6660e: 223c 0000 03e8 movel #1000,%d1 66614: 2f09 movel %a1,%sp@- 66616: 2f2e ffd8 movel %fp@(-40),%sp@- 6661a: 4c41 0800 remsl %d1,%d0,%d0 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 6661e: 2c3c 0000 03e8 movel #1000,%d6 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 66624: 2f00 movel %d0,%sp@- 66626: 2f2e ffd0 movel %fp@(-48),%sp@- 6662a: 4879 0009 7161 pea 97161 <_TOD_Days_per_month+0x179> 66630: 2f02 movel %d2,%sp@- 66632: 4e92 jsr %a2@ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 66634: 4fef 002c lea %sp@(44),%sp 66638: 486e ffa8 pea %fp@(-88) 6663c: 2f2e ffc8 movel %fp@(-56),%sp@- 66640: 486e fff8 pea %fp@(-8) 66644: 4e94 jsr %a4@ (*print)( context, 66646: 202e ffac movel %fp@(-84),%d0 6664a: 4c46 0800 remsl %d6,%d0,%d0 6664e: 222e fff4 movel %fp@(-12),%d1 66652: 2f00 movel %d0,%sp@- 66654: 2f2e ffa8 movel %fp@(-88),%sp@- 66658: 4c46 1801 remsl %d6,%d1,%d1 6665c: 202e ffec movel %fp@(-20),%d0 66660: 2241 moveal %d1,%a1 66662: 2f09 movel %a1,%sp@- 66664: 2f2e fff0 movel %fp@(-16),%sp@- 66668: 4c46 0800 remsl %d6,%d0,%d0 6666c: 2f00 movel %d0,%sp@- 6666e: 2f2e ffe8 movel %fp@(-24),%sp@- 66672: 4879 0009 7180 pea 97180 <_TOD_Days_per_month+0x198> 66678: 2f02 movel %d2,%sp@- 6667a: 4e92 jsr %a2@ 6667c: 4fef 002c lea %sp@(44),%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 66680: beb9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d7 66686: 6300 fee0 blsw 66568 6668a: 6000 fef2 braw 6657e <== NOT EXECUTED =============================================================================== 000666a8 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 666a8: 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; 666ac: 2039 0009 fe7a movel 9fe7a <_Thread_Dispatch_disable_level>,%d0 ++level; 666b2: 5280 addql #1,%d0 666b4: 2f0a movel %a2,%sp@- _Thread_Dispatch_disable_level = level; 666b6: 23c0 0009 fe7a movel %d0,9fe7a <_Thread_Dispatch_disable_level> 666bc: 2f02 movel %d2,%sp@- /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 666be: 2439 000a 01c6 movel a01c6 <_Rate_monotonic_Information+0x6>,%d2 666c4: 45f9 0006 66f4 lea 666f4 ,%a2 666ca: b4b9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d2 666d0: 6210 bhis 666e2 <== NEVER TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 666d2: 2f02 movel %d2,%sp@- * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 666d4: 5282 addql #1,%d2 (void) rtems_rate_monotonic_reset_statistics( id ); 666d6: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 666d8: 588f addql #4,%sp 666da: b4b9 000a 01ca cmpl a01ca <_Rate_monotonic_Information+0xa>,%d2 666e0: 63f0 blss 666d2 /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 666e2: 242e fff8 movel %fp@(-8),%d2 666e6: 246e fffc moveal %fp@(-4),%a2 666ea: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 666ec: 4ef9 0004 98e8 jmp 498e8 <_Thread_Enable_dispatch> ... =============================================================================== 000486de : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 486de: 4e56 ffec linkw %fp,#-20 486e2: 202e 000c movel %fp@(12),%d0 486e6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 486ea: 266e 0008 moveal %fp@(8),%a3 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 486ee: 2400 movel %d0,%d2 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; 486f0: 262b 002e movel %a3@(46),%d3 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 486f4: 4c43 2001 remul %d3,%d1,%d2 if (excess > 0) { 486f8: 4a81 tstl %d1 486fa: 664a bnes 48746 <== NEVER TAKEN 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) { 486fc: 2600 movel %d0,%d3 486fe: 6716 beqs 48716 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 48700: 204b moveal %a3,%a0 48702: 2458 moveal %a0@+,%a2 { 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) { 48704: b1ca cmpal %a2,%a0 48706: 670e beqs 48716 rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 48708: 242a 001c movel %a2@(28),%d2 4870c: b682 cmpl %d2,%d3 4870e: 6312 blss 48722 rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 48710: 2452 moveal %a2@,%a2 { 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) { 48712: b5c8 cmpal %a0,%a2 48714: 66f2 bnes 48708 <== NEVER TAKEN return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 48716: 4280 clrl %d0 } } } return ptr; } 48718: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4871e: 4e5e unlk %fp 48720: 4e75 rts rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { 48722: b483 cmpl %d3,%d2 48724: 6236 bhis 4875c ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48726: 2252 moveal %a2@,%a1 previous = the_node->previous; 48728: 206a 0004 moveal %a2@(4),%a0 ptr = (void *) new_chunk->begin; } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 4872c: 202a 0018 movel %a2@(24),%d0 next->previous = previous; 48730: 2348 0004 movel %a0,%a1@(4) previous->next = next; 48734: 2089 movel %a1,%a0@ */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 48736: 42aa 0004 clrl %a2@(4) 4873a: 4292 clrl %a2@ } } } return ptr; } 4873c: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 48742: 4e5e unlk %fp 48744: 4e75 rts static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; if (excess > 0) { value += alignment - excess; 48746: d680 addl %d0,%d3 <== NOT EXECUTED 48748: 9681 subl %d1,%d3 <== 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) { 4874a: 4a80 tstl %d0 <== NOT EXECUTED 4874c: 67c8 beqs 48716 <== NOT EXECUTED 4874e: b680 cmpl %d0,%d3 <== NOT EXECUTED 48750: 65c4 bcss 48716 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 48752: 204b moveal %a3,%a0 <== NOT EXECUTED 48754: 2458 moveal %a0@+,%a2 <== NOT EXECUTED { 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) { 48756: b1ca cmpal %a2,%a0 <== NOT EXECUTED 48758: 66ae bnes 48708 <== NOT EXECUTED 4875a: 60ba bras 48716 <== NOT EXECUTED if (free_chunk != NULL) { uintptr_t free_size = free_chunk->size; if (free_size > aligned_size) { rtems_rbheap_chunk *new_chunk = get_chunk(control); 4875c: 2f0b movel %a3,%sp@- 4875e: 4eba fd5c jsr %pc@(484bc ) if (new_chunk != NULL) { 48762: 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); 48764: 2840 moveal %d0,%a4 if (new_chunk != NULL) { 48766: 4a80 tstl %d0 48768: 67ac beqs 48716 <== NEVER TAKEN uintptr_t new_free_size = free_size - aligned_size; 4876a: 9483 subl %d3,%d2 free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 4876c: 2002 movel %d2,%d0 4876e: d0aa 0018 addl %a2@(24),%d0 rtems_rbheap_chunk *new_chunk = get_chunk(control); if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; 48772: 2542 001c movel %d2,%a2@(28) new_chunk->begin = free_chunk->begin + new_free_size; 48776: 2940 0018 movel %d0,%a4@(24) new_chunk->size = aligned_size; 4877a: 2943 001c movel %d3,%a4@(28) */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 4877e: 42ac 0004 clrl %a4@(4) 48782: 4294 clrl %a4@ static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 48784: 486c 0008 pea %a4@(8) 48788: 486b 0018 pea %a3@(24) 4878c: 4eb9 0004 a0bc jsr 4a0bc <_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; 48792: 202c 0018 movel %a4@(24),%d0 48796: 508f addql #8,%sp } } } return ptr; } 48798: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4879e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000488a2 : void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 488a2: 4e56 0000 linkw %fp,#0 <== NOT EXECUTED 488a6: 2f0b movel %a3,%sp@- <== NOT EXECUTED 488a8: 2f0a movel %a2,%sp@- <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 488aa: 4878 0020 pea 20 <== NOT EXECUTED { /* Do nothing */ } void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 488ae: 246e 0008 moveal %fp@(8),%a2 <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 488b2: 4eb9 0004 3b84 jsr 43b84 <== NOT EXECUTED if (chunk != NULL) { 488b8: 588f addql #4,%sp <== NOT EXECUTED 488ba: 4a80 tstl %d0 <== NOT EXECUTED 488bc: 6718 beqs 488d6 <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 488be: 206a 000c moveal %a2@(12),%a0 <== 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); 488c2: 2240 moveal %d0,%a1 <== NOT EXECUTED 488c4: 47ea 000c lea %a2@(12),%a3 <== NOT EXECUTED { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; 488c8: 2540 000c movel %d0,%a2@(12) <== 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); 488cc: 234b 0004 movel %a3,%a1@(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; 488d0: 2288 movel %a0,%a1@ <== NOT EXECUTED before_node->previous = the_node; 488d2: 2140 0004 movel %d0,%a0@(4) <== NOT EXECUTED rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 488d6: 246e fff8 moveal %fp@(-8),%a2 <== NOT EXECUTED 488da: 266e fffc moveal %fp@(-4),%a3 <== NOT EXECUTED 488de: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000487a2 : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 487a2: 4e56 ffc4 linkw %fp,#-60 487a6: 202e 000c movel %fp@(12),%d0 487aa: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 487ae: 2a6e 0008 moveal %fp@(8),%a5 rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 487b2: 4a80 tstl %d0 487b4: 6700 00cc beqw 48882 #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 }; 487b8: 49ee ffe8 lea %fp@(-24),%a4 { 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; 487bc: 47ed 0018 lea %a5@(24),%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 487c0: 246d 001c moveal %a5@(28),%a2 #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 }; 487c4: 42ae ffe0 clrl %fp@(-32) 487c8: 42ae ffe4 clrl %fp@(-28) 487cc: 4294 clrl %a4@ 487ce: 42ae ffec clrl %fp@(-20) 487d2: 42ae fff0 clrl %fp@(-16) 487d6: 42ae fff4 clrl %fp@(-12) 487da: 42ae fffc clrl %fp@(-4) 487de: 2d40 fff8 movel %d0,%fp@(-8) RBTree_Node* found = NULL; int compare_result; while (iter_node) { 487e2: 4a8a tstl %a2 487e4: 6700 00a8 beqw 4888e 487e8: 4282 clrl %d2 compare_result = the_rbtree->compare_function(the_node, iter_node); 487ea: 2f0a movel %a2,%sp@- 487ec: 206b 0010 moveal %a3@(16),%a0 487f0: 2f0c movel %a4,%sp@- 487f2: 4e90 jsr %a0@ if ( _RBTree_Is_equal( compare_result ) ) { 487f4: 508f addql #8,%sp 487f6: 4a80 tstl %d0 487f8: 6608 bnes 48802 <== NEVER TAKEN found = iter_node; if ( the_rbtree->is_unique ) 487fa: 240a movel %a2,%d2 487fc: 4a2b 0014 tstb %a3@(20) 48800: 6612 bnes 48814 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 48802: 4a80 tstl %d0 48804: 5ec0 sgt %d0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 48806: 7201 moveq #1,%d1 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 48808: 49c0 extbl %d0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 4880a: 9280 subl %d0,%d1 4880c: 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) { 48810: 4a8a tstl %a2 48812: 66d6 bnes 487ea <== NEVER TAKEN return rtems_rbheap_chunk_of_node( 48814: 2442 moveal %d2,%a2 48816: 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) { 48818: 70f8 moveq #-8,%d0 4881a: b08a cmpl %a2,%d0 4881c: 6770 beqs 4888e */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 4881e: 4a92 tstl %a2@ 48820: 670c beqs 4882e 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; 48822: 700e moveq #14,%d0 sc = RTEMS_INVALID_ID; } } return sc; } 48824: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5 4882a: 4e5e unlk %fp 4882c: 4e75 rts 4882e: 4aaa 0004 tstl %a2@(4) 48832: 66ee bnes 48822 <== NEVER TAKEN static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 48834: 42a7 clrl %sp@- 48836: 283c 0004 a33c movel #303932,%d4 4883c: 2f02 movel %d2,%sp@- 4883e: 2044 moveal %d4,%a0 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); 48840: 49fa fcf6 lea %pc@(48538 ),%a4 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 48844: 4e90 jsr %a0@ 48846: 4878 0001 pea 1 4884a: 2044 moveal %d4,%a0 4884c: 2600 movel %d0,%d3 4884e: 2f02 movel %d2,%sp@- 48850: 4e90 jsr %a0@ 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); 48852: 5180 subql #8,%d0 48854: 2f00 movel %d0,%sp@- 48856: 2f0a movel %a2,%sp@- 48858: 2f0b movel %a3,%sp@- 4885a: 2f0d movel %a5,%sp@- 4885c: 4e94 jsr %a4@ ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4885e: 2055 moveal %a5@,%a0 add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 48860: 4fef 0020 lea %sp@(32),%sp Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 48864: 254d 0004 movel %a5,%a2@(4) before_node = after_node->next; after_node->next = the_node; 48868: 2a8a movel %a2,%a5@ the_node->next = before_node; before_node->previous = the_node; 4886a: 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; 4886e: 2488 movel %a0,%a2@ 48870: 2043 moveal %d3,%a0 48872: 4868 fff8 pea %a0@(-8) 48876: 2f0a movel %a2,%sp@- 48878: 2f0b movel %a3,%sp@- 4887a: 2f0d movel %a5,%sp@- 4887c: 4e94 jsr %a4@ 4887e: 4fef 0010 lea %sp@(16),%sp } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { rtems_status_code sc = RTEMS_SUCCESSFUL; 48882: 4280 clrl %d0 sc = RTEMS_INVALID_ID; } } return sc; } 48884: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5 4888a: 4e5e unlk %fp 4888c: 4e75 rts check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; } } else { sc = RTEMS_INVALID_ID; 4888e: 7004 moveq #4,%d0 } } return sc; } 48890: 4cee 3c1c ffc4 moveml %fp@(-60),%d2-%d4/%a2-%a5 48896: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000485b2 : uintptr_t area_size, uintptr_t alignment, rtems_rbheap_extend_descriptors extend_descriptors, void *handler_arg ) { 485b2: 4e56 fff0 linkw %fp,#-16 485b6: 202e 0014 movel %fp@(20),%d0 485ba: 48d7 041c moveml %d2-%d4/%a2,%sp@ rtems_status_code sc = RTEMS_SUCCESSFUL; if (alignment > 0) { 485be: 4a80 tstl %d0 485c0: 660c bnes 485ce } } else { sc = RTEMS_INVALID_ADDRESS; } } else { sc = RTEMS_INVALID_NUMBER; 485c2: 700a moveq #10,%d0 } return sc; } 485c4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 485ca: 4e5e unlk %fp 485cc: 4e75 rts #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 485ce: 262e 000c movel %fp@(12),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; if (alignment > 0) { uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; 485d2: 242e 000c movel %fp@(12),%d2 485d6: d4ae 0010 addl %fp@(16),%d2 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 485da: 4c40 3001 remul %d0,%d1,%d3 if (excess > 0) { 485de: 4a81 tstl %d1 485e0: 6600 00c2 bnew 486a4 return value; } static uintptr_t align_down(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 485e4: 2602 movel %d2,%d3 return value - excess; 485e6: 2802 movel %d2,%d4 return value; } static uintptr_t align_down(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 485e8: 4c40 3001 remul %d0,%d1,%d3 return value - excess; 485ec: 9881 subl %d1,%d4 uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 485ee: b4ae 000c cmpl %fp@(12),%d2 485f2: 6300 00b6 blsw 486aa 485f6: 262e 000c movel %fp@(12),%d3 485fa: b684 cmpl %d4,%d3 485fc: 6400 00ac bccw 486aa 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 ); 48600: 206e 0008 moveal %fp@(8),%a0 48604: 2448 moveal %a0,%a2 48606: 45ea 0010 lea %a2@(16),%a2 4860a: 226e 0008 moveal %fp@(8),%a1 4860e: 5889 addql #4,%a1 48610: 2089 movel %a1,%a0@ */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48612: 2248 moveal %a0,%a1 48614: 43e9 000c lea %a1@(12),%a1 Chain_Node *tail = _Chain_Tail( the_chain ); 48618: 214a 000c movel %a2,%a0@(12) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 4861c: 45fa fe86 lea %pc@(484a4 ),%a2 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 48620: 2149 0014 movel %a1,%a0@(20) rtems_chain_initialize_empty(free_chain); rtems_chain_initialize_empty(&control->spare_descriptor_chain); rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true); control->alignment = alignment; control->handler_arg = handler_arg; 48624: 43ee 001c lea %fp@(28),%a1 48628: 214a 0028 movel %a2,%a0@(40) control->extend_descriptors = extend_descriptors; 4862c: 45ee 0018 lea %fp@(24),%a2 rtems_chain_initialize_empty(free_chain); rtems_chain_initialize_empty(&control->spare_descriptor_chain); rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true); control->alignment = alignment; control->handler_arg = handler_arg; 48630: 2151 0036 movel %a1@,%a0@(54) control->extend_descriptors = extend_descriptors; 48634: 2152 0032 movel %a2@,%a0@(50) the_rbtree->is_unique = is_unique; 48638: 7201 moveq #1,%d1 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 4863a: 42a8 0004 clrl %a0@(4) 4863e: 1141 002c moveb %d1,%a0@(44) tail->previous = head; 48642: 2148 0008 movel %a0,%a0@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 48646: 42a8 0010 clrl %a0@(16) RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4864a: 42a8 0018 clrl %a0@(24) the_rbtree->root = NULL; 4864e: 42a8 001c clrl %a0@(28) the_rbtree->first[0] = NULL; 48652: 42a8 0020 clrl %a0@(32) the_rbtree->first[1] = NULL; 48656: 42a8 0024 clrl %a0@(36) rtems_rbheap_chunk *first = NULL; rtems_chain_initialize_empty(free_chain); rtems_chain_initialize_empty(&control->spare_descriptor_chain); rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true); control->alignment = alignment; 4865a: 2140 002e movel %d0,%a0@(46) control->handler_arg = handler_arg; control->extend_descriptors = extend_descriptors; first = get_chunk(control); 4865e: 2f08 movel %a0,%sp@- 48660: 4eba fe5a jsr %pc@(484bc ) if (first != NULL) { 48664: 588f addql #4,%sp rtems_rbtree_initialize_empty(chunk_tree, chunk_compare, true); control->alignment = alignment; control->handler_arg = handler_arg; control->extend_descriptors = extend_descriptors; first = get_chunk(control); 48666: 2040 moveal %d0,%a0 if (first != NULL) { 48668: 4a80 tstl %d0 4866a: 6766 beqs 486d2 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4866c: 246e 0008 moveal %fp@(8),%a2 first->begin = aligned_begin; first->size = aligned_end - aligned_begin; 48670: 9883 subl %d3,%d4 48672: 2252 moveal %a2@,%a1 48674: 2144 001c movel %d4,%a0@(28) control->handler_arg = handler_arg; control->extend_descriptors = extend_descriptors; first = get_chunk(control); if (first != NULL) { first->begin = aligned_begin; 48678: 2143 0018 movel %d3,%a0@(24) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4867c: 214a 0004 movel %a2,%a0@(4) before_node = after_node->next; after_node->next = the_node; 48680: 2480 movel %d0,%a2@ the_node->next = before_node; before_node->previous = the_node; 48682: 2340 0004 movel %d0,%a1@(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; 48686: 2089 movel %a1,%a0@ static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 48688: 4868 0008 pea %a0@(8) 4868c: 486a 0018 pea %a2@(24) 48690: 4eb9 0004 a0bc jsr 4a0bc <_RBTree_Insert_unprotected> 48696: 508f addql #8,%sp uintptr_t alignment, rtems_rbheap_extend_descriptors extend_descriptors, void *handler_arg ) { rtems_status_code sc = RTEMS_SUCCESSFUL; 48698: 4280 clrl %d0 } else { sc = RTEMS_INVALID_NUMBER; } return sc; } 4869a: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 486a0: 4e5e unlk %fp 486a2: 4e75 rts uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 486a4: b4ae 000c cmpl %fp@(12),%d2 486a8: 620c bhis 486b6 insert_into_tree(chunk_tree, first); } else { sc = RTEMS_NO_MEMORY; } } else { sc = RTEMS_INVALID_ADDRESS; 486aa: 7009 moveq #9,%d0 } else { sc = RTEMS_INVALID_NUMBER; } return sc; } 486ac: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 486b2: 4e5e unlk %fp 486b4: 4e75 rts static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; if (excess > 0) { value += alignment - excess; 486b6: 262e 000c movel %fp@(12),%d3 486ba: d680 addl %d0,%d3 486bc: 9681 subl %d1,%d3 uintptr_t begin = (uintptr_t) area_begin; uintptr_t end = begin + area_size; uintptr_t aligned_begin = align_up(alignment, begin); uintptr_t aligned_end = align_down(alignment, end); if (begin < end && begin <= aligned_begin && aligned_begin < aligned_end) { 486be: b6ae 000c cmpl %fp@(12),%d3 486c2: 65e6 bcss 486aa <== NEVER TAKEN return value; } static uintptr_t align_down(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 486c4: 2802 movel %d2,%d4 486c6: 4c40 4001 remul %d0,%d1,%d4 return value - excess; 486ca: 2802 movel %d2,%d4 486cc: 9881 subl %d1,%d4 486ce: 6000 ff2a braw 485fa first->begin = aligned_begin; first->size = aligned_end - aligned_begin; add_to_chain(free_chain, first); insert_into_tree(chunk_tree, first); } else { sc = RTEMS_NO_MEMORY; 486d2: 701a moveq #26,%d0 } else { sc = RTEMS_INVALID_NUMBER; } return sc; } 486d4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 486da: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00055e80 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 55e80: 4e56 fffc linkw %fp,#-4 55e84: 2f0a movel %a2,%sp@- 55e86: 2f02 movel %d2,%sp@- uintptr_t amount_extended; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 55e88: 4aae 000c tstl %fp@(12) 55e8c: 6700 0082 beqw 55f10 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 55e90: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 55e96: 4eb9 0005 86c0 jsr 586c0 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 55e9c: 486e fffc pea %fp@(-4) 55ea0: 2f2e 0008 movel %fp@(8),%sp@- 55ea4: 4879 0007 c1fc pea 7c1fc <_Region_Information> 55eaa: 4eb9 0005 a440 jsr 5a440 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55eb0: 4fef 0010 lea %sp@(16),%sp 55eb4: 2440 moveal %d0,%a2 55eb6: 4aae fffc tstl %fp@(-4) 55eba: 6642 bnes 55efe case OBJECTS_LOCAL: amount_extended = _Heap_Extend( 55ebc: 42a7 clrl %sp@- 55ebe: 2f2e 0010 movel %fp@(16),%sp@- 55ec2: 2f2e 000c movel %fp@(12),%sp@- 55ec6: 486a 0068 pea %a2@(104) 55eca: 4eb9 0005 947c jsr 5947c <_Heap_Extend> starting_address, length, 0 ); if ( amount_extended > 0 ) { 55ed0: 4fef 0010 lea %sp@(16),%sp 55ed4: 4a80 tstl %d0 55ed6: 6748 beqs 55f20 the_region->length += amount_extended; 55ed8: d1aa 0054 addl %d0,%a2@(84) the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; 55edc: 4282 clrl %d2 0 ); if ( amount_extended > 0 ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; 55ede: d1aa 005c addl %d0,%a2@(92) default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55ee2: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 55ee8: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 55eee: 588f addql #4,%sp return return_status; } 55ef0: 2002 movel %d2,%d0 55ef2: 242e fff4 movel %fp@(-12),%d2 55ef6: 246e fff8 moveal %fp@(-8),%a2 55efa: 4e5e unlk %fp 55efc: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55efe: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- break; #endif case OBJECTS_ERROR: default: return_status = RTEMS_INVALID_ID; 55f04: 7404 moveq #4,%d2 break; } _RTEMS_Unlock_allocator(); 55f06: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 55f0c: 588f addql #4,%sp 55f0e: 60e0 bras 55ef0 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 55f10: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 55f12: 2002 movel %d2,%d0 55f14: 242e fff4 movel %fp@(-12),%d2 55f18: 246e fff8 moveal %fp@(-8),%a2 55f1c: 4e5e unlk %fp 55f1e: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55f20: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- if ( amount_extended > 0 ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else { return_status = RTEMS_INVALID_ADDRESS; 55f26: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55f28: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 55f2e: 588f addql #4,%sp 55f30: 60be bras 55ef0 ... =============================================================================== 00055fcc : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 55fcc: 4e56 fffc linkw %fp,#-4 55fd0: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 55fd2: 4aae 000c tstl %fp@(12) 55fd6: 6768 beqs 56040 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 55fd8: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 55fde: 4eb9 0005 86c0 jsr 586c0 <_API_Mutex_Lock> 55fe4: 486e fffc pea %fp@(-4) 55fe8: 2f2e 0008 movel %fp@(8),%sp@- 55fec: 4879 0007 c1fc pea 7c1fc <_Region_Information> 55ff2: 4eb9 0005 a440 jsr 5a440 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55ff8: 4fef 0010 lea %sp@(16),%sp 55ffc: 4aae fffc tstl %fp@(-4) 56000: 662c bnes 5602e case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 56002: 2f2e 000c movel %fp@(12),%sp@- 56006: 2040 moveal %d0,%a0 56008: 4868 0068 pea %a0@(104) return_status = RTEMS_SUCCESSFUL; 5600c: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 5600e: 4eb9 0005 98e4 jsr 598e4 <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 56014: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56016: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 5601c: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 56022: 588f addql #4,%sp return return_status; } 56024: 2002 movel %d2,%d0 56026: 242e fff8 movel %fp@(-8),%d2 5602a: 4e5e unlk %fp 5602c: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5602e: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- break; #endif case OBJECTS_ERROR: default: return_status = RTEMS_INVALID_ID; 56034: 7404 moveq #4,%d2 break; } _RTEMS_Unlock_allocator(); 56036: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 5603c: 588f addql #4,%sp 5603e: 60e4 bras 56024 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) return RTEMS_INVALID_ADDRESS; 56040: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 56042: 2002 movel %d2,%d0 56044: 242e fff8 movel %fp@(-8),%d2 56048: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000561bc : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 561bc: 4e56 fff8 linkw %fp,#-8 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 561c0: 4aae 000c tstl %fp@(12) 561c4: 6768 beqs 5622e return RTEMS_INVALID_ADDRESS; if ( !size ) 561c6: 4aae 0010 tstl %fp@(16) 561ca: 6762 beqs 5622e return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 561cc: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 561d2: 4eb9 0005 86c0 jsr 586c0 <_API_Mutex_Lock> 561d8: 486e fffc pea %fp@(-4) 561dc: 2f2e 0008 movel %fp@(8),%sp@- 561e0: 4879 0007 c1fc pea 7c1fc <_Region_Information> 561e6: 4eb9 0005 a440 jsr 5a440 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 561ec: 222e fffc movel %fp@(-4),%d1 561f0: 4fef 0010 lea %sp@(16),%sp 561f4: 663e bnes 56234 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 561f6: 2f2e 0010 movel %fp@(16),%sp@- 561fa: 2040 moveal %d0,%a0 561fc: 2f2e 000c movel %fp@(12),%sp@- 56200: 4868 0068 pea %a0@(104) 56204: 4eb9 0005 9e1c jsr 59e1c <_Heap_Size_of_alloc_area> 5620a: 4fef 000c lea %sp@(12),%sp 5620e: 4a00 tstb %d0 56210: 675c beqs 5626e <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 56212: 4280 clrl %d0 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56214: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 5621a: 2d40 fff8 movel %d0,%fp@(-8) 5621e: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 56224: 202e fff8 movel %fp@(-8),%d0 56228: 588f addql #4,%sp return return_status; } 5622a: 4e5e unlk %fp 5622c: 4e75 rts Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) return RTEMS_INVALID_ADDRESS; 5622e: 7009 moveq #9,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 56230: 4e5e unlk %fp 56232: 4e75 rts return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 56234: 7001 moveq #1,%d0 56236: b081 cmpl %d1,%d0 56238: 671a beqs 56254 <== ALWAYS TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 5623a: 4200 clrb %d0 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5623c: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED 56242: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 56246: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> <== NOT EXECUTED 5624c: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED 56250: 588f addql #4,%sp <== NOT EXECUTED 56252: 60d6 bras 5622a <== NOT EXECUTED case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 56254: 7004 moveq #4,%d0 break; } _RTEMS_Unlock_allocator(); 56256: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- 5625c: 2d40 fff8 movel %d0,%fp@(-8) 56260: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> 56266: 202e fff8 movel %fp@(-8),%d0 5626a: 588f addql #4,%sp 5626c: 60bc bras 5622a 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; 5626e: 7009 moveq #9,%d0 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56270: 2f39 0007 c386 movel 7c386 <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED 56276: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 5627a: 4eb9 0005 8720 jsr 58720 <_API_Mutex_Unlock> <== NOT EXECUTED 56280: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED 56284: 588f addql #4,%sp <== NOT EXECUTED 56286: 60a2 bras 5622a <== NOT EXECUTED =============================================================================== 00047194 : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 47194: 4e56 ffe8 linkw %fp,#-24 47198: 2f0a movel %a2,%sp@- 4719a: 2f02 movel %d2,%sp@- register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 4719c: 4aae 0008 tstl %fp@(8) 471a0: 660e bnes 471b0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 471a2: 242e ffe0 movel %fp@(-32),%d2 CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 471a6: 7003 moveq #3,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 471a8: 246e ffe4 moveal %fp@(-28),%a2 471ac: 4e5e unlk %fp 471ae: 4e75 rts CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 471b0: 4aae 0018 tstl %fp@(24) 471b4: 6726 beqs 471dc * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 471b6: 202e 0010 movel %fp@(16),%d0 471ba: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 471c0: 6728 beqs 471ea */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_binary_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE); 471c2: 7230 moveq #48,%d1 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 471c4: 7410 moveq #16,%d2 471c6: c2ae 0010 andl %fp@(16),%d1 471ca: b481 cmpl %d1,%d2 471cc: 673a beqs 47208 _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; 471ce: 700b moveq #11,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 471d0: 242e ffe0 movel %fp@(-32),%d2 471d4: 246e ffe4 moveal %fp@(-28),%a2 471d8: 4e5e unlk %fp 471da: 4e75 rts 471dc: 242e ffe0 movel %fp@(-32),%d2 if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) return RTEMS_INVALID_ADDRESS; 471e0: 7009 moveq #9,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 471e2: 246e ffe4 moveal %fp@(-28),%a2 471e6: 4e5e unlk %fp 471e8: 4e75 rts */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 471ea: 7430 moveq #48,%d2 471ec: c4ae 0010 andl %fp@(16),%d2 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 471f0: 672a beqs 4721c 471f2: 7001 moveq #1,%d0 471f4: b0ae 000c cmpl %fp@(12),%d0 471f8: 6422 bccs 4721c 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 471fa: 242e ffe0 movel %fp@(-32),%d2 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) return RTEMS_INVALID_NUMBER; 471fe: 700a moveq #10,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47200: 246e ffe4 moveal %fp@(-28),%a2 47204: 4e5e unlk %fp 47206: 4e75 rts #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 47208: 222e 0010 movel %fp@(16),%d1 4720c: 44c1 movew %d1,%ccr 4720e: 66be bnes 471ce _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 47210: 0c80 0000 00c0 cmpil #192,%d0 47216: 66da bnes 471f2 if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; 47218: 700b moveq #11,%d0 4721a: 60b4 bras 471d0 * * 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; 4721c: 2039 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d0 ++level; 47222: 5280 addql #1,%d0 _Thread_Dispatch_disable_level = level; 47224: 23c0 0005 fa06 movel %d0,5fa06 <_Thread_Dispatch_disable_level> * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 4722a: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47230: 4eb9 0004 89e4 jsr 489e4 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 47236: 588f addql #4,%sp 47238: 2440 moveal %d0,%a2 4723a: 4a80 tstl %d0 4723c: 6700 00e2 beqw 47320 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 47240: 222e 0010 movel %fp@(16),%d1 47244: 2541 0010 movel %d1,%a2@(16) /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 47248: 4a82 tstl %d2 4724a: 6668 bnes 472b4 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 4724c: 2f2e 000c movel %fp@(12),%sp@- */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 47250: 74ff moveq #-1,%d2 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 47252: 486e ffea pea %fp@(-22) 47256: 486a 0014 pea %a2@(20) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 4725a: 44c1 movew %d1,%ccr 4725c: 56c0 sne %d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 4725e: 2d42 ffea movel %d2,%fp@(-22) if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 47262: 49c0 extbl %d0 47264: 5280 addql #1,%d0 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 47266: 42ae fff2 clrl %fp@(-14) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 4726a: 2d40 ffee movel %d0,%fp@(-18) /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 4726e: 42ae fffc clrl %fp@(-4) _CORE_semaphore_Initialize( 47272: 4eb9 0004 83a4 jsr 483a4 <_CORE_semaphore_Initialize> 47278: 4fef 000c lea %sp@(12),%sp Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 4727c: 202a 0008 movel %a2@(8),%d0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 47280: 2200 movel %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47282: 2079 0005 f950 moveal 5f950 <_Semaphore_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 47288: 0281 0000 ffff andil #65535,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4728e: 242e 0008 movel %fp@(8),%d2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47292: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 47296: 206e 0018 moveal %fp@(24),%a0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4729a: 2542 000c movel %d2,%a2@(12) 4729e: 2080 movel %d0,%a0@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 472a0: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 472a6: 242e ffe0 movel %fp@(-32),%d2 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 472aa: 4280 clrl %d0 } 472ac: 246e ffe4 moveal %fp@(-28),%a2 472b0: 4e5e unlk %fp 472b2: 4e75 rts /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 472b4: 202e 0010 movel %fp@(16),%d0 else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 472b8: 7210 moveq #16,%d1 /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 472ba: 44c0 movew %d0,%ccr 472bc: 56c0 sne %d0 472be: 49c0 extbl %d0 472c0: 5280 addql #1,%d0 472c2: 2d40 fff8 movel %d0,%fp@(-8) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 472c6: b282 cmpl %d2,%d1 472c8: 676a beqs 47334 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 472ca: 7201 moveq #1,%d1 the_mutex_attr.only_owner_release = false; 472cc: 4202 clrb %d2 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 472ce: 2d41 fff2 movel %d1,%fp@(-14) the_mutex_attr.only_owner_release = false; 472d2: 1d42 fff6 moveb %d2,%fp@(-10) } mutex_status = _CORE_mutex_Initialize( 472d6: 7001 moveq #1,%d0 472d8: b0ae 000c cmpl %fp@(12),%d0 472dc: 57c0 seq %d0 472de: 49c0 extbl %d0 472e0: 4480 negl %d0 472e2: 2f00 movel %d0,%sp@- 472e4: 486e fff2 pea %fp@(-14) 472e8: 486a 0014 pea %a2@(20) 472ec: 4eb9 0004 8024 jsr 48024 <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 472f2: 4fef 000c lea %sp@(12),%sp 472f6: 7205 moveq #5,%d1 472f8: b280 cmpl %d0,%d1 472fa: 6680 bnes 4727c */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 472fc: 2f0a movel %a2,%sp@- 472fe: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47304: 4eb9 0004 8d5c jsr 48d5c <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4730a: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47310: 242e ffe0 movel %fp@(-32),%d2 (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 47314: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; 47316: 7013 moveq #19,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47318: 246e ffe4 moveal %fp@(-28),%a2 4731c: 4e5e unlk %fp 4731e: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 47320: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47326: 242e ffe0 movel %fp@(-32),%d2 the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; 4732a: 7005 moveq #5,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4732c: 246e ffe4 moveal %fp@(-28),%a2 47330: 4e5e unlk %fp 47332: 4e75 rts else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 47334: 42ae fff2 clrl %fp@(-14) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 47338: 7001 moveq #1,%d0 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 4733a: 4202 clrb %d2 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; 4733c: 2d6e 0014 fffc movel %fp@(20),%fp@(-4) the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 47342: 1d42 fff6 moveb %d2,%fp@(-10) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 47346: b0ae fff8 cmpl %fp@(-8),%d0 4734a: 668a bnes 472d6 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 4734c: 222e 0010 movel %fp@(16),%d1 47350: 0801 0006 btst #6,%d1 47354: 670e beqs 47364 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 47356: 7402 moveq #2,%d2 47358: 2d42 fff8 movel %d2,%fp@(-8) the_mutex_attr.only_owner_release = true; 4735c: 1d40 fff6 moveb %d0,%fp@(-10) 47360: 6000 ff74 braw 472d6 } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 47364: 222e 0010 movel %fp@(16),%d1 47368: 4a01 tstb %d1 4736a: 6c00 ff6a bgew 472d6 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 4736e: 7403 moveq #3,%d2 the_mutex_attr.only_owner_release = true; 47370: 7001 moveq #1,%d0 if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { if ( _Attributes_Is_inherit_priority( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 47372: 2d42 fff8 movel %d2,%fp@(-8) the_mutex_attr.only_owner_release = true; 47376: 1d40 fff6 moveb %d0,%fp@(-10) 4737a: 6000 ff5a braw 472d6 ... =============================================================================== 00047380 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 47380: 4e56 fffc linkw %fp,#-4 47384: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 47386: 486e fffc pea %fp@(-4) 4738a: 2f2e 0008 movel %fp@(8),%sp@- 4738e: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47394: 4eb9 0004 8edc jsr 48edc <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 4739a: 4fef 000c lea %sp@(12),%sp 4739e: 2440 moveal %d0,%a2 473a0: 4aae fffc tstl %fp@(-4) 473a4: 6624 bnes 473ca 473a6: 7030 moveq #48,%d0 473a8: c0aa 0010 andl %a2@(16),%d0 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 473ac: 6726 beqs 473d4 if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 473ae: 4aaa 0062 tstl %a2@(98) 473b2: 6664 bnes 47418 473b4: 7220 moveq #32,%d1 473b6: b280 cmpl %d0,%d1 473b8: 675e beqs 47418 !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 473ba: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 473c0: 246e fff8 moveal %fp@(-8),%a2 if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; 473c4: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 473c6: 4e5e unlk %fp 473c8: 4e75 rts 473ca: 246e fff8 moveal %fp@(-8),%a2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 473ce: 7004 moveq #4,%d0 } 473d0: 4e5e unlk %fp 473d2: 4e75 rts &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 473d4: 4878 0002 pea 2 473d8: 42a7 clrl %sp@- 473da: 486a 0014 pea %a2@(20) 473de: 4eb9 0004 8398 jsr 48398 <_CORE_semaphore_Flush> 473e4: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 473e8: 2f0a movel %a2,%sp@- 473ea: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 473f0: 4eb9 0004 8a74 jsr 48a74 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 473f6: 2f0a movel %a2,%sp@- 473f8: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 473fe: 4eb9 0004 8d5c jsr 48d5c <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 47404: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> 4740a: 4fef 0010 lea %sp@(16),%sp return RTEMS_SUCCESSFUL; 4740e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47410: 246e fff8 moveal %fp@(-8),%a2 47414: 4e5e unlk %fp 47416: 4e75 rts !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } _CORE_mutex_Flush( 47418: 4878 0003 pea 3 4741c: 42a7 clrl %sp@- 4741e: 486a 0014 pea %a2@(20) 47422: 4eb9 0004 8018 jsr 48018 <_CORE_mutex_Flush> 47428: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 4742c: 2f0a movel %a2,%sp@- 4742e: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47434: 4eb9 0004 8a74 jsr 48a74 <_Objects_Close> 4743a: 2f0a movel %a2,%sp@- 4743c: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47442: 4eb9 0004 8d5c jsr 48d5c <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 47448: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> 4744e: 4fef 0010 lea %sp@(16),%sp return RTEMS_SUCCESSFUL; 47452: 4280 clrl %d0 47454: 60ba bras 47410 ... =============================================================================== 000507cc : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 507cc: 4e56 fffc linkw %fp,#-4 507d0: 486e fffc pea %fp@(-4) 507d4: 2f2e 0008 movel %fp@(8),%sp@- 507d8: 4879 0006 3f1c pea 63f1c <_Semaphore_Information> 507de: 4eb9 0004 a840 jsr 4a840 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 507e4: 4fef 000c lea %sp@(12),%sp 507e8: 4aae fffc tstl %fp@(-4) 507ec: 662a bnes 50818 507ee: 7230 moveq #48,%d1 507f0: 2040 moveal %d0,%a0 507f2: c2a8 0010 andl %a0@(16),%d1 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 507f6: 6726 beqs 5081e _CORE_mutex_Flush( 507f8: 4878 0001 pea 1 507fc: 42a7 clrl %sp@- 507fe: 4868 0014 pea %a0@(20) 50802: 4eb9 0004 997c jsr 4997c <_CORE_mutex_Flush> 50808: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 5080c: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50812: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50814: 4e5e unlk %fp 50816: 4e75 rts case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 50818: 7004 moveq #4,%d0 } 5081a: 4e5e unlk %fp 5081c: 4e75 rts &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 5081e: 4878 0001 pea 1 50822: 2040 moveal %d0,%a0 50824: 42a7 clrl %sp@- 50826: 4868 0014 pea %a0@(20) 5082a: 4eb9 0004 9cfc jsr 49cfc <_CORE_semaphore_Flush> 50830: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50834: 4eb9 0004 b5b0 jsr 4b5b0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5083a: 4280 clrl %d0 5083c: 60d6 bras 50814 ... =============================================================================== 00047458 : rtems_status_code rtems_semaphore_obtain( rtems_id id, rtems_option option_set, rtems_interval timeout ) { 47458: 4e56 fff8 linkw %fp,#-8 4745c: 2f02 movel %d2,%sp@- Objects_Id id, Objects_Locations *location, ISR_Level *level ) { return (Semaphore_Control *) 4745e: 486e fffc pea %fp@(-4) 47462: 486e fff8 pea %fp@(-8) 47466: 2f2e 0008 movel %fp@(8),%sp@- 4746a: 4879 0005 f938 pea 5f938 <_Semaphore_Information> 47470: 4eb9 0004 8e74 jsr 48e74 <_Objects_Get_isr_disable> register Semaphore_Control *the_semaphore; Objects_Locations location; ISR_Level level; the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level ); switch ( location ) { 47476: 4fef 0010 lea %sp@(16),%sp 4747a: 4aae fff8 tstl %fp@(-8) 4747e: 6650 bnes 474d0 47480: 7230 moveq #48,%d1 47482: 2040 moveal %d0,%a0 47484: c2a8 0010 andl %a0@(16),%d1 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 47488: 6650 bnes 474da return _Semaphore_Translate_core_mutex_return_code( _Thread_Executing->Wait.return_code ); } /* must be a counting semaphore */ _CORE_semaphore_Seize_isr_disable( 4748a: 222e 000c movel %fp@(12),%d1 4748e: 0801 0000 btst #0,%d1 47492: 6700 00a6 beqw 4753a /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 47496: 2240 moveal %d0,%a1 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 47498: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 4749e: 2229 005c movel %a1@(92),%d1 Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 474a2: 42a8 0034 clrl %a0@(52) if ( the_semaphore->count != 0 ) { 474a6: 4a81 tstl %d1 474a8: 666e bnes 47518 _ISR_Enable( *level_p ); return; } if ( !wait ) { _ISR_Enable( *level_p ); 474aa: 202e fffc movel %fp@(-4),%d0 474ae: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 474b0: 7001 moveq #1,%d0 474b2: 2140 0034 movel %d0,%a0@(52) ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( _Thread_Executing->Wait.return_code ); 474b6: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 474bc: 2f28 0034 movel %a0@(52),%sp@- 474c0: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code> 474c6: 588f addql #4,%sp break; } return RTEMS_INVALID_ID; } 474c8: 242e fff4 movel %fp@(-12),%d2 474cc: 4e5e unlk %fp 474ce: 4e75 rts 474d0: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 474d4: 7004 moveq #4,%d0 } 474d6: 4e5e unlk %fp 474d8: 4e75 rts the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { _CORE_mutex_Seize( 474da: 2f2e fffc movel %fp@(-4),%sp@- 474de: 7401 moveq #1,%d2 474e0: 222e 000c movel %fp@(12),%d1 474e4: 4681 notl %d1 474e6: 2f2e 0010 movel %fp@(16),%sp@- 474ea: c481 andl %d1,%d2 474ec: 2f02 movel %d2,%sp@- 474ee: 2f2e 0008 movel %fp@(8),%sp@- 474f2: 4868 0014 pea %a0@(20) 474f6: 4eb9 0004 81ac jsr 481ac <_CORE_mutex_Seize> ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( _Thread_Executing->Wait.return_code ); 474fc: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 47502: 2f28 0034 movel %a0@(52),%sp@- 47506: 4eb9 0004 7644 jsr 47644 <_Semaphore_Translate_core_mutex_return_code> break; } return RTEMS_INVALID_ID; } 4750c: 242e fff4 movel %fp@(-12),%d2 id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 47510: 4fef 0018 lea %sp@(24),%sp break; } return RTEMS_INVALID_ID; } 47514: 4e5e unlk %fp 47516: 4e75 rts /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { the_semaphore->count -= 1; 47518: 5381 subql #1,%d1 4751a: 2040 moveal %d0,%a0 4751c: 2141 005c movel %d1,%a0@(92) _ISR_Enable( *level_p ); 47520: 202e fffc movel %fp@(-4),%d0 47524: 46c0 movew %d0,%sr ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( _Thread_Executing->Wait.return_code ); 47526: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 4752c: 2f28 0034 movel %a0@(52),%sp@- 47530: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code> 47536: 588f addql #4,%sp 47538: 608e bras 474c8 /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 4753a: 2240 moveal %d0,%a1 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4753c: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 47542: 2229 005c movel %a1@(92),%d1 Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 47546: 42a8 0034 clrl %a0@(52) if ( the_semaphore->count != 0 ) { 4754a: 4a81 tstl %d1 4754c: 66ca bnes 47518 * * 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; 4754e: 2239 0005 fa06 movel 5fa06 <_Thread_Dispatch_disable_level>,%d1 ++level; 47554: 5281 addql #1,%d1 _Thread_Dispatch_disable_level = level; 47556: 23c1 0005 fa06 movel %d1,5fa06 <_Thread_Dispatch_disable_level> 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; 4755c: 7201 moveq #1,%d1 4755e: 2240 moveal %d0,%a1 return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 47560: 0680 0000 0014 addil #20,%d0 47566: 2341 0044 movel %d1,%a1@(68) executing->Wait.id = id; 4756a: 222e 0008 movel %fp@(8),%d1 return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 4756e: 2140 0044 movel %d0,%a0@(68) executing->Wait.id = id; 47572: 2141 0020 movel %d1,%a0@(32) _ISR_Enable( *level_p ); 47576: 222e fffc movel %fp@(-4),%d1 4757a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 4757c: 4879 0004 a4f0 pea 4a4f0 <_Thread_queue_Timeout> 47582: 2f2e 0010 movel %fp@(16),%sp@- 47586: 2f00 movel %d0,%sp@- 47588: 4eb9 0004 a120 jsr 4a120 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4758e: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> _Thread_Executing->Wait.return_code ); 47594: 2079 0005 fb7e moveal 5fb7e <_Per_CPU_Information+0xe>,%a0 4759a: 4fef 000c lea %sp@(12),%sp id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 4759e: 2f28 0034 movel %a0@(52),%sp@- 475a2: 4eb9 0004 765a jsr 4765a <_Semaphore_Translate_core_semaphore_return_code> 475a8: 588f addql #4,%sp 475aa: 6000 ff1c braw 474c8 ... =============================================================================== 00047bb4 : void rtems_shutdown_executive( uint32_t result ) { if ( _System_state_Is_up( _System_state_Get() ) ) { 47bb4: 7003 moveq #3,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 47bb6: 4e56 0000 linkw %fp,#0 if ( _System_state_Is_up( _System_state_Get() ) ) { 47bba: b0b9 0005 fb6c cmpl 5fb6c <_System_state_Current>,%d0 47bc0: 6710 beqs 47bd2 ****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ****** ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 47bc2: 4878 0014 pea 14 47bc6: 4878 0001 pea 1 47bca: 42a7 clrl %sp@- 47bcc: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> if ( _System_state_Is_up( _System_state_Get() ) ) { #if defined(RTEMS_SMP) _SMP_Request_other_cores_to_shutdown(); #endif _Per_CPU_Information[0].idle->Wait.return_code = result; 47bd2: 2079 0005 fb86 moveal 5fb86 <_Per_CPU_Information+0x16>,%a0 47bd8: 103c 0004 moveb #4,%d0 47bdc: 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 ); 47be2: 4879 0005 f9d2 pea 5f9d2 <_Thread_BSP_context> 47be8: 23c0 0005 fb6c movel %d0,5fb6c <_System_state_Current> 47bee: 4eb9 0004 ac76 jsr 4ac76 <_CPU_Context_Restart_self> 47bf4: 588f addql #4,%sp <== NOT EXECUTED ****** RETURN TO RTEMS_INITIALIZE_START_MULTITASKING() ****** ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 47bf6: 4878 0014 pea 14 <== NOT EXECUTED 47bfa: 4878 0001 pea 1 <== NOT EXECUTED 47bfe: 42a7 clrl %sp@- <== NOT EXECUTED 47c00: 4eb9 0004 891c jsr 4891c <_Internal_error_Occurred> <== NOT EXECUTED ... =============================================================================== 00056988 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 56988: 4e56 fffc linkw %fp,#-4 5698c: 2f02 movel %d2,%sp@- register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 5698e: 4aae 000c tstl %fp@(12) 56992: 660a bnes 5699e case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56994: 242e fff8 movel %fp@(-8),%d2 Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 56998: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5699a: 4e5e unlk %fp 5699c: 4e75 rts ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 5699e: 486e fffc pea %fp@(-4) 569a2: 2f2e 0008 movel %fp@(8),%sp@- 569a6: 4eb9 0005 b208 jsr 5b208 <_Thread_Get> switch ( location ) { 569ac: 508f addql #8,%sp 569ae: 4aae fffc tstl %fp@(-4) 569b2: 6648 bnes 569fc case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 569b4: 2240 moveal %d0,%a1 569b6: 2069 00f8 moveal %a1@(248),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 569ba: 4aa8 000a tstl %a0@(10) 569be: 6746 beqs 56a06 if ( asr->is_enabled ) { 569c0: 4a28 0008 tstb %a0@(8) 569c4: 6762 beqs 56a28 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 569c6: 223c 0000 0700 movel #1792,%d1 569cc: 40c2 movew %sr,%d2 569ce: 8282 orl %d2,%d1 569d0: 46c1 movew %d1,%sr *signal_set |= signals; 569d2: 222e 000c movel %fp@(12),%d1 569d6: 83a8 0012 orl %d1,%a0@(18) _ISR_Enable( _level ); 569da: 46c2 movew %d2,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 569dc: 4ab9 0007 c47c tstl 7c47c <_Per_CPU_Information+0x8> 569e2: 6708 beqs 569ec 569e4: b0b9 0007 c482 cmpl 7c482 <_Per_CPU_Information+0xe>,%d0 569ea: 672a beqs 56a16 <== ALWAYS TAKEN _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 569ec: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 569f2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 569f4: 242e fff8 movel %fp@(-8),%d2 569f8: 4e5e unlk %fp 569fa: 4e75 rts 569fc: 242e fff8 movel %fp@(-8),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 56a00: 7004 moveq #4,%d0 } 56a02: 4e5e unlk %fp 56a04: 4e75 rts _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 56a06: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56a0c: 242e fff8 movel %fp@(-8),%d2 } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; 56a10: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56a12: 4e5e unlk %fp 56a14: 4e75 rts if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 56a16: 7001 moveq #1,%d0 56a18: 13c0 0007 c480 moveb %d0,7c480 <_Per_CPU_Information+0xc> } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 56a1e: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 56a24: 4280 clrl %d0 56a26: 60cc bras 569f4 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 56a28: 203c 0000 0700 movel #1792,%d0 56a2e: 40c1 movew %sr,%d1 56a30: 8081 orl %d1,%d0 56a32: 46c0 movew %d0,%sr *signal_set |= signals; 56a34: 202e 000c movel %fp@(12),%d0 56a38: 81a8 0016 orl %d0,%a0@(22) _ISR_Enable( _level ); 56a3c: 46c1 movew %d1,%sr if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 56a3e: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 56a44: 4280 clrl %d0 56a46: 60ac bras 569f4 =============================================================================== 000508f8 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 508f8: 4e56 ffe4 linkw %fp,#-28 508fc: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 50900: 2a2e 0008 movel %fp@(8),%d5 50904: 242e 000c movel %fp@(12),%d2 50908: 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 ) 5090c: 4a8c tstl %a4 5090e: 6700 0148 beqw 50a58 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 50912: 2479 0006 4162 moveal 64162 <_Per_CPU_Information+0xe>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 50918: 4a2a 0070 tstb %a2@(112) 5091c: 57c3 seq %d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 5091e: 266a 00f8 moveal %a2@(248),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 50922: 49c3 extbl %d3 50924: 0283 0000 0100 andil #256,%d3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 5092a: 4aaa 0076 tstl %a2@(118) 5092e: 6600 00cc bnew 509fc old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 50932: 4a2b 0008 tstb %a3@(8) 50936: 57c4 seq %d4 old_mode |= _ISR_Get_level(); 50938: 4eb9 0004 c688 jsr 4c688 <_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; 5093e: 49c4 extbl %d4 50940: 0284 0000 0400 andil #1024,%d4 50946: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); 50948: 8083 orl %d3,%d0 5094a: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 5094c: 0802 0008 btst #8,%d2 50950: 670e beqs 50960 50952: 2005 movel %d5,%d0 50954: 7201 moveq #1,%d1 50956: e088 lsrl #8,%d0 50958: b380 eorl %d1,%d0 5095a: c081 andl %d1,%d0 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 5095c: 1540 0070 moveb %d0,%a2@(112) if ( mask & RTEMS_TIMESLICE_MASK ) { 50960: 0802 0009 btst #9,%d2 50964: 6718 beqs 5097e if ( _Modes_Is_timeslice(mode_set) ) { 50966: 0805 0009 btst #9,%d5 5096a: 6700 00f8 beqw 50a64 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 5096e: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 50970: 41f9 0006 3fa2 lea 63fa2 <_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; 50976: 2540 0076 movel %d0,%a2@(118) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 5097a: 2550 0072 movel %a0@,%a2@(114) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 5097e: 7007 moveq #7,%d0 50980: c082 andl %d2,%d0 50982: 6712 beqs 50996 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 50984: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 50986: 7207 moveq #7,%d1 50988: c285 andl %d5,%d1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 5098a: 0280 0000 f8ff andil #63743,%d0 50990: e189 lsll #8,%d1 50992: 8081 orl %d1,%d0 50994: 46c0 movew %d0,%sr * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 50996: 0802 000a btst #10,%d2 5099a: 6752 beqs 509ee is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 5099c: 700a moveq #10,%d0 5099e: e0ad lsrl %d0,%d5 509a0: 7201 moveq #1,%d1 if ( is_asr_enabled != asr->is_enabled ) { 509a2: 4280 clrl %d0 509a4: 102b 0008 moveb %a3@(8),%d0 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 509a8: b385 eorl %d1,%d5 509aa: ca81 andl %d1,%d5 if ( is_asr_enabled != asr->is_enabled ) { 509ac: ba80 cmpl %d0,%d5 509ae: 673e beqs 509ee ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 509b0: 203c 0000 0700 movel #1792,%d0 asr->is_enabled = is_asr_enabled; 509b6: 1745 0008 moveb %d5,%a3@(8) 509ba: 40c1 movew %sr,%d1 509bc: 8081 orl %d1,%d0 509be: 46c0 movew %d0,%sr _signals = information->signals_pending; 509c0: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 509c4: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 509ca: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 509ce: 46c1 movew %d1,%sr _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 509d0: 4aab 0012 tstl %a3@(18) 509d4: 56c0 sne %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 509d6: 7203 moveq #3,%d1 if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 509d8: 4480 negl %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 509da: b2b9 0006 4150 cmpl 64150 <_System_state_Current>,%d1 509e0: 6744 beqs 50a26 <== ALWAYS TAKEN if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 509e2: 4280 clrl %d0 } 509e4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 509ea: 4e5e unlk %fp 509ec: 4e75 rts needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 509ee: 7203 moveq #3,%d1 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 509f0: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 509f2: b2b9 0006 4150 cmpl 64150 <_System_state_Current>,%d1 509f8: 66e8 bnes 509e2 509fa: 602a bras 50a26 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; 509fc: 4a2b 0008 tstb %a3@(8) 50a00: 57c4 seq %d4 old_mode |= _ISR_Get_level(); 50a02: 4eb9 0004 c688 jsr 4c688 <_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; 50a08: 49c4 extbl %d4 50a0a: 0284 0000 0400 andil #1024,%d4 old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 50a10: 08c3 0009 bset #9,%d3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 50a14: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); 50a16: 8083 orl %d3,%d0 50a18: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 50a1a: 0802 0008 btst #8,%d2 50a1e: 6700 ff40 beqw 50960 50a22: 6000 ff2e braw 50952 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 50a26: 2079 0006 4162 moveal 64162 <_Per_CPU_Information+0xe>,%a0 if ( are_signals_pending || 50a2c: 4a00 tstb %d0 50a2e: 660e bnes 50a3e 50a30: b1f9 0006 4166 cmpal 64166 <_Per_CPU_Information+0x12>,%a0 50a36: 67aa beqs 509e2 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 50a38: 4a28 0070 tstb %a0@(112) 50a3c: 67a4 beqs 509e2 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 50a3e: 7001 moveq #1,%d0 50a40: 13c0 0006 4160 moveb %d0,64160 <_Per_CPU_Information+0xc> } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 50a46: 4eb9 0004 b41c jsr 4b41c <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; } 50a4c: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 50a52: 4280 clrl %d0 } 50a54: 4e5e unlk %fp 50a56: 4e75 rts bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 50a58: 7009 moveq #9,%d0 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 50a5a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 50a60: 4e5e unlk %fp 50a62: 4e75 rts } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 50a64: 7007 moveq #7,%d0 50a66: c082 andl %d2,%d0 if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 50a68: 42aa 0076 clrl %a2@(118) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 50a6c: 4a80 tstl %d0 50a6e: 6700 ff26 beqw 50996 50a72: 6000 ff10 braw 50984 ... =============================================================================== 0004b91c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4b91c: 4e56 fffc linkw %fp,#-4 4b920: 2f02 movel %d2,%sp@- 4b922: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4b926: 670c beqs 4b934 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 ) ); 4b928: 4280 clrl %d0 4b92a: 1039 0006 22ac moveb 622ac ,%d0 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4b930: b082 cmpl %d2,%d0 4b932: 656e bcss 4b9a2 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4b934: 4aae 0010 tstl %fp@(16) 4b938: 6754 beqs 4b98e return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4b93a: 486e fffc pea %fp@(-4) 4b93e: 2f2e 0008 movel %fp@(8),%sp@- 4b942: 4eb9 0004 ddec jsr 4ddec <_Thread_Get> switch ( location ) { 4b948: 508f addql #8,%sp 4b94a: 4aae fffc tstl %fp@(-4) 4b94e: 6648 bnes 4b998 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4b950: 206e 0010 moveal %fp@(16),%a0 4b954: 2240 moveal %d0,%a1 4b956: 20a9 0014 movel %a1@(20),%a0@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4b95a: 4a82 tstl %d2 4b95c: 6720 beqs 4b97e the_thread->real_priority = new_priority; 4b95e: 2342 0018 movel %d2,%a1@(24) if ( the_thread->resource_count == 0 || 4b962: 4aa9 001c tstl %a1@(28) 4b966: 6706 beqs 4b96e 4b968: b4a9 0014 cmpl %a1@(20),%d2 4b96c: 6410 bccs 4b97e <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4b96e: 42a7 clrl %sp@- 4b970: 2f02 movel %d2,%sp@- 4b972: 2f00 movel %d0,%sp@- 4b974: 4eb9 0004 d8e8 jsr 4d8e8 <_Thread_Change_priority> 4b97a: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4b97e: 4eb9 0004 ddcc jsr 4ddcc <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b984: 242e fff8 movel %fp@(-8),%d2 if ( the_thread->resource_count == 0 || the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 4b988: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b98a: 4e5e unlk %fp 4b98c: 4e75 rts 4b98e: 242e fff8 movel %fp@(-8),%d2 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 4b992: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b994: 4e5e unlk %fp 4b996: 4e75 rts 4b998: 242e fff8 movel %fp@(-8),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4b99c: 7004 moveq #4,%d0 } 4b99e: 4e5e unlk %fp 4b9a0: 4e75 rts 4b9a2: 242e fff8 movel %fp@(-8),%d2 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; 4b9a6: 7013 moveq #19,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b9a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047990 : rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 47990: 4e56 fffc linkw %fp,#-4 register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) 47994: 4aae 000c tstl %fp@(12) 47998: 6744 beqs 479de <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4799a: 486e fffc pea %fp@(-4) 4799e: 2f2e 0008 movel %fp@(8),%sp@- 479a2: 4eb9 0004 9c64 jsr 49c64 <_Thread_Get> switch ( location ) { 479a8: 508f addql #8,%sp 479aa: 4aae fffc tstl %fp@(-4) 479ae: 6628 bnes 479d8 case OBJECTS_LOCAL: if ( _Thread_Start( 479b0: 2f2e 0010 movel %fp@(16),%sp@- 479b4: 42a7 clrl %sp@- 479b6: 2f2e 000c movel %fp@(12),%sp@- 479ba: 42a7 clrl %sp@- 479bc: 2f00 movel %d0,%sp@- 479be: 4eb9 0004 a678 jsr 4a678 <_Thread_Start> 479c4: 4fef 0014 lea %sp@(20),%sp 479c8: 4a00 tstb %d0 479ca: 6618 bnes 479e4 the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 479cc: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> return RTEMS_INCORRECT_STATE; 479d2: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 479d4: 4e5e unlk %fp 479d6: 4e75 rts case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 479d8: 7004 moveq #4,%d0 } 479da: 4e5e unlk %fp 479dc: 4e75 rts { register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) return RTEMS_INVALID_ADDRESS; 479de: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 479e0: 4e5e unlk %fp 479e2: 4e75 rts switch ( location ) { case OBJECTS_LOCAL: if ( _Thread_Start( the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); 479e4: 4eb9 0004 9c44 jsr 49c44 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 479ea: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 479ec: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045558 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 45558: 4e56 fffc linkw %fp,#-4 4555c: 2f02 movel %d2,%sp@- 4555e: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 45562: 6740 beqs 455a4 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 45564: 486e fffc pea %fp@(-4) 45568: 2f2e 0008 movel %fp@(8),%sp@- 4556c: 4eb9 0004 72fc jsr 472fc <_Thread_Get> switch (location) { 45572: 508f addql #8,%sp 45574: 4aae fffc tstl %fp@(-4) 45578: 6620 bnes 4559a case OBJECTS_LOCAL: tvp = the_thread->task_variables; 4557a: 2040 moveal %d0,%a0 4557c: 2268 0104 moveal %a0@(260),%a1 while (tvp) { 45580: 4a89 tstl %a1 45582: 672a beqs 455ae if (tvp->ptr == ptr) { 45584: b4a9 0004 cmpl %a1@(4),%d2 45588: 6752 beqs 455dc _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 4558a: 2051 moveal %a1@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 4558c: 4a88 tstl %a0 4558e: 671e beqs 455ae <== NEVER TAKEN if (tvp->ptr == ptr) { 45590: b4a8 0004 cmpl %a0@(4),%d2 45594: 6728 beqs 455be 45596: 2248 moveal %a0,%a1 45598: 60f0 bras 4558a case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4559a: 242e fff8 movel %fp@(-8),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4559e: 7004 moveq #4,%d0 } 455a0: 4e5e unlk %fp 455a2: 4e75 rts 455a4: 242e fff8 movel %fp@(-8),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 455a8: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 455aa: 4e5e unlk %fp 455ac: 4e75 rts return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 455ae: 4eb9 0004 72dc jsr 472dc <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 455b4: 242e fff8 movel %fp@(-8),%d2 } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 455b8: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 455ba: 4e5e unlk %fp 455bc: 4e75 rts case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; 455be: 2290 movel %a0@,%a1@ else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 455c0: 2f08 movel %a0,%sp@- 455c2: 2f00 movel %d0,%sp@- 455c4: 4eb9 0004 5678 jsr 45678 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 455ca: 4eb9 0004 72dc jsr 472dc <_Thread_Enable_dispatch> 455d0: 508f addql #8,%sp return RTEMS_SUCCESSFUL; 455d2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 455d4: 242e fff8 movel %fp@(-8),%d2 455d8: 4e5e unlk %fp 455da: 4e75 rts while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 455dc: 2040 moveal %d0,%a0 455de: 2151 0104 movel %a1@,%a0@(260) 455e2: 2049 moveal %a1,%a0 _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 455e4: 2f08 movel %a0,%sp@- 455e6: 2f00 movel %d0,%sp@- 455e8: 4eb9 0004 5678 jsr 45678 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 455ee: 4eb9 0004 72dc jsr 472dc <_Thread_Enable_dispatch> 455f4: 508f addql #8,%sp return RTEMS_SUCCESSFUL; 455f6: 4280 clrl %d0 455f8: 60da bras 455d4 ... =============================================================================== 000455fc : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 455fc: 4e56 fffc linkw %fp,#-4 45600: 2f02 movel %d2,%sp@- 45602: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 45606: 6742 beqs 4564a return RTEMS_INVALID_ADDRESS; if ( !result ) 45608: 4aae 0010 tstl %fp@(16) 4560c: 673c beqs 4564a return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 4560e: 486e fffc pea %fp@(-4) 45612: 2f2e 0008 movel %fp@(8),%sp@- 45616: 4eb9 0004 72fc jsr 472fc <_Thread_Get> switch (location) { 4561c: 508f addql #8,%sp 4561e: 4aae fffc tstl %fp@(-4) 45622: 6630 bnes 45654 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 45624: 2240 moveal %d0,%a1 45626: 2069 0104 moveal %a1@(260),%a0 while (tvp) { 4562a: 4a88 tstl %a0 4562c: 670c beqs 4563a if (tvp->ptr == ptr) { 4562e: b4a8 0004 cmpl %a0@(4),%d2 45632: 672a beqs 4565e */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 45634: 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) { 45636: 4a88 tstl %a0 45638: 66f4 bnes 4562e <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 4563a: 4eb9 0004 72dc jsr 472dc <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45640: 242e fff8 movel %fp@(-8),%d2 return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 45644: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45646: 4e5e unlk %fp 45648: 4e75 rts 4564a: 242e fff8 movel %fp@(-8),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 4564e: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45650: 4e5e unlk %fp 45652: 4e75 rts 45654: 242e fff8 movel %fp@(-8),%d2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 45658: 7004 moveq #4,%d0 } 4565a: 4e5e unlk %fp 4565c: 4e75 rts if (tvp->ptr == ptr) { /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 4565e: 226e 0010 moveal %fp@(16),%a1 45662: 22a8 000c movel %a0@(12),%a1@ _Thread_Enable_dispatch(); 45666: 4eb9 0004 72dc jsr 472dc <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4566c: 242e fff8 movel %fp@(-8),%d2 * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 45670: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45672: 4e5e unlk %fp ... =============================================================================== 000573b8 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 573b8: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 573bc: 486e fffc pea %fp@(-4) 573c0: 2f2e 0008 movel %fp@(8),%sp@- 573c4: 4879 0007 c4fc pea 7c4fc <_Timer_Information> 573ca: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 573d0: 4fef 000c lea %sp@(12),%sp 573d4: 4aae fffc tstl %fp@(-4) 573d8: 6622 bnes 573fc case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 573da: 7204 moveq #4,%d1 573dc: 2040 moveal %d0,%a0 573de: b2a8 0038 cmpl %a0@(56),%d1 573e2: 670c beqs 573f0 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 573e4: 4868 0010 pea %a0@(16) 573e8: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> 573ee: 588f addql #4,%sp _Thread_Enable_dispatch(); 573f0: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 573f6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 573f8: 4e5e unlk %fp 573fa: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 573fc: 7004 moveq #4,%d0 } 573fe: 4e5e unlk %fp ... =============================================================================== 000577b4 : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 577b4: 4e56 fff0 linkw %fp,#-16 577b8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 577bc: 486e fffc pea %fp@(-4) 577c0: 2f2e 0008 movel %fp@(8),%sp@- 577c4: 4879 0007 c4fc pea 7c4fc <_Timer_Information> 577ca: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 577d0: 4fef 000c lea %sp@(12),%sp 577d4: 2440 moveal %d0,%a2 577d6: 4aae fffc tstl %fp@(-4) 577da: 6620 bnes 577fc case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 577dc: 202a 0038 movel %a2@(56),%d0 577e0: 6728 beqs 5780a _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 577e2: 7201 moveq #1,%d1 577e4: b280 cmpl %d0,%d1 577e6: 674a beqs 57832 /* * 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; 577e8: 740b moveq #11,%d2 } _Thread_Enable_dispatch(); 577ea: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 577f0: 2002 movel %d2,%d0 577f2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 577f8: 4e5e unlk %fp 577fa: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 577fc: 7404 moveq #4,%d2 } 577fe: 2002 movel %d2,%d0 57800: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 57806: 4e5e unlk %fp 57808: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 5780a: 45ea 0010 lea %a2@(16),%a2 rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 5780e: 4282 clrl %d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 57810: 2f0a movel %a2,%sp@- 57812: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 57818: 2f0a movel %a2,%sp@- 5781a: 4879 0007 c39e pea 7c39e <_Watchdog_Ticks_chain> 57820: 4eb9 0005 bff8 jsr 5bff8 <_Watchdog_Insert> 57826: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 5782a: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> 57830: 60be bras 577f0 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 57832: 486a 0010 pea %a2@(16) rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 57836: 4282 clrl %d2 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; 57838: 2679 0007 c534 moveal 7c534 <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 5783e: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 57844: 2f0a movel %a2,%sp@- 57846: 2f0b movel %a3,%sp@- 57848: 206b 0004 moveal %a3@(4),%a0 5784c: 4e90 jsr %a0@ 5784e: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 57852: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> 57858: 6096 bras 577f0 ... =============================================================================== 00057954 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 57954: 4e56 ffec linkw %fp,#-20 57958: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 5795c: 2479 0007 c534 moveal 7c534 <_Timer_server>,%a2 if ( !timer_server ) 57962: 4a8a tstl %a2 57964: 6736 beqs 5799c return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 57966: 4a39 0007 c2b8 tstb 7c2b8 <_TOD+0x14> 5796c: 660c bnes 5797a <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; 5796e: 700b moveq #11,%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57970: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 <== NOT EXECUTED 57976: 4e5e unlk %fp <== NOT EXECUTED 57978: 4e75 rts <== NOT EXECUTED return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 5797a: 4aae 0010 tstl %fp@(16) 5797e: 6728 beqs 579a8 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 57980: 2f2e 000c movel %fp@(12),%sp@- 57984: 4eb9 0005 44b4 jsr 544b4 <_TOD_Validate> 5798a: 588f addql #4,%sp 5798c: 4a00 tstb %d0 5798e: 6624 bnes 579b4 return RTEMS_INVALID_CLOCK; 57990: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57992: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 57998: 4e5e unlk %fp 5799a: 4e75 rts Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 5799c: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5799e: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 579a4: 4e5e unlk %fp 579a6: 4e75 rts if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 579a8: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 579aa: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 579b0: 4e5e unlk %fp 579b2: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 579b4: 2f2e 000c movel %fp@(12),%sp@- 579b8: 47f9 0006 c3c0 lea 6c3c0 <__divdi3>,%a3 579be: 4eb9 0005 4410 jsr 54410 <_TOD_To_seconds> 579c4: 2400 movel %d0,%d2 579c6: 2f3c 3b9a ca00 movel #1000000000,%sp@- 579cc: 42a7 clrl %sp@- 579ce: 2f39 0007 c2a8 movel 7c2a8 <_TOD+0x4>,%sp@- 579d4: 2f39 0007 c2a4 movel 7c2a4 <_TOD>,%sp@- 579da: 4e93 jsr %a3@ if ( seconds <= _TOD_Seconds_since_epoch() ) 579dc: 4fef 0014 lea %sp@(20),%sp 579e0: b282 cmpl %d2,%d1 579e2: 64ac bccs 57990 579e4: 486e fffc pea %fp@(-4) 579e8: 2f2e 0008 movel %fp@(8),%sp@- 579ec: 4879 0007 c4fc pea 7c4fc <_Timer_Information> 579f2: 4eb9 0005 a480 jsr 5a480 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 579f8: 4fef 000c lea %sp@(12),%sp 579fc: 2840 moveal %d0,%a4 579fe: 4aae fffc tstl %fp@(-4) 57a02: 666a bnes 57a6e case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 57a04: 486c 0010 pea %a4@(16) 57a08: 4eb9 0005 c128 jsr 5c128 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 57a0e: 296e 0014 0034 movel %fp@(20),%a4@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 57a14: 7003 moveq #3,%d0 57a16: 2940 0038 movel %d0,%a4@(56) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 57a1a: 202e 0010 movel %fp@(16),%d0 57a1e: 2940 002c movel %d0,%a4@(44) the_watchdog->id = id; 57a22: 202e 0008 movel %fp@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 57a26: 42ac 0018 clrl %a4@(24) the_watchdog->routine = routine; the_watchdog->id = id; 57a2a: 2940 0030 movel %d0,%a4@(48) 57a2e: 2f3c 3b9a ca00 movel #1000000000,%sp@- 57a34: 42a7 clrl %sp@- 57a36: 2f39 0007 c2a8 movel 7c2a8 <_TOD+0x4>,%sp@- 57a3c: 2f39 0007 c2a4 movel 7c2a4 <_TOD>,%sp@- 57a42: 4e93 jsr %a3@ 57a44: 4fef 0010 lea %sp@(16),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 57a48: 9481 subl %d1,%d2 57a4a: 2942 001c movel %d2,%a4@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 57a4e: 2f0c movel %a4,%sp@- 57a50: 2f0a movel %a2,%sp@- 57a52: 206a 0004 moveal %a2@(4),%a0 57a56: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 57a58: 4eb9 0005 b1e8 jsr 5b1e8 <_Thread_Enable_dispatch> 57a5e: 4fef 000c lea %sp@(12),%sp return RTEMS_SUCCESSFUL; 57a62: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a64: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 57a6a: 4e5e unlk %fp 57a6c: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 57a6e: 7004 moveq #4,%d0 } 57a70: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 57a76: 4e5e unlk %fp ... =============================================================================== 00047fec : void rtems_workspace_greedy_free( void *opaque ) { 47fec: 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; 47ff0: 2239 0006 05ea movel 605ea <_Thread_Dispatch_disable_level>,%d1 ++level; 47ff6: 5281 addql #1,%d1 47ff8: 202e 0008 movel %fp@(8),%d0 _Thread_Dispatch_disable_level = level; 47ffc: 23c1 0006 05ea movel %d1,605ea <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Heap_Greedy_free( &_Workspace_Area, opaque ); 48002: 2f00 movel %d0,%sp@- 48004: 4879 0006 05fa pea 605fa <_Workspace_Area> 4800a: 4eb9 0004 8bb8 jsr 48bb8 <_Heap_Greedy_free> _Thread_Enable_dispatch(); 48010: 508f addql #8,%sp } 48012: 4e5e unlk %fp void rtems_workspace_greedy_free( void *opaque ) { _Thread_Disable_dispatch(); _Heap_Greedy_free( &_Workspace_Area, opaque ); _Thread_Enable_dispatch(); 48014: 4ef9 0004 a264 jmp 4a264 <_Thread_Enable_dispatch> ...