000465d4 <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 465d4: 4e56 0000 linkw %fp,#0 465d8: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 465da: 2479 0005 daee moveal 5daee <_API_extensions_List>,%a2 465e0: b5fc 0005 daf2 cmpal #383730,%a2 465e6: 6710 beqs 465f8 <_API_extensions_Run_postdriver+0x24> <== ALWAYS 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)(); 465e8: 206a 0008 moveal %a2@(8),%a0 465ec: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 465ee: 2452 moveal %a2@,%a2 void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 465f0: b5fc 0005 daf2 cmpal #383730,%a2 465f6: 66f0 bnes 465e8 <_API_extensions_Run_postdriver+0x14> <== ALWAYS TAKEN #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 465f8: 246e fffc moveal %fp@(-4),%a2 465fc: 4e5e unlk %fp 465fe: 4e75 rts 00046600 <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 46600: 4e56 0000 linkw %fp,#0 46604: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 46606: 2479 0005 daee moveal 5daee <_API_extensions_List>,%a2 4660c: b5fc 0005 daf2 cmpal #383730,%a2 46612: 6718 beqs 4662c <_API_extensions_Run_postswitch+0x2c> <== ALWAYS TAKEN * provide this hook. */ #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); 46614: 2f39 0005 da0e movel 5da0e <_Thread_Executing>,%sp@- 4661a: 206a 000c moveal %a2@(12),%a0 4661e: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 46620: 2452 moveal %a2@,%a2 void _API_extensions_Run_postswitch( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 46622: 588f addql #4,%sp 46624: b5fc 0005 daf2 cmpal #383730,%a2 4662a: 66e8 bnes 46614 <_API_extensions_Run_postswitch+0x14> <== ALWAYS TAKEN #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); } } 4662c: 246e fffc moveal %fp@(-4),%a2 46630: 4e5e unlk %fp 46632: 4e75 rts 000597d8 <_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 ) { 597d8: 4e56 ffe0 linkw %fp,#-32 597dc: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 597e0: 266e 0008 moveal %fp@(8),%a3 597e4: 282e 000c movel %fp@(12),%d4 597e8: 242e 0010 movel %fp@(16),%d2 597ec: 2a2e 001c movel %fp@(28),%d5 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 597f0: b4ab 004c cmpl %a3@(76),%d2 597f4: 6262 bhis 59858 <_CORE_message_queue_Broadcast+0x80> <== ALWAYS TAKEN * 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 ) { 597f6: 4aab 0048 tstl %a3@(72) 597fa: 664c bnes 59848 <_CORE_message_queue_Broadcast+0x70> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 597fc: 2f0b movel %a3,%sp@- 597fe: 49f9 0005 bd9c lea 5bd9c <_Thread_queue_Dequeue>,%a4 59804: 4283 clrl %d3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 59806: 4bf9 0006 19b8 lea 619b8 ,%a5 5980c: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5980e: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59810: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59812: 4a80 tstl %d0 59814: 6722 beqs 59838 <_CORE_message_queue_Broadcast+0x60> 59816: 2f02 movel %d2,%sp@- _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 59818: 5283 addql #1,%d3 5981a: 2f04 movel %d4,%sp@- 5981c: 2f2a 002c movel %a2@(44),%sp@- 59820: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 59822: 206a 0028 moveal %a2@(40),%a0 59826: 4fef 000c lea %sp@(12),%sp 5982a: 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 = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5982c: 2f0b movel %a3,%sp@- 5982e: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59830: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59832: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59834: 4a80 tstl %d0 59836: 66de bnes 59816 <_CORE_message_queue_Broadcast+0x3e> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 59838: 2045 moveal %d5,%a0 5983a: 4280 clrl %d0 5983c: 2083 movel %d3,%a0@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5983e: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 59844: 4e5e unlk %fp 59846: 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; 59848: 2045 moveal %d5,%a0 5984a: 4280 clrl %d0 #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5984c: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%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; 59852: 4290 clrl %a0@ #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 59854: 4e5e unlk %fp 59856: 4e75 rts { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 59858: 7001 moveq #1,%d0 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5985a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 <== NOT EXECUTED 59860: 4e5e unlk %fp <== NOT EXECUTED 59862: 4e75 rts 0004ff3c <_CORE_message_queue_Initialize>: /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 4ff3c: 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 ) { 4ff3e: 4e56 fff4 linkw %fp,#-12 4ff42: 202e 0014 movel %fp@(20),%d0 4ff46: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ff4a: 246e 0008 moveal %fp@(8),%a2 4ff4e: 242e 0010 movel %fp@(16),%d2 /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 4ff52: c280 andl %d0,%d1 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4ff54: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4ff58: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4ff5c: 2540 004c movel %d0,%a2@(76) /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 4ff60: 4a81 tstl %d1 4ff62: 6620 bnes 4ff84 <_CORE_message_queue_Initialize+0x48> 4ff64: 2200 movel %d0,%d1 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4ff66: 2601 movel %d1,%d3 4ff68: 0683 0000 0010 addil #16,%d3 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 4ff6e: 2003 movel %d3,%d0 4ff70: 4c02 0800 mulsl %d2,%d0 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4ff74: b280 cmpl %d0,%d1 4ff76: 631c blss 4ff94 <_CORE_message_queue_Initialize+0x58> <== NEVER TAKEN THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4ff78: 4200 clrb %d0 } 4ff7a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ff80: 4e5e unlk %fp 4ff82: 4e75 rts * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); 4ff84: 2200 movel %d0,%d1 4ff86: 5881 addql #4,%d1 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4ff88: 76fc moveq #-4,%d3 4ff8a: c283 andl %d3,%d1 } if (allocated_message_size < maximum_message_size) 4ff8c: b280 cmpl %d0,%d1 4ff8e: 64d6 bccs 4ff66 <_CORE_message_queue_Initialize+0x2a> <== NEVER TAKEN THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4ff90: 4200 clrb %d0 <== NOT EXECUTED 4ff92: 60e6 bras 4ff7a <_CORE_message_queue_Initialize+0x3e> <== NOT EXECUTED return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4ff94: 2f00 movel %d0,%sp@- 4ff96: 4eb9 0005 2c04 jsr 52c04 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4ff9c: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4ff9e: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4ffa2: 67d4 beqs 4ff78 <_CORE_message_queue_Initialize+0x3c> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4ffa4: 2f03 movel %d3,%sp@- 4ffa6: 2f02 movel %d2,%sp@- 4ffa8: 2f00 movel %d0,%sp@- 4ffaa: 486a 0060 pea %a2@(96) 4ffae: 4eb9 0005 490c jsr 5490c <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4ffb4: 4878 0006 pea 6 4ffb8: 7001 moveq #1,%d0 4ffba: 206e 000c moveal %fp@(12),%a0 4ffbe: b090 cmpl %a0@,%d0 4ffc0: 57c0 seq %d0 4ffc2: 4878 0080 pea 80 4ffc6: 49c0 extbl %d0 4ffc8: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4ffca: 41ea 0054 lea %a2@(84),%a0 4ffce: 2f00 movel %d0,%sp@- 4ffd0: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4ffd4: 41ea 0050 lea %a2@(80),%a0 4ffd8: 2548 0058 movel %a0,%a2@(88) 4ffdc: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4ffde: 42aa 0054 clrl %a2@(84) 4ffe2: 4eb9 0005 1fdc jsr 51fdc <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4ffe8: 4fef 0020 lea %sp@(32),%sp } 4ffec: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4fff2: 7001 moveq #1,%d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 4fff4: 4e5e unlk %fp 4fff6: 4e75 rts 000500dc <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 500dc: 4e56 fff4 linkw %fp,#-12 500e0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 500e4: 246e 0008 moveal %fp@(8),%a2 500e8: 242e 0010 movel %fp@(16),%d2 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 500ec: b4aa 004c cmpl %a2@(76),%d2 500f0: 6256 bhis 50148 <_CORE_message_queue_Submit+0x6c> } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 500f2: 202a 0048 movel %a2@(72),%d0 500f6: 675c beqs 50154 <_CORE_message_queue_Submit+0x78> /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 500f8: b0aa 0044 cmpl %a2@(68),%d0 500fc: 650c bcss 5010a <_CORE_message_queue_Submit+0x2e> 500fe: 7002 moveq #2,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50100: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 50106: 4e5e unlk %fp 50108: 4e75 rts RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control * _CORE_message_queue_Allocate_message_buffer ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) 5010a: 486a 0060 pea %a2@(96) 5010e: 4eb9 0004 fed0 jsr 4fed0 <_Chain_Get> 50114: 2640 moveal %d0,%a3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 50116: 2f02 movel %d2,%sp@- 50118: 2f2e 000c movel %fp@(12),%sp@- 5011c: 486b 000c pea %a3@(12) 50120: 4eb9 0005 75b4 jsr 575b4 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 50126: 2742 0008 movel %d2,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 5012a: 2f2e 001c movel %fp@(28),%sp@- 5012e: 2f0b movel %a3,%sp@- 50130: 2f0a movel %a2,%sp@- 50132: 4eb9 0005 4954 jsr 54954 <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 50138: 4fef 001c lea %sp@(28),%sp size ); the_message->Contents.size = size; _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 5013c: 4280 clrl %d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 5013e: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 50144: 4e5e unlk %fp 50146: 4e75 rts ) { CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 50148: 7001 moveq #1,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 5014a: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 50150: 4e5e unlk %fp 50152: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 50154: 2f0a movel %a2,%sp@- 50156: 4eb9 0005 1c00 jsr 51c00 <_Thread_queue_Dequeue> if ( the_thread ) { 5015c: 588f addql #4,%sp /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 5015e: 2640 moveal %d0,%a3 if ( the_thread ) { 50160: 4a80 tstl %d0 50162: 672e beqs 50192 <_CORE_message_queue_Submit+0xb6> 50164: 2f02 movel %d2,%sp@- 50166: 2f2e 000c movel %fp@(12),%sp@- 5016a: 2f2b 002c movel %a3@(44),%sp@- 5016e: 4eb9 0005 75b4 jsr 575b4 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 50174: 206b 0028 moveal %a3@(40),%a0 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 50178: 4fef 000c lea %sp@(12),%sp buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; the_thread->Wait.count = (uint32_t) submit_type; 5017c: 4280 clrl %d0 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 5017e: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 50180: 222e 001c movel %fp@(28),%d1 50184: 2741 0024 movel %d1,%a3@(36) _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50188: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 5018e: 4e5e unlk %fp 50190: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); if ( the_thread ) { 50192: 202a 0048 movel %a2@(72),%d0 /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 50196: b0aa 0044 cmpl %a2@(68),%d0 5019a: 6400 ff62 bccw 500fe <_CORE_message_queue_Submit+0x22> <== ALWAYS TAKEN 5019e: 6000 ff6a braw 5010a <_CORE_message_queue_Submit+0x2e> <== ALWAYS TAKEN ... 0004678c <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 4678c: 4e56 0000 linkw %fp,#0 46790: 206e 0008 moveal %fp@(8),%a0 46794: 2f0a movel %a2,%sp@- 46796: 246e 000c moveal %fp@(12),%a2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 4679a: 224a moveal %a2,%a1 4679c: 2159 0040 movel %a1@+,%a0@(64) 467a0: 2159 0044 movel %a1@+,%a0@(68) 467a4: 2159 0048 movel %a1@+,%a0@(72) CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 467a8: 202e 0010 movel %fp@(16),%d0 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 467ac: 3151 004c movew %a1@,%a0@(76) the_mutex->lock = initial_lock; 467b0: 2140 004e movel %d0,%a0@(78) the_mutex->blocked_count = 0; 467b4: 42a8 0056 clrl %a0@(86) if ( initial_lock == CORE_MUTEX_LOCKED ) { 467b8: 4a80 tstl %d0 467ba: 6654 bnes 46810 <_CORE_mutex_Initialize+0x84> the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 467bc: 2279 0005 da0e moveal 5da0e <_Thread_Executing>,%a1 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 467c2: 103c 0001 moveb #1,%d0 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 467c6: 7202 moveq #2,%d1 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 467c8: 2140 0052 movel %d0,%a0@(82) the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; 467cc: 2169 0008 005e movel %a1@(8),%a0@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 467d2: 2028 0046 movel %a0@(70),%d0 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 467d6: 2149 005a movel %a1,%a0@(90) the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 467da: b280 cmpl %d0,%d1 467dc: 6762 beqs 46840 <_CORE_mutex_Initialize+0xb4> <== ALWAYS TAKEN 467de: 123c 0003 moveb #3,%d1 467e2: b280 cmpl %d0,%d1 467e4: 675a beqs 46840 <_CORE_mutex_Initialize+0xb4> the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 467e6: 4aaa 0006 tstl %a2@(6) 467ea: 56c0 sne %d0 467ec: 4878 0005 pea 5 467f0: 49c0 extbl %d0 467f2: 4878 0400 pea 400 467f6: 4480 negl %d0 467f8: 2f00 movel %d0,%sp@- 467fa: 2f08 movel %a0,%sp@- 467fc: 4eb9 0004 8488 jsr 48488 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 46802: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46806: 4280 clrl %d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 46808: 246e fffc moveal %fp@(-4),%a2 4680c: 4e5e unlk %fp 4680e: 4e75 rts the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46810: 4aaa 0006 tstl %a2@(6) 46814: 56c0 sne %d0 #endif _Thread_Executing->resource_count++; } } else { the_mutex->nest_count = 0; 46816: 42a8 0052 clrl %a0@(82) the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 4681a: 49c0 extbl %d0 4681c: 4480 negl %d0 _Thread_Executing->resource_count++; } } else { the_mutex->nest_count = 0; the_mutex->holder = NULL; 4681e: 42a8 005a clrl %a0@(90) the_mutex->holder_id = 0; 46822: 42a8 005e clrl %a0@(94) } _Thread_queue_Initialize( 46826: 4878 0005 pea 5 4682a: 4878 0400 pea 400 4682e: 2f00 movel %d0,%sp@- 46830: 2f08 movel %a0,%sp@- 46832: 4eb9 0004 8488 jsr 48488 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 46838: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 4683c: 4280 clrl %d0 4683e: 60c8 bras 46808 <_CORE_mutex_Initialize+0x7c> <== ALWAYS TAKEN the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 46840: 2028 004a movel %a0@(74),%d0 46844: b0a9 0014 cmpl %a1@(20),%d0 46848: 6228 bhis 46872 <_CORE_mutex_Initialize+0xe6> _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 4684a: 52a9 001c addql #1,%a1@(28) the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 4684e: 4aaa 0006 tstl %a2@(6) 46852: 56c0 sne %d0 46854: 4878 0005 pea 5 46858: 49c0 extbl %d0 4685a: 4878 0400 pea 400 4685e: 4480 negl %d0 46860: 2f00 movel %d0,%sp@- 46862: 2f08 movel %a0,%sp@- 46864: 4eb9 0004 8488 jsr 48488 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 4686a: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 4686e: 4280 clrl %d0 46870: 6096 bras 46808 <_CORE_mutex_Initialize+0x7c> STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 46872: 246e fffc moveal %fp@(-4),%a2 the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 46876: 7006 moveq #6,%d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 46878: 4e5e unlk %fp 4687a: 4e75 rts 00046908 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 46908: 4e56 0000 linkw %fp,#0 4690c: 202e 0010 movel %fp@(16),%d0 46910: 2f0a movel %a2,%sp@- 46912: 246e 0008 moveal %fp@(8),%a2 46916: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46918: 2239 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 4691e: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46920: 4a81 tstl %d1 46922: 6704 beqs 46928 <_CORE_mutex_Seize+0x20> 46924: 4a00 tstb %d0 46926: 6634 bnes 4695c <_CORE_mutex_Seize+0x54> <== NEVER TAKEN 46928: 486e 0018 pea %fp@(24) 4692c: 2f0a movel %a2,%sp@- 4692e: 4eb9 0004 b098 jsr 4b098 <_CORE_mutex_Seize_interrupt_trylock> 46934: 508f addql #8,%sp 46936: 4a80 tstl %d0 46938: 6716 beqs 46950 <_CORE_mutex_Seize+0x48> 4693a: 4a02 tstb %d2 4693c: 6636 bnes 46974 <_CORE_mutex_Seize+0x6c> 4693e: 202e 0018 movel %fp@(24),%d0 46942: 46c0 movew %d0,%sr 46944: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 4694a: 7001 moveq #1,%d0 4694c: 2140 0034 movel %d0,%a0@(52) } 46950: 242e fff8 movel %fp@(-8),%d2 46954: 246e fffc moveal %fp@(-4),%a2 46958: 4e5e unlk %fp 4695a: 4e75 rts bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 4695c: 7001 moveq #1,%d0 4695e: b0b9 0005 dad6 cmpl 5dad6 <_System_state_Current>,%d0 46964: 64c2 bccs 46928 <_CORE_mutex_Seize+0x20> 46966: 4878 0013 pea 13 4696a: 42a7 clrl %sp@- 4696c: 42a7 clrl %sp@- 4696e: 4eb9 0004 6f7c jsr 46f7c <_Internal_error_Occurred> 46974: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 4697a: 5280 addql #1,%d0 4697c: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 46982: 216e 000c 0020 movel %fp@(12),%a0@(32) 46988: 23c0 0005 d954 movel %d0,5d954 <_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; 4698e: 7001 moveq #1,%d0 46990: 214a 0044 movel %a2,%a0@(68) 46994: 2540 0030 movel %d0,%a2@(48) 46998: 202e 0018 movel %fp@(24),%d0 4699c: 46c0 movew %d0,%sr 4699e: 2f2e 0014 movel %fp@(20),%sp@- 469a2: 2f0a movel %a2,%sp@- 469a4: 4eb9 0004 687c jsr 4687c <_CORE_mutex_Seize_interrupt_blocking> } 469aa: 242e fff8 movel %fp@(-8),%d2 bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 469ae: 508f addql #8,%sp } 469b0: 246e fffc moveal %fp@(-4),%a2 469b4: 4e5e unlk %fp 469b6: 4e75 rts 0004b098 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 4b098: 4e56 0000 linkw %fp,#0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4b09c: 2279 0005 da0e moveal 5da0e <_Thread_Executing>,%a1 4b0a2: 2f0a movel %a2,%sp@- 4b0a4: 206e 0008 moveal %fp@(8),%a0 4b0a8: 246e 000c moveal %fp@(12),%a2 4b0ac: 2f02 movel %d2,%sp@- executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4b0ae: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4b0b2: 4aa8 004e tstl %a0@(78) 4b0b6: 673a beqs 4b0f2 <_CORE_mutex_Seize_interrupt_trylock+0x5a> the_mutex->lock = CORE_MUTEX_LOCKED; 4b0b8: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4b0bc: 7201 moveq #1,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 4b0be: 2169 0008 005e movel %a1@(8),%a0@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 4b0c4: 2028 0046 movel %a0@(70),%d0 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4b0c8: 2141 0052 movel %d1,%a0@(82) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4b0cc: 123c 0002 moveb #2,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 4b0d0: 2149 005a movel %a1,%a0@(90) the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4b0d4: b280 cmpl %d0,%d1 4b0d6: 672e beqs 4b106 <_CORE_mutex_Seize_interrupt_trylock+0x6e> 4b0d8: 123c 0003 moveb #3,%d1 4b0dc: b280 cmpl %d0,%d1 4b0de: 674e beqs 4b12e <_CORE_mutex_Seize_interrupt_trylock+0x96> executing->resource_count++; } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); 4b0e0: 2012 movel %a2@,%d0 4b0e2: 46c0 movew %d0,%sr 4b0e4: 4280 clrl %d0 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 4b0e6: 242e fff8 movel %fp@(-8),%d2 4b0ea: 246e fffc moveal %fp@(-4),%a2 4b0ee: 4e5e unlk %fp 4b0f0: 4e75 rts /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 4b0f2: b3e8 005a cmpal %a0@(90),%a1 4b0f6: 671a beqs 4b112 <_CORE_mutex_Seize_interrupt_trylock+0x7a> 4b0f8: 242e fff8 movel %fp@(-8),%d2 the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; _ISR_Enable( *level_p ); 4b0fc: 7001 moveq #1,%d0 4b0fe: 246e fffc moveal %fp@(-4),%a2 4b102: 4e5e unlk %fp 4b104: 4e75 rts _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4b106: 52a9 001c addql #1,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); 4b10a: 2012 movel %a2@,%d0 4b10c: 46c0 movew %d0,%sr 4b10e: 4280 clrl %d0 4b110: 60d4 bras 4b0e6 <_CORE_mutex_Seize_interrupt_trylock+0x4e> <== ALWAYS TAKEN * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4b112: 2028 0040 movel %a0@(64),%d0 4b116: 6658 bnes 4b170 <_CORE_mutex_Seize_interrupt_trylock+0xd8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 4b118: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 4b11c: 2012 movel %a2@,%d0 4b11e: 46c0 movew %d0,%sr 4b120: 242e fff8 movel %fp@(-8),%d2 4b124: 4280 clrl %d0 4b126: 246e fffc moveal %fp@(-4),%a2 4b12a: 4e5e unlk %fp 4b12c: 4e75 rts _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4b12e: 2429 001c movel %a1@(28),%d2 4b132: 2002 movel %d2,%d0 4b134: 5280 addql #1,%d0 4b136: 2340 001c movel %d0,%a1@(28) { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; 4b13a: 2029 0014 movel %a1@(20),%d0 */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4b13e: 2228 004a movel %a0@(74),%d1 current = executing->current_priority; if ( current == ceiling ) { 4b142: b081 cmpl %d1,%d0 4b144: 6700 0082 beqw 4b1c8 <_CORE_mutex_Seize_interrupt_trylock+0x130> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { 4b148: 6244 bhis 4b18e <_CORE_mutex_Seize_interrupt_trylock+0xf6> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4b14a: 7206 moveq #6,%d1 the_mutex->lock = CORE_MUTEX_UNLOCKED; 4b14c: 7001 moveq #1,%d0 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4b14e: 2341 0034 movel %d1,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 4b152: 42a8 0052 clrl %a0@(82) _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 4b156: 2140 004e movel %d0,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 4b15a: 2342 001c movel %d2,%a1@(28) _ISR_Enable( *level_p ); 4b15e: 2012 movel %a2@,%d0 4b160: 46c0 movew %d0,%sr 4b162: 242e fff8 movel %fp@(-8),%d2 4b166: 4280 clrl %d0 4b168: 246e fffc moveal %fp@(-4),%a2 4b16c: 4e5e unlk %fp 4b16e: 4e75 rts * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4b170: 7201 moveq #1,%d1 4b172: b280 cmpl %d0,%d1 4b174: 6682 bnes 4b0f8 <_CORE_mutex_Seize_interrupt_trylock+0x60> <== NEVER TAKEN case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 4b176: 7002 moveq #2,%d0 <== NOT EXECUTED 4b178: 2340 0034 movel %d0,%a1@(52) <== NOT EXECUTED _ISR_Enable( *level_p ); 4b17c: 2012 movel %a2@,%d0 <== NOT EXECUTED 4b17e: 46c0 movew %d0,%sr <== NOT EXECUTED 4b180: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED 4b184: 4280 clrl %d0 <== NOT EXECUTED 4b186: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 4b18a: 4e5e unlk %fp <== NOT EXECUTED 4b18c: 4e75 rts <== NOT EXECUTED rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4b18e: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 4b194: 5280 addql #1,%d0 4b196: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> return 0; } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 4b19c: 2012 movel %a2@,%d0 4b19e: 46c0 movew %d0,%sr _Thread_Change_priority( 4b1a0: 42a7 clrl %sp@- 4b1a2: 2f28 004a movel %a0@(74),%sp@- 4b1a6: 2f28 005a movel %a0@(90),%sp@- 4b1aa: 4eb9 0004 7828 jsr 47828 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 4b1b0: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> 4b1b6: 242e fff8 movel %fp@(-8),%d2 4b1ba: 4fef 000c lea %sp@(12),%sp 4b1be: 4280 clrl %d0 4b1c0: 246e fffc moveal %fp@(-4),%a2 4b1c4: 4e5e unlk %fp 4b1c6: 4e75 rts Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { _ISR_Enable( *level_p ); 4b1c8: 2012 movel %a2@,%d0 4b1ca: 46c0 movew %d0,%sr 4b1cc: 242e fff8 movel %fp@(-8),%d2 4b1d0: 4280 clrl %d0 4b1d2: 246e fffc moveal %fp@(-4),%a2 4b1d6: 4e5e unlk %fp 4b1d8: 4e75 rts ... 000469b8 <_CORE_mutex_Surrender>: #else Objects_Id id __attribute__((unused)), CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused)) #endif ) { 469b8: 4e56 0000 linkw %fp,#0 469bc: 2f0a movel %a2,%sp@- 469be: 246e 0008 moveal %fp@(8),%a2 Thread_Control *the_thread; Thread_Control *holder; #ifdef __RTEMS_STRICT_ORDER_MUTEX__ Chain_Node *first_node; #endif holder = the_mutex->holder; 469c2: 206a 005a moveal %a2@(90),%a0 * allowed when the mutex in quetion is FIFO or simple Priority * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { 469c6: 4a2a 0044 tstb %a2@(68) 469ca: 6712 beqs 469de <_CORE_mutex_Surrender+0x26> if ( !_Thread_Is_executing( holder ) ) 469cc: b1f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a0 469d2: 670a beqs 469de <_CORE_mutex_Surrender+0x26> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 469d4: 246e fffc moveal %fp@(-4),%a2 * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { if ( !_Thread_Is_executing( holder ) ) 469d8: 7003 moveq #3,%d0 } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 469da: 4e5e unlk %fp 469dc: 4e75 rts return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 469de: 202a 0052 movel %a2@(82),%d0 469e2: 6768 beqs 46a4c <_CORE_mutex_Surrender+0x94> return CORE_MUTEX_STATUS_SUCCESSFUL; the_mutex->nest_count--; 469e4: 5380 subql #1,%d0 469e6: 2540 0052 movel %d0,%a2@(82) if ( the_mutex->nest_count != 0 ) { 469ea: 6660 bnes 46a4c <_CORE_mutex_Surrender+0x94> 469ec: 202a 0046 movel %a2@(70),%d0 /* * Formally release the mutex before possibly transferring it to a * blocked thread. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 469f0: 7202 moveq #2,%d1 469f2: b280 cmpl %d0,%d1 469f4: 6700 0084 beqw 46a7a <_CORE_mutex_Surrender+0xc2> 469f8: 123c 0003 moveb #3,%d1 469fc: b280 cmpl %d0,%d1 469fe: 677a beqs 46a7a <_CORE_mutex_Surrender+0xc2> } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; 46a00: 42aa 005a clrl %a2@(90) /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46a04: 7202 moveq #2,%d1 first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; the_mutex->holder_id = 0; 46a06: 42aa 005e clrl %a2@(94) /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46a0a: b280 cmpl %d0,%d1 46a0c: 6748 beqs 46a56 <_CORE_mutex_Surrender+0x9e> 46a0e: 123c 0003 moveb #3,%d1 46a12: b280 cmpl %d0,%d1 46a14: 6740 beqs 46a56 <_CORE_mutex_Surrender+0x9e> /* * Now we check if another thread was waiting for this mutex. If so, * transfer the mutex to that thread. */ if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) { 46a16: 2f0a movel %a2,%sp@- 46a18: 4eb9 0004 80ac jsr 480ac <_Thread_queue_Dequeue> 46a1e: 588f addql #4,%sp 46a20: 2040 moveal %d0,%a0 46a22: 4a80 tstl %d0 46a24: 6700 0090 beqw 46ab6 <_CORE_mutex_Surrender+0xfe> #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 46a28: 7201 moveq #1,%d1 } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 46a2a: 2568 0008 005e movel %a0@(8),%a2@(94) the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 46a30: 202a 0046 movel %a2@(70),%d0 #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 46a34: 2541 0052 movel %d1,%a2@(82) switch ( the_mutex->Attributes.discipline ) { 46a38: 123c 0002 moveb #2,%d1 } else #endif { the_mutex->holder = the_thread; 46a3c: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 46a40: b280 cmpl %d0,%d1 46a42: 6764 beqs 46aa8 <_CORE_mutex_Surrender+0xf0> 46a44: 123c 0003 moveb #3,%d1 46a48: b280 cmpl %d0,%d1 46a4a: 6734 beqs 46a80 <_CORE_mutex_Surrender+0xc8> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46a4c: 246e fffc moveal %fp@(-4),%a2 } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46a50: 4280 clrl %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 46a52: 4e5e unlk %fp 46a54: 4e75 rts _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { #ifdef __RTEMS_STRICT_ORDER_MUTEX__ if(the_mutex->queue.priority_before != holder->current_priority) _Thread_Change_priority(holder,the_mutex->queue.priority_before,true); #endif if ( holder->resource_count == 0 && 46a56: 4aa8 001c tstl %a0@(28) 46a5a: 66ba bnes 46a16 <_CORE_mutex_Surrender+0x5e> holder->real_priority != holder->current_priority ) { 46a5c: 2028 0018 movel %a0@(24),%d0 46a60: b0a8 0014 cmpl %a0@(20),%d0 46a64: 67b0 beqs 46a16 <_CORE_mutex_Surrender+0x5e> _Thread_Change_priority( holder, holder->real_priority, true ); 46a66: 4878 0001 pea 1 46a6a: 2f00 movel %d0,%sp@- 46a6c: 2f08 movel %a0,%sp@- 46a6e: 4eb9 0004 7828 jsr 47828 <_Thread_Change_priority> 46a74: 4fef 000c lea %sp@(12),%sp 46a78: 609c bras 46a16 <_CORE_mutex_Surrender+0x5e> <== ALWAYS TAKEN the_mutex->nest_count++; return CORE_MUTEX_RELEASE_NOT_ORDER; } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; 46a7a: 53a8 001c subql #1,%a0@(28) 46a7e: 6080 bras 46a00 <_CORE_mutex_Surrender+0x48> <== ALWAYS TAKEN case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING: #ifdef __RTEMS_STRICT_ORDER_MUTEX__ _Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue); the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; 46a80: 52a8 001c addql #1,%a0@(28) if (the_mutex->Attributes.priority_ceiling < 46a84: 202a 004a movel %a2@(74),%d0 the_thread->current_priority){ 46a88: b0a8 0014 cmpl %a0@(20),%d0 46a8c: 64be bccs 46a4c <_CORE_mutex_Surrender+0x94> _Thread_Change_priority( 46a8e: 42a7 clrl %sp@- 46a90: 2f00 movel %d0,%sp@- 46a92: 2f08 movel %a0,%sp@- 46a94: 4eb9 0004 7828 jsr 47828 <_Thread_Change_priority> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46a9a: 246e fffc moveal %fp@(-4),%a2 the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; if (the_mutex->Attributes.priority_ceiling < the_thread->current_priority){ _Thread_Change_priority( 46a9e: 4fef 000c lea %sp@(12),%sp 46aa2: 4280 clrl %d0 } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46aa4: 4e5e unlk %fp 46aa6: 4e75 rts 46aa8: 246e fffc moveal %fp@(-4),%a2 case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT: #ifdef __RTEMS_STRICT_ORDER_MUTEX__ _Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue); the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; 46aac: 4280 clrl %d0 46aae: 52a8 001c addql #1,%a0@(28) } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46ab2: 4e5e unlk %fp 46ab4: 4e75 rts } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46ab6: 7001 moveq #1,%d0 46ab8: 2540 004e movel %d0,%a2@(78) return CORE_MUTEX_STATUS_SUCCESSFUL; } 46abc: 246e fffc moveal %fp@(-4),%a2 } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46ac0: 4200 clrb %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 46ac2: 4e5e unlk %fp 46ac4: 4e75 rts ... 00046b1c <_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 ) { 46b1c: 4e56 0000 linkw %fp,#0 46b20: 2f0a movel %a2,%sp@- 46b22: 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)) ) { 46b26: 2f0a movel %a2,%sp@- 46b28: 4eb9 0004 80ac jsr 480ac <_Thread_queue_Dequeue> 46b2e: 588f addql #4,%sp 46b30: 4a80 tstl %d0 46b32: 670a beqs 46b3e <_CORE_semaphore_Surrender+0x22> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b34: 246e fffc moveal %fp@(-4),%a2 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 46b38: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b3a: 4e5e unlk %fp 46b3c: 4e75 rts if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 46b3e: 203c 0000 0700 movel #1792,%d0 46b44: 40c1 movew %sr,%d1 46b46: 8081 orl %d1,%d0 46b48: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46b4a: 202a 0048 movel %a2@(72),%d0 46b4e: b0aa 0040 cmpl %a2@(64),%d0 46b52: 6412 bccs 46b66 <_CORE_semaphore_Surrender+0x4a> <== ALWAYS TAKEN the_semaphore->count += 1; 46b54: 5280 addql #1,%d0 46b56: 2540 0048 movel %d0,%a2@(72) 46b5a: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46b5c: 46c1 movew %d1,%sr } return status; } 46b5e: 246e fffc moveal %fp@(-4),%a2 46b62: 4e5e unlk %fp 46b64: 4e75 rts (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46b66: 7004 moveq #4,%d0 <== NOT EXECUTED the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46b68: 46c1 movew %d1,%sr <== NOT EXECUTED 46b6a: 60f2 bras 46b5e <_CORE_semaphore_Surrender+0x42> <== NOT EXECUTED 0004b050 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4b050: 4e56 0000 linkw %fp,#0 4b054: 202e 0010 movel %fp@(16),%d0 4b058: 2f0a movel %a2,%sp@- 4b05a: 246e 0008 moveal %fp@(8),%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 4b05e: 224a moveal %a2,%a1 4b060: 2f02 movel %d2,%sp@- 4b062: 242e 0014 movel %fp@(20),%d2 Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; 4b066: 42aa 0004 clrl %a2@(4) next = starting_address; while ( count-- ) { 4b06a: 4a80 tstl %d0 4b06c: 6718 beqs 4b086 <_Chain_Initialize+0x36> <== ALWAYS TAKEN Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; 4b06e: 206e 000c moveal %fp@(12),%a0 while ( count-- ) { current->next = next; next->previous = current; 4b072: 2149 0004 movel %a1,%a0@(4) 4b076: 2208 movel %a0,%d1 4b078: d282 addl %d2,%d1 current = next; next = (Chain_Node *) 4b07a: 5380 subql #1,%d0 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { current->next = next; 4b07c: 2288 movel %a0,%a1@ next->previous = current; current = next; next = (Chain_Node *) 4b07e: 2248 moveal %a0,%a1 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { 4b080: 2041 moveal %d1,%a0 4b082: 4a80 tstl %d0 4b084: 66ec bnes 4b072 <_Chain_Initialize+0x22> next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); 4b086: 200a movel %a2,%d0 4b088: 5880 addql #4,%d0 4b08a: 2280 movel %d0,%a1@ the_chain->last = current; } 4b08c: 241f movel %sp@+,%d2 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); the_chain->last = current; 4b08e: 2549 0008 movel %a1,%a2@(8) } 4b092: 245f moveal %sp@+,%a2 4b094: 4e5e unlk %fp 4b096: 4e75 rts 000456d0 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 456d0: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456d6: 4e56 ffec linkw %fp,#-20 456da: 222e 0008 movel %fp@(8),%d1 456de: 48d7 043c moveml %d2-%d5/%a2,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 456e2: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456e8: 242e 000c movel %fp@(12),%d2 456ec: 2a2e 0010 movel %fp@(16),%d5 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 456f0: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456f4: 226e 0014 moveal %fp@(20),%a1 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 456f8: 206a 0108 moveal %a2@(264),%a0 _ISR_Disable( level ); 456fc: 40c4 movew %sr,%d4 456fe: 8084 orl %d4,%d0 45700: 46c0 movew %d0,%sr pending_events = api->pending_events; 45702: 2610 movel %a0@,%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 45704: 2001 movel %d1,%d0 45706: c083 andl %d3,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 45708: 670c beqs 45716 <_Event_Seize+0x46> 4570a: b081 cmpl %d1,%d0 4570c: 6700 0084 beqw 45792 <_Event_Seize+0xc2> 45710: 0802 0001 btst #1,%d2 45714: 667c bnes 45792 <_Event_Seize+0xc2> <== NEVER TAKEN _ISR_Enable( level ); *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 45716: 0802 0000 btst #0,%d2 4571a: 6662 bnes 4577e <_Event_Seize+0xae> * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 4571c: 2542 0030 movel %d2,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45720: 7401 moveq #1,%d2 * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 45722: 2541 0024 movel %d1,%a2@(36) executing->Wait.return_argument = event_out; 45726: 2549 0028 movel %a1,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4572a: 23c2 0005 db32 movel %d2,5db32 <_Event_Sync_state> _ISR_Enable( level ); 45730: 46c4 movew %d4,%sr if ( ticks ) { 45732: 4a85 tstl %d5 45734: 6672 bnes 457a8 <_Event_Seize+0xd8> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 45736: 4878 0100 pea 100 4573a: 2f0a movel %a2,%sp@- 4573c: 4eb9 0004 8614 jsr 48614 <_Thread_Set_state> _ISR_Disable( level ); 45742: 203c 0000 0700 movel #1792,%d0 45748: 40c1 movew %sr,%d1 4574a: 8081 orl %d1,%d0 4574c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4574e: 7401 moveq #1,%d2 45750: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 45752: 2039 0005 db32 movel 5db32 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 45758: 42b9 0005 db32 clrl 5db32 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4575e: b480 cmpl %d0,%d2 45760: 6700 00a4 beqw 45806 <_Event_Seize+0x136> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45764: 2d4a 000c movel %a2,%fp@(12) 45768: 2d41 0010 movel %d1,%fp@(16) } 4576c: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45772: 2d40 0008 movel %d0,%fp@(8) } 45776: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45778: 4ef9 0004 77c0 jmp 477c0 <_Thread_blocking_operation_Cancel> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); 4577e: 46c4 movew %d4,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 45780: 720d moveq #13,%d1 45782: 2541 0034 movel %d1,%a2@(52) * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 45786: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); executing->Wait.return_code = RTEMS_UNSATISFIED; *event_out = seized_events; 4578c: 2280 movel %d0,%a1@ * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 4578e: 4e5e unlk %fp 45790: 4e75 rts pending_events = api->pending_events; seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 45792: 2200 movel %d0,%d1 45794: 4681 notl %d1 45796: c283 andl %d3,%d1 45798: 2081 movel %d1,%a0@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 4579a: 46c4 movew %d4,%sr *event_out = seized_events; 4579c: 2280 movel %d0,%a1@ * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 4579e: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 457a4: 4e5e unlk %fp 457a6: 4e75 rts _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); if ( ticks ) { _Watchdog_Initialize( 457a8: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 457ac: 223c 0004 599c movel #285084,%d1 the_watchdog->id = id; 457b2: 2540 0068 movel %d0,%a2@(104) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 457b6: 2541 0064 movel %d1,%a2@(100) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 457ba: 2545 0054 movel %d5,%a2@(84) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 457be: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 457c2: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 457c6: 486a 0048 pea %a2@(72) 457ca: 4879 0005 da2c pea 5da2c <_Watchdog_Ticks_chain> 457d0: 4eb9 0004 8e18 jsr 48e18 <_Watchdog_Insert> 457d6: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 457d8: 4878 0100 pea 100 457dc: 2f0a movel %a2,%sp@- 457de: 4eb9 0004 8614 jsr 48614 <_Thread_Set_state> _ISR_Disable( level ); 457e4: 203c 0000 0700 movel #1792,%d0 457ea: 40c1 movew %sr,%d1 457ec: 8081 orl %d1,%d0 457ee: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 457f0: 7401 moveq #1,%d2 457f2: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 457f4: 2039 0005 db32 movel 5db32 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 457fa: 42b9 0005 db32 clrl 5db32 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 45800: b480 cmpl %d0,%d2 45802: 6600 ff60 bnew 45764 <_Event_Seize+0x94> _ISR_Enable( level ); 45806: 46c1 movew %d1,%sr * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 45808: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4580e: 4e5e unlk %fp 45810: 4e75 rts ... 00045870 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 45870: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 45876: 4e56 ffec linkw %fp,#-20 4587a: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4587e: 246e 0008 moveal %fp@(8),%a2 rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 45882: 206a 0108 moveal %a2@(264),%a0 option_set = (rtems_option) the_thread->Wait.option; 45886: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 4588a: 40c3 movew %sr,%d3 4588c: 8083 orl %d3,%d0 4588e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 45890: 222a 0024 movel %a2@(36),%d1 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 ); 45894: 2001 movel %d1,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 45896: 2410 movel %a0@,%d2 45898: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 4589a: 6778 beqs 45914 <_Event_Surrender+0xa4> /* * 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() && 4589c: 2279 0005 d9ee moveal 5d9ee <_ISR_Nest_level>,%a1 458a2: 4a89 tstl %a1 458a4: 670a beqs 458b0 <_Event_Surrender+0x40> 458a6: b5f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a2 458ac: 6700 00a0 beqw 4594e <_Event_Surrender+0xde> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 458b0: 2a2a 0010 movel %a2@(16),%d5 458b4: 0285 0000 0100 andil #256,%d5 458ba: 674c beqs 45908 <_Event_Surrender+0x98> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 458bc: b081 cmpl %d1,%d0 458be: 6706 beqs 458c6 <_Event_Surrender+0x56> 458c0: 0804 0001 btst #1,%d4 458c4: 6742 beqs 45908 <_Event_Surrender+0x98> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 458c6: 2200 movel %d0,%d1 458c8: 4681 notl %d1 458ca: c282 andl %d2,%d1 458cc: 2081 movel %d1,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 458ce: 206a 0028 moveal %a2@(40),%a0 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 458d2: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 458d6: 2080 movel %d0,%a0@ _ISR_Flash( level ); 458d8: 203c 0000 0700 movel #1792,%d0 458de: 46c3 movew %d3,%sr 458e0: 8083 orl %d3,%d0 458e2: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 458e4: 7a02 moveq #2,%d5 458e6: baaa 0050 cmpl %a2@(80),%d5 458ea: 6734 beqs 45920 <_Event_Surrender+0xb0> _ISR_Enable( level ); 458ec: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 458ee: 2f3c 1003 fff8 movel #268697592,%sp@- 458f4: 2f0a movel %a2,%sp@- 458f6: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> 458fc: 508f addql #8,%sp } return; } } _ISR_Enable( level ); } 458fe: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45904: 4e5e unlk %fp 45906: 4e75 rts _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45908: 46c3 movew %d3,%sr } 4590a: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45910: 4e5e unlk %fp 45912: 4e75 rts /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { _ISR_Enable( level ); 45914: 46c3 movew %d3,%sr } return; } } _ISR_Enable( level ); } 45916: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4591c: 4e5e unlk %fp 4591e: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45920: 7003 moveq #3,%d0 45922: 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 ); 45926: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45928: 486a 0048 pea %a2@(72) 4592c: 4eb9 0004 8f60 jsr 48f60 <_Watchdog_Remove> 45932: 2f3c 1003 fff8 movel #268697592,%sp@- 45938: 2f0a movel %a2,%sp@- 4593a: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> 45940: 4fef 000c lea %sp@(12),%sp } return; } } _ISR_Enable( level ); } 45944: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4594a: 4e5e unlk %fp 4594c: 4e75 rts * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 4594e: 2279 0005 db32 moveal 5db32 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 45954: 7a02 moveq #2,%d5 45956: ba89 cmpl %a1,%d5 45958: 6710 beqs 4596a <_Event_Surrender+0xfa> <== ALWAYS TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 4595a: 2279 0005 db32 moveal 5db32 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 45960: 1a3c 0001 moveb #1,%d5 45964: ba89 cmpl %a1,%d5 45966: 6600 ff48 bnew 458b0 <_Event_Surrender+0x40> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 4596a: b081 cmpl %d1,%d0 4596c: 6706 beqs 45974 <_Event_Surrender+0x104> 4596e: 0804 0001 btst #1,%d4 45972: 671a beqs 4598e <_Event_Surrender+0x11e> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 45974: 2200 movel %d0,%d1 45976: 4681 notl %d1 45978: c282 andl %d2,%d1 4597a: 2081 movel %d1,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4597c: 206a 0028 moveal %a2@(40),%a0 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 45980: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45984: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 45986: 7003 moveq #3,%d0 45988: 23c0 0005 db32 movel %d0,5db32 <_Event_Sync_state> } _ISR_Enable( level ); 4598e: 46c3 movew %d3,%sr } return; } } _ISR_Enable( level ); } 45990: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45996: 4e5e unlk %fp 45998: 4e75 rts ... 0004599c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 4599c: 4e56 fffc linkw %fp,#-4 459a0: 2f03 movel %d3,%sp@- 459a2: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 459a4: 486e fffc pea %fp@(-4) 459a8: 2f2e 0008 movel %fp@(8),%sp@- 459ac: 4eb9 0004 7d70 jsr 47d70 <_Thread_Get> switch ( location ) { 459b2: 508f addql #8,%sp 459b4: 4aae fffc tstl %fp@(-4) 459b8: 6642 bnes 459fc <_Event_Timeout+0x60> <== ALWAYS 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 ); 459ba: 223c 0000 0700 movel #1792,%d1 459c0: 40c2 movew %sr,%d2 459c2: 8282 orl %d2,%d1 459c4: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 459c6: 2040 moveal %d0,%a0 459c8: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 459cc: b0b9 0005 da0e cmpl 5da0e <_Thread_Executing>,%d0 459d2: 6734 beqs 45a08 <_Event_Timeout+0x6c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 459d4: 7606 moveq #6,%d3 459d6: 2040 moveal %d0,%a0 459d8: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 459dc: 46c2 movew %d2,%sr 459de: 2f3c 1003 fff8 movel #268697592,%sp@- 459e4: 2f00 movel %d0,%sp@- 459e6: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 459ec: 508f addql #8,%sp 459ee: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 459f4: 5380 subql #1,%d0 459f6: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 459fc: 242e fff4 movel %fp@(-12),%d2 45a00: 262e fff8 movel %fp@(-8),%d3 45a04: 4e5e unlk %fp 45a06: 4e75 rts } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45a08: 2239 0005 db32 movel 5db32 <_Event_Sync_state>,%d1 45a0e: 7601 moveq #1,%d3 45a10: b681 cmpl %d1,%d3 45a12: 66c0 bnes 459d4 <_Event_Timeout+0x38> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a14: 7606 moveq #6,%d3 45a16: 2040 moveal %d0,%a0 #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a18: 7202 moveq #2,%d1 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a1a: 2143 0034 movel %d3,%a0@(52) #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a1e: 23c1 0005 db32 movel %d1,5db32 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; _ISR_Enable( level ); 45a24: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45a26: 2f3c 1003 fff8 movel #268697592,%sp@- 45a2c: 2f00 movel %d0,%sp@- 45a2e: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 45a34: 508f addql #8,%sp 45a36: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 45a3c: 5380 subql #1,%d0 45a3e: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> 45a44: 60b6 bras 459fc <_Event_Timeout+0x60> <== ALWAYS TAKEN ... 0004b314 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4b314: 4e56 ffcc linkw %fp,#-52 4b318: 226e 000c moveal %fp@(12),%a1 4b31c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4b320: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 4b324: 2c09 movel %a1,%d6 4b326: 5886 addql #4,%d6 uintptr_t const page_size = heap->page_size; 4b328: 202a 0010 movel %a2@(16),%d0 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4b32c: 222e 0010 movel %fp@(16),%d1 4b330: 282e 0014 movel %fp@(20),%d4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4b334: 206a 0008 moveal %a2@(8),%a0 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 4b338: 2d40 fffc movel %d0,%fp@(-4) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4b33c: bc89 cmpl %a1,%d6 4b33e: 6500 0146 bcsw 4b486 <_Heap_Allocate_aligned_with_boundary+0x172> <== ALWAYS TAKEN /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4b342: 4a84 tstl %d4 4b344: 6600 013c bnew 4b482 <_Heap_Allocate_aligned_with_boundary+0x16e> <== ALWAYS TAKEN if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4b348: b1ca cmpal %a2,%a0 4b34a: 6700 0152 beqw 4b49e <_Heap_Allocate_aligned_with_boundary+0x18a> uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b34e: 242e fffc movel %fp@(-4),%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b352: 7a04 moveq #4,%d5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b354: 5e82 addql #7,%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b356: 9a89 subl %a1,%d5 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4b358: 4283 clrl %d3 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b35a: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b35e: 2d45 fff4 movel %d5,%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 ) { 4b362: 2028 0004 movel %a0@(4),%d0 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4b366: 5283 addql #1,%d3 /* * 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 ) { 4b368: b086 cmpl %d6,%d0 4b36a: 630e blss 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> if ( alignment == 0 ) { 4b36c: 4a81 tstl %d1 4b36e: 6628 bnes 4b398 <_Heap_Allocate_aligned_with_boundary+0x84> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4b370: 2408 movel %a0,%d2 4b372: 5082 addql #8,%d2 boundary ); } } if ( alloc_begin != 0 ) { 4b374: 4a82 tstl %d2 4b376: 6600 00ee bnew 4b466 <_Heap_Allocate_aligned_with_boundary+0x152> <== NEVER TAKEN break; } block = block->next; 4b37a: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4b37e: b1ca cmpal %a2,%a0 4b380: 66e0 bnes 4b362 <_Heap_Allocate_aligned_with_boundary+0x4e> 4b382: 4280 clrl %d0 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4b384: b6aa 0044 cmpl %a2@(68),%d3 4b388: 6304 blss 4b38e <_Heap_Allocate_aligned_with_boundary+0x7a> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4b38a: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; } 4b38e: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4b394: 4e5e unlk %fp 4b396: 4e75 rts 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; 4b398: 7efe moveq #-2,%d7 4b39a: 4be8 0008 lea %a0@(8),%a5 4b39e: c087 andl %d7,%d0 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4b3a0: 286a 0014 moveal %a2@(20),%a4 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; 4b3a4: 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; 4b3a6: 2a2e fff8 movel %fp@(-8),%d5 4b3aa: 9a8c subl %a4,%d5 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b3ac: 242e fff4 movel %fp@(-12),%d2 4b3b0: d480 addl %d0,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4b3b2: 2e02 movel %d2,%d7 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b3b4: d085 addl %d5,%d0 4b3b6: 4c41 7005 remul %d1,%d5,%d7 4b3ba: 9485 subl %d5,%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 ) { 4b3bc: b480 cmpl %d0,%d2 4b3be: 630a blss 4b3ca <_Heap_Allocate_aligned_with_boundary+0xb6> 4b3c0: 2a00 movel %d0,%d5 4b3c2: 4c41 5002 remul %d1,%d2,%d5 4b3c6: 9082 subl %d2,%d0 4b3c8: 2400 movel %d0,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4b3ca: 4a84 tstl %d4 4b3cc: 676c beqs 4b43a <_Heap_Allocate_aligned_with_boundary+0x126> /* 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; 4b3ce: 2002 movel %d2,%d0 4b3d0: d089 addl %a1,%d0 4b3d2: 2e00 movel %d0,%d7 4b3d4: 4c44 7005 remul %d4,%d5,%d7 4b3d8: 2e00 movel %d0,%d7 4b3da: 9e85 subl %d5,%d7 4b3dc: 2a07 movel %d7,%d5 /* 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 ) { 4b3de: be82 cmpl %d2,%d7 4b3e0: 6358 blss 4b43a <_Heap_Allocate_aligned_with_boundary+0x126> 4b3e2: be80 cmpl %d0,%d7 4b3e4: 6454 bccs 4b43a <_Heap_Allocate_aligned_with_boundary+0x126> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4b3e6: 2e0d movel %a5,%d7 4b3e8: de89 addl %a1,%d7 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4b3ea: ba87 cmpl %d7,%d5 4b3ec: 658c bcss 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 4b3ee: 9a89 subl %a1,%d5 4b3f0: 2005 movel %d5,%d0 4b3f2: 2647 moveal %d7,%a3 4b3f4: 4c41 0002 remul %d1,%d2,%d0 4b3f8: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4b3fa: 2005 movel %d5,%d0 4b3fc: d089 addl %a1,%d0 4b3fe: 2405 movel %d5,%d2 4b400: 2e00 movel %d0,%d7 4b402: 4c44 7005 remul %d4,%d5,%d7 4b406: 2e00 movel %d0,%d7 4b408: 9e85 subl %d5,%d7 4b40a: 2a07 movel %d7,%d5 /* 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 ) { 4b40c: be82 cmpl %d2,%d7 4b40e: 632a blss 4b43a <_Heap_Allocate_aligned_with_boundary+0x126> 4b410: be80 cmpl %d0,%d7 4b412: 6426 bccs 4b43a <_Heap_Allocate_aligned_with_boundary+0x126> if ( boundary_line < boundary_floor ) { 4b414: ba8b cmpl %a3,%d5 4b416: 6500 ff62 bcsw 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 4b41a: 9a89 subl %a1,%d5 4b41c: 2005 movel %d5,%d0 4b41e: 4c41 0002 remul %d1,%d2,%d0 4b422: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4b424: 2005 movel %d5,%d0 4b426: d089 addl %a1,%d0 4b428: 2405 movel %d5,%d2 4b42a: 2e00 movel %d0,%d7 4b42c: 4c44 7005 remul %d4,%d5,%d7 4b430: 2e00 movel %d0,%d7 4b432: 9e85 subl %d5,%d7 4b434: 2a07 movel %d7,%d5 /* 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 ) { 4b436: be82 cmpl %d2,%d7 4b438: 62d6 bhis 4b410 <_Heap_Allocate_aligned_with_boundary+0xfc> <== NEVER TAKEN 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 ) { 4b43a: b48d cmpl %a5,%d2 4b43c: 6500 ff3c bcsw 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN 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; 4b440: 70f8 moveq #-8,%d0 4b442: 9088 subl %a0,%d0 4b444: 2a40 moveal %d0,%a5 4b446: 2e02 movel %d2,%d7 4b448: dbc2 addal %d2,%a5 4b44a: 202e fffc movel %fp@(-4),%d0 4b44e: 4c40 7005 remul %d0,%d5,%d7 4b452: 9bc5 subal %d5,%a5 if ( free_size >= min_block_size || free_size == 0 ) { 4b454: bbcc cmpal %a4,%a5 4b456: 6400 ff1c bccw 4b374 <_Heap_Allocate_aligned_with_boundary+0x60> 4b45a: 4a8d tstl %a5 4b45c: 6600 ff1c bnew 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN boundary ); } } if ( alloc_begin != 0 ) { 4b460: 4a82 tstl %d2 4b462: 6700 ff16 beqw 4b37a <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4b466: 2f09 movel %a1,%sp@- block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4b468: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4b46c: 2f02 movel %d2,%sp@- 4b46e: 2f08 movel %a0,%sp@- 4b470: 2f0a movel %a2,%sp@- 4b472: 4eb9 0004 6e44 jsr 46e44 <_Heap_Block_allocate> 4b478: 4fef 0010 lea %sp@(16),%sp 4b47c: 2002 movel %d2,%d0 4b47e: 6000 ff04 braw 4b384 <_Heap_Allocate_aligned_with_boundary+0x70> <== ALWAYS TAKEN /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4b482: b889 cmpl %a1,%d4 4b484: 640c bccs 4b492 <_Heap_Allocate_aligned_with_boundary+0x17e> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4b486: 4280 clrl %d0 } return (void *) alloc_begin; } 4b488: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4b48e: 4e5e unlk %fp 4b490: 4e75 rts if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4b492: 4a81 tstl %d1 4b494: 6600 feb2 bnew 4b348 <_Heap_Allocate_aligned_with_boundary+0x34> <== ALWAYS TAKEN 4b498: 2200 movel %d0,%d1 4b49a: 6000 feac braw 4b348 <_Heap_Allocate_aligned_with_boundary+0x34> alignment = page_size; } } while ( block != free_list_tail ) { 4b49e: 4283 clrl %d3 4b4a0: 4280 clrl %d0 4b4a2: 6000 fee0 braw 4b384 <_Heap_Allocate_aligned_with_boundary+0x70> <== ALWAYS TAKEN ... 00046e44 <_Heap_Block_allocate>: Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e44: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46e46: 4e56 ffe0 linkw %fp,#-32 46e4a: 222e 0010 movel %fp@(16),%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 46e4e: 2041 moveal %d1,%a0 46e50: 5188 subql #8,%a0 46e52: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46e56: 246e 000c moveal %fp@(12),%a2 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e5a: 7601 moveq #1,%d3 ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const alloc_area_begin = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_area_offset = alloc_begin - alloc_area_begin; 46e5c: 2848 moveal %a0,%a4 46e5e: 240a movel %a2,%d2 46e60: 99ca subal %a2,%a4 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e62: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46e66: 266e 0008 moveal %fp@(8),%a3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e6a: c6b2 0804 andl %a2@(00000004,%d0:l),%d3 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46e6e: 2a2e 0014 movel %fp@(20),%d5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e72: 4a03 tstb %d3 46e74: 6600 00aa bnew 46f20 <_Heap_Block_allocate+0xdc> free_list_anchor = block->prev; _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 46e78: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46e7c: 76fe moveq #-2,%d3 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; 46e7e: 52ab 0040 addql #1,%a3@(64) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 46e82: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 46e86: 2a40 moveal %d0,%a5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { free_list_anchor = block->prev; 46e88: 226a 000c moveal %a2@(12),%a1 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46e8c: c6aa 0004 andl %a2@(4),%d3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 46e90: 2340 0008 movel %d0,%a1@(8) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46e94: 202b 0010 movel %a3@(16),%d0 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46e98: 97ab 0030 subl %d3,%a3@(48) next->prev = prev; 46e9c: 2b49 000c movel %a1,%a5@(12) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46ea0: b08c cmpl %a4,%d0 46ea2: 6200 0088 bhiw 46f2c <_Heap_Block_allocate+0xe8> - 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; 46ea6: 262a 0004 movel %a2@(4),%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 46eaa: 4c40 1004 remul %d0,%d4,%d1 _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; if ( _Heap_Is_prev_used( block ) ) { 46eae: 7201 moveq #1,%d1 46eb0: 91c4 subal %d4,%a0 _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); uintptr_t const new_block_begin = (uintptr_t) new_block; uintptr_t const new_block_size = block_end - new_block_begin; block_end = new_block_begin; block_size = block_end - block_begin; 46eb2: 2008 movel %a0,%d0 46eb4: 908a subl %a2,%d0 _HAssert( block_size >= heap->min_block_size ); _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; 46eb6: d1ab 0030 addl %d0,%a3@(48) if ( _Heap_Is_prev_used( block ) ) { 46eba: c2aa 0004 andl %a2@(4),%d1 46ebe: 6700 0082 beqw 46f42 <_Heap_Block_allocate+0xfe> } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46ec2: 78fe moveq #-2,%d4 _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 46ec4: 52ab 0038 addql #1,%a3@(56) 46ec8: 220a movel %a2,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 46eca: 2869 0008 moveal %a1@(8),%a4 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46ece: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46ed0: 7801 moveq #1,%d4 46ed2: 8880 orl %d0,%d4 new_block->next = next; 46ed4: 254c 0008 movel %a4,%a2@(8) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46ed8: d483 addl %d3,%d2 46eda: 9488 subl %a0,%d2 new_block->prev = block_before; 46edc: 2549 000c movel %a1,%a2@(12) block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46ee0: 2544 0004 movel %d4,%a2@(4) block_before->next = new_block; 46ee4: 234a 0008 movel %a2,%a1@(8) next->prev = new_block; 46ee8: 294a 000c movel %a2,%a4@(12) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46eec: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46eee: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46ef0: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46ef4: 2f05 movel %d5,%sp@- 46ef6: 2f01 movel %d1,%sp@- 46ef8: 2f08 movel %a0,%sp@- 46efa: 2f0b movel %a3,%sp@- 46efc: 4eb9 0004 6d50 jsr 46d50 <_Heap_Block_split> 46f02: 4fef 0010 lea %sp@(16),%sp alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 46f06: 202b 0030 movel %a3@(48),%d0 Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { Heap_Statistics *const stats = &heap->stats; 46f0a: b0ab 0034 cmpl %a3@(52),%d0 46f0e: 6404 bccs 46f14 <_Heap_Block_allocate+0xd0> ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { stats->min_free_size = stats->free_size; 46f10: 2740 0034 movel %d0,%a3@(52) } return block; } 46f14: 200a movel %a2,%d0 46f16: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 46f1c: 4e5e unlk %fp 46f1e: 4e75 rts stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46f20: 202b 0010 movel %a3@(16),%d0 /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); 46f24: 224b moveal %a3,%a1 } if ( alloc_area_offset < heap->page_size ) { 46f26: b08c cmpl %a4,%d0 46f28: 6300 ff7c blsw 46ea6 <_Heap_Block_allocate+0x62> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 46f2c: 4874 5800 pea %a4@(00000000,%d5:l) 46f30: 2f09 movel %a1,%sp@- 46f32: 2f0a movel %a2,%sp@- 46f34: 2f0b movel %a3,%sp@- 46f36: 4eb9 0004 6d50 jsr 46d50 <_Heap_Block_split> 46f3c: 4fef 0010 lea %sp@(16),%sp 46f40: 60c4 bras 46f06 <_Heap_Block_allocate+0xc2> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 46f42: 95d2 subal %a2@,%a2 Heap_Block *const prev_block = _Heap_Prev_block( block ); uintptr_t const prev_block_size = _Heap_Block_size( prev_block ); block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; 46f44: 78fe moveq #-2,%d4 46f46: 2209 movel %a1,%d1 46f48: c8aa 0004 andl %a2@(4),%d4 46f4c: d084 addl %d4,%d0 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f4e: 78fe moveq #-2,%d4 46f50: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f52: 7801 moveq #1,%d4 46f54: 8880 orl %d0,%d4 new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f56: d483 addl %d3,%d2 46f58: 9488 subl %a0,%d2 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f5a: 2544 0004 movel %d4,%a2@(4) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f5e: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46f60: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46f62: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f66: 2f05 movel %d5,%sp@- 46f68: 2f01 movel %d1,%sp@- 46f6a: 2f08 movel %a0,%sp@- 46f6c: 2f0b movel %a3,%sp@- 46f6e: 4eb9 0004 6d50 jsr 46d50 <_Heap_Block_split> 46f74: 4fef 0010 lea %sp@(16),%sp 46f78: 608c bras 46f06 <_Heap_Block_allocate+0xc2> <== ALWAYS TAKEN ... 00046d50 <_Heap_Block_split>: Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 46d50: 4e56 ffe4 linkw %fp,#-28 46d54: 226e 0008 moveal %fp@(8),%a1 46d58: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 46d5c: 246e 000c moveal %fp@(12),%a2 - 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; 46d60: 76fe moveq #-2,%d3 46d62: 282a 0004 movel %a2@(4),%d4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 46d66: 2669 0014 moveal %a1@(20),%a3 uintptr_t const min_alloc_size = min_block_size - HEAP_BLOCK_HEADER_SIZE; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const used_size = _Heap_Max( alloc_size, min_alloc_size ) + HEAP_BLOCK_HEADER_SIZE; 46d6a: 220b movel %a3,%d1 46d6c: 5181 subql #8,%d1 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 46d6e: 286e 0010 moveal %fp@(16),%a4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; 46d72: 2429 0010 movel %a1@(16),%d2 uintptr_t const min_alloc_size = min_block_size - HEAP_BLOCK_HEADER_SIZE; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const used_size = _Heap_Max( alloc_size, min_alloc_size ) + HEAP_BLOCK_HEADER_SIZE; 46d76: 202e 0014 movel %fp@(20),%d0 46d7a: c684 andl %d4,%d3 46d7c: b280 cmpl %d0,%d1 46d7e: 6302 blss 46d82 <_Heap_Block_split+0x32> 46d80: 2001 movel %d1,%d0 46d82: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d84: 2a00 movel %d0,%d5 46d86: 4c42 5001 remul %d2,%d1,%d5 if ( remainder != 0 ) { 46d8a: 4a81 tstl %d1 46d8c: 6664 bnes 46df2 <_Heap_Block_split+0xa2> Heap_Block *next_block = _Heap_Block_at( block, block_size ); _HAssert( used_size <= block_size + HEAP_BLOCK_SIZE_OFFSET ); _HAssert( used_size + free_size == block_size + HEAP_BLOCK_SIZE_OFFSET ); if ( free_size >= free_size_limit ) { 46d8e: 2203 movel %d3,%d1 46d90: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46d92: 41f2 3800 lea %a2@(00000000,%d3:l),%a0 uintptr_t alignment ) { uintptr_t remainder = value % alignment; if ( remainder != 0 ) { 46d96: 2400 movel %d0,%d2 46d98: 9280 subl %d0,%d1 46d9a: 588b addql #4,%a3 46d9c: b7c1 cmpal %d1,%a3 46d9e: 6266 bhis 46e06 <_Heap_Block_split+0xb6> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46da0: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46da2: 47f2 2800 lea %a2@(00000000,%d2:l),%a3 Heap_Block *const free_block = _Heap_Block_at( block, used_block_size ); uintptr_t free_block_size = block_size - used_block_size; 46da6: 9682 subl %d2,%d3 _Heap_Block_set_size( block, used_block_size ); /* Statistics */ stats->free_size += free_block_size; if ( _Heap_Is_used( next_block ) ) { 46da8: 7201 moveq #1,%d1 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46daa: c880 andl %d0,%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; 46dac: 70fe moveq #-2,%d0 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46dae: 8484 orl %d4,%d2 46db0: 2542 0004 movel %d2,%a2@(4) _HAssert( used_block_size + free_block_size == block_size ); _Heap_Block_set_size( block, used_block_size ); /* Statistics */ stats->free_size += free_block_size; 46db4: d7a9 0030 addl %d3,%a1@(48) - 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; 46db8: c0a8 0004 andl %a0@(4),%d0 if ( _Heap_Is_used( next_block ) ) { 46dbc: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46dc0: 6752 beqs 46e14 <_Heap_Block_split+0xc4> free_block_size += next_block_size; next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46dc2: 7001 moveq #1,%d0 if ( _Heap_Is_used( next_block ) ) { _Heap_Free_list_insert_after( free_list_anchor, free_block ); /* Statistics */ ++stats->free_blocks; 46dc4: 52a9 0038 addql #1,%a1@(56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 46dc8: 246c 0008 moveal %a4@(8),%a2 free_block_size += next_block_size; next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46dcc: 8083 orl %d3,%d0 new_block->next = next; 46dce: 274a 0008 movel %a2,%a3@(8) 46dd2: 2740 0004 movel %d0,%a3@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 46dd6: 70fe moveq #-2,%d0 new_block->prev = block_before; 46dd8: 274c 000c movel %a4,%a3@(12) 46ddc: c1a8 0004 andl %d0,%a0@(4) block_before->next = new_block; 46de0: 294b 0008 movel %a3,%a4@(8) next->prev = new_block; 46de4: 254b 000c movel %a3,%a2@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; 46de8: 2083 movel %d3,%a0@ next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; } } 46dea: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 46dee: 4e5e unlk %fp 46df0: 4e75 rts ) { uintptr_t remainder = value % alignment; if ( remainder != 0 ) { return value - remainder + alignment; 46df2: d480 addl %d0,%d2 46df4: 9481 subl %d1,%d2 Heap_Block *next_block = _Heap_Block_at( block, block_size ); _HAssert( used_size <= block_size + HEAP_BLOCK_SIZE_OFFSET ); _HAssert( used_size + free_size == block_size + HEAP_BLOCK_SIZE_OFFSET ); if ( free_size >= free_size_limit ) { 46df6: 2203 movel %d3,%d1 46df8: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46dfa: 41f2 3800 lea %a2@(00000000,%d3:l),%a0 46dfe: 9280 subl %d0,%d1 46e00: 588b addql #4,%a3 46e02: b7c1 cmpal %d1,%a3 46e04: 639a blss 46da0 <_Heap_Block_split+0x50> free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 46e06: 7001 moveq #1,%d0 } } 46e08: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 46e0c: 81a8 0004 orl %d0,%a0@(4) } } 46e10: 4e5e unlk %fp 46e12: 4e75 rts } else { uintptr_t const next_block_size = _Heap_Block_size( next_block ); _Heap_Free_list_replace( next_block, free_block ); free_block_size += next_block_size; 46e14: d680 addl %d0,%d3 next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46e16: 7001 moveq #1,%d0 Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 46e18: 2468 000c moveal %a0@(12),%a2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 46e1c: 2268 0008 moveal %a0@(8),%a1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46e20: 41f3 3800 lea %a3@(00000000,%d3:l),%a0 46e24: 8083 orl %d3,%d0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 46e26: 2749 0008 movel %a1,%a3@(8) new_block->prev = prev; 46e2a: 274a 000c movel %a2,%a3@(12) 46e2e: 2740 0004 movel %d0,%a3@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 46e32: 70fe moveq #-2,%d0 next->prev = new_block; prev->next = new_block; 46e34: 254b 0008 movel %a3,%a2@(8) 46e38: c1a8 0004 andl %d0,%a0@(4) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 46e3c: 234b 000c movel %a3,%a1@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; 46e40: 2083 movel %d3,%a0@ 46e42: 60a6 bras 46dea <_Heap_Block_split+0x9a> <== ALWAYS TAKEN 000503a8 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 503a8: 4e56 fff4 linkw %fp,#-12 503ac: 206e 0008 moveal %fp@(8),%a0 503b0: 202e 000c movel %fp@(12),%d0 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; 503b4: 2228 001c movel %a0@(28),%d1 uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 503b8: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 503bc: 48d7 040c moveml %d2-%d3/%a2,%sp@ Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 503c0: b0a8 0018 cmpl %a0@(24),%d0 503c4: 6410 bccs 503d6 <_Heap_Extend+0x2e> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 503c6: b280 cmpl %d0,%d1 503c8: 671c beqs 503e6 <_Heap_Extend+0x3e> 503ca: 7002 moveq #2,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 503cc: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 503d2: 4e5e unlk %fp 503d4: 4e75 rts * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 503d6: b280 cmpl %d0,%d1 503d8: 63ec blss 503c6 <_Heap_Extend+0x1e> 503da: 7001 moveq #1,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 503dc: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 503e2: 4e5e unlk %fp 503e4: 4e75 rts { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 503e6: 2200 movel %d0,%d1 503e8: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 503ec: 70f8 moveq #-8,%d0 503ee: 9089 subl %a1,%d0 503f0: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 503f2: 2600 movel %d0,%d3 503f4: 4c68 3002 0010 remul %a0@(16),%d2,%d3 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 503fa: 2141 001c movel %d1,%a0@(28) extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 503fe: 246e 0014 moveal %fp@(20),%a2 50402: 9082 subl %d2,%d0 50404: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 50406: b0a8 0014 cmpl %a0@(20),%d0 5040a: 640c bccs 50418 <_Heap_Extend+0x70> <== NEVER TAKEN /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 5040c: 4280 clrl %d0 <== NOT EXECUTED } return HEAP_EXTEND_SUCCESSFUL; } 5040e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50414: 4e5e unlk %fp 50416: 4e75 rts uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 50418: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5041a: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 5041e: c4a9 0004 andl %a1@(4),%d2 if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 50422: 2228 0020 movel %a0@(32),%d1 50426: 928a subl %a2,%d1 50428: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 5042a: 214a 0024 movel %a2,%a0@(36) 5042e: 2342 0004 movel %d2,%a1@(4) if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 50432: 7401 moveq #1,%d2 50434: 8481 orl %d1,%d2 50436: 2542 0004 movel %d2,%a2@(4) /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 5043a: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 5043e: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 50442: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 50446: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 5044a: 2f08 movel %a0,%sp@- 5044c: 4eb9 0004 b528 jsr 4b528 <_Heap_Free> 50452: 508f addql #8,%sp 50454: 4280 clrl %d0 50456: 60b6 bras 5040e <_Heap_Extend+0x66> <== ALWAYS TAKEN 0004b4a8 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4b4a8: 4e56 ffe4 linkw %fp,#-28 4b4ac: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4b4b0: 2040 moveal %d0,%a0 4b4b2: 5188 subql #8,%a0 4b4b4: 226e 0008 moveal %fp@(8),%a1 4b4b8: 4c69 0001 0010 remul %a1@(16),%d1,%d0 4b4be: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 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; 4b4c2: 2029 0020 movel %a1@(32),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4b4c6: 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 4b4c8: b088 cmpl %a0,%d0 4b4ca: 6200 00a0 bhiw 4b56c <_Heap_Free+0xc4> && (uintptr_t) block <= (uintptr_t) heap->last_block; 4b4ce: 2229 0024 movel %a1@(36),%d1 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 4b4d2: b288 cmpl %a0,%d1 4b4d4: 6500 0096 bcsw 4b56c <_Heap_Free+0xc4> <== ALWAYS 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; 4b4d8: 2628 0004 movel %a0@(4),%d3 4b4dc: 74fe moveq #-2,%d2 4b4de: c483 andl %d3,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4b4e0: 45f0 2800 lea %a0@(00000000,%d2:l),%a2 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 4b4e4: b5c0 cmpal %d0,%a2 4b4e6: 6500 0084 bcsw 4b56c <_Heap_Free+0xc4> <== ALWAYS TAKEN 4b4ea: b5c1 cmpal %d1,%a2 4b4ec: 627e bhis 4b56c <_Heap_Free+0xc4> <== ALWAYS 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; 4b4ee: 282a 0004 movel %a2@(4),%d4 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4b4f2: 7a01 moveq #1,%d5 4b4f4: ca84 andl %d4,%d5 4b4f6: 4a05 tstb %d5 4b4f8: 6772 beqs 4b56c <_Heap_Free+0xc4> <== ALWAYS 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; 4b4fa: 7afe moveq #-2,%d5 4b4fc: c885 andl %d5,%d4 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4b4fe: b5c1 cmpal %d1,%a2 4b500: 6700 00fa beqw 4b5fc <_Heap_Free+0x154> #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4b504: 7a01 moveq #1,%d5 4b506: 7c01 moveq #1,%d6 4b508: cab2 4804 andl %a2@(00000004,%d4:l),%d5 4b50c: bd85 eorl %d6,%d5 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 ) ) { 4b50e: 7c01 moveq #1,%d6 4b510: c686 andl %d6,%d3 4b512: 4a03 tstb %d3 4b514: 6660 bnes 4b576 <_Heap_Free+0xce> uintptr_t const prev_size = block->prev_size; 4b516: 2610 movel %a0@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4b518: 91c3 subal %d3,%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 4b51a: b1c0 cmpal %d0,%a0 4b51c: 654e bcss 4b56c <_Heap_Free+0xc4> <== ALWAYS TAKEN 4b51e: b1c1 cmpal %d1,%a0 4b520: 624a bhis 4b56c <_Heap_Free+0xc4> <== ALWAYS TAKEN 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) ) { 4b522: 7001 moveq #1,%d0 4b524: c0a8 0004 andl %a0@(4),%d0 4b528: 4a00 tstb %d0 4b52a: 6740 beqs 4b56c <_Heap_Free+0xc4> <== ALWAYS TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4b52c: 4a05 tstb %d5 4b52e: 6700 00d2 beqw 4b602 <_Heap_Free+0x15a> } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 4b532: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4b536: 53a9 0038 subql #1,%a1@(56) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4b53a: d882 addl %d2,%d4 4b53c: d684 addl %d4,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b53e: 7001 moveq #1,%d0 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4b540: 246a 0008 moveal %a2@(8),%a2 4b544: 8083 orl %d3,%d0 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4b546: 2183 3800 movel %d3,%a0@(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; 4b54a: 2140 0004 movel %d0,%a0@(4) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4b54e: 254b 000c movel %a3,%a2@(12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4b552: 274a 0008 movel %a2,%a3@(8) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b556: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4b55a: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4b55e: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4b562: 7001 moveq #1,%d0 return( true ); } 4b564: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 4b568: 4e5e unlk %fp 4b56a: 4e75 rts 4b56c: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4b570: 4200 clrb %d0 } 4b572: 4e5e unlk %fp 4b574: 4e75 rts uintptr_t const size = block_size + prev_size; 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 */ 4b576: 4a05 tstb %d5 4b578: 6736 beqs 4b5b0 <_Heap_Free+0x108> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 4b57a: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + next_block_size; 4b57e: d882 addl %d2,%d4 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b580: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4b582: 246a 0008 moveal %a2@(8),%a2 4b586: 8084 orl %d4,%d0 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4b588: 2184 4800 movel %d4,%a0@(00000000,%d4:l) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 4b58c: 214b 000c movel %a3,%a0@(12) ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4b590: 214a 0008 movel %a2,%a0@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b594: 2140 0004 movel %d0,%a0@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b598: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4b59c: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4b5a0: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4b5a4: 7001 moveq #1,%d0 new_block->prev = prev; next->prev = new_block; 4b5a6: 2548 000c movel %a0,%a2@(12) prev->next = new_block; 4b5aa: 2748 0008 movel %a0,%a3@(8) 4b5ae: 60b4 bras 4b564 <_Heap_Free+0xbc> <== ALWAYS TAKEN 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; 4b5b0: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b5b2: 7cfe moveq #-2,%d6 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; 4b5b4: 8a82 orl %d2,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4b5b6: 2669 0008 moveal %a1@(8),%a3 4b5ba: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b5be: cdaa 0004 andl %d6,%a2@(4) next_block->prev_size = block_size; 4b5c2: 2482 movel %d2,%a2@ /* Statistics */ ++stats->free_blocks; 4b5c4: 2029 0038 movel %a1@(56),%d0 4b5c8: 5280 addql #1,%d0 new_block->next = next; 4b5ca: 214b 0008 movel %a3,%a0@(8) new_block->prev = block_before; 4b5ce: 2149 000c movel %a1,%a0@(12) block_before->next = new_block; 4b5d2: 2348 0008 movel %a0,%a1@(8) next->prev = new_block; 4b5d6: 2748 000c movel %a0,%a3@(12) 4b5da: 2340 0038 movel %d0,%a1@(56) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4b5de: b0a9 003c cmpl %a1@(60),%d0 4b5e2: 6300 ff72 blsw 4b556 <_Heap_Free+0xae> } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b5e6: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4b5ea: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4b5ee: 52a9 0050 addql #1,%a1@(80) 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; 4b5f2: 2340 003c movel %d0,%a1@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b5f6: 7001 moveq #1,%d0 4b5f8: 6000 ff6a braw 4b564 <_Heap_Free+0xbc> <== ALWAYS TAKEN _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4b5fc: 4205 clrb %d5 4b5fe: 6000 ff0e braw 4b50e <_Heap_Free+0x66> <== ALWAYS TAKEN 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; 4b602: d682 addl %d2,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b604: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b606: 7cfe moveq #-2,%d6 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; 4b608: 8a83 orl %d3,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4b60a: 2483 movel %d3,%a2@ } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b60c: 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; 4b60e: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b612: cdaa 0004 andl %d6,%a2@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4b616: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4b61a: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4b61e: 52a9 0050 addql #1,%a1@(80) 4b622: 6000 ff40 braw 4b564 <_Heap_Free+0xbc> <== ALWAYS TAKEN ... 0006a668 <_Heap_Get_free_information>: void _Heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { 6a668: 4e56 fff0 linkw %fp,#-16 6a66c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 6a670: 246e 0008 moveal %fp@(8),%a2 6a674: 266e 000c moveal %fp@(12),%a3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6a678: 206a 0008 moveal %a2@(8),%a0 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 6a67c: 4293 clrl %a3@ info->largest = 0; 6a67e: 42ab 0004 clrl %a3@(4) info->total = 0; 6a682: 42ab 0008 clrl %a3@(8) for(the_block = _Heap_Free_list_first(the_heap); 6a686: b1ca cmpal %a2,%a0 6a688: 672a beqs 6a6b4 <_Heap_Get_free_information+0x4c> <== ALWAYS TAKEN 6a68a: 4282 clrl %d2 6a68c: 7201 moveq #1,%d1 6a68e: 93c9 subal %a1,%a1 - 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; 6a690: 70fe moveq #-2,%d0 the_block != tail; the_block = the_block->next) 6a692: 2601 movel %d1,%d3 6a694: 5281 addql #1,%d1 6a696: 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; 6a69a: d3c0 addal %d0,%a1 6a69c: b082 cmpl %d2,%d0 6a69e: 6302 blss 6a6a2 <_Heap_Get_free_information+0x3a> 6a6a0: 2400 movel %d0,%d2 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 6a6a2: 2068 0008 moveal %a0@(8),%a0 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 6a6a6: b1ca cmpal %a2,%a0 6a6a8: 66e6 bnes 6a690 <_Heap_Get_free_information+0x28> 6a6aa: 2742 0004 movel %d2,%a3@(4) 6a6ae: 2683 movel %d3,%a3@ 6a6b0: 2749 0008 movel %a1,%a3@(8) info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 6a6b4: 4cd7 0c0c moveml %sp@,%d2-%d3/%a2-%a3 6a6b8: 4e5e unlk %fp 6a6ba: 4e75 rts 0007ac48 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 7ac48: 4e56 fff4 linkw %fp,#-12 7ac4c: 206e 0008 moveal %fp@(8),%a0 7ac50: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7ac54: 246e 000c moveal %fp@(12),%a2 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 7ac58: 2428 0024 movel %a0@(36),%d2 void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 7ac5c: 2268 0020 moveal %a0@(32),%a1 Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; 7ac60: 4292 clrl %a2@ the_info->Free.total = 0; 7ac62: 42aa 0008 clrl %a2@(8) the_info->Free.largest = 0; 7ac66: 42aa 0004 clrl %a2@(4) the_info->Used.number = 0; 7ac6a: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 7ac6e: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 7ac72: 42aa 0010 clrl %a2@(16) while ( the_block != end ) { 7ac76: b489 cmpl %a1,%d2 7ac78: 6746 beqs 7acc0 <_Heap_Get_information+0x78> <== ALWAYS TAKEN uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; 7ac7a: 260a movel %a2,%d3 7ac7c: 0683 0000 000c addil #12,%d3 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7ac82: 2229 0004 movel %a1@(4),%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; 7ac86: 70fe moveq #-2,%d0 uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 7ac88: 204a moveal %a2,%a0 7ac8a: c081 andl %d1,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 7ac8c: d3c0 addal %d0,%a1 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; 7ac8e: 2229 0004 movel %a1@(4),%d1 7ac92: 0801 0000 btst #0,%d1 7ac96: 6702 beqs 7ac9a <_Heap_Get_information+0x52> 7ac98: 2043 moveal %d3,%a0 info = &the_info->Used; else info = &the_info->Free; info->number++; 7ac9a: 5290 addql #1,%a0@ info->total += the_size; 7ac9c: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 7aca0: b0a8 0004 cmpl %a0@(4),%d0 7aca4: 6304 blss 7acaa <_Heap_Get_information+0x62> info->largest = the_size; 7aca6: 2140 0004 movel %d0,%a0@(4) the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7acaa: b3c2 cmpal %d2,%a1 7acac: 66d8 bnes 7ac86 <_Heap_Get_information+0x3e> 7acae: 202a 0014 movel %a2@(20),%d0 7acb2: 5080 addql #8,%d0 /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7acb4: 2540 0014 movel %d0,%a2@(20) } 7acb8: 4cd7 040c moveml %sp@,%d2-%d3/%a2 7acbc: 4e5e unlk %fp 7acbe: 4e75 rts the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7acc0: 7008 moveq #8,%d0 <== NOT EXECUTED /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7acc2: 2540 0014 movel %d0,%a2@(20) <== NOT EXECUTED } 7acc6: 4cd7 040c moveml %sp@,%d2-%d3/%a2 <== NOT EXECUTED 7acca: 4e5e unlk %fp <== NOT EXECUTED 7accc: 4e75 rts <== NOT EXECUTED ... 00046c10 <_Heap_Initialize>: Heap_Control *heap, void *heap_area_begin_ptr, uintptr_t heap_area_size, uintptr_t page_size ) { 46c10: 4e56 ffe8 linkw %fp,#-24 46c14: 206e 0008 moveal %fp@(8),%a0 46c18: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 46c1c: 226e 000c moveal %fp@(12),%a1 46c20: 242e 0010 movel %fp@(16),%d2 46c24: 222e 0014 movel %fp@(20),%d1 uintptr_t min_block_size = 0; uintptr_t overhead = 0; Heap_Block *first_block = NULL; Heap_Block *last_block = NULL; if ( page_size == 0 ) { 46c28: 6600 00ce bnew 46cf8 <_Heap_Initialize+0xe8> ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; uintptr_t alloc_area_begin = heap_area_begin + HEAP_BLOCK_HEADER_SIZE; 46c2c: 2009 movel %a1,%d0 46c2e: 5080 addql #8,%d0 uintptr_t min_block_size = 0; uintptr_t overhead = 0; Heap_Block *first_block = NULL; Heap_Block *last_block = NULL; if ( page_size == 0 ) { 46c30: 123c 0004 moveb #4,%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46c34: 2a00 movel %d0,%d5 46c36: 7610 moveq #16,%d3 46c38: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46c3c: 4a84 tstl %d4 46c3e: 6704 beqs 46c44 <_Heap_Initialize+0x34> <== NEVER TAKEN return value - remainder + alignment; 46c40: d081 addl %d1,%d0 46c42: 9084 subl %d4,%d0 uintptr_t page_size ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; 46c44: 2809 movel %a1,%d4 46c46: d882 addl %d2,%d4 overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46c48: b889 cmpl %a1,%d4 46c4a: 6500 00bc bcsw 46d08 <_Heap_Initialize+0xf8> } min_block_size = _Heap_Align_up( sizeof( Heap_Block ), page_size ); alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); 46c4e: 2a00 movel %d0,%d5 46c50: 2440 moveal %d0,%a2 46c52: 9a89 subl %a1,%d5 46c54: 518a subql #8,%a2 first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46c56: ba82 cmpl %d2,%d5 46c58: 6400 00ae bccw 46d08 <_Heap_Initialize+0xf8> min_block_size = _Heap_Align_up( sizeof( Heap_Block ), page_size ); alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; 46c5c: 9485 subl %d5,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 46c5e: 2a02 movel %d2,%d5 46c60: 4c41 5000 remul %d1,%d0,%d5 46c64: 9480 subl %d0,%d2 first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46c66: b483 cmpl %d3,%d2 46c68: 6500 009e bcsw 46d08 <_Heap_Initialize+0xf8> } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46c6c: 7a01 moveq #1,%d5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46c6e: 47f2 2800 lea %a2@(00000000,%d2:l),%a3 alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; 46c72: 2002 movel %d2,%d0 46c74: 5180 subql #8,%d0 } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46c76: 8a82 orl %d2,%d5 return 0; } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; 46c78: 2481 movel %d1,%a2@ first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46c7a: 2545 0004 movel %d5,%a2@(4) * last block appears as used for the _Heap_Is_used() and _Heap_Is_free() * functions. */ last_block = _Heap_Block_at( first_block, first_block_size ); last_block->prev_size = first_block_size; last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; 46c7e: 2a0a movel %a2,%d5 46c80: 9a8b subl %a3,%d5 46c82: 2745 0004 movel %d5,%a3@(4) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46c86: 2a39 0005 d0f8 movel 5d0f8 ,%d5 * block indicates that the previous block is used, this ensures that the * last block appears as used for the _Heap_Is_used() and _Heap_Is_free() * functions. */ last_block = _Heap_Block_at( first_block, first_block_size ); last_block->prev_size = first_block_size; 46c8c: 2682 movel %d2,%a3@ last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; 46c8e: 2141 0010 movel %d1,%a0@(16) /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; stats->free_blocks = 1; 46c92: 7201 moveq #1,%d1 /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; first_block->next = _Heap_Free_list_tail( heap ); 46c94: 2548 0008 movel %a0,%a2@(8) first_block->prev = _Heap_Free_list_head( heap ); 46c98: 2548 000c movel %a0,%a2@(12) last_block->prev_size = first_block_size; last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; 46c9c: 2143 0014 movel %d3,%a0@(20) heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; 46ca0: 2144 001c movel %d4,%a0@(28) _Heap_Free_list_tail( heap )->prev = first_block; /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; 46ca4: 2142 0034 movel %d2,%a0@(52) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46ca8: 2145 0028 movel %d5,%a0@(40) 46cac: 5285 addql #1,%d5 heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; _Heap_Free_list_tail( heap )->prev = first_block; /* Statistics */ stats->size = first_block_size; 46cae: 2142 002c movel %d2,%a0@(44) stats->free_size = first_block_size; 46cb2: 2142 0030 movel %d2,%a0@(48) last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; 46cb6: 2149 0018 movel %a1,%a0@(24) /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; stats->free_blocks = 1; 46cba: 2141 0038 movel %d1,%a0@(56) stats->max_free_blocks = 1; 46cbe: 2141 003c movel %d1,%a0@(60) stats->used_blocks = 0; 46cc2: 42a8 0040 clrl %a0@(64) stats->max_search = 0; 46cc6: 42a8 0044 clrl %a0@(68) stats->allocs = 0; 46cca: 42a8 0048 clrl %a0@(72) stats->searches = 0; 46cce: 42a8 004c clrl %a0@(76) stats->frees = 0; 46cd2: 42a8 0050 clrl %a0@(80) stats->resizes = 0; 46cd6: 42a8 0054 clrl %a0@(84) heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; heap->last_block = last_block; 46cda: 214b 0024 movel %a3,%a0@(36) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46cde: 23c5 0005 d0f8 movel %d5,5d0f8 heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; _Heap_Free_list_tail( heap )->prev = first_block; 46ce4: 214a 000c movel %a2,%a0@(12) /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; 46ce8: 214a 0020 movel %a2,%a0@(32) heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; 46cec: 214a 0008 movel %a2,%a0@(8) _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; } 46cf0: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 46cf4: 4e5e unlk %fp 46cf6: 4e75 rts RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46cf8: 7003 moveq #3,%d0 46cfa: c081 andl %d1,%d0 if ( remainder != 0 ) { 46cfc: 6704 beqs 46d02 <_Heap_Initialize+0xf2> return value - remainder + alignment; 46cfe: 5881 addql #4,%d1 46d00: 9280 subl %d0,%d1 if ( page_size == 0 ) { page_size = CPU_ALIGNMENT; } else { page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT ); if ( page_size < CPU_ALIGNMENT ) { 46d02: 7003 moveq #3,%d0 46d04: b081 cmpl %d1,%d0 46d06: 650a bcss 46d12 <_Heap_Initialize+0x102> ); _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; 46d08: 4280 clrl %d0 } 46d0a: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 46d0e: 4e5e unlk %fp 46d10: 4e75 rts RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d12: 7610 moveq #16,%d3 46d14: 4c41 3000 remul %d1,%d0,%d3 if ( remainder != 0 ) { 46d18: 4a80 tstl %d0 46d1a: 671e beqs 46d3a <_Heap_Initialize+0x12a> return value - remainder + alignment; 46d1c: 2601 movel %d1,%d3 46d1e: 0683 0000 0010 addil #16,%d3 46d24: 9680 subl %d0,%d3 ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; uintptr_t alloc_area_begin = heap_area_begin + HEAP_BLOCK_HEADER_SIZE; 46d26: 2009 movel %a1,%d0 46d28: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d2a: 2a00 movel %d0,%d5 46d2c: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46d30: 4a84 tstl %d4 46d32: 6700 ff10 beqw 46c44 <_Heap_Initialize+0x34> <== ALWAYS TAKEN 46d36: 6000 ff08 braw 46c40 <_Heap_Initialize+0x30> <== ALWAYS TAKEN 46d3a: 2009 movel %a1,%d0 46d3c: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d3e: 2a00 movel %d0,%d5 if ( remainder != 0 ) { 46d40: 7610 moveq #16,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d42: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46d46: 4a84 tstl %d4 46d48: 6700 fefa beqw 46c44 <_Heap_Initialize+0x34> 46d4c: 6000 fef2 braw 46c40 <_Heap_Initialize+0x30> <== ALWAYS TAKEN 0005a75c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5a75c: 4e56 0000 linkw %fp,#0 5a760: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 5a764: 2040 moveal %d0,%a0 5a766: 5188 subql #8,%a0 5a768: 226e 0008 moveal %fp@(8),%a1 5a76c: 2f02 movel %d2,%sp@- 5a76e: 2400 movel %d0,%d2 5a770: 4c69 2001 0010 remul %a1@(16),%d1,%d2 5a776: 91c1 subal %d1,%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5a778: 2229 0020 movel %a1@(32),%d1 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 5a77c: b288 cmpl %a0,%d1 5a77e: 6238 bhis 5a7b8 <_Heap_Size_of_alloc_area+0x5c> && (uintptr_t) block <= (uintptr_t) heap->last_block; 5a780: 2269 0024 moveal %a1@(36),%a1 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 5a784: b3c8 cmpal %a0,%a1 5a786: 6530 bcss 5a7b8 <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5a788: 74fe moveq #-2,%d2 5a78a: c4a8 0004 andl %a0@(4),%d2 5a78e: d1c2 addal %d2,%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 5a790: b1c1 cmpal %d1,%a0 5a792: 6524 bcss 5a7b8 <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN 5a794: b1c9 cmpal %a1,%a0 5a796: 6220 bhis 5a7b8 <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5a798: 7201 moveq #1,%d1 5a79a: c2a8 0004 andl %a0@(4),%d1 5a79e: 4a01 tstb %d1 5a7a0: 6716 beqs 5a7b8 <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5a7a2: 7204 moveq #4,%d1 5a7a4: 9280 subl %d0,%d1 5a7a6: 2001 movel %d1,%d0 5a7a8: d088 addl %a0,%d0 5a7aa: 226e 0010 moveal %fp@(16),%a1 return true; } 5a7ae: 241f movel %sp@+,%d2 5a7b0: 4e5e unlk %fp || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5a7b2: 2280 movel %d0,%a1@ 5a7b4: 7001 moveq #1,%d0 return true; } 5a7b6: 4e75 rts 5a7b8: 241f movel %sp@+,%d2 5a7ba: 4e5e unlk %fp return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; 5a7bc: 4200 clrb %d0 } 5a7be: 4e75 rts 0004796c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4796c: 4e56 ffc8 linkw %fp,#-56 47970: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47974: 246e 0008 moveal %fp@(8),%a2 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47978: 4bfa 0496 lea %pc@(47e10 <_Heap_Walk_print>),%a5 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4797c: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 47980: 262a 0010 movel %a2@(16),%d3 uintptr_t const min_block_size = heap->min_block_size; 47984: 282a 0014 movel %a2@(20),%d4 Heap_Block *const last_block = heap->last_block; 47988: 2a2a 0024 movel %a2@(36),%d5 Heap_Block *block = heap->first_block; 4798c: 266a 0020 moveal %a2@(32),%a3 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47990: 4a2e 0013 tstb %fp@(19) 47994: 6604 bnes 4799a <_Heap_Walk+0x2e> 47996: 4bfa ffcc lea %pc@(47964 <_Heap_Walk_print_nothing>),%a5 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4799a: 7003 moveq #3,%d0 4799c: b0b9 0005 ffde cmpl 5ffde <_System_state_Current>,%d0 479a2: 670c beqs 479b0 <_Heap_Walk+0x44> block = next_block; } return true; } 479a4: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 479aa: 7001 moveq #1,%d0 block = next_block; } return true; } 479ac: 4e5e unlk %fp 479ae: 4e75 rts 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)( 479b0: 2f2a 000c movel %a2@(12),%sp@- 479b4: 2f2a 0008 movel %a2@(8),%sp@- 479b8: 2f05 movel %d5,%sp@- 479ba: 2f0b movel %a3,%sp@- 479bc: 2f2a 001c movel %a2@(28),%sp@- 479c0: 2f2a 0018 movel %a2@(24),%sp@- 479c4: 2f04 movel %d4,%sp@- 479c6: 2f03 movel %d3,%sp@- 479c8: 4879 0005 c3a4 pea 5c3a4 <_Status_Object_name_errors_to_status+0x14> 479ce: 42a7 clrl %sp@- 479d0: 2f02 movel %d2,%sp@- 479d2: 4e95 jsr %a5@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 479d4: 4fef 002c lea %sp@(44),%sp 479d8: 4a83 tstl %d3 479da: 6700 0154 beqw 47b30 <_Heap_Walk+0x1c4> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 479de: 7003 moveq #3,%d0 479e0: c083 andl %d3,%d0 479e2: 6600 016a bnew 47b4e <_Heap_Walk+0x1e2> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 479e6: 2204 movel %d4,%d1 479e8: 4c43 1000 remul %d3,%d0,%d1 479ec: 4a80 tstl %d0 479ee: 6600 0176 bnew 47b66 <_Heap_Walk+0x1fa> ); return false; } if ( 479f2: 200b movel %a3,%d0 479f4: 5080 addql #8,%d0 479f6: 4c43 0001 remul %d3,%d1,%d0 479fa: 4a81 tstl %d1 479fc: 6600 0180 bnew 47b7e <_Heap_Walk+0x212> 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; 47a00: 2c2b 0004 movel %a3@(4),%d6 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47a04: 7201 moveq #1,%d1 47a06: c286 andl %d6,%d1 47a08: 2d46 fff0 movel %d6,%fp@(-16) 47a0c: 4a01 tstb %d1 47a0e: 6700 0186 beqw 47b96 <_Heap_Walk+0x22a> ); return false; } if ( first_block->prev_size != page_size ) { 47a12: 2053 moveal %a3@,%a0 47a14: b1c3 cmpal %d3,%a0 47a16: 6600 00de bnew 47af6 <_Heap_Walk+0x18a> ); return false; } if ( _Heap_Is_free( last_block ) ) { 47a1a: 2045 moveal %d5,%a0 47a1c: 7cfe moveq #-2,%d6 47a1e: 7001 moveq #1,%d0 47a20: cca8 0004 andl %a0@(4),%d6 47a24: c0b0 6804 andl %a0@(00000004,%d6:l),%d0 47a28: 4a00 tstb %d0 47a2a: 6700 0180 beqw 47bac <_Heap_Walk+0x240> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 47a2e: 2c2a 0010 movel %a2@(16),%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47a32: 206a 0008 moveal %a2@(8),%a0 47a36: 2d46 fffc movel %d6,%fp@(-4) 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 ) { 47a3a: b1ca cmpal %a2,%a0 47a3c: 6700 0192 beqw 47bd0 <_Heap_Walk+0x264> 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; 47a40: 2e2a 0020 movel %a2@(32),%d7 47a44: 2d47 fff4 movel %d7,%fp@(-12) 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 47a48: b1c7 cmpal %d7,%a0 47a4a: 6500 00c4 bcsw 47b10 <_Heap_Walk+0x1a4> <== ALWAYS TAKEN && (uintptr_t) block <= (uintptr_t) heap->last_block; 47a4e: 286a 0024 moveal %a2@(36),%a4 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 47a52: b1cc cmpal %a4,%a0 47a54: 6200 00ba bhiw 47b10 <_Heap_Walk+0x1a4> <== ALWAYS TAKEN ); return false; } if ( 47a58: 2248 moveal %a0,%a1 47a5a: 5089 addql #8,%a1 47a5c: 2009 movel %a1,%d0 47a5e: 4c46 0007 remul %d6,%d7,%d0 47a62: 2d49 fff8 movel %a1,%fp@(-8) 47a66: 4a87 tstl %d7 47a68: 6600 0372 bnew 47ddc <_Heap_Walk+0x470> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_used( free_block ) ) { 47a6c: 7efe moveq #-2,%d7 47a6e: 7001 moveq #1,%d0 47a70: cea8 0004 andl %a0@(4),%d7 47a74: c0b0 7804 andl %a0@(00000004,%d7:l),%d0 47a78: 6600 037c bnew 47df6 <_Heap_Walk+0x48a> <== ALWAYS TAKEN ); return false; } if ( free_block->prev != prev_block ) { 47a7c: 2e28 000c movel %a0@(12),%d7 47a80: be8a cmpl %a2,%d7 47a82: 6650 bnes 47ad4 <_Heap_Walk+0x168> <== ALWAYS TAKEN 47a84: 202e fff0 movel %fp@(-16),%d0 47a88: 2241 moveal %d1,%a1 47a8a: 2c2e fff4 movel %fp@(-12),%d6 47a8e: 2d40 fff8 movel %d0,%fp@(-8) 47a92: 2d43 fff4 movel %d3,%fp@(-12) (*printer)( 47a96: 2008 movel %a0,%d0 return false; } prev_block = free_block; free_block = free_block->next; 47a98: 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 ) { 47a9c: b1ca cmpal %a2,%a0 47a9e: 6700 0122 beqw 47bc2 <_Heap_Walk+0x256> 47aa2: bc88 cmpl %a0,%d6 47aa4: 626a bhis 47b10 <_Heap_Walk+0x1a4> ); return false; } if ( 47aa6: 2e08 movel %a0,%d7 47aa8: 5087 addql #8,%d7 47aaa: b1cc cmpal %a4,%a0 47aac: 6262 bhis 47b10 <_Heap_Walk+0x1a4> <== ALWAYS TAKEN 47aae: 262e fffc movel %fp@(-4),%d3 47ab2: 4c43 7001 remul %d3,%d1,%d7 47ab6: 4a81 tstl %d1 47ab8: 6600 0322 bnew 47ddc <_Heap_Walk+0x470> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_used( free_block ) ) { 47abc: 72fe moveq #-2,%d1 47abe: 7e01 moveq #1,%d7 47ac0: c2a8 0004 andl %a0@(4),%d1 47ac4: ceb0 1804 andl %a0@(00000004,%d1:l),%d7 47ac8: 6600 032c bnew 47df6 <_Heap_Walk+0x48a> <== ALWAYS TAKEN ); return false; } if ( free_block->prev != prev_block ) { 47acc: 2e28 000c movel %a0@(12),%d7 47ad0: b087 cmpl %d7,%d0 47ad2: 67c2 beqs 47a96 <_Heap_Walk+0x12a> (*printer)( 47ad4: 2f07 movel %d7,%sp@- 47ad6: 2f08 movel %a0,%sp@- 47ad8: 4879 0005 c595 pea 5c595 <_Status_Object_name_errors_to_status+0x205> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47ade: 4878 0001 pea 1 47ae2: 2f02 movel %d2,%sp@- 47ae4: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47ae6: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47aea: 4200 clrb %d0 block = next_block; } return true; } 47aec: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47af2: 4e5e unlk %fp 47af4: 4e75 rts return false; } if ( first_block->prev_size != page_size ) { (*printer)( 47af6: 2f03 movel %d3,%sp@- 47af8: 2f08 movel %a0,%sp@- 47afa: 4879 0005 c4e9 pea 5c4e9 <_Status_Object_name_errors_to_status+0x159> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b00: 4878 0001 pea 1 47b04: 2f02 movel %d2,%sp@- 47b06: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47b08: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b0c: 4200 clrb %d0 47b0e: 60dc bras 47aec <_Heap_Walk+0x180> <== ALWAYS TAKEN 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)( 47b10: 2f08 movel %a0,%sp@- 47b12: 4879 0005 c529 pea 5c529 <_Status_Object_name_errors_to_status+0x199> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47b18: 4878 0001 pea 1 47b1c: 2f02 movel %d2,%sp@- 47b1e: 4e95 jsr %a5@ 47b20: 4fef 0010 lea %sp@(16),%sp 47b24: 4200 clrb %d0 block = next_block; } return true; } 47b26: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47b2c: 4e5e unlk %fp 47b2e: 4e75 rts first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 47b30: 4879 0005 c435 pea 5c435 <_Status_Object_name_errors_to_status+0xa5> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47b36: 4878 0001 pea 1 47b3a: 2f02 movel %d2,%sp@- 47b3c: 4e95 jsr %a5@ 47b3e: 4fef 000c lea %sp@(12),%sp 47b42: 4200 clrb %d0 block = next_block; } return true; } 47b44: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47b4a: 4e5e unlk %fp 47b4c: 4e75 rts return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 47b4e: 2f03 movel %d3,%sp@- 47b50: 4879 0005 c448 pea 5c448 <_Status_Object_name_errors_to_status+0xb8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47b56: 4878 0001 pea 1 47b5a: 2f02 movel %d2,%sp@- 47b5c: 4e95 jsr %a5@ 47b5e: 4fef 0010 lea %sp@(16),%sp 47b62: 4200 clrb %d0 47b64: 60c0 bras 47b26 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 47b66: 2f04 movel %d4,%sp@- 47b68: 4879 0005 c466 pea 5c466 <_Status_Object_name_errors_to_status+0xd6> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47b6e: 4878 0001 pea 1 47b72: 2f02 movel %d2,%sp@- 47b74: 4e95 jsr %a5@ 47b76: 4fef 0010 lea %sp@(16),%sp 47b7a: 4200 clrb %d0 47b7c: 60a8 bras 47b26 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47b7e: 2f0b movel %a3,%sp@- 47b80: 4879 0005 c48a pea 5c48a <_Status_Object_name_errors_to_status+0xfa> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47b86: 4878 0001 pea 1 47b8a: 2f02 movel %d2,%sp@- 47b8c: 4e95 jsr %a5@ 47b8e: 4fef 0010 lea %sp@(16),%sp 47b92: 4200 clrb %d0 47b94: 6090 bras 47b26 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47b96: 4879 0005 c4bb pea 5c4bb <_Status_Object_name_errors_to_status+0x12b> 47b9c: 4878 0001 pea 1 47ba0: 2f02 movel %d2,%sp@- 47ba2: 4e95 jsr %a5@ 47ba4: 4fef 000c lea %sp@(12),%sp 47ba8: 4200 clrb %d0 47baa: 6098 bras 47b44 <_Heap_Walk+0x1d8> <== ALWAYS TAKEN return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 47bac: 4879 0005 c514 pea 5c514 <_Status_Object_name_errors_to_status+0x184> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47bb2: 4878 0001 pea 1 47bb6: 2f02 movel %d2,%sp@- 47bb8: 4e95 jsr %a5@ 47bba: 4fef 000c lea %sp@(12),%sp 47bbe: 4200 clrb %d0 47bc0: 6082 bras 47b44 <_Heap_Walk+0x1d8> <== ALWAYS TAKEN 47bc2: 262e fff8 movel %fp@(-8),%d3 47bc6: 2209 movel %a1,%d1 47bc8: 2d43 fff0 movel %d3,%fp@(-16) 47bcc: 262e fff4 movel %fp@(-12),%d3 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47bd0: b7c5 cmpal %d5,%a3 47bd2: 6700 fdd0 beqw 479a4 <_Heap_Walk+0x38> <== ALWAYS TAKEN 47bd6: 2c2e fff0 movel %fp@(-16),%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; 47bda: 7efe moveq #-2,%d7 47bdc: cc87 andl %d7,%d6 47bde: 2d43 fff8 movel %d3,%fp@(-8) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47be2: 49f3 6800 lea %a3@(00000000,%d6:l),%a4 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 47be6: 4a01 tstb %d1 47be8: 6700 0126 beqw 47d10 <_Heap_Walk+0x3a4> <== ALWAYS TAKEN (*printer)( 47bec: 2f06 movel %d6,%sp@- 47bee: 2f0b movel %a3,%sp@- 47bf0: 4879 0005 c5c7 pea 5c5c7 <_Status_Object_name_errors_to_status+0x237> 47bf6: 42a7 clrl %sp@- 47bf8: 2f02 movel %d2,%sp@- 47bfa: 4e95 jsr %a5@ 47bfc: 4fef 0014 lea %sp@(20),%sp 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 47c00: b9ea 0020 cmpal %a2@(32),%a4 47c04: 6500 00d0 bcsw 47cd6 <_Heap_Walk+0x36a> <== ALWAYS TAKEN 47c08: b9ea 0024 cmpal %a2@(36),%a4 47c0c: 6200 00c8 bhiw 47cd6 <_Heap_Walk+0x36a> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 47c10: 262e fff8 movel %fp@(-8),%d3 47c14: 2206 movel %d6,%d1 47c16: 4c43 1000 remul %d3,%d0,%d1 47c1a: 4a80 tstl %d0 47c1c: 6600 0162 bnew 47d80 <_Heap_Walk+0x414> ); return false; } if ( block_size < min_block_size ) { 47c20: bc84 cmpl %d4,%d6 47c22: 6500 0178 bcsw 47d9c <_Heap_Walk+0x430> ); return false; } if ( next_block_begin <= block_begin ) { 47c26: b9cb cmpal %a3,%a4 47c28: 6300 0196 blsw 47dc0 <_Heap_Walk+0x454> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 47c2c: 7001 moveq #1,%d0 47c2e: c0ac 0004 andl %a4@(4),%d0 47c32: 4a00 tstb %d0 47c34: 6600 00bc bnew 47cf2 <_Heap_Walk+0x386> 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; 47c38: 262b 0004 movel %a3@(4),%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47c3c: 7cfe moveq #-2,%d6 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47c3e: 43f9 0005 c6bd lea 5c6bd <_Status_Object_name_errors_to_status+0x32d>,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47c44: 2e2a 0008 movel %a2@(8),%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; 47c48: cc83 andl %d3,%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47c4a: 2d47 fffc movel %d7,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47c4e: 2e0b movel %a3,%d7 47c50: de86 addl %d6,%d7 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)( 47c52: 222b 0008 movel %a3@(8),%d1 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47c56: b2aa 000c cmpl %a2@(12),%d1 47c5a: 6710 beqs 47c6c <_Heap_Walk+0x300> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 47c5c: 43f9 0005 c6c7 lea 5c6c7 <_Status_Object_name_errors_to_status+0x337>,%a1 47c62: b5c1 cmpal %d1,%a2 47c64: 6706 beqs 47c6c <_Heap_Walk+0x300> 47c66: 43f9 0005 c302 lea 5c302 ,%a1 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)( 47c6c: 202b 000c movel %a3@(12),%d0 47c70: 41f9 0005 c6d1 lea 5c6d1 <_Status_Object_name_errors_to_status+0x341>,%a0 47c76: b0ae fffc cmpl %fp@(-4),%d0 47c7a: 6710 beqs 47c8c <_Heap_Walk+0x320> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 47c7c: 41f9 0005 c6dc lea 5c6dc <_Status_Object_name_errors_to_status+0x34c>,%a0 47c82: b5c0 cmpal %d0,%a2 47c84: 6706 beqs 47c8c <_Heap_Walk+0x320> 47c86: 41f9 0005 c302 lea 5c302 ,%a0 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 47c8c: 2f09 movel %a1,%sp@- 47c8e: 2f01 movel %d1,%sp@- 47c90: 2f08 movel %a0,%sp@- 47c92: 2f00 movel %d0,%sp@- 47c94: 2f0b movel %a3,%sp@- 47c96: 4879 0005 c6e6 pea 5c6e6 <_Status_Object_name_errors_to_status+0x356> 47c9c: 42a7 clrl %sp@- 47c9e: 2f02 movel %d2,%sp@- 47ca0: 4e95 jsr %a5@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 47ca2: 4fef 0020 lea %sp@(32),%sp 47ca6: 2047 moveal %d7,%a0 47ca8: 2010 movel %a0@,%d0 47caa: b086 cmpl %d6,%d0 47cac: 6700 0082 beqw 47d30 <_Heap_Walk+0x3c4> (*printer)( 47cb0: 2f07 movel %d7,%sp@- 47cb2: 2f00 movel %d0,%sp@- 47cb4: 2f06 movel %d6,%sp@- 47cb6: 2f0b movel %a3,%sp@- 47cb8: 4879 0005 c712 pea 5c712 <_Status_Object_name_errors_to_status+0x382> 47cbe: 4878 0001 pea 1 47cc2: 2f02 movel %d2,%sp@- 47cc4: 4e95 jsr %a5@ 47cc6: 4fef 001c lea %sp@(28),%sp block = next_block; } return true; } 47cca: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 47cd0: 4200 clrb %d0 block = next_block; } return true; } 47cd2: 4e5e unlk %fp 47cd4: 4e75 rts block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 47cd6: 2f0c movel %a4,%sp@- 47cd8: 2f0b movel %a3,%sp@- 47cda: 4879 0005 c603 pea 5c603 <_Status_Object_name_errors_to_status+0x273> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47ce0: 4878 0001 pea 1 47ce4: 2f02 movel %d2,%sp@- 47ce6: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47ce8: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47cec: 4200 clrb %d0 47cee: 6000 fdfc braw 47aec <_Heap_Walk+0x180> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47cf2: b9c5 cmpal %d5,%a4 47cf4: 6700 fcae beqw 479a4 <_Heap_Walk+0x38> <== ALWAYS TAKEN 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 ) { 47cf8: 2c2c 0004 movel %a4@(4),%d6 47cfc: 7201 moveq #1,%d1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47cfe: 7efe moveq #-2,%d7 47d00: 264c moveal %a4,%a3 47d02: c286 andl %d6,%d1 47d04: cc87 andl %d7,%d6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47d06: 49f3 6800 lea %a3@(00000000,%d6:l),%a4 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 47d0a: 4a01 tstb %d1 47d0c: 6600 fede bnew 47bec <_Heap_Walk+0x280> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 47d10: 2f13 movel %a3@,%sp@- 47d12: 2f06 movel %d6,%sp@- 47d14: 2f0b movel %a3,%sp@- 47d16: 4879 0005 c5de pea 5c5de <_Status_Object_name_errors_to_status+0x24e> 47d1c: 42a7 clrl %sp@- 47d1e: 2f02 movel %d2,%sp@- 47d20: 4e95 jsr %a5@ 47d22: 4fef 0018 lea %sp@(24),%sp 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 47d26: b9ea 0020 cmpal %a2@(32),%a4 47d2a: 65aa bcss 47cd6 <_Heap_Walk+0x36a> <== ALWAYS TAKEN 47d2c: 6000 feda braw 47c08 <_Heap_Walk+0x29c> <== ALWAYS TAKEN ); return false; } if ( !prev_used ) { 47d30: 7001 moveq #1,%d0 47d32: c680 andl %d0,%d3 47d34: 4a03 tstb %d3 47d36: 672e beqs 47d66 <_Heap_Walk+0x3fa> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47d38: 206a 0008 moveal %a2@(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 ) { 47d3c: b5c8 cmpal %a0,%a2 47d3e: 670c beqs 47d4c <_Heap_Walk+0x3e0> <== ALWAYS TAKEN if ( free_block == block ) { 47d40: b7c8 cmpal %a0,%a3 47d42: 67ae beqs 47cf2 <_Heap_Walk+0x386> return true; } free_block = free_block->next; 47d44: 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 ) { 47d48: b5c8 cmpal %a0,%a2 47d4a: 66f4 bnes 47d40 <_Heap_Walk+0x3d4> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47d4c: 2f0b movel %a3,%sp@- 47d4e: 4879 0005 c77a pea 5c77a <_Status_Object_name_errors_to_status+0x3ea> 47d54: 4878 0001 pea 1 47d58: 2f02 movel %d2,%sp@- 47d5a: 4e95 jsr %a5@ 47d5c: 4fef 0010 lea %sp@(16),%sp 47d60: 4200 clrb %d0 47d62: 6000 fdc2 braw 47b26 <_Heap_Walk+0x1ba> return false; } if ( !prev_used ) { (*printer)( 47d66: 2f0b movel %a3,%sp@- 47d68: 4879 0005 c74b pea 5c74b <_Status_Object_name_errors_to_status+0x3bb> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47d6e: 4878 0001 pea 1 47d72: 2f02 movel %d2,%sp@- 47d74: 4e95 jsr %a5@ 47d76: 4fef 0010 lea %sp@(16),%sp 47d7a: 4200 clrb %d0 47d7c: 6000 fda8 braw 47b26 <_Heap_Walk+0x1ba> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 47d80: 2f06 movel %d6,%sp@- 47d82: 2f0b movel %a3,%sp@- 47d84: 4879 0005 c630 pea 5c630 <_Status_Object_name_errors_to_status+0x2a0> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47d8a: 4878 0001 pea 1 47d8e: 2f02 movel %d2,%sp@- 47d90: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47d92: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47d96: 4200 clrb %d0 47d98: 6000 fd52 braw 47aec <_Heap_Walk+0x180> return false; } if ( block_size < min_block_size ) { (*printer)( 47d9c: 2f04 movel %d4,%sp@- 47d9e: 2f06 movel %d6,%sp@- 47da0: 2f0b movel %a3,%sp@- 47da2: 4879 0005 c65e pea 5c65e <_Status_Object_name_errors_to_status+0x2ce> 47da8: 4878 0001 pea 1 47dac: 2f02 movel %d2,%sp@- 47dae: 4e95 jsr %a5@ block, block_size, min_block_size ); return false; 47db0: 4fef 0018 lea %sp@(24),%sp block = next_block; } return true; } 47db4: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 return false; } if ( block_size < min_block_size ) { (*printer)( 47dba: 4200 clrb %d0 block = next_block; } return true; } 47dbc: 4e5e unlk %fp 47dbe: 4e75 rts return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47dc0: 2f0c movel %a4,%sp@- 47dc2: 2f0b movel %a3,%sp@- 47dc4: 4879 0005 c689 pea 5c689 <_Status_Object_name_errors_to_status+0x2f9> 47dca: 4878 0001 pea 1 47dce: 2f02 movel %d2,%sp@- 47dd0: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47dd2: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47dd6: 4200 clrb %d0 47dd8: 6000 fd12 braw 47aec <_Heap_Walk+0x180> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47ddc: 2f08 movel %a0,%sp@- 47dde: 4879 0005 c549 pea 5c549 <_Status_Object_name_errors_to_status+0x1b9> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47de4: 4878 0001 pea 1 47de8: 2f02 movel %d2,%sp@- 47dea: 4e95 jsr %a5@ 47dec: 4fef 0010 lea %sp@(16),%sp 47df0: 4200 clrb %d0 47df2: 6000 fd32 braw 47b26 <_Heap_Walk+0x1ba> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 47df6: 2f08 movel %a0,%sp@- 47df8: 4879 0005 c579 pea 5c579 <_Status_Object_name_errors_to_status+0x1e9> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47dfe: 4878 0001 pea 1 47e02: 2f02 movel %d2,%sp@- 47e04: 4e95 jsr %a5@ 47e06: 4fef 0010 lea %sp@(16),%sp 47e0a: 4200 clrb %d0 47e0c: 6000 fd18 braw 47b26 <_Heap_Walk+0x1ba> 00046470 <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 46470: 4e56 0000 linkw %fp,#0 46474: 2f0a movel %a2,%sp@- 46476: 2f02 movel %d2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 46478: 4ab9 0005 db6e tstl 5db6e <_IO_Number_of_drivers> 4647e: 671e beqs 4649e <_IO_Initialize_all_drivers+0x2e> <== ALWAYS TAKEN 46480: 4282 clrl %d2 46482: 45f9 0004 af90 lea 4af90 ,%a2 (void) rtems_io_initialize( major, 0, NULL ); 46488: 42a7 clrl %sp@- 4648a: 42a7 clrl %sp@- 4648c: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 4648e: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 46490: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 46492: 4fef 000c lea %sp@(12),%sp 46496: b4b9 0005 db6e cmpl 5db6e <_IO_Number_of_drivers>,%d2 4649c: 65ea bcss 46488 <_IO_Initialize_all_drivers+0x18> (void) rtems_io_initialize( major, 0, NULL ); } 4649e: 242e fff8 movel %fp@(-8),%d2 464a2: 246e fffc moveal %fp@(-4),%a2 464a6: 4e5e unlk %fp 464a8: 4e75 rts 000464aa <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 464aa: 4e56 fff0 linkw %fp,#-16 464ae: 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 = Configuration.Device_driver_table; 464b2: 2639 0005 c256 movel 5c256 ,%d3 drivers_in_table = Configuration.number_of_device_drivers; 464b8: 2439 0005 c252 movel 5c252 ,%d2 number_of_drivers = Configuration.maximum_drivers; 464be: 2839 0005 c24e movel 5c24e ,%d4 /* * 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 ) 464c4: b882 cmpl %d2,%d4 464c6: 6216 bhis 464de <_IO_Manager_initialization+0x34> * 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; 464c8: 23c3 0005 db72 movel %d3,5db72 <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 464ce: 23c2 0005 db6e movel %d2,5db6e <_IO_Number_of_drivers> ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 464d4: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 464da: 4e5e unlk %fp 464dc: 4e75 rts /* * 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 *) 464de: 2004 movel %d4,%d0 464e0: 2a04 movel %d4,%d5 464e2: e788 lsll #3,%d0 464e4: eb8d lsll #5,%d5 464e6: 9a80 subl %d0,%d5 464e8: 2f05 movel %d5,%sp@- 464ea: 4eb9 0004 907c jsr 4907c <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 464f0: 2f05 movel %d5,%sp@- 464f2: 42a7 clrl %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; 464f4: 23c4 0005 db6e movel %d4,5db6e <_IO_Number_of_drivers> memset( 464fa: 2f00 movel %d0,%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 *) 464fc: 23c0 0005 db72 movel %d0,5db72 <_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( 46502: 4eb9 0004 e098 jsr 4e098 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46508: 4fef 0010 lea %sp@(16),%sp 4650c: 4a82 tstl %d2 4650e: 67c4 beqs 464d4 <_IO_Manager_initialization+0x2a> <== ALWAYS TAKEN 46510: 2839 0005 db72 movel 5db72 <_IO_Driver_address_table>,%d4 46516: 4280 clrl %d0 46518: 4281 clrl %d1 _IO_Driver_address_table[index] = driver_table[index]; 4651a: 2243 moveal %d3,%a1 4651c: 2044 moveal %d4,%a0 4651e: d3c0 addal %d0,%a1 46520: d1c0 addal %d0,%a0 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46522: 5281 addql #1,%d1 46524: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 4652a: 20d9 movel %a1@+,%a0@+ 4652c: 20d9 movel %a1@+,%a0@+ 4652e: 20d9 movel %a1@+,%a0@+ 46530: 20d9 movel %a1@+,%a0@+ 46532: 20d9 movel %a1@+,%a0@+ 46534: 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++ ) 46536: b282 cmpl %d2,%d1 46538: 649a bccs 464d4 <_IO_Manager_initialization+0x2a> _IO_Driver_address_table[index] = driver_table[index]; 4653a: 2243 moveal %d3,%a1 4653c: 2044 moveal %d4,%a0 4653e: d3c0 addal %d0,%a1 46540: d1c0 addal %d0,%a0 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46542: 5281 addql #1,%d1 46544: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 4654a: 20d9 movel %a1@+,%a0@+ 4654c: 20d9 movel %a1@+,%a0@+ 4654e: 20d9 movel %a1@+,%a0@+ 46550: 20d9 movel %a1@+,%a0@+ 46552: 20d9 movel %a1@+,%a0@+ 46554: 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++ ) 46556: b282 cmpl %d2,%d1 46558: 65c0 bcss 4651a <_IO_Manager_initialization+0x70> <== ALWAYS TAKEN 4655a: 6000 ff78 braw 464d4 <_IO_Manager_initialization+0x2a> <== ALWAYS TAKEN ... 00046f7c <_Internal_error_Occurred>: _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46f7c: 4280 clrl %d0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46f7e: 4e56 0000 linkw %fp,#0 46f82: 222e 000c movel %fp@(12),%d1 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46f86: 1001 moveb %d1,%d0 46f88: 2040 moveal %d0,%a0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46f8a: 2f03 movel %d3,%sp@- 46f8c: 202e 0008 movel %fp@(8),%d0 46f90: 2f02 movel %d2,%sp@- 46f92: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46f96: 2f02 movel %d2,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46f98: 13c1 0005 d9fe moveb %d1,5d9fe <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46f9e: 2f08 movel %a0,%sp@- bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46fa0: 23c0 0005 d9fa movel %d0,5d9fa <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46fa6: 2f00 movel %d0,%sp@- ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46fa8: 23c2 0005 da00 movel %d2,5da00 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 46fae: 4eb9 0004 8cae jsr 48cae <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46fb4: 307c 0700 moveaw #1792,%a0 46fb8: 2608 movel %a0,%d3 46fba: 40c0 movew %sr,%d0 46fbc: 8083 orl %d3,%d0 46fbe: 46c0 movew %d0,%sr 46fc0: 2002 movel %d2,%d0 <== NOT EXECUTED 46fc2: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 46fc8: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46fca: 7005 moveq #5,%d0 46fcc: 4fef 000c lea %sp@(12),%sp 46fd0: 23c0 0005 dad6 movel %d0,5dad6 <_System_state_Current> 46fd6: 60fe bras 46fd6 <_Internal_error_Occurred+0x5a> <== ALWAYS TAKEN 00047040 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 47040: 4e56 fff0 linkw %fp,#-16 47044: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 47048: 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 ) 4704c: 4aaa 0014 tstl %a2@(20) 47050: 660c bnes 4705e <_Objects_Allocate+0x1e> <== NEVER TAKEN 47052: 4280 clrl %d0 <== NOT EXECUTED information->inactive--; } } return the_object; } 47054: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4705a: 4e5e unlk %fp 4705c: 4e75 rts /* * 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 ); 4705e: 240a movel %a2,%d2 47060: 0682 0000 001c addil #28,%d2 47066: 47f9 0004 b014 lea 4b014 <_Chain_Get>,%a3 4706c: 2f02 movel %d2,%sp@- 4706e: 4e93 jsr %a3@ if ( information->auto_extend ) { 47070: 588f addql #4,%sp 47072: 4a2a 0010 tstb %a2@(16) 47076: 67dc beqs 47054 <_Objects_Allocate+0x14> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 47078: 4a80 tstl %d0 4707a: 6738 beqs 470b4 <_Objects_Allocate+0x74> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4707c: 2040 moveal %d0,%a0 4707e: 4281 clrl %d1 47080: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47082: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47084: 362a 0008 movew %a2@(8),%d3 47088: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 4708c: 306a 0028 moveaw %a2@(40),%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47090: 342a 0012 movew %a2@(18),%d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47094: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 47096: 5388 subql #1,%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47098: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 4709c: 3548 0028 movew %a0,%a2@(40) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470a0: 206a 002a moveal %a2@(42),%a0 470a4: e589 lsll #2,%d1 information->inactive--; } } return the_object; } 470a6: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 470ac: 4e5e unlk %fp block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470ae: d1c1 addal %d1,%a0 470b0: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 470b2: 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 ); 470b4: 2f0a movel %a2,%sp@- 470b6: 4eb9 0004 70fc jsr 470fc <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 470bc: 2f02 movel %d2,%sp@- 470be: 4e93 jsr %a3@ } if ( the_object ) { 470c0: 508f addql #8,%sp 470c2: 4a80 tstl %d0 470c4: 66b6 bnes 4707c <_Objects_Allocate+0x3c> information->inactive--; } } return the_object; } 470c6: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 470cc: 4e5e unlk %fp 470ce: 4e75 rts 000470fc <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 470fc: 4e56 ffcc linkw %fp,#-52 47100: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47104: 246e 0008 moveal %fp@(8),%a2 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 47108: 4285 clrl %d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4710a: 206a 002e moveal %a2@(46),%a0 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 4710e: 3a2a 0008 movew %a2@(8),%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 47112: 4a88 tstl %a0 47114: 6700 022c beqw 47342 <_Objects_Extend_information+0x246> block_count = 0; else { block_count = information->maximum / information->allocation_size; 47118: 322a 000e movew %a2@(14),%d1 4711c: 302a 0012 movew %a2@(18),%d0 47120: 3801 movew %d1,%d4 47122: 0284 0000 ffff andil #65535,%d4 47128: 88c0 divuw %d0,%d4 4712a: 0284 0000 ffff andil #65535,%d4 for ( ; block < block_count; block++ ) { 47130: 6700 0224 beqw 47356 <_Objects_Extend_information+0x25a> <== ALWAYS TAKEN if ( information->object_blocks[ block ] == NULL ) 47134: 4a90 tstl %a0@ 47136: 6700 021e beqw 47356 <_Objects_Extend_information+0x25a> <== ALWAYS TAKEN 4713a: 5888 addql #4,%a0 4713c: 2605 movel %d5,%d3 4713e: 4282 clrl %d2 47140: 0280 0000 ffff andil #65535,%d0 break; else index_base += information->allocation_size; 47146: 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++ ) { 47148: 5282 addql #1,%d2 4714a: b484 cmpl %d4,%d2 4714c: 6404 bccs 47152 <_Objects_Extend_information+0x56> if ( information->object_blocks[ block ] == NULL ) 4714e: 4a98 tstl %a0@+ 47150: 66f4 bnes 47146 <_Objects_Extend_information+0x4a> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 47152: 0281 0000 ffff andil #65535,%d1 47158: 2641 moveal %d1,%a3 4715a: d7c0 addal %d0,%a3 /* * 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 ) { 4715c: b7fc 0000 ffff cmpal #65535,%a3 47162: 6200 0186 bhiw 472ea <_Objects_Extend_information+0x1ee> <== ALWAYS TAKEN /* * 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; 47166: 41ea 0014 lea %a2@(20),%a0 4716a: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 4716e: 4a2a 0010 tstb %a2@(16) 47172: 6700 0180 beqw 472f4 <_Objects_Extend_information+0x1f8> new_object_block = _Workspace_Allocate( block_size ); 47176: 2f00 movel %d0,%sp@- 47178: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> if ( !new_object_block ) 4717e: 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 ); 47180: 2c00 movel %d0,%d6 if ( !new_object_block ) 47182: 6700 0166 beqw 472ea <_Objects_Extend_information+0x1ee> <== ALWAYS TAKEN } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 47186: 4280 clrl %d0 47188: 302a 000e movew %a2@(14),%d0 4718c: b083 cmpl %d3,%d0 4718e: 6200 00c4 bhiw 47254 <_Objects_Extend_information+0x158> */ /* * Up the block count and maximum */ block_count++; 47192: 2a44 moveal %d4,%a5 47194: 528d addql #1,%a5 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 47196: 200b movel %a3,%d0 47198: 41f5 da00 lea %a5@(00000000,%a5:l:2),%a0 4719c: d088 addl %a0,%d0 4719e: d085 addl %d5,%d0 471a0: e588 lsll #2,%d0 471a2: 2f00 movel %d0,%sp@- 471a4: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> if ( !object_blocks ) { 471aa: 588f addql #4,%sp * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 471ac: 2840 moveal %d0,%a4 if ( !object_blocks ) { 471ae: 4a80 tstl %d0 471b0: 6700 01b2 beqw 47364 <_Objects_Extend_information+0x268> <== ALWAYS TAKEN } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 471b4: 2e0d movel %a5,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 471b6: 4280 clrl %d0 } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 471b8: e58f lsll #2,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 471ba: 302a 000e movew %a2@(14),%d0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 471be: 4bf4 7800 lea %a4@(00000000,%d7:l),%a5 471c2: de8d addl %a5,%d7 471c4: b085 cmpl %d5,%d0 471c6: 6200 013c bhiw 47304 <_Objects_Extend_information+0x208> <== ALWAYS TAKEN } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 471ca: 4a85 tstl %d5 471cc: 670c beqs 471da <_Objects_Extend_information+0xde> <== ALWAYS TAKEN information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 471ce: 2047 moveal %d7,%a0 471d0: 4280 clrl %d0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 471d2: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 471d4: 5280 addql #1,%d0 471d6: b085 cmpl %d5,%d0 471d8: 65f8 bcss 471d2 <_Objects_Extend_information+0xd6> <== ALWAYS TAKEN 471da: 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 ); 471dc: 4281 clrl %d1 471de: 322a 0012 movew %a2@(18),%d1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 471e2: 42b5 4800 clrl %a5@(00000000,%d4:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 471e6: d283 addl %d3,%d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 471e8: 42b4 4800 clrl %a4@(00000000,%d4:l) inactive_per_block[block_count] = 0; for ( index=index_base ; 471ec: b283 cmpl %d3,%d1 471ee: 6310 blss 47200 <_Objects_Extend_information+0x104> <== ALWAYS TAKEN 471f0: 2247 moveal %d7,%a1 471f2: 2003 movel %d3,%d0 471f4: 41f1 3c00 lea %a1@(00000000,%d3:l:4),%a0 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 471f8: 4298 clrl %a0@+ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 471fa: 5280 addql #1,%d0 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 471fc: b280 cmpl %d0,%d1 471fe: 62f8 bhis 471f8 <_Objects_Extend_information+0xfc> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 47200: 203c 0000 0700 movel #1792,%d0 47206: 40c4 movew %sr,%d4 47208: 8084 orl %d4,%d0 4720a: 46c0 movew %d0,%sr 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( 4720c: 2012 movel %a2@,%d0 4720e: 7218 moveq #24,%d1 47210: 4285 clrl %d5 47212: e3a8 lsll %d1,%d0 47214: 3a0b movew %a3,%d5 47216: 4281 clrl %d1 47218: 2245 moveal %d5,%a1 4721a: 7a1b moveq #27,%d5 4721c: 322a 0004 movew %a2@(4),%d1 47220: 08c0 0010 bset #16,%d0 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 47224: 206a 002e moveal %a2@(46),%a0 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( 47228: eba9 lsll %d5,%d1 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 4722a: 354b 000e movew %a3,%a2@(14) _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 4722e: 254c 002e movel %a4,%a2@(46) information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47232: 8081 orl %d1,%d0 47234: 2209 movel %a1,%d1 47236: 8280 orl %d0,%d1 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 47238: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 4723c: 2541 000a movel %d1,%a2@(10) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 47240: 2547 0018 movel %d7,%a2@(24) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 47244: 46c4 movew %d4,%sr if ( old_tables ) 47246: 4a88 tstl %a0 47248: 670a beqs 47254 <_Objects_Extend_information+0x158> _Workspace_Free( old_tables ); 4724a: 2f08 movel %a0,%sp@- 4724c: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47252: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 47254: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 47258: 4280 clrl %d0 4725a: 280e movel %fp,%d4 4725c: 0684 ffff fff4 addil #-12,%d4 47262: 47f9 0004 b014 lea 4b014 <_Chain_Get>,%a3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 47268: 2a0a movel %a2,%d5 4726a: 0685 0000 001c addil #28,%d5 47270: 49f9 0004 6748 lea 46748 <_Chain_Append>,%a4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 47276: e58a lsll #2,%d2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 47278: 302a 0012 movew %a2@(18),%d0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 4727c: 2186 2800 movel %d6,%a0@(00000000,%d2:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 47280: 2f2a 0014 movel %a2@(20),%sp@- 47284: 2f00 movel %d0,%sp@- 47286: 2f06 movel %d6,%sp@- 47288: 2f04 movel %d4,%sp@- 4728a: 4eb9 0004 b050 jsr 4b050 <_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 ) { 47290: 4fef 0010 lea %sp@(16),%sp 47294: 2f04 movel %d4,%sp@- 47296: 4e93 jsr %a3@ 47298: 588f addql #4,%sp 4729a: 4a80 tstl %d0 4729c: 6732 beqs 472d0 <_Objects_Extend_information+0x1d4> <== ALWAYS TAKEN the_object->id = _Objects_Build_id( 4729e: 2212 movel %a2@,%d1 472a0: 7c18 moveq #24,%d6 472a2: 7e1b moveq #27,%d7 472a4: 2040 moveal %d0,%a0 472a6: eda9 lsll %d6,%d1 472a8: 4286 clrl %d6 472aa: 3c2a 0004 movew %a2@(4),%d6 472ae: 08c1 0010 bset #16,%d1 472b2: efae lsll %d7,%d6 472b4: 8286 orl %d6,%d1 472b6: 8283 orl %d3,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 472b8: 5283 addql #1,%d3 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 472ba: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 472be: 2f00 movel %d0,%sp@- 472c0: 2f05 movel %d5,%sp@- 472c2: 4e94 jsr %a4@ index++; 472c4: 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 ) { 472c6: 2f04 movel %d4,%sp@- 472c8: 4e93 jsr %a3@ 472ca: 588f addql #4,%sp 472cc: 4a80 tstl %d0 472ce: 66ce bnes 4729e <_Objects_Extend_information+0x1a2> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 472d0: 4280 clrl %d0 information->inactive = 472d2: 322a 0028 movew %a2@(40),%d1 472d6: 326a 0012 moveaw %a2@(18),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 472da: 206a 002a moveal %a2@(42),%a0 information->inactive = 472de: d289 addl %a1,%d1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 472e0: 3009 movew %a1,%d0 information->inactive = 472e2: 3541 0028 movew %d1,%a2@(40) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 472e6: 2180 2800 movel %d0,%a0@(00000000,%d2:l) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 472ea: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 472f0: 4e5e unlk %fp 472f2: 4e75 rts 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 ); 472f4: 2f00 movel %d0,%sp@- 472f6: 4eb9 0004 907c jsr 4907c <_Workspace_Allocate_or_fatal_error> 472fc: 588f addql #4,%sp 472fe: 2c00 movel %d0,%d6 47300: 6000 fe84 braw 47186 <_Objects_Extend_information+0x8a> <== ALWAYS TAKEN /* * 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, 47304: e58c lsll #2,%d4 47306: 2f04 movel %d4,%sp@- 47308: 2f2a 002e movel %a2@(46),%sp@- 4730c: 2f0c movel %a4,%sp@- 4730e: 4eb9 0004 e028 jsr 4e028 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 47314: 2f04 movel %d4,%sp@- 47316: 2f2a 002a movel %a2@(42),%sp@- 4731a: 2f0d movel %a5,%sp@- 4731c: 4eb9 0004 e028 jsr 4e028 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 47322: 4280 clrl %d0 47324: 302a 000e movew %a2@(14),%d0 47328: da80 addl %d0,%d5 4732a: e58d lsll #2,%d5 4732c: 2f05 movel %d5,%sp@- 4732e: 2f2a 0018 movel %a2@(24),%sp@- 47332: 2f07 movel %d7,%sp@- 47334: 4eb9 0004 e028 jsr 4e028 4733a: 4fef 0024 lea %sp@(36),%sp 4733e: 6000 fe9c braw 471dc <_Objects_Extend_information+0xe0> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 47342: 4280 clrl %d0 47344: 2605 movel %d5,%d3 47346: 4282 clrl %d2 47348: 4284 clrl %d4 4734a: 322a 000e movew %a2@(14),%d1 4734e: 302a 0012 movew %a2@(18),%d0 47352: 6000 fdfe braw 47152 <_Objects_Extend_information+0x56> <== ALWAYS TAKEN block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 47356: 2605 movel %d5,%d3 <== NOT EXECUTED 47358: 4282 clrl %d2 <== NOT EXECUTED 4735a: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED 47360: 6000 fdf0 braw 47152 <_Objects_Extend_information+0x56> <== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 47364: 2f06 movel %d6,%sp@- 47366: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> return; 4736c: 588f addql #4,%sp } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 4736e: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 47374: 4e5e unlk %fp 47376: 4e75 rts 00047428 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 47428: 4e56 0000 linkw %fp,#0 4742c: 2f02 movel %d2,%sp@- 4742e: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 47432: 660a bnes 4743e <_Objects_Get_information+0x16> * 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 ) 47434: 4280 clrl %d0 return NULL; #endif return info; } 47436: 242e fffc movel %fp@(-4),%d2 4743a: 4e5e unlk %fp 4743c: 4e75 rts /* * 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 ); 4743e: 2f2e 0008 movel %fp@(8),%sp@- 47442: 4eb9 0004 b628 jsr 4b628 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 47448: 588f addql #4,%sp 4744a: 4a80 tstl %d0 4744c: 67e6 beqs 47434 <_Objects_Get_information+0xc> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 4744e: b082 cmpl %d2,%d0 47450: 65e2 bcss 47434 <_Objects_Get_information+0xc> return NULL; if ( !_Objects_Information_table[ the_api ] ) 47452: 202e 0008 movel %fp@(8),%d0 47456: 41f9 0005 d90c lea 5d90c <_Objects_Information_table>,%a0 4745c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47460: 4a88 tstl %a0 47462: 67d0 beqs 47434 <_Objects_Get_information+0xc> <== ALWAYS TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 47464: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 47468: 67cc beqs 47436 <_Objects_Get_information+0xe> <== ALWAYS 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 ) 4746a: 2040 moveal %d0,%a0 4746c: 4a68 000e tstw %a0@(14) 47470: 67c2 beqs 47434 <_Objects_Get_information+0xc> return NULL; #endif return info; } 47472: 242e fffc movel %fp@(-4),%d2 47476: 4e5e unlk %fp 47478: 4e75 rts ... 00053b58 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 53b58: 4e56 ffe0 linkw %fp,#-32 53b5c: 48d7 043c moveml %d2-%d5/%a2,%sp@ 53b60: 262e 000c movel %fp@(12),%d3 53b64: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 53b68: 4a83 tstl %d3 53b6a: 660e bnes 53b7a <_Objects_Get_name_as_string+0x22> } } *d = '\0'; _Thread_Enable_dispatch(); return name; 53b6c: 4282 clrl %d2 } return NULL; /* unreachable path */ } 53b6e: 2002 movel %d2,%d0 53b70: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 53b76: 4e5e unlk %fp 53b78: 4e75 rts Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 53b7a: 4a82 tstl %d2 53b7c: 67f0 beqs 53b6e <_Objects_Get_name_as_string+0x16> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 53b7e: 4aae 0008 tstl %fp@(8) 53b82: 6700 00a8 beqw 53c2c <_Objects_Get_name_as_string+0xd4> <== ALWAYS TAKEN 53b86: 282e 0008 movel %fp@(8),%d4 information = _Objects_Get_information_id( tmpId ); 53b8a: 2f04 movel %d4,%sp@- 53b8c: 4eb9 0004 c8dc jsr 4c8dc <_Objects_Get_information_id> if ( !information ) 53b92: 588f addql #4,%sp 53b94: 4a80 tstl %d0 53b96: 67d4 beqs 53b6c <_Objects_Get_name_as_string+0x14> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 53b98: 486e fffc pea %fp@(-4) 53b9c: 2f04 movel %d4,%sp@- 53b9e: 2f00 movel %d0,%sp@- 53ba0: 4eb9 0004 c9bc jsr 4c9bc <_Objects_Get> switch ( location ) { 53ba6: 4fef 000c lea %sp@(12),%sp 53baa: 4aae fffc tstl %fp@(-4) 53bae: 66bc bnes 53b6c <_Objects_Get_name_as_string+0x14> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 53bb0: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 53bb2: 7818 moveq #24,%d4 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 53bb4: 5383 subql #1,%d3 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 53bb6: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 53bba: 2200 movel %d0,%d1 53bbc: e8a9 lsrl %d4,%d1 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 53bbe: 2a00 movel %d0,%d5 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 53bc0: 2800 movel %d0,%d4 lname[ 2 ] = (u32_name >> 8) & 0xff; 53bc2: e08d lsrl #8,%d5 lname[ 3 ] = (u32_name >> 0) & 0xff; 53bc4: 1d40 fffa moveb %d0,%fp@(-6) lname[ 4 ] = '\0'; 53bc8: 4200 clrb %d0 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 53bca: 4244 clrw %d4 53bcc: 4844 swap %d4 lname[ 2 ] = (u32_name >> 8) & 0xff; 53bce: 1d45 fff9 moveb %d5,%fp@(-7) lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 53bd2: 1d40 fffb moveb %d0,%fp@(-5) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 53bd6: 1d44 fff8 moveb %d4,%fp@(-8) } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 53bda: 1d41 fff7 moveb %d1,%fp@(-9) 53bde: 1001 moveb %d1,%d0 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 53be0: 4a83 tstl %d3 53be2: 6756 beqs 53c3a <_Objects_Get_name_as_string+0xe2> <== ALWAYS TAKEN 53be4: 4a01 tstb %d1 53be6: 6752 beqs 53c3a <_Objects_Get_name_as_string+0xe2> <== ALWAYS TAKEN 53be8: 2042 moveal %d2,%a0 53bea: 4281 clrl %d1 53bec: 45ee fff7 lea %fp@(-9),%a2 *d = (isprint((unsigned char)*s)) ? *s : '*'; 53bf0: 4284 clrl %d4 53bf2: 1800 moveb %d0,%d4 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 53bf4: 5281 addql #1,%d1 *d = (isprint((unsigned char)*s)) ? *s : '*'; 53bf6: 2279 0006 9830 moveal 69830 <__ctype_ptr__>,%a1 53bfc: 1831 4801 moveb %a1@(00000001,%d4:l),%d4 53c00: 49c4 extbl %d4 53c02: 0284 0000 0097 andil #151,%d4 53c08: 6602 bnes 53c0c <_Objects_Get_name_as_string+0xb4> 53c0a: 702a moveq #42,%d0 53c0c: 10c0 moveb %d0,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 53c0e: b681 cmpl %d1,%d3 53c10: 6306 blss 53c18 <_Objects_Get_name_as_string+0xc0> 53c12: 1032 1800 moveb %a2@(00000000,%d1:l),%d0 53c16: 66d8 bnes 53bf0 <_Objects_Get_name_as_string+0x98> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 53c18: 4210 clrb %a0@ _Thread_Enable_dispatch(); 53c1a: 4eb9 0004 d324 jsr 4d324 <_Thread_Enable_dispatch> return name; } return NULL; /* unreachable path */ } 53c20: 2002 movel %d2,%d0 53c22: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 53c28: 4e5e unlk %fp 53c2a: 4e75 rts return NULL; if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 53c2c: 2079 0006 b646 moveal 6b646 <_Thread_Executing>,%a0 53c32: 2828 0008 movel %a0@(8),%d4 53c36: 6000 ff52 braw 53b8a <_Objects_Get_name_as_string+0x32> s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 53c3a: 2042 moveal %d2,%a0 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 53c3c: 4210 clrb %a0@ _Thread_Enable_dispatch(); 53c3e: 4eb9 0004 d324 jsr 4d324 <_Thread_Enable_dispatch> 53c44: 60da bras 53c20 <_Objects_Get_name_as_string+0xc8> <== ALWAYS TAKEN ... 0005654c <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 5654c: 4e56 fff0 linkw %fp,#-16 56550: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 56554: 246e 0008 moveal %fp@(8),%a2 56558: 266e 0010 moveal %fp@(16),%a3 Objects_Control *object; Objects_Id next_id; if ( !information ) 5655c: 4a8a tstl %a2 5655e: 660c bnes 5656c <_Objects_Get_next+0x20> *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; 56560: 4280 clrl %d0 } 56562: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 56568: 4e5e unlk %fp 5656a: 4e75 rts Objects_Id next_id; if ( !information ) return NULL; if ( !location_p ) 5656c: 4a8b tstl %a3 5656e: 67f0 beqs 56560 <_Objects_Get_next+0x14> return NULL; if ( !next_id_p ) 56570: 4aae 0014 tstl %fp@(20) 56574: 67ea beqs 56560 <_Objects_Get_next+0x14> return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 56576: 302e 000e movew %fp@(14),%d0 5657a: 673a beqs 565b6 <_Objects_Get_next+0x6a> 5657c: 242e 000c movel %fp@(12),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 56580: 49f9 0004 c9bc lea 4c9bc <_Objects_Get>,%a4 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 56586: 4281 clrl %d1 56588: 4280 clrl %d0 5658a: 322a 000e movew %a2@(14),%d1 5658e: 3002 movew %d2,%d0 56590: b081 cmpl %d1,%d0 56592: 622e bhis 565c2 <_Objects_Get_next+0x76> *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 56594: 2f0b movel %a3,%sp@- 56596: 2f02 movel %d2,%sp@- next_id++; 56598: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 5659a: 2f0a movel %a2,%sp@- 5659c: 4e94 jsr %a4@ next_id++; } while (*location_p != OBJECTS_LOCAL); 5659e: 4fef 000c lea %sp@(12),%sp 565a2: 4a93 tstl %a3@ 565a4: 66e0 bnes 56586 <_Objects_Get_next+0x3a> *next_id_p = next_id; 565a6: 206e 0014 moveal %fp@(20),%a0 565aa: 2082 movel %d2,%a0@ return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 565ac: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 565b2: 4e5e unlk %fp 565b4: 4e75 rts if ( !next_id_p ) return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) next_id = information->minimum_id; 565b6: 242a 0006 movel %a2@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 565ba: 49f9 0004 c9bc lea 4c9bc <_Objects_Get>,%a4 565c0: 60c4 bras 56586 <_Objects_Get_next+0x3a> <== ALWAYS TAKEN do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 565c2: 7401 moveq #1,%d2 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 565c4: 72ff moveq #-1,%d1 565c6: 4280 clrl %d0 565c8: 206e 0014 moveal %fp@(20),%a0 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 565cc: 2682 movel %d2,%a3@ return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 565ce: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 565d4: 2081 movel %d1,%a0@ return 0; } 565d6: 4e5e unlk %fp 565d8: 4e75 rts ... 0005b0dc <_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; 5b0dc: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 5b0de: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5b0e0: 4e56 0000 linkw %fp,#0 5b0e4: 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; 5b0e8: 90a8 0006 subl %a0@(6),%d0 5b0ec: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 5b0f0: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5b0f4: 226e 0010 moveal %fp@(16),%a1 * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; if ( information->maximum >= index ) { 5b0f8: b280 cmpl %d0,%d1 5b0fa: 6510 bcss 5b10c <_Objects_Get_no_protection+0x30> if ( (the_object = information->local_table[ index ]) != NULL ) { 5b0fc: 2068 0018 moveal %a0@(24),%a0 5b100: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5b104: 6706 beqs 5b10c <_Objects_Get_no_protection+0x30> <== ALWAYS TAKEN *location = OBJECTS_LOCAL; 5b106: 4291 clrl %a1@ * 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; } 5b108: 4e5e unlk %fp 5b10a: 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; 5b10c: 7001 moveq #1,%d0 return NULL; } 5b10e: 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; 5b110: 2280 movel %d0,%a1@ 5b112: 4280 clrl %d0 return NULL; } 5b114: 4e75 rts ... 0004ca28 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4ca28: 4e56 fffc linkw %fp,#-4 4ca2c: 222e 0008 movel %fp@(8),%d1 4ca30: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4ca32: 4a81 tstl %d1 4ca34: 660a bnes 4ca40 <_Objects_Id_to_name+0x18> 4ca36: 2079 0006 b646 moveal 6b646 <_Thread_Executing>,%a0 4ca3c: 2228 0008 movel %a0@(8),%d1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4ca40: 7418 moveq #24,%d2 4ca42: 2001 movel %d1,%d0 4ca44: e4a8 lsrl %d2,%d0 4ca46: 143c 0007 moveb #7,%d2 4ca4a: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4ca4c: 143c 0003 moveb #3,%d2 4ca50: 2040 moveal %d0,%a0 4ca52: 5388 subql #1,%a0 4ca54: b488 cmpl %a0,%d2 4ca56: 654a bcss 4caa2 <_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 ] ) 4ca58: 41f9 0006 b544 lea 6b544 <_Objects_Information_table>,%a0 4ca5e: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 4ca62: 4a88 tstl %a0 4ca64: 673c beqs 4caa2 <_Objects_Id_to_name+0x7a> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4ca66: 2001 movel %d1,%d0 4ca68: 741b moveq #27,%d2 4ca6a: e4a8 lsrl %d2,%d0 4ca6c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 4ca70: 6730 beqs 4caa2 <_Objects_Id_to_name+0x7a> <== ALWAYS 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 ); 4ca72: 486e fffc pea %fp@(-4) 4ca76: 2f01 movel %d1,%sp@- 4ca78: 2f00 movel %d0,%sp@- 4ca7a: 4eb9 0004 c9bc jsr 4c9bc <_Objects_Get> if ( !the_object ) 4ca80: 4fef 000c lea %sp@(12),%sp 4ca84: 4a80 tstl %d0 4ca86: 671a beqs 4caa2 <_Objects_Id_to_name+0x7a> return OBJECTS_INVALID_ID; *name = the_object->name; 4ca88: 206e 000c moveal %fp@(12),%a0 4ca8c: 2240 moveal %d0,%a1 4ca8e: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 4ca92: 4eb9 0004 d324 jsr 4d324 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4ca98: 242e fff8 movel %fp@(-8),%d2 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 4ca9c: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4ca9e: 4e5e unlk %fp 4caa0: 4e75 rts 4caa2: 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; 4caa6: 7003 moveq #3,%d0 } 4caa8: 4e5e unlk %fp 4caaa: 4e75 rts 00047548 <_Objects_Initialize_information>: information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 47548: 41f9 0005 d90c lea 5d90c <_Objects_Information_table>,%a0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4754e: 4e56 fff0 linkw %fp,#-16 47552: 202e 000c movel %fp@(12),%d0 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 47556: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4755a: 48d7 003c moveml %d2-%d5,%sp@ 4755e: 222e 0014 movel %fp@(20),%d1 47562: 4285 clrl %d5 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 47564: 2601 movel %d1,%d3 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 47566: 206e 0008 moveal %fp@(8),%a0 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 4756a: 4244 clrw %d4 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4756c: 3a2e 001a movew %fp@(26),%d5 47570: 242e 0010 movel %fp@(16),%d2 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 47574: d683 addl %d3,%d3 47576: 9783 subxl %d3,%d3 47578: 4483 negl %d3 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 4757a: 3144 0028 movew %d4,%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; 4757e: 3144 000e movew %d4,%a0@(14) , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 47582: 282e 0020 movel %fp@(32),%d4 #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 47586: 3142 0004 movew %d2,%a0@(4) _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 4758a: 1143 0010 moveb %d3,%a0@(16) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 4758e: 2145 0014 movel %d5,%a0@(20) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 47592: 2388 2c00 movel %a0,%a1@(00000000,%d2:l:4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 47596: 0881 001f bclr #31,%d1 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 4759a: 2080 movel %d0,%a0@ information->the_class = the_class; information->size = size; information->local_table = 0; 4759c: 42a8 0018 clrl %a0@(24) information->inactive_per_block = 0; 475a0: 42a8 002a clrl %a0@(42) information->object_blocks = 0; 475a4: 42a8 002e clrl %a0@(46) maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 475a8: 4a03 tstb %d3 475aa: 6706 beqs 475b2 <_Objects_Initialize_information+0x6a> 475ac: 4a81 tstl %d1 475ae: 6700 0092 beqw 47642 <_Objects_Initialize_information+0xfa> /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 475b2: 7a18 moveq #24,%d5 475b4: 4a81 tstl %d1 475b6: 56c3 sne %d3 475b8: eba8 lsll %d5,%d0 475ba: 1a3c 001b moveb #27,%d5 475be: 49c3 extbl %d3 475c0: 4483 negl %d3 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; 475c2: 43f9 0005 d0fc lea 5d0fc ,%a1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 475c8: ebaa lsll %d5,%d2 475ca: 08c0 0010 bset #16,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 475ce: 1a3c 0003 moveb #3,%d5 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 475d2: 8082 orl %d2,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 475d4: ca84 andl %d4,%d5 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 475d6: 3141 0012 movew %d1,%a0@(18) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 475da: 8083 orl %d3,%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; 475dc: 2149 0018 movel %a1,%a0@(24) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 475e0: 2140 0006 movel %d0,%a0@(6) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 475e4: 4a85 tstl %d5 475e6: 6626 bnes 4760e <_Objects_Initialize_information+0xc6> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 475e8: 43e8 0020 lea %a0@(32),%a1 475ec: 2149 001c movel %a1,%a0@(28) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 475f0: 43e8 001c lea %a0@(28),%a1 name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 475f4: 3144 0032 movew %d4,%a0@(50) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 475f8: 42a8 0020 clrl %a0@(32) the_chain->last = _Chain_Head(the_chain); 475fc: 2149 0024 movel %a1,%a0@(36) _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 47600: 4a81 tstl %d1 47602: 662c bnes 47630 <_Objects_Initialize_information+0xe8> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 47604: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 4760a: 4e5e unlk %fp 4760c: 4e75 rts * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 4760e: 5884 addql #4,%d4 <== NOT EXECUTED 47610: 70fc moveq #-4,%d0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47612: 43e8 0020 lea %a0@(32),%a1 <== NOT EXECUTED 47616: c880 andl %d0,%d4 <== NOT EXECUTED 47618: 2149 001c movel %a1,%a0@(28) <== NOT EXECUTED the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4761c: 43e8 001c lea %a0@(28),%a1 <== NOT EXECUTED ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 47620: 3144 0032 movew %d4,%a0@(50) <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47624: 42a8 0020 clrl %a0@(32) <== NOT EXECUTED the_chain->last = _Chain_Head(the_chain); 47628: 2149 0024 movel %a1,%a0@(36) <== NOT EXECUTED _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 4762c: 4a81 tstl %d1 <== NOT EXECUTED 4762e: 67d4 beqs 47604 <_Objects_Initialize_information+0xbc> <== NOT EXECUTED /* * 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 ); 47630: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 47634: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 4763a: 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 ); 4763c: 4ef9 0004 70fc jmp 470fc <_Objects_Extend_information> /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { _Internal_error_Occurred( 47642: 4878 0014 pea 14 47646: 4878 0001 pea 1 4764a: 42a7 clrl %sp@- 4764c: 4eb9 0004 6f7c jsr 46f7c <_Internal_error_Occurred> ... 00047664 <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 47664: 4e56 fff4 linkw %fp,#-12 47668: 206e 0008 moveal %fp@(8),%a0 4766c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47670: 222e 000c movel %fp@(12),%d1 47674: 202e 0010 movel %fp@(16),%d0 47678: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 4767c: 4a8a tstl %a2 4767e: 675a beqs 476da <_Objects_Name_to_id_u32+0x76> return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 47680: 4a81 tstl %d1 47682: 6718 beqs 4769c <_Objects_Name_to_id_u32+0x38> return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 47684: 3428 000e movew %a0@(14),%d2 47688: 6712 beqs 4769c <_Objects_Name_to_id_u32+0x38> 4768a: 4a80 tstl %d0 4768c: 6718 beqs 476a6 <_Objects_Name_to_id_u32+0x42> 4768e: 0c80 7fff ffff cmpil #2147483647,%d0 47694: 6710 beqs 476a6 <_Objects_Name_to_id_u32+0x42> 47696: 7601 moveq #1,%d3 47698: b680 cmpl %d0,%d3 4769a: 670a beqs 476a6 <_Objects_Name_to_id_u32+0x42> search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 4769c: 7001 moveq #1,%d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 4769e: 4cd7 040c moveml %sp@,%d2-%d3/%a2 476a2: 4e5e unlk %fp 476a4: 4e75 rts search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 476a6: 2068 0018 moveal %a0@(24),%a0 476aa: 7001 moveq #1,%d0 476ac: 5888 addql #4,%a0 476ae: 0282 0000 ffff andil #65535,%d2 the_object = information->local_table[ index ]; 476b4: 2250 moveal %a0@,%a1 search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 476b6: 5280 addql #1,%d0 476b8: 5888 addql #4,%a0 the_object = information->local_table[ index ]; if ( !the_object ) 476ba: 4a89 tstl %a1 476bc: 6706 beqs 476c4 <_Objects_Name_to_id_u32+0x60> continue; if ( name == the_object->name.name_u32 ) { 476be: b2a9 000c cmpl %a1@(12),%d1 476c2: 6708 beqs 476cc <_Objects_Name_to_id_u32+0x68> search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 476c4: b082 cmpl %d2,%d0 476c6: 63ec blss 476b4 <_Objects_Name_to_id_u32+0x50> 476c8: 7001 moveq #1,%d0 476ca: 60d2 bras 4769e <_Objects_Name_to_id_u32+0x3a> <== ALWAYS TAKEN the_object = information->local_table[ index ]; if ( !the_object ) continue; if ( name == the_object->name.name_u32 ) { *id = the_object->id; 476cc: 24a9 0008 movel %a1@(8),%a2@ 476d0: 4280 clrl %d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 476d2: 4cd7 040c moveml %sp@,%d2-%d3/%a2 476d6: 4e5e unlk %fp 476d8: 4e75 rts Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 476da: 7002 moveq #2,%d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 476dc: 4cd7 040c moveml %sp@,%d2-%d3/%a2 476e0: 4e5e unlk %fp 476e2: 4e75 rts 000476e4 <_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) / 476e4: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 476e6: 4e56 ffec linkw %fp,#-20 476ea: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 476ee: 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 ); 476f2: 4283 clrl %d3 block_count = (information->maximum - index_base) / 476f4: 4284 clrl %d4 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 476f6: 362a 0008 movew %a2@(8),%d3 block_count = (information->maximum - index_base) / 476fa: 382a 000e movew %a2@(14),%d4 476fe: 322a 0012 movew %a2@(18),%d1 47702: 9883 subl %d3,%d4 47704: 4c41 4004 remul %d1,%d4,%d4 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 47708: 672c beqs 47736 <_Objects_Shrink_information+0x52> <== ALWAYS TAKEN if ( information->inactive_per_block[ block ] == 4770a: 226a 002a moveal %a2@(42),%a1 4770e: b291 cmpl %a1@,%d1 47710: 672e beqs 47740 <_Objects_Shrink_information+0x5c> <== ALWAYS TAKEN information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 47712: 7404 moveq #4,%d2 47714: 4280 clrl %d0 } index_base += information->allocation_size; 47716: 2042 moveal %d2,%a0 47718: d681 addl %d1,%d3 4771a: 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++ ) { 4771c: 5280 addql #1,%d0 4771e: b084 cmpl %d4,%d0 47720: 6414 bccs 47736 <_Objects_Shrink_information+0x52> <== ALWAYS TAKEN if ( information->inactive_per_block[ block ] == 47722: b2b1 2800 cmpl %a1@(00000000,%d2:l),%d1 47726: 671a beqs 47742 <_Objects_Shrink_information+0x5e> 47728: 2408 movel %a0,%d2 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 4772a: 2042 moveal %d2,%a0 4772c: d681 addl %d1,%d3 4772e: 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++ ) { 47730: 5280 addql #1,%d0 47732: b084 cmpl %d4,%d0 47734: 65ec bcss 47722 <_Objects_Shrink_information+0x3e> return; } index_base += information->allocation_size; } } 47736: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4773c: 4e5e unlk %fp 4773e: 4e75 rts 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 ] == 47740: 4282 clrl %d2 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 47742: 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 ); 47746: 47f9 0004 afec lea 4afec <_Chain_Extract>,%a3 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 4774c: 4280 clrl %d0 4774e: 3028 000a movew %a0@(10),%d0 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 47752: 2810 movel %a0@,%d4 if ((index >= index_base) && 47754: b680 cmpl %d0,%d3 47756: 620c bhis 47764 <_Objects_Shrink_information+0x80> (index < (index_base + information->allocation_size))) { 47758: 4281 clrl %d1 4775a: 322a 0012 movew %a2@(18),%d1 4775e: d283 addl %d3,%d1 47760: b280 cmpl %d0,%d1 47762: 623e bhis 477a2 <_Objects_Shrink_information+0xbe> _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 47764: 2044 moveal %d4,%a0 47766: 4a84 tstl %d4 47768: 66e2 bnes 4774c <_Objects_Shrink_information+0x68> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 4776a: 206a 002e moveal %a2@(46),%a0 4776e: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 47772: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> information->object_blocks[ block ] = NULL; 47778: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 4777c: 588f addql #4,%sp _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 4777e: 302a 0028 movew %a2@(40),%d0 47782: 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; 47786: 226a 002a moveal %a2@(42),%a1 information->inactive -= information->allocation_size; 4778a: 9081 subl %d1,%d0 * 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; 4778c: 42b1 2800 clrl %a1@(00000000,%d2:l) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 47790: 42b0 2800 clrl %a0@(00000000,%d2:l) information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 47794: 3540 0028 movew %d0,%a2@(40) return; } index_base += information->allocation_size; } } 47798: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4779e: 4e5e unlk %fp 477a0: 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 ); 477a2: 2f08 movel %a0,%sp@- 477a4: 4e93 jsr %a3@ 477a6: 588f addql #4,%sp } } while ( the_object ); 477a8: 2044 moveal %d4,%a0 477aa: 4a84 tstl %d4 477ac: 669e bnes 4774c <_Objects_Shrink_information+0x68> 477ae: 60ba bras 4776a <_Objects_Shrink_information+0x86> <== ALWAYS TAKEN 0004af00 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4af00: 4e56 0000 linkw %fp,#0 void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { 4af04: 2039 0005 da0e movel 5da0e <_Thread_Executing>,%d0 void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4af0a: 2f0a movel %a2,%sp@- 4af0c: 246e 000c moveal %fp@(12),%a2 void (*dtor)(void *); void *value; dtor = tvp->dtor; 4af10: 206a 0010 moveal %a2@(16),%a0 if (_Thread_Is_executing(the_thread)) { 4af14: b0ae 0008 cmpl %fp@(8),%d0 4af18: 671e beqs 4af38 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x38> value = *tvp->ptr; *tvp->ptr = tvp->gval; } else { value = tvp->tval; 4af1a: 202a 000c movel %a2@(12),%d0 } if ( dtor ) 4af1e: 4a88 tstl %a0 4af20: 6706 beqs 4af28 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x28> (*dtor)(value); 4af22: 2f00 movel %d0,%sp@- 4af24: 4e90 jsr %a0@ 4af26: 588f addql #4,%sp _Workspace_Free(tvp); 4af28: 2d4a 0008 movel %a2,%fp@(8) } 4af2c: 246e fffc moveal %fp@(-4),%a2 4af30: 4e5e unlk %fp } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 4af32: 4ef9 0004 90cc jmp 490cc <_Workspace_Free> void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { value = *tvp->ptr; 4af38: 226a 0004 moveal %a2@(4),%a1 4af3c: 2011 movel %a1@,%d0 *tvp->ptr = tvp->gval; 4af3e: 22aa 0008 movel %a2@(8),%a1@ 4af42: 60da bras 4af1e <_RTEMS_Tasks_Invoke_task_variable_dtor+0x1e> <== ALWAYS TAKEN 0004ae76 <_RTEMS_tasks_Create_extension>: bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 4ae76: 4e56 0000 linkw %fp,#0 4ae7a: 2f0a movel %a2,%sp@- 4ae7c: 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() ) 4ae80: 4a39 0005 c1f4 tstb 5c1f4 4ae86: 665c bnes 4aee4 <_RTEMS_tasks_Create_extension+0x6e> 4ae88: 701e moveq #30,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4ae8a: 2f00 movel %d0,%sp@- 4ae8c: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> if ( !api ) 4ae92: 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 ); 4ae94: 2040 moveal %d0,%a0 if ( !api ) 4ae96: 4a80 tstl %d0 4ae98: 675c beqs 4aef6 <_RTEMS_tasks_Create_extension+0x80> <== ALWAYS TAKEN created->API_Extensions[ THREAD_API_RTEMS ] = api; api->pending_events = EVENT_SETS_NONE_PENDING; api->event_condition = 0; _ASR_Initialize( &api->Signal ); created->task_variables = NULL; 4ae9a: 42aa 0118 clrl %a2@(280) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 4ae9e: 4200 clrb %d0 api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4aea0: 2548 0108 movel %a0,%a2@(264) 4aea4: 1140 0008 moveb %d0,%a0@(8) api->pending_events = EVENT_SETS_NONE_PENDING; 4aea8: 4290 clrl %a0@ api->event_condition = 0; 4aeaa: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4aeae: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4aeb2: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 4aeb6: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 4aeba: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4aebe: 42a8 001a clrl %a0@(26) _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { 4aec2: 4a39 0005 c1f4 tstb 5c1f4 4aec8: 6710 beqs 4aeda <_RTEMS_tasks_Create_extension+0x64> 4aeca: 41e8 001e lea %a0@(30),%a0 4aece: 4280 clrl %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4aed0: 4298 clrl %a0@+ api->event_condition = 0; _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) 4aed2: 5280 addql #1,%d0 4aed4: 7210 moveq #16,%d1 4aed6: b280 cmpl %d0,%d1 4aed8: 66f6 bnes 4aed0 <_RTEMS_tasks_Create_extension+0x5a> api->Notepads[i] = 0; } return true; } 4aeda: 246e fffc moveal %fp@(-4),%a2 4aede: 4e5e unlk %fp api->event_condition = 0; _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) 4aee0: 7001 moveq #1,%d0 api->Notepads[i] = 0; } return true; } 4aee2: 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() ) 4aee4: 705e moveq #94,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4aee6: 2f00 movel %d0,%sp@- 4aee8: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> if ( !api ) 4aeee: 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 ); 4aef0: 2040 moveal %d0,%a0 if ( !api ) 4aef2: 4a80 tstl %d0 4aef4: 66a4 bnes 4ae9a <_RTEMS_tasks_Create_extension+0x24> for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4aef6: 246e fffc moveal %fp@(-4),%a2 4aefa: 4e5e unlk %fp if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); if ( !api ) 4aefc: 4200 clrb %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4aefe: 4e75 rts 00046150 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 46150: 4e56 ffe4 linkw %fp,#-28 46154: 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; 46158: 2479 0005 c21a moveal 5c21a ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 4615e: 2639 0005 c216 movel 5c216 ,%d3 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 46164: 4a8a tstl %a2 46166: 6754 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 46168: 4a83 tstl %d3 4616a: 6750 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> <== ALWAYS TAKEN 4616c: 280e movel %fp,%d4 4616e: 4282 clrl %d2 46170: 5984 subql #4,%d4 46172: 47f9 0004 5f24 lea 45f24 ,%a3 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 46178: 49f9 0004 61d8 lea 461d8 ,%a4 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 4617e: 2f04 movel %d4,%sp@- 46180: 2f2a 000c movel %a2@(12),%sp@- 46184: 2f2a 0014 movel %a2@(20),%sp@- 46188: 2f2a 0004 movel %a2@(4),%sp@- 4618c: 2f2a 0008 movel %a2@(8),%sp@- 46190: 2f12 movel %a2@,%sp@- 46192: 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 ) ) 46194: 4fef 0018 lea %sp@(24),%sp 46198: 4a80 tstl %d0 4619a: 662a bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 4619c: 2f2a 0018 movel %a2@(24),%sp@- 461a0: 2f2a 0010 movel %a2@(16),%sp@- 461a4: 2f2e fffc movel %fp@(-4),%sp@- 461a8: 4e94 jsr %a4@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 461aa: 4fef 000c lea %sp@(12),%sp 461ae: 4a80 tstl %d0 461b0: 6614 bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 461b2: 5282 addql #1,%d2 461b4: 45ea 001c lea %a2@(28),%a2 461b8: b483 cmpl %d3,%d2 461ba: 65c2 bcss 4617e <_RTEMS_tasks_Initialize_user_tasks_body+0x2e> <== ALWAYS TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 461bc: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 461c2: 4e5e unlk %fp 461c4: 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 ); 461c6: 2f00 movel %d0,%sp@- 461c8: 4878 0001 pea 1 461cc: 4878 0001 pea 1 461d0: 4eb9 0004 6f7c jsr 46f7c <_Internal_error_Occurred> ... 0004adb2 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4adb2: 4e56 ffec linkw %fp,#-20 4adb6: 206e 0008 moveal %fp@(8),%a0 4adba: 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 ]; 4adbe: 2468 0108 moveal %a0@(264),%a2 if ( !api ) 4adc2: 4a8a tstl %a2 4adc4: 671a beqs 4ade0 <_RTEMS_tasks_Post_switch_extension+0x2e> <== ALWAYS TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4adc6: 203c 0000 0700 movel #1792,%d0 4adcc: 40c1 movew %sr,%d1 4adce: 8081 orl %d1,%d0 4add0: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 4add2: 242a 0012 movel %a2@(18),%d2 asr->signals_posted = 0; 4add6: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4adda: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4addc: 4a82 tstl %d2 4adde: 660a bnes 4adea <_RTEMS_tasks_Post_switch_extension+0x38> <== NEVER TAKEN (*asr->handler)( signal_set ); asr->nest_level -= 1; rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); } 4ade0: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 <== NOT EXECUTED 4ade6: 4e5e unlk %fp <== NOT EXECUTED 4ade8: 4e75 rts <== NOT EXECUTED if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4adea: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4adee: 260e movel %fp,%d3 4adf0: 5983 subql #4,%d3 4adf2: 47f9 0004 cd28 lea 4cd28 ,%a3 4adf8: 2f03 movel %d3,%sp@- 4adfa: 2f3c 0000 ffff movel #65535,%sp@- 4ae00: 2f2a 000e movel %a2@(14),%sp@- 4ae04: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 4ae06: 2f02 movel %d2,%sp@- 4ae08: 206a 000a moveal %a2@(10),%a0 4ae0c: 4e90 jsr %a0@ asr->nest_level -= 1; 4ae0e: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4ae12: 2f03 movel %d3,%sp@- 4ae14: 2f3c 0000 ffff movel #65535,%sp@- 4ae1a: 2f2e fffc movel %fp@(-4),%sp@- 4ae1e: 4e93 jsr %a3@ 4ae20: 4fef 001c lea %sp@(28),%sp } 4ae24: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4ae2a: 4e5e unlk %fp 4ae2c: 4e75 rts 0004ad0e <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 4ad0e: 4e56 0000 linkw %fp,#0 4ad12: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 4ad16: 2068 0118 moveal %a0@(280),%a0 while (tvp) { 4ad1a: 4a88 tstl %a0 4ad1c: 6712 beqs 4ad30 <_RTEMS_tasks_Switch_extension+0x22> tvp->tval = *tvp->ptr; 4ad1e: 2268 0004 moveal %a0@(4),%a1 4ad22: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 4ad26: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4ad2a: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 4ad2c: 4a88 tstl %a0 4ad2e: 66ee bnes 4ad1e <_RTEMS_tasks_Switch_extension+0x10> <== ALWAYS TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 4ad30: 206e 000c moveal %fp@(12),%a0 4ad34: 2068 0118 moveal %a0@(280),%a0 while (tvp) { 4ad38: 4a88 tstl %a0 4ad3a: 6712 beqs 4ad4e <_RTEMS_tasks_Switch_extension+0x40> tvp->gval = *tvp->ptr; 4ad3c: 2268 0004 moveal %a0@(4),%a1 4ad40: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 4ad44: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4ad48: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 4ad4a: 4a88 tstl %a0 4ad4c: 66ee bnes 4ad3c <_RTEMS_tasks_Switch_extension+0x2e> <== ALWAYS TAKEN tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 4ad4e: 4e5e unlk %fp 4ad50: 4e75 rts 0007a372 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 7a372: 4e56 ffd0 linkw %fp,#-48 7a376: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 7a37a: 266e 0008 moveal %fp@(8),%a3 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7a37e: 280e movel %fp,%d4 7a380: 5184 subql #8,%d4 _Timestamp_Subtract( 7a382: 45f9 0004 f190 lea 4f190 <_Timespec_Subtract>,%a2 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7a388: 2f04 movel %d4,%sp@- ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 7a38a: 286b 0040 moveal %a3@(64),%a4 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7a38e: 4eb9 0006 a1f8 jsr 6a1f8 <_TOD_Get_uptime> _Timestamp_Subtract( 7a394: 2f2e 000c movel %fp@(12),%sp@- 7a398: 2f04 movel %d4,%sp@- 7a39a: 486b 004c pea %a3@(76) 7a39e: 4e92 jsr %a2@ * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7a3a0: 4fef 0010 lea %sp@(16),%sp #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 7a3a4: 202c 0082 movel %a4@(130),%d0 7a3a8: 222c 0086 movel %a4@(134),%d1 7a3ac: 2d40 fff0 movel %d0,%fp@(-16) 7a3b0: 2d41 fff4 movel %d1,%fp@(-12) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7a3b4: b9f9 000a 5322 cmpal a5322 <_Thread_Executing>,%a4 7a3ba: 670c beqs 7a3c8 <_Rate_monotonic_Get_status+0x56> */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 7a3bc: 7001 moveq #1,%d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7a3be: 4cee 1c1c ffd0 moveml %fp@(-48),%d2-%d4/%a2-%a4 7a3c4: 4e5e unlk %fp 7a3c6: 4e75 rts if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 7a3c8: 49ee ffe8 lea %fp@(-24),%a4 &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7a3cc: 240e movel %fp,%d2 7a3ce: 0682 ffff fff0 addil #-16,%d2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7a3d4: 260b movel %a3,%d3 7a3d6: 0683 0000 0044 addil #68,%d3 if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 7a3dc: 2f0c movel %a4,%sp@- 7a3de: 2f04 movel %d4,%sp@- 7a3e0: 4879 000a 532a pea a532a <_Thread_Time_of_last_context_switch> 7a3e6: 4e92 jsr %a2@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7a3e8: 2f0c movel %a4,%sp@- 7a3ea: 2f02 movel %d2,%sp@- 7a3ec: 4eb9 0004 f148 jsr 4f148 <_Timespec_Add_to> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7a3f2: 2f03 movel %d3,%sp@- 7a3f4: 2f02 movel %d2,%sp@- 7a3f6: 4eb9 0007 ae50 jsr 7ae50 <_Timespec_Less_than> 7a3fc: 4fef 001c lea %sp@(28),%sp 7a400: 4a00 tstb %d0 7a402: 670c beqs 7a410 <_Rate_monotonic_Get_status+0x9e> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7a404: 4cee 1c1c ffd0 moveml %fp@(-48),%d2-%d4/%a2-%a4 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7a40a: 4200 clrb %d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7a40c: 4e5e unlk %fp 7a40e: 4e75 rts */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 7a410: 2f2e 0010 movel %fp@(16),%sp@- 7a414: 2f02 movel %d2,%sp@- 7a416: 2f03 movel %d3,%sp@- 7a418: 4e92 jsr %a2@ 7a41a: 4fef 000c lea %sp@(12),%sp 7a41e: 7001 moveq #1,%d0 7a420: 609c bras 7a3be <_Rate_monotonic_Get_status+0x4c> <== ALWAYS TAKEN 0007a728 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 7a728: 4e56 fffc linkw %fp,#-4 7a72c: 2f0a movel %a2,%sp@- 7a72e: 486e fffc pea %fp@(-4) 7a732: 2f2e 0008 movel %fp@(8),%sp@- 7a736: 4879 000a 5692 pea a5692 <_Rate_monotonic_Information> 7a73c: 4eb9 0004 daa4 jsr 4daa4 <_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 ) { 7a742: 4fef 000c lea %sp@(12),%sp 7a746: 2440 moveal %d0,%a2 7a748: 4aae fffc tstl %fp@(-4) 7a74c: 6636 bnes 7a784 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 7a74e: 206a 0040 moveal %a2@(64),%a0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 7a752: 2028 0010 movel %a0@(16),%d0 7a756: 0280 0000 4000 andil #16384,%d0 7a75c: 670a beqs 7a768 <_Rate_monotonic_Timeout+0x40> the_thread->Wait.id == the_period->Object.id ) { 7a75e: 202a 0008 movel %a2@(8),%d0 7a762: b0a8 0020 cmpl %a0@(32),%d0 7a766: 675e beqs 7a7c6 <_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 ) { 7a768: 7001 moveq #1,%d0 7a76a: b0aa 0038 cmpl %a2@(56),%d0 7a76e: 671c beqs 7a78c <_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; 7a770: 7004 moveq #4,%d0 7a772: 2540 0038 movel %d0,%a2@(56) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 7a776: 2039 000a 5268 movel a5268 <_Thread_Dispatch_disable_level>,%d0 7a77c: 5380 subql #1,%d0 7a77e: 23c0 000a 5268 movel %d0,a5268 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 7a784: 246e fff8 moveal %fp@(-8),%a2 7a788: 4e5e unlk %fp 7a78a: 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; 7a78c: 103c 0003 moveb #3,%d0 7a790: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 7a794: 2f0a movel %a2,%sp@- 7a796: 4eb9 0007 a2f4 jsr 7a2f4 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7a79c: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7a7a2: 486a 0010 pea %a2@(16) 7a7a6: 4879 000a 5340 pea a5340 <_Watchdog_Ticks_chain> 7a7ac: 4eb9 0004 f490 jsr 4f490 <_Watchdog_Insert> 7a7b2: 4fef 000c lea %sp@(12),%sp 7a7b6: 2039 000a 5268 movel a5268 <_Thread_Dispatch_disable_level>,%d0 7a7bc: 5380 subql #1,%d0 7a7be: 23c0 000a 5268 movel %d0,a5268 <_Thread_Dispatch_disable_level> 7a7c4: 60be bras 7a784 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 7a7c6: 2f3c 1003 fff8 movel #268697592,%sp@- 7a7cc: 2f08 movel %a0,%sp@- 7a7ce: 4eb9 0004 dfec jsr 4dfec <_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 ); 7a7d4: 2f0a movel %a2,%sp@- 7a7d6: 4eb9 0007 a2f4 jsr 7a2f4 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7a7dc: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7a7e2: 486a 0010 pea %a2@(16) 7a7e6: 4879 000a 5340 pea a5340 <_Watchdog_Ticks_chain> 7a7ec: 4eb9 0004 f490 jsr 4f490 <_Watchdog_Insert> the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && 7a7f2: 4fef 0014 lea %sp@(20),%sp */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 7a7f6: 2039 000a 5268 movel a5268 <_Thread_Dispatch_disable_level>,%d0 7a7fc: 5380 subql #1,%d0 7a7fe: 23c0 000a 5268 movel %d0,a5268 <_Thread_Dispatch_disable_level> 7a804: 6000 ff7e braw 7a784 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN 0007a422 <_Rate_monotonic_Update_statistics>: * Update the counts. */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 7a422: 7004 moveq #4,%d0 } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 7a424: 4e56 ffd8 linkw %fp,#-40 7a428: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 7a42c: 246e 0008 moveal %fp@(8),%a2 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 7a430: 52aa 0054 addql #1,%a2@(84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 7a434: b0aa 0038 cmpl %a2@(56),%d0 7a438: 6700 00c6 beqw 7a500 <_Rate_monotonic_Update_statistics+0xde> /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 7a43c: 260e movel %fp,%d3 7a43e: 5183 subql #8,%d3 7a440: 240e movel %fp,%d2 7a442: 0682 ffff fff0 addil #-16,%d2 7a448: 2f03 movel %d3,%sp@- 7a44a: 2f02 movel %d2,%sp@- 7a44c: 2f0a movel %a2,%sp@- 7a44e: 4eb9 0007 a372 jsr 7a372 <_Rate_monotonic_Get_status> if (!valid_status) 7a454: 4fef 000c lea %sp@(12),%sp 7a458: 4a00 tstb %d0 7a45a: 660a bnes 7a466 <_Rate_monotonic_Update_statistics+0x44> stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 7a45c: 4cee 3c0c ffd8 moveml %fp@(-40),%d2-%d3/%a2-%a5 7a462: 4e5e unlk %fp 7a464: 4e75 rts /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 7a466: 2f03 movel %d3,%sp@- 7a468: 486a 006c pea %a2@(108) 7a46c: 4bf9 0004 f148 lea 4f148 <_Timespec_Add_to>,%a5 if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 7a472: 49f9 0007 ae50 lea 7ae50 <_Timespec_Less_than>,%a4 /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 7a478: 4e95 jsr %a5@ if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 7a47a: 486a 005c pea %a2@(92) 7a47e: 2f03 movel %d3,%sp@- 7a480: 4e94 jsr %a4@ 7a482: 4fef 0010 lea %sp@(16),%sp 7a486: 4a00 tstb %d0 7a488: 6710 beqs 7a49a <_Rate_monotonic_Update_statistics+0x78> stats->min_cpu_time = executed; 7a48a: 202e fff8 movel %fp@(-8),%d0 7a48e: 222e fffc movel %fp@(-4),%d1 7a492: 2540 005c movel %d0,%a2@(92) 7a496: 2541 0060 movel %d1,%a2@(96) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 7a49a: 486a 0064 pea %a2@(100) 7a49e: 47f9 0007 ae1c lea 7ae1c <_Timespec_Greater_than>,%a3 7a4a4: 2f03 movel %d3,%sp@- 7a4a6: 4e93 jsr %a3@ 7a4a8: 508f addql #8,%sp 7a4aa: 4a00 tstb %d0 7a4ac: 6710 beqs 7a4be <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 7a4ae: 202e fff8 movel %fp@(-8),%d0 7a4b2: 222e fffc movel %fp@(-4),%d1 7a4b6: 2540 0064 movel %d0,%a2@(100) 7a4ba: 2541 0068 movel %d1,%a2@(104) /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 7a4be: 2f02 movel %d2,%sp@- 7a4c0: 486a 0084 pea %a2@(132) 7a4c4: 4e95 jsr %a5@ if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 7a4c6: 486a 0074 pea %a2@(116) 7a4ca: 2f02 movel %d2,%sp@- 7a4cc: 4e94 jsr %a4@ 7a4ce: 4fef 0010 lea %sp@(16),%sp 7a4d2: 4a00 tstb %d0 7a4d4: 6654 bnes 7a52a <_Rate_monotonic_Update_statistics+0x108> stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 7a4d6: 486a 007c pea %a2@(124) 7a4da: 2f02 movel %d2,%sp@- 7a4dc: 4e93 jsr %a3@ 7a4de: 508f addql #8,%sp 7a4e0: 4a00 tstb %d0 7a4e2: 6700 ff78 beqw 7a45c <_Rate_monotonic_Update_statistics+0x3a> stats->max_wall_time = since_last_period; 7a4e6: 202e fff0 movel %fp@(-16),%d0 7a4ea: 222e fff4 movel %fp@(-12),%d1 7a4ee: 2540 007c movel %d0,%a2@(124) 7a4f2: 2541 0080 movel %d1,%a2@(128) stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 7a4f6: 4cee 3c0c ffd8 moveml %fp@(-40),%d2-%d3/%a2-%a5 7a4fc: 4e5e unlk %fp 7a4fe: 4e75 rts */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 7a500: 52aa 0058 addql #1,%a2@(88) /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 7a504: 260e movel %fp,%d3 7a506: 5183 subql #8,%d3 7a508: 240e movel %fp,%d2 7a50a: 0682 ffff fff0 addil #-16,%d2 7a510: 2f03 movel %d3,%sp@- 7a512: 2f02 movel %d2,%sp@- 7a514: 2f0a movel %a2,%sp@- 7a516: 4eb9 0007 a372 jsr 7a372 <_Rate_monotonic_Get_status> if (!valid_status) 7a51c: 4fef 000c lea %sp@(12),%sp 7a520: 4a00 tstb %d0 7a522: 6700 ff38 beqw 7a45c <_Rate_monotonic_Update_statistics+0x3a> <== ALWAYS TAKEN 7a526: 6000 ff3e braw 7a466 <_Rate_monotonic_Update_statistics+0x44> <== ALWAYS TAKEN */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; 7a52a: 202e fff0 movel %fp@(-16),%d0 7a52e: 222e fff4 movel %fp@(-12),%d1 7a532: 2540 0074 movel %d0,%a2@(116) 7a536: 2541 0078 movel %d1,%a2@(120) 7a53a: 609a bras 7a4d6 <_Rate_monotonic_Update_statistics+0xb4> <== ALWAYS TAKEN 00046b9c <_TOD_Tickle_ticks>: * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 46b9c: 4e56 ffec linkw %fp,#-20 Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 46ba0: 2239 0005 c230 movel 5c230 ,%d1 * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 46ba6: 48d7 040c moveml %d2-%d3/%a2,%sp@ /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 46baa: 240e movel %fp,%d2 46bac: 5182 subql #8,%d2 { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 46bae: 263c 0000 03e8 movel #1000,%d3 46bb4: 4c03 1800 mulsl %d3,%d1 /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 46bb8: 45f9 0004 8ad0 lea 48ad0 <_Timespec_Add_to>,%a2 /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 46bbe: 2039 0005 da94 movel 5da94 <_Watchdog_Ticks_since_boot>,%d0 46bc4: 5280 addql #1,%d0 /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 46bc6: 2f02 movel %d2,%sp@- 46bc8: 4879 0005 d9d2 pea 5d9d2 <_TOD_Uptime> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 46bce: 2d41 fffc movel %d1,%fp@(-4) /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 46bd2: 23c0 0005 da94 movel %d0,5da94 <_Watchdog_Ticks_since_boot> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 46bd8: 42ae fff8 clrl %fp@(-8) /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 46bdc: 4e92 jsr %a2@ /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); 46bde: 2f02 movel %d2,%sp@- 46be0: 4879 0005 d9e6 pea 5d9e6 <_TOD_Now> 46be6: 4e92 jsr %a2@ while ( seconds ) { 46be8: 4fef 0010 lea %sp@(16),%sp /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); 46bec: 2400 movel %d0,%d2 while ( seconds ) { 46bee: 6716 beqs 46c06 <_TOD_Tickle_ticks+0x6a> 46bf0: 45f9 0004 9000 lea 49000 <_Watchdog_Tickle>,%a2 */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void ) { _Watchdog_Tickle( &_Watchdog_Seconds_chain ); 46bf6: 4879 0005 da20 pea 5da20 <_Watchdog_Seconds_chain> _Watchdog_Tickle_seconds(); seconds--; 46bfc: 5382 subql #1,%d2 46bfe: 4e92 jsr %a2@ _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); while ( seconds ) { 46c00: 588f addql #4,%sp 46c02: 4a82 tstl %d2 46c04: 66f0 bnes 46bf6 <_TOD_Tickle_ticks+0x5a> <== ALWAYS TAKEN _Watchdog_Tickle_seconds(); seconds--; } } 46c06: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46c0c: 4e5e unlk %fp 46c0e: 4e75 rts 00046bc8 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46bc8: 4e56 0000 linkw %fp,#0 46bcc: 206e 0008 moveal %fp@(8),%a0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 46bd0: 2039 0005 e9f0 movel 5e9f0 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46bd6: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46bd8: 4a88 tstl %a0 46bda: 6762 beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN 46bdc: 243c 000f 4240 movel #1000000,%d2 46be2: 4c40 2002 remul %d0,%d2,%d2 (the_tod->ticks >= ticks_per_second) || 46be6: b4a8 0018 cmpl %a0@(24),%d2 46bea: 6352 blss 46c3e <_TOD_Validate+0x76> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46bec: 703b moveq #59,%d0 46bee: b0a8 0014 cmpl %a0@(20),%d0 46bf2: 654a bcss 46c3e <_TOD_Validate+0x76> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 46bf4: b0a8 0010 cmpl %a0@(16),%d0 46bf8: 6544 bcss 46c3e <_TOD_Validate+0x76> (the_tod->hour >= TOD_HOURS_PER_DAY) || 46bfa: 7217 moveq #23,%d1 46bfc: b2a8 000c cmpl %a0@(12),%d1 46c00: 653c bcss 46c3e <_TOD_Validate+0x76> (the_tod->month == 0) || 46c02: 2028 0004 movel %a0@(4),%d0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c06: 6736 beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN 46c08: 740c moveq #12,%d2 46c0a: b480 cmpl %d0,%d2 46c0c: 6530 bcss 46c3e <_TOD_Validate+0x76> (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) || 46c0e: 2210 movel %a0@,%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c10: 0c81 0000 07c3 cmpil #1987,%d1 46c16: 6326 blss 46c3e <_TOD_Validate+0x76> (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) || (the_tod->day == 0) ) 46c18: 2068 0008 moveal %a0@(8),%a0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c1c: 4a88 tstl %a0 46c1e: 671e beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN (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 ) 46c20: 143c 0003 moveb #3,%d2 46c24: c282 andl %d2,%d1 46c26: 661e bnes 46c46 <_TOD_Validate+0x7e> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 46c28: 43f9 0005 d99e lea 5d99e <_TOD_Days_per_month>,%a1 46c2e: 2031 0c34 movel %a1@(00000034,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 46c32: b1c0 cmpal %d0,%a0 46c34: 53c0 sls %d0 46c36: 4480 negl %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c38: 241f movel %sp@+,%d2 46c3a: 4e5e unlk %fp 46c3c: 4e75 rts 46c3e: 241f movel %sp@+,%d2 46c40: 4e5e unlk %fp * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 46c42: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c44: 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 ]; 46c46: 43f9 0005 d99e lea 5d99e <_TOD_Days_per_month>,%a1 46c4c: 2031 0c00 movel %a1@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 46c50: b1c0 cmpal %d0,%a0 46c52: 53c0 sls %d0 46c54: 4480 negl %d0 46c56: 60e0 bras 46c38 <_TOD_Validate+0x70> <== ALWAYS TAKEN 00047828 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 47828: 4e56 fff0 linkw %fp,#-16 4782c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 47830: 246e 0008 moveal %fp@(8),%a2 /* * 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 ); 47834: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 47836: 242e 000c movel %fp@(12),%d2 */ /* * Save original state */ original_state = the_thread->current_state; 4783a: 262a 0010 movel %a2@(16),%d3 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4783e: 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 ); 47842: 4eb9 0004 8728 jsr 48728 <_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 ) 47848: 588f addql #4,%sp 4784a: b4aa 0014 cmpl %a2@(20),%d2 4784e: 670c beqs 4785c <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 47850: 2f02 movel %d2,%sp@- 47852: 2f0a movel %a2,%sp@- 47854: 4eb9 0004 85a4 jsr 485a4 <_Thread_Set_priority> 4785a: 508f addql #8,%sp _ISR_Disable( level ); 4785c: 203c 0000 0700 movel #1792,%d0 47862: 40c1 movew %sr,%d1 47864: 8081 orl %d1,%d0 47866: 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; 47868: 202a 0010 movel %a2@(16),%d0 if ( state != STATES_TRANSIENT ) { 4786c: 7404 moveq #4,%d2 4786e: b480 cmpl %d0,%d2 47870: 6738 beqs 478aa <_Thread_Change_priority+0x82> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 47872: 44c3 movew %d3,%ccr 47874: 6708 beqs 4787e <_Thread_Change_priority+0x56> <== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 47876: 74fb moveq #-5,%d2 47878: c480 andl %d0,%d2 4787a: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 4787e: 46c1 movew %d1,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 47880: 0280 0003 bee0 andil #245472,%d0 47886: 660a bnes 47892 <_Thread_Change_priority+0x6a> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 47888: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4788e: 4e5e unlk %fp 47890: 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 ); 47892: 2d4a 000c movel %a2,%fp@(12) 47896: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 4789c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 478a2: 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 ); 478a4: 4ef9 0004 84f8 jmp 484f8 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 478aa: 44c3 movew %d3,%ccr 478ac: 673c beqs 478ea <_Thread_Change_priority+0xc2> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 478ae: 206a 008e moveal %a2@(142),%a0 478b2: 302a 0094 movew %a2@(148),%d0 478b6: 3410 movew %a0@,%d2 * 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 ); 478b8: 42aa 0010 clrl %a2@(16) 478bc: 8082 orl %d2,%d0 478be: 3080 movew %d0,%a0@ _Priority_Major_bit_map |= the_priority_map->ready_major; 478c0: 3439 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d2 478c6: 302a 0092 movew %a2@(146),%d0 478ca: 8082 orl %d2,%d0 478cc: 33c0 0005 da04 movew %d0,5da04 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 478d2: 4a04 tstb %d4 478d4: 6700 0082 beqw 47958 <_Thread_Change_priority+0x130> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 478d8: 206a 008a moveal %a2@(138),%a0 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 478dc: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 478de: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 478e2: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 478e4: 234a 0004 movel %a2,%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; 478e8: 2489 movel %a1,%a2@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 478ea: 203c 0000 0700 movel #1792,%d0 478f0: 46c1 movew %d1,%sr 478f2: 8081 orl %d1,%d0 478f4: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 478f6: 3039 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d0 478fc: 4840 swap %d0 478fe: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 47900: 4282 clrl %d2 47902: 41f9 0005 da70 lea 5da70 <_Priority_Bit_map>,%a0 47908: 3400 movew %d0,%d2 4790a: 3030 2a00 movew %a0@(00000000,%d2:l:2),%d0 4790e: 4840 swap %d0 47910: 04c0 ff1 %d0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 47912: 4283 clrl %d3 47914: e98a lsll #4,%d2 47916: 3600 movew %d0,%d3 47918: 2279 0005 d900 moveal 5d900 <_Thread_Ready_chain>,%a1 4791e: 2002 movel %d2,%d0 47920: d083 addl %d3,%d0 47922: 2400 movel %d0,%d2 47924: e58a lsll #2,%d2 47926: e988 lsll #4,%d0 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 47928: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 4792e: 93c2 subal %d2,%a1 47930: 2031 0800 movel %a1@(00000000,%d0:l),%d0 47934: 23c0 0005 d9e2 movel %d0,5d9e2 <_Thread_Heir> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 4793a: b1c0 cmpal %d0,%a0 4793c: 670e beqs 4794c <_Thread_Change_priority+0x124> _Thread_Executing->is_preemptible ) 4793e: 4a28 0075 tstb %a0@(117) 47942: 6708 beqs 4794c <_Thread_Change_priority+0x124> _Context_Switch_necessary = true; 47944: 7401 moveq #1,%d2 47946: 13c2 0005 da1e moveb %d2,5da1e <_Context_Switch_necessary> _ISR_Enable( level ); 4794c: 46c1 movew %d1,%sr } 4794e: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47954: 4e5e unlk %fp 47956: 4e75 rts _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); 47958: 206a 008a moveal %a2@(138),%a0 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4795c: 2008 movel %a0,%d0 4795e: 5880 addql #4,%d0 47960: 2480 movel %d0,%a2@ old_last_node = the_chain->last; 47962: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 47966: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4796a: 2549 0004 movel %a1,%a2@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4796e: 228a movel %a2,%a1@ 47970: 6000 ff78 braw 478ea <_Thread_Change_priority+0xc2> <== ALWAYS TAKEN 00047974 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47974: 327c 0700 moveaw #1792,%a1 47978: 2009 movel %a1,%d0 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 4797a: 4e56 ffec linkw %fp,#-20 4797e: 206e 0008 moveal %fp@(8),%a0 47982: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 47986: 242e 000c movel %fp@(12),%d2 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4798a: 40c3 movew %sr,%d3 4798c: 8083 orl %d3,%d0 4798e: 46c0 movew %d0,%sr current_state = the_thread->current_state; 47990: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 47994: 2002 movel %d2,%d0 47996: c081 andl %d1,%d0 47998: 6776 beqs 47a10 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4799a: 2002 movel %d2,%d0 4799c: 4680 notl %d0 4799e: c081 andl %d1,%d0 current_state = 479a0: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 479a4: 666a bnes 47a10 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 479a6: 2868 008e moveal %a0@(142),%a4 479aa: 3028 0094 movew %a0@(148),%d0 479ae: 3214 movew %a4@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 479b0: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 479b4: 240a movel %a2,%d2 479b6: 5882 addql #4,%d2 479b8: 8081 orl %d1,%d0 479ba: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 479bc: 266a 0008 moveal %a2@(8),%a3 479c0: 3880 movew %d0,%a4@ the_chain->last = the_node; 479c2: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 479c6: 3239 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d1 479cc: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 479d0: 214b 0004 movel %a3,%a0@(4) 479d4: 8081 orl %d1,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 479d6: 2688 movel %a0,%a3@ 479d8: 33c0 0005 da04 movew %d0,5da04 <_Priority_Major_bit_map> _ISR_Flash( level ); 479de: 2009 movel %a1,%d0 479e0: 46c3 movew %d3,%sr 479e2: 8083 orl %d3,%d0 479e4: 46c0 movew %d0,%sr * 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 ( the_thread->current_priority < _Thread_Heir->current_priority ) { 479e6: 2028 0014 movel %a0@(20),%d0 479ea: 2279 0005 d9e2 moveal 5d9e2 <_Thread_Heir>,%a1 479f0: b0a9 0014 cmpl %a1@(20),%d0 479f4: 641a bccs 47a10 <_Thread_Clear_state+0x9c> _Thread_Heir = the_thread; 479f6: 23c8 0005 d9e2 movel %a0,5d9e2 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 479fc: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 47a02: 4a28 0075 tstb %a0@(117) 47a06: 6712 beqs 47a1a <_Thread_Clear_state+0xa6> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a08: 7001 moveq #1,%d0 47a0a: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> } } } _ISR_Enable( level ); 47a10: 46c3 movew %d3,%sr } 47a12: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 47a16: 4e5e unlk %fp 47a18: 4e75 rts * 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 ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 47a1a: 4a80 tstl %d0 47a1c: 66f2 bnes 47a10 <_Thread_Clear_state+0x9c> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a1e: 7001 moveq #1,%d0 <== NOT EXECUTED 47a20: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> <== NOT EXECUTED 47a26: 60e8 bras 47a10 <_Thread_Clear_state+0x9c> <== NOT EXECUTED 00047a28 <_Thread_Close>: 47a28: 4280 clrl %d0 void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { 47a2a: 4e56 0000 linkw %fp,#0 47a2e: 2f0b movel %a3,%sp@- 47a30: 266e 0008 moveal %fp@(8),%a3 47a34: 2f0a movel %a2,%sp@- 47a36: 246e 000c moveal %fp@(12),%a2 47a3a: 206b 0018 moveal %a3@(24),%a0 47a3e: 302a 000a movew %a2@(10),%d0 47a42: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47a46: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 47a4c: 5380 subql #1,%d0 * disappear and set a transient state on it. So we temporarily * unnest dispatching. */ _Thread_Unnest_dispatch(); _User_extensions_Thread_delete( the_thread ); 47a4e: 2f0a movel %a2,%sp@- 47a50: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> 47a56: 4eb9 0004 8d4c jsr 48d4c <_User_extensions_Thread_delete> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47a5c: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 47a62: 5280 addql #1,%d0 47a64: 23c0 0005 d954 movel %d0,5d954 <_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 ); 47a6a: 2f0a movel %a2,%sp@- 47a6c: 2f0b movel %a3,%sp@- 47a6e: 4eb9 0004 70d0 jsr 470d0 <_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 ); 47a74: 4878 0001 pea 1 47a78: 2f0a movel %a2,%sp@- 47a7a: 4eb9 0004 8614 jsr 48614 <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 47a80: 2f0a movel %a2,%sp@- 47a82: 4eb9 0004 8420 jsr 48420 <_Thread_queue_Extract_with_proxy> 47a88: 4fef 0018 lea %sp@(24),%sp 47a8c: 4a00 tstb %d0 47a8e: 6608 bnes 47a98 <_Thread_Close+0x70> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 47a90: 7002 moveq #2,%d0 47a92: b0aa 0050 cmpl %a2@(80),%d0 47a96: 6756 beqs 47aee <_Thread_Close+0xc6> /* * 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 ) ) 47a98: b5f9 0005 d9da cmpal 5d9da <_Thread_Allocated_fp>,%a2 47a9e: 6746 beqs 47ae6 <_Thread_Close+0xbe> _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; if ( the_thread->Start.fp_context ) 47aa0: 202a 00c4 movel %a2@(196),%d0 #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; 47aa4: 42aa 0100 clrl %a2@(256) if ( the_thread->Start.fp_context ) 47aa8: 4a80 tstl %d0 47aaa: 670a beqs 47ab6 <_Thread_Close+0x8e> (void) _Workspace_Free( the_thread->Start.fp_context ); 47aac: 2f00 movel %d0,%sp@- 47aae: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47ab4: 588f addql #4,%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 ); 47ab6: 2f0a movel %a2,%sp@- 47ab8: 4eb9 0004 8810 jsr 48810 <_Thread_Stack_Free> the_thread->Start.stack = NULL; if ( the_thread->extensions ) 47abe: 202a 0114 movel %a2@(276),%d0 47ac2: 588f addql #4,%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; 47ac4: 42aa 00c8 clrl %a2@(200) if ( the_thread->extensions ) 47ac8: 4a80 tstl %d0 47aca: 670a beqs 47ad6 <_Thread_Close+0xae> (void) _Workspace_Free( the_thread->extensions ); 47acc: 2f00 movel %d0,%sp@- 47ace: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47ad4: 588f addql #4,%sp the_thread->extensions = NULL; 47ad6: 42aa 0114 clrl %a2@(276) } 47ada: 246e fff8 moveal %fp@(-8),%a2 47ade: 266e fffc moveal %fp@(-4),%a3 47ae2: 4e5e unlk %fp 47ae4: 4e75 rts */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) { _Thread_Allocated_fp = NULL; 47ae6: 42b9 0005 d9da clrl 5d9da <_Thread_Allocated_fp> 47aec: 60b2 bras 47aa0 <_Thread_Close+0x78> <== ALWAYS TAKEN */ _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 ); 47aee: 486a 0048 pea %a2@(72) 47af2: 4eb9 0004 8f60 jsr 48f60 <_Watchdog_Remove> 47af8: 588f addql #4,%sp /* * 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 ) ) 47afa: b5f9 0005 d9da cmpal 5d9da <_Thread_Allocated_fp>,%a2 47b00: 669e bnes 47aa0 <_Thread_Close+0x78> <== NEVER TAKEN 47b02: 60e2 bras 47ae6 <_Thread_Close+0xbe> <== NOT EXECUTED 00047bb4 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47bb4: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47bb8: 486e fffc pea %fp@(-4) 47bbc: 2f2e 0008 movel %fp@(8),%sp@- 47bc0: 4eb9 0004 7d70 jsr 47d70 <_Thread_Get> switch ( location ) { 47bc6: 508f addql #8,%sp 47bc8: 4aae fffc tstl %fp@(-4) 47bcc: 661e bnes 47bec <_Thread_Delay_ended+0x38> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 47bce: 2f3c 1000 0018 movel #268435480,%sp@- 47bd4: 2f00 movel %d0,%sp@- 47bd6: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> 47bdc: 508f addql #8,%sp 47bde: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 47be4: 5380 subql #1,%d0 47be6: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 47bec: 4e5e unlk %fp 47bee: 4e75 rts 00047bf0 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 47bf0: 4e56 ffc8 linkw %fp,#-56 47bf4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 47bf8: 2e3c 0000 0700 movel #1792,%d7 47bfe: 2007 movel %d7,%d0 { Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 47c00: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 _ISR_Disable( level ); 47c06: 40c1 movew %sr,%d1 47c08: 8081 orl %d1,%d0 47c0a: 46c0 movew %d0,%sr while ( _Context_Switch_necessary == true ) { 47c0c: 1039 0005 da1e moveb 5da1e <_Context_Switch_necessary>,%d0 47c12: 6700 00fa beqw 47d0e <_Thread_Dispatch+0x11e> 47c16: 260e movel %fp,%d3 47c18: 240e movel %fp,%d2 47c1a: 5183 subql #8,%d3 47c1c: 2c3c 0004 b278 movel #307832,%d6 47c22: 0682 ffff fff0 addil #-16,%d2 47c28: 2a3c 0004 8b18 movel #297752,%d5 47c2e: 283c 0004 8ad0 movel #297680,%d4 47c34: 4bf9 0004 8dd8 lea 48dd8 <_User_extensions_Thread_switch>,%a5 47c3a: 49f9 0004 914c lea 4914c <_CPU_Context_switch>,%a4 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 47c40: 7001 moveq #1,%d0 47c42: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 47c48: 2679 0005 d9e2 moveal 5d9e2 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 47c4e: 4200 clrb %d0 _Thread_Executing = heir; 47c50: 23cb 0005 da0e movel %a3,5da0e <_Thread_Executing> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 47c56: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> _Thread_Executing = heir; #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 ) 47c5c: 7001 moveq #1,%d0 47c5e: b0ab 007a cmpl %a3@(122),%d0 47c62: 6700 00d6 beqw 47d3a <_Thread_Dispatch+0x14a> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 47c66: 46c1 movew %d1,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47c68: 2f03 movel %d3,%sp@- 47c6a: 2046 moveal %d6,%a0 47c6c: 4e90 jsr %a0@ _Timestamp_Subtract( 47c6e: 2045 moveal %d5,%a0 47c70: 2f02 movel %d2,%sp@- 47c72: 2f03 movel %d3,%sp@- 47c74: 4879 0005 da16 pea 5da16 <_Thread_Time_of_last_context_switch> 47c7a: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47c7c: 2044 moveal %d4,%a0 47c7e: 2f02 movel %d2,%sp@- 47c80: 486a 0082 pea %a2@(130) 47c84: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47c86: 2079 0005 d9de moveal 5d9de <_Thread_libc_reent>,%a0 47c8c: 4fef 0018 lea %sp@(24),%sp &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 47c90: 202e fff8 movel %fp@(-8),%d0 47c94: 222e fffc movel %fp@(-4),%d1 47c98: 23c0 0005 da16 movel %d0,5da16 <_Thread_Time_of_last_context_switch> 47c9e: 23c1 0005 da1a movel %d1,5da1a <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47ca4: 4a88 tstl %a0 47ca6: 6708 beqs 47cb0 <_Thread_Dispatch+0xc0> <== ALWAYS TAKEN executing->libc_reent = *_Thread_libc_reent; 47ca8: 2550 0104 movel %a0@,%a2@(260) *_Thread_libc_reent = heir->libc_reent; 47cac: 20ab 0104 movel %a3@(260),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47cb0: 2f0b movel %a3,%sp@- 47cb2: 2f0a movel %a2,%sp@- 47cb4: 4e95 jsr %a5@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47cb6: 486b 00cc pea %a3@(204) 47cba: 486a 00cc pea %a2@(204) 47cbe: 4e94 jsr %a4@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 47cc0: 4fef 0010 lea %sp@(16),%sp 47cc4: 4aaa 0100 tstl %a2@(256) 47cc8: 672c beqs 47cf6 <_Thread_Dispatch+0x106> #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 ); 47cca: 2079 0005 d9da moveal 5d9da <_Thread_Allocated_fp>,%a0 47cd0: b1ca cmpal %a2,%a0 47cd2: 6722 beqs 47cf6 <_Thread_Dispatch+0x106> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47cd4: 4a88 tstl %a0 47cd6: 670c beqs 47ce4 <_Thread_Dispatch+0xf4> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47cd8: 4868 0100 pea %a0@(256) 47cdc: 4eb9 0004 927a jsr 4927a <_CPU_Context_save_fp> 47ce2: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 47ce4: 486a 0100 pea %a2@(256) 47ce8: 4eb9 0004 92b2 jsr 492b2 <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 47cee: 588f addql #4,%sp 47cf0: 23ca 0005 d9da movel %a2,5d9da <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 47cf6: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 _ISR_Disable( level ); 47cfc: 2007 movel %d7,%d0 47cfe: 40c1 movew %sr,%d1 47d00: 8081 orl %d1,%d0 47d02: 46c0 movew %d0,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 47d04: 1039 0005 da1e moveb 5da1e <_Context_Switch_necessary>,%d0 47d0a: 6600 ff34 bnew 47c40 <_Thread_Dispatch+0x50> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 47d0e: 42b9 0005 d954 clrl 5d954 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 47d14: 46c1 movew %d1,%sr if ( _Thread_Do_post_task_switch_extension || 47d16: 4ab9 0005 d9f6 tstl 5d9f6 <_Thread_Do_post_task_switch_extension> 47d1c: 6606 bnes 47d24 <_Thread_Dispatch+0x134> <== ALWAYS TAKEN executing->do_post_task_switch_extension ) { 47d1e: 4a2a 0074 tstb %a2@(116) 47d22: 670c beqs 47d30 <_Thread_Dispatch+0x140> executing->do_post_task_switch_extension = false; 47d24: 4201 clrb %d1 47d26: 1541 0074 moveb %d1,%a2@(116) _API_extensions_Run_postswitch(); 47d2a: 4eb9 0004 6600 jsr 46600 <_API_extensions_Run_postswitch> } } 47d30: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47d36: 4e5e unlk %fp 47d38: 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; 47d3a: 41f9 0005 d904 lea 5d904 <_Thread_Ticks_per_timeslice>,%a0 47d40: 2750 0076 movel %a0@,%a3@(118) 47d44: 6000 ff20 braw 47c66 <_Thread_Dispatch+0x76> <== ALWAYS TAKEN 0004d178 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4d178: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4d17c: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4d182: 4aa8 0010 tstl %a0@(16) 4d186: 660e bnes 4d196 <_Thread_Evaluate_mode+0x1e> <== ALWAYS TAKEN 4d188: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 4d18e: 6712 beqs 4d1a2 <_Thread_Evaluate_mode+0x2a> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4d190: 4a28 0075 tstb %a0@(117) 4d194: 670c beqs 4d1a2 <_Thread_Evaluate_mode+0x2a> <== ALWAYS TAKEN _Context_Switch_necessary = true; return true; } return false; } 4d196: 4e5e unlk %fp executing = _Thread_Executing; if ( !_States_Is_ready( executing->current_state ) || ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { _Context_Switch_necessary = true; 4d198: 7001 moveq #1,%d0 4d19a: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> return true; } return false; } 4d1a0: 4e75 rts 4d1a2: 4e5e unlk %fp executing = _Thread_Executing; if ( !_States_Is_ready( executing->current_state ) || ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { _Context_Switch_necessary = true; return true; 4d1a4: 4200 clrb %d0 } return false; } 4d1a6: 4e75 rts 0004d1a8 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4d1a8: 4e56 0000 linkw %fp,#0 4d1ac: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4d1ae: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4d1b4: 2f02 movel %d2,%sp@- /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4d1b6: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4d1ba: 40c0 movew %sr,%d0 4d1bc: e189 lsll #8,%d1 4d1be: 0280 0000 f8ff andil #63743,%d0 4d1c4: 8081 orl %d1,%d0 4d1c6: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4d1c8: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4d1ca: 1439 0005 d108 moveb 5d108 ,%d2 doneConstructors = 1; 4d1d0: 13c0 0005 d108 moveb %d0,5d108 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4d1d6: 4aaa 0100 tstl %a2@(256) 4d1da: 6720 beqs 4d1fc <_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 ); 4d1dc: 2079 0005 d9da moveal 5d9da <_Thread_Allocated_fp>,%a0 4d1e2: b1ca cmpal %a2,%a0 4d1e4: 6716 beqs 4d1fc <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4d1e6: 4a88 tstl %a0 4d1e8: 670c beqs 4d1f6 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4d1ea: 4868 0100 pea %a0@(256) 4d1ee: 4eb9 0004 927a jsr 4927a <_CPU_Context_save_fp> 4d1f4: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4d1f6: 23ca 0005 d9da movel %a2,5d9da <_Thread_Allocated_fp> /* * Take care that 'begin' extensions get to complete before * 'switch' extensions can run. This means must keep dispatch * disabled until all 'begin' extensions complete. */ _User_extensions_Thread_begin( executing ); 4d1fc: 2f0a movel %a2,%sp@- 4d1fe: 4eb9 0004 8c30 jsr 48c30 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4d204: 4eb9 0004 7d48 jsr 47d48 <_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 (!doneCons) /* && (volatile void *)_init) */ { 4d20a: 588f addql #4,%sp 4d20c: 4a02 tstb %d2 4d20e: 6746 beqs 4d256 <_Thread_Handler+0xae> INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4d210: 4aaa 009e tstl %a2@(158) 4d214: 6718 beqs 4d22e <_Thread_Handler+0x86> <== NEVER TAKEN * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 4d216: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4d218: 4eb9 0004 8c6e jsr 48c6e <_User_extensions_Thread_exitted> <== NOT EXECUTED _Internal_error_Occurred( 4d21e: 4878 0006 pea 6 <== NOT EXECUTED 4d222: 4878 0001 pea 1 <== NOT EXECUTED 4d226: 42a7 clrl %sp@- <== NOT EXECUTED 4d228: 4eb9 0004 6f7c jsr 46f7c <_Internal_error_Occurred> <== NOT EXECUTED } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4d22e: 2f2a 00a6 movel %a2@(166),%sp@- 4d232: 206a 009a moveal %a2@(154),%a0 4d236: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4d238: 588f addql #4,%sp 4d23a: 2540 0028 movel %d0,%a2@(40) * was placed in return_argument. This assumed that if it returned * anything (which is not supporting in all APIs), then it would be * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); 4d23e: 2f0a movel %a2,%sp@- 4d240: 4eb9 0004 8c6e jsr 48c6e <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4d246: 4878 0006 pea 6 4d24a: 4878 0001 pea 1 4d24e: 42a7 clrl %sp@- 4d250: 4eb9 0004 6f7c jsr 46f7c <_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 (!doneCons) /* && (volatile void *)_init) */ { INIT_NAME (); 4d256: 4eb9 0005 a858 jsr 5a858 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4d25c: 4aaa 009e tstl %a2@(158) 4d260: 66b4 bnes 4d216 <_Thread_Handler+0x6e> <== ALWAYS TAKEN 4d262: 60ca bras 4d22e <_Thread_Handler+0x86> <== ALWAYS TAKEN 00047e0c <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e0c: 4e56 ffe4 linkw %fp,#-28 47e10: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 47e14: 242e 0014 movel %fp@(20),%d2 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 47e18: 2f02 movel %d2,%sp@- Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e1a: 246e 000c moveal %fp@(12),%a2 47e1e: 262e 0018 movel %fp@(24),%d3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47e22: 42aa 0108 clrl %a2@(264) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e26: 266e 001c moveal %fp@(28),%a3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47e2a: 42aa 010c clrl %a2@(268) 47e2e: 42aa 0110 clrl %a2@(272) extensions_area = NULL; the_thread->libc_reent = NULL; 47e32: 42aa 0104 clrl %a2@(260) /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 47e36: 2f0a movel %a2,%sp@- Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e38: 182e 0023 moveb %fp@(35),%d4 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 47e3c: 4eb9 0004 87ac jsr 487ac <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 47e42: 508f addql #8,%sp 47e44: 4a80 tstl %d0 47e46: 6700 0110 beqw 47f58 <_Thread_Initialize+0x14c> 47e4a: b082 cmpl %d2,%d0 47e4c: 6500 010a bcsw 47f58 <_Thread_Initialize+0x14c> <== ALWAYS TAKEN void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 47e50: 2540 00bc movel %d0,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 47e54: 256a 00c8 00c0 movel %a2@(200),%a2@(192) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 47e5a: 4a03 tstb %d3 47e5c: 6600 0112 bnew 47f70 <_Thread_Initialize+0x164> 47e60: 4280 clrl %d0 47e62: 4285 clrl %d5 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47e64: 2239 0005 d9f2 movel 5d9f2 <_Thread_Maximum_extensions>,%d1 if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; the_thread->Start.fp_context = fp_area; 47e6a: 2540 00c4 movel %d0,%a2@(196) fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 47e6e: 2540 0100 movel %d0,%a2@(256) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47e72: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 47e76: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 47e7a: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 47e7e: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47e82: 4a81 tstl %d1 47e84: 6600 010c bnew 47f92 <_Thread_Initialize+0x186> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 47e88: 42aa 0114 clrl %a2@(276) 47e8c: 4283 clrl %d3 #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47e8e: 2f0b movel %a3,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47e90: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 47e96: 7001 moveq #1,%d0 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 47e98: 256e 0024 00ac movel %fp@(36),%a2@(172) the_thread->Start.budget_callout = budget_callout; 47e9e: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 47ea4: 1544 00aa moveb %d4,%a2@(170) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47ea8: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47eaa: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 47eae: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 47eb2: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 47eb6: 254b 0018 movel %a3,%a2@(24) the_thread->Start.initial_priority = priority; 47eba: 254b 00b8 movel %a3,%a2@(184) _Thread_Set_priority( the_thread, priority ); 47ebe: 4eb9 0004 85a4 jsr 485a4 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47ec4: 206e 0008 moveal %fp@(8),%a0 47ec8: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 47eca: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47ed0: 2068 0018 moveal %a0@(24),%a0 47ed4: 302a 000a movew %a2@(10),%d0 /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 47ed8: 42aa 0082 clrl %a2@(130) 47edc: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 47ee0: 42aa 0086 clrl %a2@(134) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 47ee4: 2f0a movel %a2,%sp@- 47ee6: 4eb9 0004 8d00 jsr 48d00 <_User_extensions_Thread_create> if ( extension_status ) 47eec: 4fef 000c lea %sp@(12),%sp 47ef0: 4a00 tstb %d0 47ef2: 6670 bnes 47f64 <_Thread_Initialize+0x158> return true; failed: if ( the_thread->libc_reent ) 47ef4: 202a 0104 movel %a2@(260),%d0 47ef8: 670a beqs 47f04 <_Thread_Initialize+0xf8> _Workspace_Free( the_thread->libc_reent ); 47efa: 2f00 movel %d0,%sp@- 47efc: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47f02: 588f addql #4,%sp 47f04: 47ea 0108 lea %a2@(264),%a3 47f08: 4282 clrl %d2 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); 47f0a: 49f9 0004 90cc lea 490cc <_Workspace_Free>,%a4 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 47f10: 2013 movel %a3@,%d0 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 47f12: 5282 addql #1,%d2 47f14: 588b addql #4,%a3 if ( the_thread->API_Extensions[i] ) 47f16: 4a80 tstl %d0 47f18: 6706 beqs 47f20 <_Thread_Initialize+0x114> _Workspace_Free( the_thread->API_Extensions[i] ); 47f1a: 2f00 movel %d0,%sp@- 47f1c: 4e94 jsr %a4@ 47f1e: 588f addql #4,%sp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 47f20: 7003 moveq #3,%d0 47f22: b082 cmpl %d2,%d0 47f24: 66ea bnes 47f10 <_Thread_Initialize+0x104> if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); if ( extensions_area ) 47f26: 4a83 tstl %d3 47f28: 670a beqs 47f34 <_Thread_Initialize+0x128> (void) _Workspace_Free( extensions_area ); 47f2a: 2f03 movel %d3,%sp@- 47f2c: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47f32: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 47f34: 4a85 tstl %d5 47f36: 670a beqs 47f42 <_Thread_Initialize+0x136> (void) _Workspace_Free( fp_area ); 47f38: 2f05 movel %d5,%sp@- 47f3a: 4eb9 0004 90cc jsr 490cc <_Workspace_Free> 47f40: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 47f42: 2f0a movel %a2,%sp@- 47f44: 4eb9 0004 8810 jsr 48810 <_Thread_Stack_Free> return false; 47f4a: 588f addql #4,%sp } 47f4c: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 47f52: 4200 clrb %d0 return false; } 47f54: 4e5e unlk %fp 47f56: 4e75 rts 47f58: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); return false; 47f5e: 4200 clrb %d0 } 47f60: 4e5e unlk %fp 47f62: 4e75 rts 47f64: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 47f6a: 7001 moveq #1,%d0 _Thread_Stack_Free( the_thread ); return false; } 47f6c: 4e5e unlk %fp 47f6e: 4e75 rts /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 47f70: 4878 001c pea 1c 47f74: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> if ( !fp_area ) 47f7a: 588f addql #4,%sp /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 47f7c: 2a00 movel %d0,%d5 if ( !fp_area ) 47f7e: 6600 fee4 bnew 47e64 <_Thread_Initialize+0x58> extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 47f82: 202a 0104 movel %a2@(260),%d0 * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) 47f86: 4283 clrl %d3 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 47f88: 4a80 tstl %d0 47f8a: 6600 ff6e bnew 47efa <_Thread_Initialize+0xee> <== ALWAYS TAKEN 47f8e: 6000 ff74 braw 47f04 <_Thread_Initialize+0xf8> <== ALWAYS TAKEN /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 47f92: e589 lsll #2,%d1 47f94: 2041 moveal %d1,%a0 47f96: 4868 0004 pea %a0@(4) 47f9a: 4eb9 0004 90b0 jsr 490b0 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 47fa0: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 47fa2: 2600 movel %d0,%d3 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 47fa4: 6700 ff4e beqw 47ef4 <_Thread_Initialize+0xe8> goto failed; } the_thread->extensions = (void **) extensions_area; 47fa8: 2040 moveal %d0,%a0 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 47faa: 4281 clrl %d1 47fac: 4280 clrl %d0 47fae: 2279 0005 d9f2 moveal 5d9f2 <_Thread_Maximum_extensions>,%a1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 47fb4: 2543 0114 movel %d3,%a2@(276) * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; 47fb8: 42b0 1c00 clrl %a0@(00000000,%d1:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 47fbc: 5280 addql #1,%d0 47fbe: 2200 movel %d0,%d1 47fc0: b3c0 cmpal %d0,%a1 47fc2: 6500 feca bcsw 47e8e <_Thread_Initialize+0x82> 47fc6: 206a 0114 moveal %a2@(276),%a0 47fca: 60ec bras 47fb8 <_Thread_Initialize+0x1ac> <== ALWAYS TAKEN 0004c708 <_Thread_Reset>: void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4c708: 4e56 0000 linkw %fp,#0 4c70c: 2f0a movel %a2,%sp@- 4c70e: 246e 0008 moveal %fp@(8),%a2 the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; 4c712: 256e 0010 00a6 movel %fp@(16),%a2@(166) the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4c718: 256a 00ac 007a movel %a2@(172),%a2@(122) the_thread->budget_callout = the_thread->Start.budget_callout; 4c71e: 256a 00b0 007e movel %a2@(176),%a2@(126) the_thread->Start.pointer_argument = pointer_argument; 4c724: 256e 000c 00a2 movel %fp@(12),%a2@(162) { the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; 4c72a: 156a 00aa 0075 moveb %a2@(170),%a2@(117) Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; 4c730: 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 ) ) { 4c734: 2f0a movel %a2,%sp@- 4c736: 4eb9 0004 8fd8 jsr 48fd8 <_Thread_queue_Extract_with_proxy> 4c73c: 588f addql #4,%sp 4c73e: 4a00 tstb %d0 4c740: 6608 bnes 4c74a <_Thread_Reset+0x42> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4c742: 7002 moveq #2,%d0 4c744: b0aa 0050 cmpl %a2@(80),%d0 4c748: 672a beqs 4c774 <_Thread_Reset+0x6c> (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { 4c74a: 202a 00b8 movel %a2@(184),%d0 4c74e: b0aa 0014 cmpl %a2@(20),%d0 4c752: 6718 beqs 4c76c <_Thread_Reset+0x64> the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4c754: 2d4a 0008 movel %a2,%fp@(8) 4c758: 2d40 000c movel %d0,%fp@(12) if ( _Watchdog_Is_active( &the_thread->Timer ) ) (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; 4c75c: 2540 0018 movel %d0,%a2@(24) _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); } } 4c760: 246e fffc moveal %fp@(-4),%a2 4c764: 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 ); 4c766: 4ef9 0004 91f8 jmp 491f8 <_Thread_Set_priority> } } 4c76c: 246e fffc moveal %fp@(-4),%a2 4c770: 4e5e unlk %fp 4c772: 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 ); 4c774: 486a 0048 pea %a2@(72) 4c778: 4eb9 0004 9bf8 jsr 49bf8 <_Watchdog_Remove> 4c77e: 588f addql #4,%sp 4c780: 60c8 bras 4c74a <_Thread_Reset+0x42> <== ALWAYS TAKEN ... 0004ba70 <_Thread_Reset_timeslice>: Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4ba70: 223c 0000 0700 movel #1792,%d1 4ba76: 2001 movel %d1,%d0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4ba78: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 4ba7c: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4ba82: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 4ba86: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4ba8a: 40c2 movew %sr,%d2 4ba8c: 8082 orl %d2,%d0 4ba8e: 46c0 movew %d0,%sr if ( _Chain_Has_only_one_node( ready ) ) { 4ba90: 2029 0008 movel %a1@(8),%d0 4ba94: b091 cmpl %a1@,%d0 4ba96: 6752 beqs 4baea <_Thread_Reset_timeslice+0x7a> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4ba98: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ba9a: 2009 movel %a1,%d0 4ba9c: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4ba9e: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4baa2: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4baa4: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4baa8: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 4baaa: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4baae: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4bab2: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4bab6: 2488 movel %a0,%a2@ return; } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 4bab8: 46c2 movew %d2,%sr 4baba: 8282 orl %d2,%d1 4babc: 46c1 movew %d1,%sr if ( _Thread_Is_heir( executing ) ) 4babe: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 4bac4: 6712 beqs 4bad8 <_Thread_Reset_timeslice+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; 4bac6: 7001 moveq #1,%d0 <== NOT EXECUTED 4bac8: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> <== NOT EXECUTED _ISR_Enable( level ); 4bace: 46c2 movew %d2,%sr <== NOT EXECUTED } 4bad0: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4bad4: 4e5e unlk %fp 4bad6: 4e75 rts _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 4bad8: 23d1 0005 d9e2 movel %a1@,5d9e2 <_Thread_Heir> _Context_Switch_necessary = true; 4bade: 7001 moveq #1,%d0 4bae0: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> _ISR_Enable( level ); 4bae6: 46c2 movew %d2,%sr 4bae8: 60e6 bras 4bad0 <_Thread_Reset_timeslice+0x60> <== ALWAYS TAKEN executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); if ( _Chain_Has_only_one_node( ready ) ) { _ISR_Enable( level ); 4baea: 46c2 movew %d2,%sr _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; _ISR_Enable( level ); } 4baec: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4baf0: 4e5e unlk %fp 4baf2: 4e75 rts 0004915c <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 4915c: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4915e: 4e56 0000 linkw %fp,#0 49162: 2f0a movel %a2,%sp@- 49164: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 49168: c0aa 0010 andl %a2@(16),%d0 4916c: 4a00 tstb %d0 4916e: 670a beqs 4917a <_Thread_Restart+0x1e> return true; } return false; } 49170: 246e fffc moveal %fp@(-4),%a2 49174: 4e5e unlk %fp Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 49176: 4200 clrb %d0 return true; } return false; } 49178: 4e75 rts Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 4917a: 2f0a movel %a2,%sp@- 4917c: 4eb9 0004 937c jsr 4937c <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 49182: 2f2e 0010 movel %fp@(16),%sp@- 49186: 2f2e 000c movel %fp@(12),%sp@- 4918a: 2f0a movel %a2,%sp@- 4918c: 4eb9 0004 c708 jsr 4c708 <_Thread_Reset> _Thread_Load_environment( the_thread ); 49192: 2f0a movel %a2,%sp@- 49194: 4eb9 0004 c35c jsr 4c35c <_Thread_Load_environment> _Thread_Ready( the_thread ); 4919a: 2f0a movel %a2,%sp@- 4919c: 4eb9 0004 c648 jsr 4c648 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 491a2: 2f0a movel %a2,%sp@- 491a4: 4eb9 0004 99e8 jsr 499e8 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 491aa: 4fef 001c lea %sp@(28),%sp 491ae: b5f9 0005 e956 cmpal 5e956 <_Thread_Executing>,%a2 491b4: 670a beqs 491c0 <_Thread_Restart+0x64> return true; } return false; } 491b6: 246e fffc moveal %fp@(-4),%a2 491ba: 4e5e unlk %fp _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 491bc: 7001 moveq #1,%d0 return true; } return false; } 491be: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 491c0: 4aaa 0100 tstl %a2@(256) 491c4: 6712 beqs 491d8 <_Thread_Restart+0x7c> _Context_Restore_fp( &_Thread_Executing->fp_context ); 491c6: 486a 0100 pea %a2@(256) 491ca: 4eb9 0004 9f4a jsr 49f4a <_CPU_Context_restore_fp> 491d0: 2479 0005 e956 moveal 5e956 <_Thread_Executing>,%a2 491d6: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 491d8: 222a 00cc movel %a2@(204),%d1 491dc: 202a 00fc movel %a2@(252),%d0 491e0: 46c1 movew %d1,%sr 491e2: 2e40 moveal %d0,%sp 491e4: 4e75 rts 491e6: 2540 00fc movel %d0,%a2@(252) <== NOT EXECUTED 491ea: 2541 00cc movel %d1,%a2@(204) <== NOT EXECUTED 491ee: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 491f2: 4e5e unlk %fp <== NOT EXECUTED 491f4: 7001 moveq #1,%d0 <== NOT EXECUTED 491f6: 4e75 rts 0004c6d0 <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c6d0: 327c 0700 moveaw #1792,%a1 4c6d4: 2009 movel %a1,%d0 void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4c6d6: 4e56 ffec linkw %fp,#-20 4c6da: 206e 0008 moveal %fp@(8),%a0 4c6de: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c6e2: 40c1 movew %sr,%d1 4c6e4: 8081 orl %d1,%d0 4c6e6: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4c6e8: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4c6ec: 0800 0001 btst #1,%d0 4c6f0: 6774 beqs 4c766 <_Thread_Resume+0x96> <== ALWAYS TAKEN 4c6f2: 74fd moveq #-3,%d2 4c6f4: c082 andl %d2,%d0 current_state = 4c6f6: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4c6fa: 666a bnes 4c766 <_Thread_Resume+0x96> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4c6fc: 2868 008e moveal %a0@(142),%a4 4c700: 3028 0094 movew %a0@(148),%d0 4c704: 3414 movew %a4@,%d2 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4c706: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4c70a: 260a movel %a2,%d3 4c70c: 5883 addql #4,%d3 4c70e: 8082 orl %d2,%d0 4c710: 2083 movel %d3,%a0@ old_last_node = the_chain->last; 4c712: 266a 0008 moveal %a2@(8),%a3 4c716: 3880 movew %d0,%a4@ the_chain->last = the_node; 4c718: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4c71c: 3439 0006 377c movew 6377c <_Priority_Major_bit_map>,%d2 4c722: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 4c726: 214b 0004 movel %a3,%a0@(4) 4c72a: 8082 orl %d2,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4c72c: 2688 movel %a0,%a3@ 4c72e: 33c0 0006 377c movew %d0,6377c <_Priority_Major_bit_map> _ISR_Flash( level ); 4c734: 2009 movel %a1,%d0 4c736: 46c1 movew %d1,%sr 4c738: 8081 orl %d1,%d0 4c73a: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4c73c: 2028 0014 movel %a0@(20),%d0 4c740: 2279 0006 375a moveal 6375a <_Thread_Heir>,%a1 4c746: b0a9 0014 cmpl %a1@(20),%d0 4c74a: 641a bccs 4c766 <_Thread_Resume+0x96> _Thread_Heir = the_thread; 4c74c: 23c8 0006 375a movel %a0,6375a <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4c752: 2079 0006 3786 moveal 63786 <_Thread_Executing>,%a0 4c758: 4a28 0075 tstb %a0@(117) 4c75c: 6712 beqs 4c770 <_Thread_Resume+0xa0> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c75e: 7001 moveq #1,%d0 4c760: 13c0 0006 3796 moveb %d0,63796 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4c766: 46c1 movew %d1,%sr } 4c768: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 4c76c: 4e5e unlk %fp 4c76e: 4e75 rts _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4c770: 4a80 tstl %d0 4c772: 66f2 bnes 4c766 <_Thread_Resume+0x96> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c774: 7001 moveq #1,%d0 <== NOT EXECUTED 4c776: 13c0 0006 3796 moveb %d0,63796 <_Context_Switch_necessary> <== NOT EXECUTED 4c77c: 60e8 bras 4c766 <_Thread_Resume+0x96> <== NOT EXECUTED ... 00048614 <_Thread_Set_state>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 48614: 203c 0000 0700 movel #1792,%d0 void _Thread_Set_state( Thread_Control *the_thread, States_Control state ) { 4861a: 4e56 fff4 linkw %fp,#-12 4861e: 206e 0008 moveal %fp@(8),%a0 48622: 48d7 040c moveml %d2-%d3/%a2,%sp@ 48626: 242e 000c movel %fp@(12),%d2 ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 4862a: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4862e: 40c1 movew %sr,%d1 48630: 8081 orl %d1,%d0 48632: 46c0 movew %d0,%sr if ( !_States_Is_ready( the_thread->current_state ) ) { 48634: 2028 0010 movel %a0@(16),%d0 48638: 6640 bnes 4867a <_Thread_Set_state+0x66> return; } the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { 4863a: 2029 0008 movel %a1@(8),%d0 _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = state; 4863e: 2142 0010 movel %d2,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 48642: b091 cmpl %a1@,%d0 48644: 6700 0096 beqw 486dc <_Thread_Set_state+0xc8> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48648: 2250 moveal %a0@,%a1 previous = the_node->previous; 4864a: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 4864e: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48650: 234a 0004 movel %a2,%a1@(4) _Priority_Remove_from_bit_map( &the_thread->Priority_map ); } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 48654: 203c 0000 0700 movel #1792,%d0 4865a: 46c1 movew %d1,%sr 4865c: 8081 orl %d1,%d0 4865e: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 48660: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 48666: 672e beqs 48696 <_Thread_Set_state+0x82> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 48668: b1f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a0 4866e: 671a beqs 4868a <_Thread_Set_state+0x76> _Context_Switch_necessary = true; _ISR_Enable( level ); 48670: 46c1 movew %d1,%sr } 48672: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48676: 4e5e unlk %fp 48678: 4e75 rts Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); if ( !_States_Is_ready( the_thread->current_state ) ) { the_thread->current_state = 4867a: 8480 orl %d0,%d2 4867c: 2142 0010 movel %d2,%a0@(16) _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); 48680: 46c1 movew %d1,%sr if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 48682: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48686: 4e5e unlk %fp 48688: 4e75 rts if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; 4868a: 7001 moveq #1,%d0 4868c: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> _ISR_Enable( level ); 48692: 46c1 movew %d1,%sr 48694: 60dc bras 48672 <_Thread_Set_state+0x5e> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 48696: 3039 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d0 4869c: 4840 swap %d0 4869e: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 486a0: 4282 clrl %d2 486a2: 43f9 0005 da70 lea 5da70 <_Priority_Bit_map>,%a1 486a8: 3400 movew %d0,%d2 486aa: 3031 2a00 movew %a1@(00000000,%d2:l:2),%d0 486ae: 4840 swap %d0 486b0: 04c0 ff1 %d0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 486b2: 4283 clrl %d3 486b4: e98a lsll #4,%d2 486b6: 3600 movew %d0,%d3 486b8: 2279 0005 d900 moveal 5d900 <_Thread_Ready_chain>,%a1 486be: 2002 movel %d2,%d0 486c0: d083 addl %d3,%d0 486c2: 2400 movel %d0,%d2 486c4: e58a lsll #2,%d2 486c6: e988 lsll #4,%d0 486c8: 93c2 subal %d2,%a1 486ca: d3c0 addal %d0,%a1 486cc: 23d1 0005 d9e2 movel %a1@,5d9e2 <_Thread_Heir> _ISR_Flash( level ); if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 486d2: b1f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a0 486d8: 6696 bnes 48670 <_Thread_Set_state+0x5c> 486da: 60ae bras 4868a <_Thread_Set_state+0x76> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 486dc: 2009 movel %a1,%d0 486de: 5880 addql #4,%d0 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 486e0: 2468 008e moveal %a0@(142),%a2 486e4: 2280 movel %d0,%a1@ 486e6: 3412 movew %a2@,%d2 486e8: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 486ec: 2349 0008 movel %a1,%a1@(8) 486f0: c082 andl %d2,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 486f2: 42a9 0004 clrl %a1@(4) 486f6: 3480 movew %d0,%a2@ the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 486f8: 6600 ff5a bnew 48654 <_Thread_Set_state+0x40> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 486fc: 3439 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d2 48702: 3028 0096 movew %a0@(150),%d0 48706: c082 andl %d2,%d0 48708: 33c0 0005 da04 movew %d0,5da04 <_Priority_Major_bit_map> } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 4870e: 203c 0000 0700 movel #1792,%d0 48714: 46c1 movew %d1,%sr 48716: 8081 orl %d1,%d0 48718: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 4871a: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 48720: 6600 ff46 bnew 48668 <_Thread_Set_state+0x54> 48724: 6000 ff70 braw 48696 <_Thread_Set_state+0x82> <== ALWAYS TAKEN 000488e4 <_Thread_Suspend>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 488e4: 203c 0000 0700 movel #1792,%d0 */ void _Thread_Suspend( Thread_Control *the_thread ) { 488ea: 4e56 fff4 linkw %fp,#-12 488ee: 206e 0008 moveal %fp@(8),%a0 488f2: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 488f6: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 488fa: 40c1 movew %sr,%d1 488fc: 8081 orl %d1,%d0 488fe: 46c0 movew %d0,%sr #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { 48900: 2028 0010 movel %a0@(16),%d0 48904: 6642 bnes 48948 <_Thread_Suspend+0x64> _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 48906: 7002 moveq #2,%d0 if ( _Chain_Has_only_one_node( ready ) ) { 48908: 2429 0008 movel %a1@(8),%d2 _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 4890c: 2140 0010 movel %d0,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 48910: b491 cmpl %a1@,%d2 48912: 6700 0098 beqw 489ac <_Thread_Suspend+0xc8> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48916: 2250 moveal %a0@,%a1 previous = the_node->previous; 48918: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 4891c: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4891e: 234a 0004 movel %a2,%a1@(4) _Priority_Remove_from_bit_map( &the_thread->Priority_map ); } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 48922: 203c 0000 0700 movel #1792,%d0 48928: 46c1 movew %d1,%sr 4892a: 8081 orl %d1,%d0 4892c: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 4892e: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 48934: 6730 beqs 48966 <_Thread_Suspend+0x82> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 48936: b1f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a0 4893c: 671c beqs 4895a <_Thread_Suspend+0x76> <== ALWAYS TAKEN _Context_Switch_necessary = true; _ISR_Enable( level ); 4893e: 46c1 movew %d1,%sr } 48940: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48944: 4e5e unlk %fp 48946: 4e75 rts _ISR_Disable( level ); #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { the_thread->current_state = 48948: 7402 moveq #2,%d2 4894a: 8480 orl %d0,%d2 4894c: 2142 0010 movel %d2,%a0@(16) _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); 48950: 46c1 movew %d1,%sr if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 48952: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48956: 4e5e unlk %fp 48958: 4e75 rts if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; 4895a: 7401 moveq #1,%d2 4895c: 13c2 0005 da1e moveb %d2,5da1e <_Context_Switch_necessary> _ISR_Enable( level ); 48962: 46c1 movew %d1,%sr 48964: 60da bras 48940 <_Thread_Suspend+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 48966: 3039 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d0 4896c: 4840 swap %d0 4896e: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 48970: 4282 clrl %d2 48972: 43f9 0005 da70 lea 5da70 <_Priority_Bit_map>,%a1 48978: 3400 movew %d0,%d2 4897a: 3031 2a00 movew %a1@(00000000,%d2:l:2),%d0 4897e: 4840 swap %d0 48980: 04c0 ff1 %d0 48982: 4283 clrl %d3 48984: e98a lsll #4,%d2 48986: 3600 movew %d0,%d3 48988: 2279 0005 d900 moveal 5d900 <_Thread_Ready_chain>,%a1 4898e: 2002 movel %d2,%d0 48990: d083 addl %d3,%d0 48992: 2400 movel %d0,%d2 48994: e58a lsll #2,%d2 48996: e988 lsll #4,%d0 48998: 93c2 subal %d2,%a1 4899a: d3c0 addal %d0,%a1 4899c: 23d1 0005 d9e2 movel %a1@,5d9e2 <_Thread_Heir> _ISR_Flash( level ); if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 489a2: b1f9 0005 da0e cmpal 5da0e <_Thread_Executing>,%a0 489a8: 6694 bnes 4893e <_Thread_Suspend+0x5a> <== ALWAYS TAKEN 489aa: 60ae bras 4895a <_Thread_Suspend+0x76> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 489ac: 2009 movel %a1,%d0 489ae: 5880 addql #4,%d0 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 489b0: 2468 008e moveal %a0@(142),%a2 489b4: 2280 movel %d0,%a1@ 489b6: 3412 movew %a2@,%d2 489b8: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 489bc: 2349 0008 movel %a1,%a1@(8) 489c0: c082 andl %d2,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 489c2: 42a9 0004 clrl %a1@(4) 489c6: 3480 movew %d0,%a2@ the_thread->current_state = STATES_SUSPENDED; if ( _Chain_Has_only_one_node( ready ) ) { _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 489c8: 6600 ff58 bnew 48922 <_Thread_Suspend+0x3e> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 489cc: 3439 0005 da04 movew 5da04 <_Priority_Major_bit_map>,%d2 489d2: 3028 0096 movew %a0@(150),%d0 489d6: c082 andl %d2,%d0 489d8: 33c0 0005 da04 movew %d0,5da04 <_Priority_Major_bit_map> } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 489de: 203c 0000 0700 movel #1792,%d0 489e4: 46c1 movew %d1,%sr 489e6: 8081 orl %d1,%d0 489e8: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 489ea: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 489f0: 6600 ff44 bnew 48936 <_Thread_Suspend+0x52> <== ALWAYS TAKEN 489f4: 6000 ff70 braw 48966 <_Thread_Suspend+0x82> <== ALWAYS TAKEN 00048a44 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48a44: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 48a48: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48a4e: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 48a52: 243c 0000 0700 movel #1792,%d2 48a58: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 48a5a: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 48a5e: 40c1 movew %sr,%d1 48a60: 8081 orl %d1,%d0 48a62: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 48a64: 2029 0008 movel %a1@(8),%d0 48a68: b091 cmpl %a1@,%d0 48a6a: 6750 beqs 48abc <_Thread_Yield_processor+0x78> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48a6c: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48a6e: 2009 movel %a1,%d0 48a70: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 48a72: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 48a76: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48a78: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48a7c: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 48a7e: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 48a82: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 48a86: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 48a8a: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 48a8c: 46c1 movew %d1,%sr 48a8e: 8481 orl %d1,%d2 48a90: 46c2 movew %d2,%sr if ( _Thread_Is_heir( executing ) ) 48a92: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 48a98: 6712 beqs 48aac <_Thread_Yield_processor+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48a9a: 7001 moveq #1,%d0 <== NOT EXECUTED 48a9c: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> <== NOT EXECUTED _ISR_Enable( level ); 48aa2: 46c1 movew %d1,%sr } 48aa4: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 48aa8: 4e5e unlk %fp 48aaa: 4e75 rts _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 48aac: 23d1 0005 d9e2 movel %a1@,5d9e2 <_Thread_Heir> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48ab2: 7001 moveq #1,%d0 48ab4: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> 48aba: 60e6 bras 48aa2 <_Thread_Yield_processor+0x5e> <== ALWAYS TAKEN if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 48abc: b1f9 0005 d9e2 cmpal 5d9e2 <_Thread_Heir>,%a0 48ac2: 67de beqs 48aa2 <_Thread_Yield_processor+0x5e> <== NEVER TAKEN _Context_Switch_necessary = true; 48ac4: 7001 moveq #1,%d0 <== NOT EXECUTED 48ac6: 13c0 0005 da1e moveb %d0,5da1e <_Context_Switch_necessary> <== NOT EXECUTED 48acc: 60d4 bras 48aa2 <_Thread_Yield_processor+0x5e> <== NOT EXECUTED ... 00048114 <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 48114: 203c 0000 0700 movel #1792,%d0 */ Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 4811a: 4e56 ffec linkw %fp,#-20 4811e: 226e 0008 moveal %fp@(8),%a1 48122: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 48126: 40c2 movew %sr,%d2 48128: 8082 orl %d2,%d0 4812a: 46c0 movew %d0,%sr 4812c: 4280 clrl %d0 4812e: 2049 moveal %a1,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 48130: 2208 movel %a0,%d1 48132: 5881 addql #4,%d1 48134: b290 cmpl %a0@,%d1 48136: 661c bnes 48154 <_Thread_queue_Dequeue_priority+0x40> for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 48138: 5280 addql #1,%d0 4813a: 41e8 000c lea %a0@(12),%a0 Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 4813e: 7204 moveq #4,%d1 48140: b280 cmpl %d0,%d1 48142: 66ec bnes 48130 <_Thread_queue_Dequeue_priority+0x1c> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 48144: 46c2 movew %d2,%sr 48146: 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 ); } 48148: 200a movel %a2,%d0 4814a: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48150: 4e5e unlk %fp 48152: 4e75 rts _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { the_thread = (Thread_Control *) 48154: 2200 movel %d0,%d1 48156: e588 lsll #2,%d0 48158: e989 lsll #4,%d1 4815a: 9280 subl %d0,%d1 4815c: 2471 1800 moveal %a1@(00000000,%d1:l),%a2 48160: 200a movel %a2,%d0 48162: 0680 0000 003c addil #60,%d0 _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; new_first_node = the_thread->Wait.Block2n.first; 48168: 206a 0038 moveal %a2@(56),%a0 new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 4816c: 2652 moveal %a2@,%a3 previous_node = the_thread->Object.Node.previous; 4816e: 226a 0004 moveal %a2@(4),%a1 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 48172: 42aa 0044 clrl %a2@(68) 48176: b088 cmpl %a0,%d0 48178: 6700 008a beqw 48204 <_Thread_queue_Dequeue_priority+0xf0> 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 ) ) { last_node = the_thread->Wait.Block2n.last; 4817c: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 48180: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 48182: 2748 0004 movel %a0,%a3@(4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 48186: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 48188: 2149 0004 movel %a1,%a0@(4) last_node = the_thread->Wait.Block2n.last; 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; 4818c: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4818e: 226a 0040 moveal %a2@(64),%a1 48192: b3ea 0038 cmpal %a2@(56),%a1 48196: 6716 beqs 481ae <_Thread_queue_Dequeue_priority+0x9a> /* > two threads on 2-n */ new_second_node->previous = 48198: 43e8 0038 lea %a0@(56),%a1 4819c: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 481a0: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 481a4: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 481a8: 41e8 003c lea %a0@(60),%a0 481ac: 2888 movel %a0,%a4@ } else { previous_node->next = next_node; next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 481ae: 7002 moveq #2,%d0 481b0: b0aa 0050 cmpl %a2@(80),%d0 481b4: 671e beqs 481d4 <_Thread_queue_Dequeue_priority+0xc0> _ISR_Enable( level ); 481b6: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 481b8: 2f3c 1003 fff8 movel #268697592,%sp@- 481be: 2f0a movel %a2,%sp@- 481c0: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> 481c6: 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 ); } 481c8: 200a movel %a2,%d0 481ca: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 481d0: 4e5e unlk %fp 481d2: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 481d4: 7203 moveq #3,%d1 481d6: 2541 0050 movel %d1,%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 ); 481da: 46c2 movew %d2,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 481dc: 486a 0048 pea %a2@(72) 481e0: 4eb9 0004 8f60 jsr 48f60 <_Watchdog_Remove> 481e6: 2f3c 1003 fff8 movel #268697592,%sp@- 481ec: 2f0a movel %a2,%sp@- 481ee: 4eb9 0004 7974 jsr 47974 <_Thread_Clear_state> 481f4: 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 ); } 481f8: 200a movel %a2,%d0 481fa: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48200: 4e5e unlk %fp 48202: 4e75 rts last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; next_node->previous = previous_node; 48204: 2749 0004 movel %a1,%a3@(4) new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 48208: 228b movel %a3,%a1@ 4820a: 60a2 bras 481ae <_Thread_queue_Dequeue_priority+0x9a> <== ALWAYS TAKEN 000482a8 <_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 ) { 482a8: 4e56 ffe4 linkw %fp,#-28 482ac: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 482b0: 266e 000c moveal %fp@(12),%a3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 482b4: 41eb 003c lea %a3@(60),%a0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 482b8: 263c 0000 0700 movel #1792,%d3 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 482be: 222b 0014 movel %a3@(20),%d1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 482c2: 2401 movel %d1,%d2 482c4: ec8a lsrl #6,%d2 482c6: 2002 movel %d2,%d0 482c8: e58a lsll #2,%d2 482ca: e988 lsll #4,%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 482cc: 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 ]; 482d0: 9082 subl %d2,%d0 482d2: 45f4 0800 lea %a4@(00000000,%d0:l),%a2 482d6: 2748 0038 movel %a0,%a3@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 482da: 41eb 0038 lea %a3@(56),%a0 block_state = the_thread_queue->state; 482de: 242c 0038 movel %a4@(56),%d2 482e2: 2748 0040 movel %a0,%a3@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 482e6: 42ab 003c clrl %a3@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 482ea: 0801 0005 btst #5,%d1 482ee: 6656 bnes 48346 <_Thread_queue_Enqueue_priority+0x9e> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 482f0: 2a0a movel %a2,%d5 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 482f2: 2803 movel %d3,%d4 482f4: 5885 addql #4,%d5 482f6: 2004 movel %d4,%d0 482f8: 40c3 movew %sr,%d3 482fa: 8083 orl %d3,%d0 482fc: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->first; 482fe: 2052 moveal %a2@,%a0 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48300: ba88 cmpl %a0,%d5 48302: 6700 010a beqw 4840e <_Thread_queue_Enqueue_priority+0x166> search_priority = search_thread->current_priority; 48306: 2268 0014 moveal %a0@(20),%a1 if ( priority <= search_priority ) 4830a: b3c1 cmpal %d1,%a1 4830c: 6418 bccs 48326 <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 4830e: 2004 movel %d4,%d0 48310: 46c3 movew %d3,%sr 48312: 8083 orl %d3,%d0 48314: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 48316: 2002 movel %d2,%d0 48318: c0a8 0010 andl %a0@(16),%d0 4831c: 6700 0092 beqw 483b0 <_Thread_queue_Enqueue_priority+0x108> <== ALWAYS TAKEN _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 48320: 2050 moveal %a0@,%a0 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48322: ba88 cmpl %a0,%d5 48324: 66e0 bnes 48306 <_Thread_queue_Enqueue_priority+0x5e> 48326: 2403 movel %d3,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48328: 7001 moveq #1,%d0 4832a: b0ac 0030 cmpl %a4@(48),%d0 4832e: 6700 0094 beqw 483c4 <_Thread_queue_Enqueue_priority+0x11c> <== NEVER TAKEN * 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; 48332: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 48336: 202c 0030 movel %a4@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 4833a: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 4833c: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 48340: 4e5e unlk %fp 48342: 4e75 rts if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 48344: 46c4 movew %d4,%sr the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 48346: 4284 clrl %d4 48348: 1839 0005 c222 moveb 5c222 ,%d4 _ISR_Disable( level ); 4834e: 2003 movel %d3,%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; 48350: 2244 moveal %d4,%a1 48352: 5289 addql #1,%a1 _ISR_Disable( level ); 48354: 40c4 movew %sr,%d4 48356: 8084 orl %d4,%d0 48358: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->last; 4835a: 206a 0008 moveal %a2@(8),%a0 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4835e: b5c8 cmpal %a0,%a2 48360: 6720 beqs 48382 <_Thread_queue_Enqueue_priority+0xda> search_priority = search_thread->current_priority; 48362: 2268 0014 moveal %a0@(20),%a1 if ( priority >= search_priority ) 48366: b3c1 cmpal %d1,%a1 48368: 6318 blss 48382 <_Thread_queue_Enqueue_priority+0xda> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 4836a: 2003 movel %d3,%d0 4836c: 46c4 movew %d4,%sr 4836e: 8084 orl %d4,%d0 48370: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 48372: 2002 movel %d2,%d0 48374: c0a8 0010 andl %a0@(16),%d0 48378: 67ca beqs 48344 <_Thread_queue_Enqueue_priority+0x9c> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 4837a: 2068 0004 moveal %a0@(4),%a0 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4837e: b5c8 cmpal %a0,%a2 48380: 66e0 bnes 48362 <_Thread_queue_Enqueue_priority+0xba> 48382: 2404 movel %d4,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 48384: 7001 moveq #1,%d0 48386: b0ac 0030 cmpl %a4@(48),%d0 4838a: 66a6 bnes 48332 <_Thread_queue_Enqueue_priority+0x8a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4838c: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 48390: b3c1 cmpal %d1,%a1 48392: 6756 beqs 483ea <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 48394: 2250 moveal %a0@,%a1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 48396: 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; 4839a: 2689 movel %a1,%a3@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4839c: 274c 0044 movel %a4,%a3@(68) 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; 483a0: 208b movel %a3,%a0@ next_node->previous = the_node; 483a2: 234b 0004 movel %a3,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 483a6: 46c4 movew %d4,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 483a8: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 483ac: 4e5e unlk %fp 483ae: 4e75 rts if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 483b0: 46c3 movew %d3,%sr <== NOT EXECUTED if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 483b2: 2004 movel %d4,%d0 <== NOT EXECUTED 483b4: 40c3 movew %sr,%d3 <== NOT EXECUTED 483b6: 8083 orl %d3,%d0 <== NOT EXECUTED 483b8: 46c0 movew %d0,%sr <== NOT EXECUTED search_thread = (Thread_Control *) header->first; 483ba: 2052 moveal %a2@,%a0 <== NOT EXECUTED while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 483bc: ba88 cmpl %a0,%d5 <== NOT EXECUTED 483be: 6600 ff46 bnew 48306 <_Thread_queue_Enqueue_priority+0x5e> <== NOT EXECUTED 483c2: 604a bras 4840e <_Thread_queue_Enqueue_priority+0x166> <== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 483c4: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 483c8: b3c1 cmpal %d1,%a1 483ca: 671e beqs 483ea <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 483cc: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 483d0: 2688 movel %a0,%a3@ the_node->previous = previous_node; 483d2: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 483d6: 274c 0044 movel %a4,%a3@(68) 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; 483da: 228b movel %a3,%a1@ search_node->previous = the_node; 483dc: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 483e0: 46c3 movew %d3,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 483e2: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 483e6: 4e5e unlk %fp 483e8: 4e75 rts 483ea: 41e8 003c lea %a0@(60),%a0 _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; 483ee: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 483f2: 2688 movel %a0,%a3@ the_node->previous = previous_node; 483f4: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 483f8: 274c 0044 movel %a4,%a3@(68) 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; 483fc: 228b movel %a3,%a1@ search_node->previous = the_node; 483fe: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 48402: 46c2 movew %d2,%sr 48404: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 48406: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 4840a: 4e5e unlk %fp 4840c: 4e75 rts restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4840e: 2403 movel %d3,%d2 48410: 327c ffff moveaw #-1,%a1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48414: 7001 moveq #1,%d0 48416: b0ac 0030 cmpl %a4@(48),%d0 4841a: 6600 ff16 bnew 48332 <_Thread_queue_Enqueue_priority+0x8a> 4841e: 60a4 bras 483c4 <_Thread_queue_Enqueue_priority+0x11c> <== ALWAYS TAKEN 0004820c <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 4820c: 4e56 fff0 linkw %fp,#-16 48210: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48214: 266e 0008 moveal %fp@(8),%a3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 48218: 2f2b 0038 movel %a3@(56),%sp@- Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 4821c: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 48222: 242e 000c movel %fp@(12),%d2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 48226: 2f0a movel %a2,%sp@- 48228: 4eb9 0004 8614 jsr 48614 <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 4822e: 508f addql #8,%sp 48230: 4a82 tstl %d2 48232: 6644 bnes 48278 <_Thread_queue_Enqueue_with_handler+0x6c> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 48234: 41f9 0004 82a8 lea 482a8 <_Thread_queue_Enqueue_priority>,%a0 4823a: 7001 moveq #1,%d0 4823c: b0ab 0034 cmpl %a3@(52),%d0 48240: 6706 beqs 48248 <_Thread_queue_Enqueue_with_handler+0x3c> 48242: 41f9 0004 b7e4 lea 4b7e4 <_Thread_queue_Enqueue_fifo>,%a0 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 48248: 486e fffc pea %fp@(-4) 4824c: 2f0a movel %a2,%sp@- 4824e: 2f0b movel %a3,%sp@- 48250: 4e90 jsr %a0@ if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 48252: 4fef 000c lea %sp@(12),%sp 48256: 7201 moveq #1,%d1 48258: b280 cmpl %d0,%d1 4825a: 6712 beqs 4826e <_Thread_queue_Enqueue_with_handler+0x62> _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 4825c: 2f2e fffc movel %fp@(-4),%sp@- 48260: 2f0a movel %a2,%sp@- 48262: 2f00 movel %d0,%sp@- 48264: 4eb9 0004 77c0 jsr 477c0 <_Thread_blocking_operation_Cancel> 4826a: 4fef 000c lea %sp@(12),%sp } 4826e: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48274: 4e5e unlk %fp 48276: 4e75 rts /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { _Watchdog_Initialize( 48278: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4827c: 256e 0010 0064 movel %fp@(16),%a2@(100) the_watchdog->id = id; 48282: 2540 0068 movel %d0,%a2@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 48286: 2542 0054 movel %d2,%a2@(84) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4828a: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4828e: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 48292: 486a 0048 pea %a2@(72) 48296: 4879 0005 da2c pea 5da2c <_Watchdog_Ticks_chain> 4829c: 4eb9 0004 8e18 jsr 48e18 <_Watchdog_Insert> 482a2: 508f addql #8,%sp 482a4: 608e bras 48234 <_Thread_queue_Enqueue_with_handler+0x28> <== ALWAYS TAKEN ... 0004b878 <_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 ); 4b878: 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 ) { 4b87e: 4e56 ffec linkw %fp,#-20 4b882: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4b886: 246e 000c moveal %fp@(12),%a2 4b88a: 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 ); 4b88e: 40c1 movew %sr,%d1 4b890: 8081 orl %d1,%d0 4b892: 46c0 movew %d0,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4b894: 202a 0010 movel %a2@(16),%d0 4b898: 0280 0003 bee0 andil #245472,%d0 4b89e: 677e beqs 4b91e <_Thread_queue_Extract_priority_helper+0xa6> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4b8a0: 200a movel %a2,%d0 4b8a2: 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; 4b8a8: 2652 moveal %a2@,%a3 previous_node = the_node->previous; 4b8aa: 226a 0004 moveal %a2@(4),%a1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4b8ae: 206a 0038 moveal %a2@(56),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4b8b2: b088 cmpl %a0,%d0 4b8b4: 6774 beqs 4b92a <_Thread_queue_Extract_priority_helper+0xb2> if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 4b8b6: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4b8ba: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4b8bc: 2748 0004 movel %a0,%a3@(4) new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 4b8c0: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4b8c2: 2149 0004 movel %a1,%a0@(4) last_node = the_thread->Wait.Block2n.last; 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; 4b8c6: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4b8c8: 202a 0040 movel %a2@(64),%d0 4b8cc: b0aa 0038 cmpl %a2@(56),%d0 4b8d0: 6716 beqs 4b8e8 <_Thread_queue_Extract_priority_helper+0x70> /* > two threads on 2-n */ new_second_node->previous = 4b8d2: 43e8 0038 lea %a0@(56),%a1 4b8d6: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4b8da: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4b8de: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4b8e2: 41e8 003c lea %a0@(60),%a0 4b8e6: 2888 movel %a0,%a4@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4b8e8: 4a02 tstb %d2 4b8ea: 6626 bnes 4b912 <_Thread_queue_Extract_priority_helper+0x9a> <== ALWAYS TAKEN _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4b8ec: 7002 moveq #2,%d0 4b8ee: b0aa 0050 cmpl %a2@(80),%d0 4b8f2: 6742 beqs 4b936 <_Thread_queue_Extract_priority_helper+0xbe> _ISR_Enable( level ); 4b8f4: 46c1 movew %d1,%sr 4b8f6: 2d4a 0008 movel %a2,%fp@(8) 4b8fa: 227c 1003 fff8 moveal #268697592,%a1 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4b900: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b906: 2d49 000c movel %a1,%fp@(12) 4b90a: 4e5e unlk %fp 4b90c: 4ef9 0004 7974 jmp 47974 <_Thread_Clear_state> /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { _ISR_Enable( level ); 4b912: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4b914: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b91a: 4e5e unlk %fp 4b91c: 4e75 rts Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4b91e: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4b920: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b926: 4e5e unlk %fp 4b928: 4e75 rts new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; next_node->previous = previous_node; 4b92a: 2749 0004 movel %a1,%a3@(4) new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 4b92e: 228b movel %a3,%a1@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4b930: 4a02 tstb %d2 4b932: 67b8 beqs 4b8ec <_Thread_queue_Extract_priority_helper+0x74> 4b934: 60dc bras 4b912 <_Thread_queue_Extract_priority_helper+0x9a> <== ALWAYS TAKEN 4b936: 7003 moveq #3,%d0 4b938: 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 ); 4b93c: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4b93e: 486a 0048 pea %a2@(72) 4b942: 4eb9 0004 8f60 jsr 48f60 <_Watchdog_Remove> 4b948: 588f addql #4,%sp 4b94a: 227c 1003 fff8 moveal #268697592,%a1 4b950: 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 } 4b954: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b95a: 2d49 000c movel %a1,%fp@(12) 4b95e: 4e5e unlk %fp 4b960: 4ef9 0004 7974 jmp 47974 <_Thread_Clear_state> ... 00048488 <_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 ) { 48488: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 4848a: 4e56 0000 linkw %fp,#0 4848e: 206e 0008 moveal %fp@(8),%a0 the_thread_queue->state = state; 48492: 216e 0010 0038 movel %fp@(16),%a0@(56) Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 48498: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 4849c: 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; 484a2: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 484a6: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 484aa: b280 cmpl %d0,%d1 484ac: 6712 beqs 484c0 <_Thread_queue_Initialize+0x38> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484ae: 2008 movel %a0,%d0 484b0: 5880 addql #4,%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 484b2: 2148 0008 movel %a0,%a0@(8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484b6: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 484b8: 42a8 0004 clrl %a0@(4) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo ); } } 484bc: 4e5e unlk %fp 484be: 4e75 rts * timeout_status - return on a timeout * * Output parameters: NONE */ void _Thread_queue_Initialize( 484c0: 2008 movel %a0,%d0 484c2: 0680 0000 0030 addil #48,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484c8: 2208 movel %a0,%d1 484ca: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 484cc: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484d0: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 484d2: 2148 0008 movel %a0,%a0@(8) 484d6: 41e8 000c lea %a0@(12),%a0 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 484da: b088 cmpl %a0,%d0 484dc: 67de beqs 484bc <_Thread_queue_Initialize+0x34> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484de: 2208 movel %a0,%d1 484e0: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 484e2: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 484e6: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 484e8: 2148 0008 movel %a0,%a0@(8) 484ec: 41e8 000c lea %a0@(12),%a0 484f0: b088 cmpl %a0,%d0 484f2: 66d4 bnes 484c8 <_Thread_queue_Initialize+0x40> 484f4: 60c6 bras 484bc <_Thread_queue_Initialize+0x34> <== ALWAYS TAKEN ... 000484f8 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 484f8: 4e56 fff0 linkw %fp,#-16 484fc: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48500: 246e 0008 moveal %fp@(8),%a2 48504: 266e 000c moveal %fp@(12),%a3 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 48508: 4a8a tstl %a2 4850a: 6708 beqs 48514 <_Thread_queue_Requeue+0x1c> <== ALWAYS 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 ) { 4850c: 7001 moveq #1,%d0 4850e: b0aa 0034 cmpl %a2@(52),%d0 48512: 670a beqs 4851e <_Thread_queue_Requeue+0x26> <== NEVER TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 48514: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 <== NOT EXECUTED 4851a: 4e5e unlk %fp <== NOT EXECUTED 4851c: 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 ); 4851e: 303c 0700 movew #1792,%d0 48522: 40c2 movew %sr,%d2 48524: 8082 orl %d2,%d0 48526: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48528: 202b 0010 movel %a3@(16),%d0 4852c: 0280 0003 bee0 andil #245472,%d0 48532: 660c bnes 48540 <_Thread_queue_Requeue+0x48> <== NEVER 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 ); 48534: 46c2 movew %d2,%sr <== NOT EXECUTED } } 48536: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 4853c: 4e5e unlk %fp 4853e: 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 ); 48540: 4878 0001 pea 1 48544: 7001 moveq #1,%d0 48546: 2f0b movel %a3,%sp@- 48548: 2540 0030 movel %d0,%a2@(48) 4854c: 2f0a movel %a2,%sp@- 4854e: 4eb9 0004 b878 jsr 4b878 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 48554: 486e fffc pea %fp@(-4) 48558: 2f0b movel %a3,%sp@- 4855a: 2f0a movel %a2,%sp@- 4855c: 4eb9 0004 82a8 jsr 482a8 <_Thread_queue_Enqueue_priority> 48562: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 48566: 46c2 movew %d2,%sr 48568: 60cc bras 48536 <_Thread_queue_Requeue+0x3e> <== ALWAYS TAKEN ... 0004856c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4856c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48570: 486e fffc pea %fp@(-4) 48574: 2f2e 0008 movel %fp@(8),%sp@- 48578: 4eb9 0004 7d70 jsr 47d70 <_Thread_Get> switch ( location ) { 4857e: 508f addql #8,%sp 48580: 4aae fffc tstl %fp@(-4) 48584: 6618 bnes 4859e <_Thread_queue_Timeout+0x32> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 48586: 2f00 movel %d0,%sp@- 48588: 4eb9 0004 b968 jsr 4b968 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4858e: 588f addql #4,%sp 48590: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 48596: 5380 subql #1,%d0 48598: 23c0 0005 d954 movel %d0,5d954 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 4859e: 4e5e unlk %fp 485a0: 4e75 rts ... 00058ce8 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 58ce8: 4e56 ffb0 linkw %fp,#-80 58cec: 41ee ffec lea %fp@(-20),%a0 58cf0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 58cf4: 246e 0008 moveal %fp@(8),%a2 58cf8: 2c0e movel %fp,%d6 58cfa: 260e movel %fp,%d3 58cfc: 5186 subql #8,%d6 58cfe: 0683 ffff ffe8 addil #-24,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d04: 240a movel %a2,%d2 /* * 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 ); 58d06: 2a0a movel %a2,%d5 58d08: 4bf9 0005 cd94 lea 5cd94 <_Watchdog_Adjust_to_chain>,%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d0e: 0682 0000 0030 addil #48,%d2 /* * 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 ); 58d14: 0685 0000 0068 addil #104,%d5 58d1a: 47f9 0005 9754 lea 59754 <_Chain_Get>,%a3 58d20: 49f9 0005 ce24 lea 5ce24 <_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 ); 58d26: 283c 0000 0700 movel #1792,%d4 58d2c: 2d48 ffd8 movel %a0,%fp@(-40) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 58d30: 41ea 0008 lea %a2@(8),%a0 58d34: 2d48 ffe0 movel %a0,%fp@(-32) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 58d38: 41ea 0040 lea %a2@(64),%a0 58d3c: 2d48 ffe4 movel %a0,%fp@(-28) Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58d40: 41ee fff4 lea %fp@(-12),%a0 58d44: 2d48 fffc movel %a0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58d48: 41ee ffec lea %fp@(-20),%a0 58d4c: 2d46 fff4 movel %d6,%fp@(-12) the_chain->permanent_null = NULL; 58d50: 42ae fff8 clrl %fp@(-8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58d54: 2d48 ffe8 movel %a0,%fp@(-24) the_chain->permanent_null = NULL; 58d58: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 58d5c: 2d43 fff0 movel %d3,%fp@(-16) { /* * 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; 58d60: 41ee fff4 lea %fp@(-12),%a0 58d64: 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; 58d68: 2039 0007 ca30 movel 7ca30 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 58d6e: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 58d72: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d76: 9081 subl %d1,%d0 58d78: 2f03 movel %d3,%sp@- 58d7a: 2f00 movel %d0,%sp@- 58d7c: 2f02 movel %d2,%sp@- 58d7e: 4e95 jsr %a5@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58d80: 2039 0007 c982 movel 7c982 <_TOD_Now>,%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 ) { 58d86: 4fef 000c lea %sp@(12),%sp Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 58d8a: 222a 0074 movel %a2@(116),%d1 /* * 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 ) { 58d8e: b280 cmpl %d0,%d1 58d90: 6500 0086 bcsw 58e18 <_Timer_server_Body+0x130> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 58d94: b280 cmpl %d0,%d1 58d96: 6200 00a4 bhiw 58e3c <_Timer_server_Body+0x154> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 58d9a: 2540 0074 movel %d0,%a2@(116) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 58d9e: 202a 0078 movel %a2@(120),%d0 58da2: 2f00 movel %d0,%sp@- 58da4: 4e93 jsr %a3@ if ( timer == NULL ) { 58da6: 588f addql #4,%sp 58da8: 4a80 tstl %d0 58daa: 672e beqs 58dda <_Timer_server_Body+0xf2> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58dac: 2040 moveal %d0,%a0 58dae: 7e01 moveq #1,%d7 58db0: 2228 0038 movel %a0@(56),%d1 58db4: be81 cmpl %d1,%d7 58db6: 6700 00a8 beqw 58e60 <_Timer_server_Body+0x178> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 58dba: 7e03 moveq #3,%d7 58dbc: be81 cmpl %d1,%d7 58dbe: 66de bnes 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 58dc0: 2040 moveal %d0,%a0 58dc2: 4868 0010 pea %a0@(16) 58dc6: 2f05 movel %d5,%sp@- 58dc8: 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 ); 58dca: 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 ); 58dce: 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 ); 58dd0: 2f00 movel %d0,%sp@- 58dd2: 4e93 jsr %a3@ if ( timer == NULL ) { 58dd4: 588f addql #4,%sp 58dd6: 4a80 tstl %d0 58dd8: 66d2 bnes 58dac <_Timer_server_Body+0xc4> <== ALWAYS 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 ); 58dda: 2004 movel %d4,%d0 58ddc: 40c1 movew %sr,%d1 58dde: 8081 orl %d1,%d0 58de0: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 58de2: bcae fff4 cmpl %fp@(-12),%d6 58de6: 6700 0086 beqw 58e6e <_Timer_server_Body+0x186> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 58dea: 46c1 movew %d1,%sr static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 58dec: 2039 0007 ca30 movel 7ca30 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 58df2: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 58df6: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58dfa: 9081 subl %d1,%d0 58dfc: 2f03 movel %d3,%sp@- 58dfe: 2f00 movel %d0,%sp@- 58e00: 2f02 movel %d2,%sp@- 58e02: 4e95 jsr %a5@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58e04: 2039 0007 c982 movel 7c982 <_TOD_Now>,%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 ) { 58e0a: 4fef 000c lea %sp@(12),%sp Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 58e0e: 222a 0074 movel %a2@(116),%d1 /* * 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 ) { 58e12: b280 cmpl %d0,%d1 58e14: 6400 ff7e bccw 58d94 <_Timer_server_Body+0xac> <== NEVER TAKEN /* * 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 ); 58e18: 2f03 movel %d3,%sp@- 58e1a: 2e00 movel %d0,%d7 58e1c: 9e81 subl %d1,%d7 58e1e: 2f07 movel %d7,%sp@- 58e20: 2d40 ffdc movel %d0,%fp@(-36) 58e24: 2f05 movel %d5,%sp@- 58e26: 4eb9 0005 cd94 jsr 5cd94 <_Watchdog_Adjust_to_chain> 58e2c: 202e ffdc movel %fp@(-36),%d0 58e30: 4fef 000c lea %sp@(12),%sp */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 58e34: 2540 0074 movel %d0,%a2@(116) 58e38: 6000 ff64 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN /* * 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 ); 58e3c: 9280 subl %d0,%d1 58e3e: 2f01 movel %d1,%sp@- 58e40: 4878 0001 pea 1 58e44: 2d40 ffdc movel %d0,%fp@(-36) 58e48: 2f05 movel %d5,%sp@- 58e4a: 4eb9 0005 cd00 jsr 5cd00 <_Watchdog_Adjust> 58e50: 202e ffdc movel %fp@(-36),%d0 58e54: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 58e58: 2540 0074 movel %d0,%a2@(116) 58e5c: 6000 ff40 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 58e60: 4868 0010 pea %a0@(16) 58e64: 2f02 movel %d2,%sp@- 58e66: 4e94 jsr %a4@ 58e68: 508f addql #8,%sp 58e6a: 6000 ff32 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 58e6e: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 58e72: 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 ) ) { 58e74: 202e ffd8 movel %fp@(-40),%d0 58e78: b0ae ffe8 cmpl %fp@(-24),%d0 58e7c: 6752 beqs 58ed0 <_Timer_server_Body+0x1e8> /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 58e7e: 2204 movel %d4,%d1 58e80: 40c0 movew %sr,%d0 58e82: 8280 orl %d0,%d1 58e84: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58e86: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 58e8a: b1ee ffd8 cmpal %fp@(-40),%a0 58e8e: 6732 beqs 58ec2 <_Timer_server_Body+0x1da> <== ALWAYS TAKEN { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 58e90: 2250 moveal %a0@,%a1 the_chain->first = new_first; 58e92: 2d49 ffe8 movel %a1,%fp@(-24) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 58e96: 42a8 0008 clrl %a0@(8) new_first->previous = _Chain_Head(the_chain); 58e9a: 2343 0004 movel %d3,%a1@(4) _ISR_Enable( level ); 58e9e: 46c0 movew %d0,%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 ); 58ea0: 2f28 0024 movel %a0@(36),%sp@- 58ea4: 2f28 0020 movel %a0@(32),%sp@- 58ea8: 2068 001c moveal %a0@(28),%a0 58eac: 4e90 jsr %a0@ } 58eae: 508f addql #8,%sp /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 58eb0: 2204 movel %d4,%d1 58eb2: 40c0 movew %sr,%d0 58eb4: 8280 orl %d0,%d1 58eb6: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58eb8: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 58ebc: b1ee ffd8 cmpal %fp@(-40),%a0 58ec0: 66ce bnes 58e90 <_Timer_server_Body+0x1a8> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 58ec2: 46c0 movew %d0,%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; 58ec4: 41ee fff4 lea %fp@(-12),%a0 58ec8: 2548 0078 movel %a0,%a2@(120) 58ecc: 6000 fe9a braw 58d68 <_Timer_server_Body+0x80> <== ALWAYS TAKEN * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 58ed0: 4207 clrb %d7 58ed2: 1547 007c moveb %d7,%a2@(124) 58ed6: 2039 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d0 58edc: 5280 addql #1,%d0 58ede: 23c0 0007 c8f0 movel %d0,7c8f0 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 58ee4: 4878 0008 pea 8 58ee8: 2f12 movel %a2@,%sp@- 58eea: 4eb9 0005 c450 jsr 5c450 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 58ef0: 2f0a movel %a2,%sp@- 58ef2: 4eba fd1c jsr %pc@(58c10 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 58ef6: 2f0a movel %a2,%sp@- 58ef8: 4eba fd80 jsr %pc@(58c7a <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 58efc: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> ts->active = true; 58f02: 7001 moveq #1,%d0 58f04: 1540 007c moveb %d0,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 58f08: 2f2e ffe0 movel %fp@(-32),%sp@- 58f0c: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 58f12: 2f2e ffe4 movel %fp@(-28),%sp@- 58f16: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> 58f1c: 4fef 0018 lea %sp@(24),%sp 58f20: 6000 fe3e braw 58d60 <_Timer_server_Body+0x78> <== ALWAYS TAKEN 00058f24 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 58f24: 4e56 fff0 linkw %fp,#-16 58f28: 206e 000c moveal %fp@(12),%a0 58f2c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 58f30: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 58f34: 202a 0078 movel %a2@(120),%d0 58f38: 671a beqs 58f54 <_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 ); 58f3a: 202a 0078 movel %a2@(120),%d0 58f3e: 2d48 000c movel %a0,%fp@(12) } } 58f42: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 * 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 ); 58f48: 2d40 0008 movel %d0,%fp@(8) } } 58f4c: 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 ); 58f4e: 4ef9 0005 971c jmp 5971c <_Chain_Append> 58f54: 2039 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d0 58f5a: 5280 addql #1,%d0 58f5c: 23c0 0007 c8f0 movel %d0,7c8f0 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58f62: 2028 0038 movel %a0@(56),%d0 58f66: 7201 moveq #1,%d1 58f68: b280 cmpl %d0,%d1 58f6a: 6700 0088 beqw 58ff4 <_Timer_server_Schedule_operation_method+0xd0> _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 ) { 58f6e: 7203 moveq #3,%d1 58f70: b280 cmpl %d0,%d1 58f72: 670e beqs 58f82 <_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 ); } } 58f74: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 58f7a: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 58f7c: 4ef9 0005 ba08 jmp 5ba08 <_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 ); 58f82: 203c 0000 0700 movel #1792,%d0 58f88: 40c2 movew %sr,%d2 58f8a: 8082 orl %d2,%d0 58f8c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 58f8e: 260a movel %a2,%d3 58f90: 0683 0000 006c addil #108,%d3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58f96: 2039 0007 c982 movel 7c982 <_TOD_Now>,%d0 last_snapshot = ts->TOD_watchdogs.last_snapshot; 58f9c: 222a 0074 movel %a2@(116),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58fa0: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 58fa4: b689 cmpl %a1,%d3 58fa6: 671a beqs 58fc2 <_Timer_server_Schedule_operation_method+0x9e> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 58fa8: 2629 0010 movel %a1@(16),%d3 if ( snapshot > last_snapshot ) { 58fac: b280 cmpl %d0,%d1 58fae: 6400 00b8 bccw 59068 <_Timer_server_Schedule_operation_method+0x144> /* * We advanced in time. */ delta = snapshot - last_snapshot; 58fb2: 2800 movel %d0,%d4 58fb4: 9881 subl %d1,%d4 if (delta_interval > delta) { 58fb6: b883 cmpl %d3,%d4 58fb8: 6500 00ba bcsw 59074 <_Timer_server_Schedule_operation_method+0x150> <== NEVER TAKEN 58fbc: 4281 clrl %d1 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 58fbe: 2341 0010 movel %d1,%a1@(16) <== NOT EXECUTED } ts->TOD_watchdogs.last_snapshot = snapshot; 58fc2: 2540 0074 movel %d0,%a2@(116) _ISR_Enable( level ); 58fc6: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 58fc8: 4868 0010 pea %a0@(16) 58fcc: 486a 0068 pea %a2@(104) 58fd0: 4eb9 0005 ce24 jsr 5ce24 <_Watchdog_Insert> if ( !ts->active ) { 58fd6: 508f addql #8,%sp 58fd8: 102a 007c moveb %a2@(124),%d0 58fdc: 6696 bnes 58f74 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_tod_system_watchdog( ts ); 58fde: 2f0a movel %a2,%sp@- 58fe0: 4eba fc98 jsr %pc@(58c7a <_Timer_server_Reset_tod_system_watchdog>) 58fe4: 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 ); } } 58fe6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 58fec: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 58fee: 4ef9 0005 ba08 jmp 5ba08 <_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 ); 58ff4: 203c 0000 0700 movel #1792,%d0 58ffa: 40c3 movew %sr,%d3 58ffc: 8083 orl %d3,%d0 58ffe: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 59000: 2039 0007 ca30 movel 7ca30 <_Watchdog_Ticks_since_boot>,%d0 59006: 240a movel %a2,%d2 59008: 0682 0000 0034 addil #52,%d2 last_snapshot = ts->Interval_watchdogs.last_snapshot; 5900e: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 59012: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 59016: b489 cmpl %a1,%d2 59018: 6712 beqs 5902c <_Timer_server_Schedule_operation_method+0x108> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 5901a: 2800 movel %d0,%d4 5901c: 9881 subl %d1,%d4 delta_interval = first_watchdog->delta_interval; 5901e: 2429 0010 movel %a1@(16),%d2 if (delta_interval > delta) { 59022: b484 cmpl %d4,%d2 59024: 623a bhis 59060 <_Timer_server_Schedule_operation_method+0x13c> 59026: 4282 clrl %d2 delta_interval -= delta; } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 59028: 2342 0010 movel %d2,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 5902c: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 59030: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 59032: 4868 0010 pea %a0@(16) 59036: 486a 0030 pea %a2@(48) 5903a: 4eb9 0005 ce24 jsr 5ce24 <_Watchdog_Insert> if ( !ts->active ) { 59040: 508f addql #8,%sp 59042: 102a 007c moveb %a2@(124),%d0 59046: 6600 ff2c bnew 58f74 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_interval_system_watchdog( ts ); 5904a: 2f0a movel %a2,%sp@- 5904c: 4eba fbc2 jsr %pc@(58c10 <_Timer_server_Reset_interval_system_watchdog>) 59050: 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 ); } } 59052: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 59058: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 5905a: 4ef9 0005 ba08 jmp 5ba08 <_Thread_Enable_dispatch> */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; 59060: 9484 subl %d4,%d2 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 59062: 2342 0010 movel %d2,%a1@(16) 59066: 60c4 bras 5902c <_Timer_server_Schedule_operation_method+0x108> <== ALWAYS TAKEN } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 59068: d283 addl %d3,%d1 delta_interval += delta; 5906a: 9280 subl %d0,%d1 } first_watchdog->delta_interval = delta_interval; 5906c: 2341 0010 movel %d1,%a1@(16) 59070: 6000 ff50 braw 58fc2 <_Timer_server_Schedule_operation_method+0x9e> <== ALWAYS TAKEN /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; 59074: 9684 subl %d4,%d3 59076: 2203 movel %d3,%d1 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 59078: 2341 0010 movel %d1,%a1@(16) 5907c: 6000 ff44 braw 58fc2 <_Timer_server_Schedule_operation_method+0x9e> <== ALWAYS TAKEN 00048ad0 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 48ad0: 4e56 0000 linkw %fp,#0 48ad4: 226e 0008 moveal %fp@(8),%a1 48ad8: 2f0a movel %a2,%sp@- 48ada: 246e 000c moveal %fp@(12),%a2 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 48ade: 206a 0004 moveal %a2@(4),%a0 48ae2: d1e9 0004 addal %a1@(4),%a0 /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 48ae6: 2208 movel %a0,%d1 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 48ae8: 2012 movel %a2@,%d0 /* Add the basics */ time->tv_sec += add->tv_sec; 48aea: d191 addl %d0,%a1@ time->tv_nsec += add->tv_nsec; 48aec: 2348 0004 movel %a0,%a1@(4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 48af0: b1fc 3b9a c9ff cmpal #999999999,%a0 48af6: 631a blss 48b12 <_Timespec_Add_to+0x42> 48af8: 2051 moveal %a1@,%a0 * * This routines adds two timespecs. The second argument is added * to the first. */ uint32_t _Timespec_Add_to( 48afa: 5288 addql #1,%a0 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; 48afc: 0681 c465 3600 addil #-1000000000,%d1 time->tv_sec++; seconds++; 48b02: 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 ) { 48b04: 0c81 3b9a c9ff cmpil #999999999,%d1 48b0a: 62ee bhis 48afa <_Timespec_Add_to+0x2a> <== ALWAYS TAKEN 48b0c: 2288 movel %a0,%a1@ 48b0e: 2341 0004 movel %d1,%a1@(4) time->tv_sec++; seconds++; } return seconds; } 48b12: 245f moveal %sp@+,%a2 48b14: 4e5e unlk %fp 48b16: 4e75 rts 0007ae1c <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 7ae1c: 4e56 0000 linkw %fp,#0 7ae20: 226e 0008 moveal %fp@(8),%a1 7ae24: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec > rhs->tv_sec ) 7ae28: 2211 movel %a1@,%d1 7ae2a: 2010 movel %a0@,%d0 7ae2c: b081 cmpl %d1,%d0 7ae2e: 6d18 blts 7ae48 <_Timespec_Greater_than+0x2c> return true; if ( lhs->tv_sec < rhs->tv_sec ) 7ae30: 6e10 bgts 7ae42 <_Timespec_Greater_than+0x26> <== ALWAYS TAKEN #include #include #include bool _Timespec_Greater_than( 7ae32: 2068 0004 moveal %a0@(4),%a0 7ae36: b1e9 0004 cmpal %a1@(4),%a0 7ae3a: 5dc0 slt %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 7ae3c: 4e5e unlk %fp #include #include #include bool _Timespec_Greater_than( 7ae3e: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 7ae40: 4e75 rts 7ae42: 4e5e unlk %fp <== NOT EXECUTED ) { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) 7ae44: 4200 clrb %d0 <== NOT EXECUTED /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 7ae46: 4e75 rts <== NOT EXECUTED 7ae48: 4e5e unlk %fp bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 7ae4a: 7001 moveq #1,%d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 7ae4c: 4e75 rts ... 00048cae <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 48cae: 4e56 fff0 linkw %fp,#-16 48cb2: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48cb6: 242e 0008 movel %fp@(8),%d2 48cba: 262e 0010 movel %fp@(16),%d3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48cbe: 2479 0005 daea moveal 5daea <_User_extensions_List+0x8>,%a2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 48cc4: 182e 000f moveb %fp@(15),%d4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48cc8: b5fc 0005 dae2 cmpal #383714,%a2 48cce: 6726 beqs 48cf6 <_User_extensions_Fatal+0x48> <== ALWAYS TAKEN the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 48cd0: 0284 0000 00ff andil #255,%d4 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 48cd6: 206a 0030 moveal %a2@(48),%a0 48cda: 4a88 tstl %a0 48cdc: 670c beqs 48cea <_User_extensions_Fatal+0x3c> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 48cde: 2f03 movel %d3,%sp@- 48ce0: 2f04 movel %d4,%sp@- 48ce2: 2f02 movel %d2,%sp@- 48ce4: 4e90 jsr %a0@ 48ce6: 4fef 000c lea %sp@(12),%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48cea: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48cee: b5fc 0005 dae2 cmpal #383714,%a2 48cf4: 66e0 bnes 48cd6 <_User_extensions_Fatal+0x28> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 48cf6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48cfc: 4e5e unlk %fp 48cfe: 4e75 rts 00048b6c <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 48b6c: 4e56 ffec linkw %fp,#-20 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48b70: 203c 0005 dae6 movel #383718,%d0 48b76: 23c0 0005 dae2 movel %d0,5dae2 <_User_extensions_List> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 48b7c: 203c 0005 dae2 movel #383714,%d0 48b82: 23c0 0005 daea movel %d0,5daea <_User_extensions_List+0x8> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48b88: 203c 0005 d95c movel #383324,%d0 48b8e: 23c0 0005 d958 movel %d0,5d958 <_User_extensions_Switches_list> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 48b94: 203c 0005 d958 movel #383320,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 48b9a: 42b9 0005 dae6 clrl 5dae6 <_User_extensions_List+0x4> 48ba0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 48ba4: 2439 0005 c25a movel 5c25a ,%d2 initial_extensions = Configuration.User_extension_table; 48baa: 2639 0005 c25e movel 5c25e ,%d3 48bb0: 42b9 0005 d95c clrl 5d95c <_User_extensions_Switches_list+0x4> the_chain->last = _Chain_Head(the_chain); 48bb6: 23c0 0005 d960 movel %d0,5d960 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 48bbc: 4a83 tstl %d3 48bbe: 6764 beqs 48c24 <_User_extensions_Handler_initialization+0xb8> extension = (User_extensions_Control *) 48bc0: 7834 moveq #52,%d4 48bc2: 4c02 4800 mulsl %d2,%d4 48bc6: 2f04 movel %d4,%sp@- 48bc8: 4eb9 0004 907c jsr 4907c <_Workspace_Allocate_or_fatal_error> 48bce: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 48bd0: 2f04 movel %d4,%sp@- 48bd2: 42a7 clrl %sp@- 48bd4: 2f00 movel %d0,%sp@- 48bd6: 4eb9 0004 e098 jsr 4e098 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48bdc: 4fef 0010 lea %sp@(16),%sp 48be0: 4a82 tstl %d2 48be2: 6740 beqs 48c24 <_User_extensions_Handler_initialization+0xb8> <== ALWAYS TAKEN 48be4: 4284 clrl %d4 48be6: 47f9 0004 baf4 lea 4baf4 <_User_extensions_Add_set>,%a3 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 48bec: 2043 moveal %d3,%a0 48bee: 5284 addql #1,%d4 48bf0: 0683 0000 0020 addil #32,%d3 48bf6: 2558 0014 movel %a0@+,%a2@(20) 48bfa: 2558 0018 movel %a0@+,%a2@(24) 48bfe: 2558 001c movel %a0@+,%a2@(28) 48c02: 2558 0020 movel %a0@+,%a2@(32) 48c06: 2558 0024 movel %a0@+,%a2@(36) 48c0a: 2558 0028 movel %a0@+,%a2@(40) 48c0e: 2558 002c movel %a0@+,%a2@(44) 48c12: 2550 0030 movel %a0@,%a2@(48) _User_extensions_Add_set( extension ); 48c16: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 48c18: 45ea 0034 lea %a2@(52),%a2 48c1c: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48c1e: 588f addql #4,%sp 48c20: b882 cmpl %d2,%d4 48c22: 65c8 bcss 48bec <_User_extensions_Handler_initialization+0x80> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 48c24: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 48c2a: 4e5e unlk %fp 48c2c: 4e75 rts ... 00048c30 <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 48c30: 4e56 0000 linkw %fp,#0 48c34: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48c36: 2479 0005 dae2 moveal 5dae2 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 48c3c: 2f02 movel %d2,%sp@- 48c3e: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48c42: b5fc 0005 dae6 cmpal #383718,%a2 48c48: 6718 beqs 48c62 <_User_extensions_Thread_begin+0x32> <== ALWAYS TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) 48c4a: 206a 0028 moveal %a2@(40),%a0 48c4e: 4a88 tstl %a0 48c50: 6706 beqs 48c58 <_User_extensions_Thread_begin+0x28> (*the_extension->Callouts.thread_begin)( executing ); 48c52: 2f02 movel %d2,%sp@- 48c54: 4e90 jsr %a0@ 48c56: 588f addql #4,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48c58: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48c5a: b5fc 0005 dae6 cmpal #383718,%a2 48c60: 66e8 bnes 48c4a <_User_extensions_Thread_begin+0x1a> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) (*the_extension->Callouts.thread_begin)( executing ); } } 48c62: 242e fff8 movel %fp@(-8),%d2 48c66: 246e fffc moveal %fp@(-4),%a2 48c6a: 4e5e unlk %fp 48c6c: 4e75 rts 00048d00 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 48d00: 4e56 0000 linkw %fp,#0 48d04: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48d06: 2479 0005 dae2 moveal 5dae2 <_User_extensions_List>,%a2 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 48d0c: 2f02 movel %d2,%sp@- 48d0e: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48d12: b5fc 0005 dae6 cmpal #383718,%a2 48d18: 6722 beqs 48d3c <_User_extensions_Thread_create+0x3c> <== ALWAYS TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 48d1a: 206a 0014 moveal %a2@(20),%a0 48d1e: 4a88 tstl %a0 48d20: 6710 beqs 48d32 <_User_extensions_Thread_create+0x32> status = (*the_extension->Callouts.thread_create)( 48d22: 2f02 movel %d2,%sp@- 48d24: 2f39 0005 da0e movel 5da0e <_Thread_Executing>,%sp@- 48d2a: 4e90 jsr %a0@ _Thread_Executing, the_thread ); if ( !status ) 48d2c: 508f addql #8,%sp 48d2e: 4a00 tstb %d0 48d30: 670c beqs 48d3e <_User_extensions_Thread_create+0x3e> User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48d32: 2452 moveal %a2@,%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48d34: b5fc 0005 dae6 cmpal #383718,%a2 48d3a: 66de bnes 48d1a <_User_extensions_Thread_create+0x1a> 48d3c: 7001 moveq #1,%d0 return false; } } return true; } 48d3e: 242e fff8 movel %fp@(-8),%d2 48d42: 246e fffc moveal %fp@(-4),%a2 48d46: 4e5e unlk %fp 48d48: 4e75 rts ... 00048d4c <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 48d4c: 4e56 0000 linkw %fp,#0 48d50: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48d52: 2479 0005 daea moveal 5daea <_User_extensions_List+0x8>,%a2 #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 48d58: 2f02 movel %d2,%sp@- 48d5a: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48d5e: b5fc 0005 dae2 cmpal #383714,%a2 48d64: 6720 beqs 48d86 <_User_extensions_Thread_delete+0x3a> <== ALWAYS TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) 48d66: 206a 0020 moveal %a2@(32),%a0 48d6a: 4a88 tstl %a0 48d6c: 670c beqs 48d7a <_User_extensions_Thread_delete+0x2e> (*the_extension->Callouts.thread_delete)( 48d6e: 2f02 movel %d2,%sp@- 48d70: 2f39 0005 da0e movel 5da0e <_Thread_Executing>,%sp@- 48d76: 4e90 jsr %a0@ 48d78: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48d7a: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48d7e: b5fc 0005 dae2 cmpal #383714,%a2 48d84: 66e0 bnes 48d66 <_User_extensions_Thread_delete+0x1a> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 48d86: 242e fff8 movel %fp@(-8),%d2 48d8a: 246e fffc moveal %fp@(-4),%a2 48d8e: 4e5e unlk %fp 48d90: 4e75 rts ... 00048c6e <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 48c6e: 4e56 0000 linkw %fp,#0 48c72: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48c74: 2479 0005 daea moveal 5daea <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 48c7a: 2f02 movel %d2,%sp@- 48c7c: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48c80: b5fc 0005 dae2 cmpal #383714,%a2 48c86: 671a beqs 48ca2 <_User_extensions_Thread_exitted+0x34> <== ALWAYS TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 48c88: 206a 002c moveal %a2@(44),%a0 48c8c: 4a88 tstl %a0 48c8e: 6706 beqs 48c96 <_User_extensions_Thread_exitted+0x28> (*the_extension->Callouts.thread_exitted)( executing ); 48c90: 2f02 movel %d2,%sp@- 48c92: 4e90 jsr %a0@ 48c94: 588f addql #4,%sp <== NOT EXECUTED Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48c96: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48c9a: b5fc 0005 dae2 cmpal #383714,%a2 48ca0: 66e6 bnes 48c88 <_User_extensions_Thread_exitted+0x1a> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 48ca2: 242e fff8 movel %fp@(-8),%d2 48ca6: 246e fffc moveal %fp@(-4),%a2 48caa: 4e5e unlk %fp 48cac: 4e75 rts 000499e8 <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 499e8: 4e56 0000 linkw %fp,#0 499ec: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 499ee: 2479 0005 ea2a moveal 5ea2a <_User_extensions_List>,%a2 #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 499f4: 2f02 movel %d2,%sp@- 499f6: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 499fa: b5fc 0005 ea2e cmpal #387630,%a2 49a00: 671e beqs 49a20 <_User_extensions_Thread_restart+0x38> <== ALWAYS TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) 49a02: 206a 001c moveal %a2@(28),%a0 49a06: 4a88 tstl %a0 49a08: 670c beqs 49a16 <_User_extensions_Thread_restart+0x2e> (*the_extension->Callouts.thread_restart)( 49a0a: 2f02 movel %d2,%sp@- 49a0c: 2f39 0005 e956 movel 5e956 <_Thread_Executing>,%sp@- 49a12: 4e90 jsr %a0@ 49a14: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 49a16: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 49a18: b5fc 0005 ea2e cmpal #387630,%a2 49a1e: 66e2 bnes 49a02 <_User_extensions_Thread_restart+0x1a> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 49a20: 242e fff8 movel %fp@(-8),%d2 49a24: 246e fffc moveal %fp@(-4),%a2 49a28: 4e5e unlk %fp 49a2a: 4e75 rts 00048d94 <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 48d94: 4e56 0000 linkw %fp,#0 48d98: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48d9a: 2479 0005 dae2 moveal 5dae2 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 48da0: 2f02 movel %d2,%sp@- 48da2: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48da6: b5fc 0005 dae6 cmpal #383718,%a2 48dac: 671e beqs 48dcc <_User_extensions_Thread_start+0x38> <== ALWAYS TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) 48dae: 206a 0018 moveal %a2@(24),%a0 48db2: 4a88 tstl %a0 48db4: 670c beqs 48dc2 <_User_extensions_Thread_start+0x2e> (*the_extension->Callouts.thread_start)( 48db6: 2f02 movel %d2,%sp@- 48db8: 2f39 0005 da0e movel 5da0e <_Thread_Executing>,%sp@- 48dbe: 4e90 jsr %a0@ 48dc0: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48dc2: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48dc4: b5fc 0005 dae6 cmpal #383718,%a2 48dca: 66e2 bnes 48dae <_User_extensions_Thread_start+0x1a> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 48dcc: 242e fff8 movel %fp@(-8),%d2 48dd0: 246e fffc moveal %fp@(-4),%a2 48dd4: 4e5e unlk %fp 48dd6: 4e75 rts 00048dd8 <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 48dd8: 4e56 fff4 linkw %fp,#-12 48ddc: 48d7 040c moveml %d2-%d3/%a2,%sp@ 48de0: 262e 0008 movel %fp@(8),%d3 48de4: 242e 000c movel %fp@(12),%d2 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 48de8: 2479 0005 d958 moveal 5d958 <_User_extensions_Switches_list>,%a2 48dee: b5fc 0005 d95c cmpal #383324,%a2 48df4: 6716 beqs 48e0c <_User_extensions_Thread_switch+0x34> <== ALWAYS TAKEN !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); 48df6: 2f02 movel %d2,%sp@- 48df8: 2f03 movel %d3,%sp@- 48dfa: 206a 0008 moveal %a2@(8),%a0 48dfe: 4e90 jsr %a0@ Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { 48e00: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 48e02: 508f addql #8,%sp 48e04: b5fc 0005 d95c cmpal #383324,%a2 48e0a: 66ea bnes 48df6 <_User_extensions_Thread_switch+0x1e> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 48e0c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 48e12: 4e5e unlk %fp 48e14: 4e75 rts ... 0004aaf4 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4aaf4: 4e56 ffe8 linkw %fp,#-24 4aaf8: 226e 000c moveal %fp@(12),%a1 4aafc: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ ISR_Level level; _ISR_Disable( level ); 4ab00: 283c 0000 0700 movel #1792,%d4 4ab06: 2004 movel %d4,%d0 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4ab08: 266e 0008 moveal %fp@(8),%a3 4ab0c: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4ab10: 40c1 movew %sr,%d1 4ab12: 8081 orl %d1,%d0 4ab14: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4ab16: 244b moveal %a3,%a2 4ab18: 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 ) ) { 4ab1a: b5c8 cmpal %a0,%a2 4ab1c: 6748 beqs 4ab66 <_Watchdog_Adjust+0x72> switch ( direction ) { 4ab1e: 4a89 tstl %a1 4ab20: 6650 bnes 4ab72 <_Watchdog_Adjust+0x7e> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4ab22: 4a82 tstl %d2 4ab24: 6740 beqs 4ab66 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4ab26: 2628 0010 movel %a0@(16),%d3 4ab2a: 49f9 0004 ad70 lea 4ad70 <_Watchdog_Tickle>,%a4 4ab30: b682 cmpl %d2,%d3 4ab32: 622c bhis 4ab60 <_Watchdog_Adjust+0x6c> <== ALWAYS TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4ab34: 7001 moveq #1,%d0 4ab36: 2140 0010 movel %d0,%a0@(16) _ISR_Enable( level ); 4ab3a: 46c1 movew %d1,%sr _Watchdog_Tickle( header ); 4ab3c: 2f0b movel %a3,%sp@- 4ab3e: 4e94 jsr %a4@ _ISR_Disable( level ); 4ab40: 2004 movel %d4,%d0 4ab42: 40c1 movew %sr,%d1 4ab44: 8081 orl %d1,%d0 4ab46: 46c0 movew %d0,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4ab48: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 4ab4a: 588f addql #4,%sp 4ab4c: 2013 movel %a3@,%d0 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 4ab4e: 2040 moveal %d0,%a0 4ab50: b08a cmpl %a2,%d0 4ab52: 6712 beqs 4ab66 <_Watchdog_Adjust+0x72> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4ab54: 4a82 tstl %d2 4ab56: 670e beqs 4ab66 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4ab58: 2628 0010 movel %a0@(16),%d3 4ab5c: b483 cmpl %d3,%d2 4ab5e: 64d4 bccs 4ab34 <_Watchdog_Adjust+0x40> _Watchdog_First( header )->delta_interval -= units; 4ab60: 9682 subl %d2,%d3 4ab62: 2143 0010 movel %d3,%a0@(16) } break; } } _ISR_Enable( level ); 4ab66: 46c1 movew %d1,%sr } 4ab68: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4ab6e: 4e5e unlk %fp 4ab70: 4e75 rts * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4ab72: 7001 moveq #1,%d0 4ab74: b089 cmpl %a1,%d0 4ab76: 66ee bnes 4ab66 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4ab78: d5a8 0010 addl %d2,%a0@(16) } break; } } _ISR_Enable( level ); 4ab7c: 46c1 movew %d1,%sr } 4ab7e: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4ab84: 4e5e unlk %fp 4ab86: 4e75 rts 0005cd94 <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 5cd94: 4e56 ffe4 linkw %fp,#-28 5cd98: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 5cd9c: 2a6e 0008 moveal %fp@(8),%a5 5cda0: 282e 000c movel %fp@(12),%d4 5cda4: 266e 0010 moveal %fp@(16),%a3 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { 5cda8: 675e beqs 5ce08 <_Watchdog_Adjust_to_chain+0x74> return; } _ISR_Disable( level ); 5cdaa: 263c 0000 0700 movel #1792,%d3 5cdb0: 2003 movel %d3,%d0 5cdb2: 40c1 movew %sr,%d1 5cdb4: 8081 orl %d1,%d0 5cdb6: 46c0 movew %d0,%sr 5cdb8: 284d moveal %a5,%a4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5cdba: 240b movel %a3,%d2 5cdbc: 5882 addql #4,%d2 5cdbe: 205c moveal %a4@+,%a0 while ( 1 ) { if ( units <= 0 ) { break; } if ( _Chain_Is_empty( header ) ) { 5cdc0: b1cc cmpal %a4,%a0 5cdc2: 6742 beqs 5ce06 <_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 ) { 5cdc4: 2028 0010 movel %a0@(16),%d0 5cdc8: b880 cmpl %d0,%d4 5cdca: 654c bcss 5ce18 <_Watchdog_Adjust_to_chain+0x84> /* * 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; 5cdcc: 9880 subl %d0,%d4 first->delta_interval = 0; 5cdce: 42a8 0010 clrl %a0@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 5cdd2: 2250 moveal %a0@,%a1 previous = the_node->previous; 5cdd4: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 5cdd8: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 5cdda: 234a 0004 movel %a2,%a1@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 5cdde: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 5cde0: 226b 0008 moveal %a3@(8),%a1 the_chain->last = the_node; 5cde4: 2748 0008 movel %a0,%a3@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 5cde8: 2149 0004 movel %a1,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 5cdec: 2288 movel %a0,%a1@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 5cdee: 2003 movel %d3,%d0 5cdf0: 46c1 movew %d1,%sr 5cdf2: 8081 orl %d1,%d0 5cdf4: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5cdf6: 2055 moveal %a5@,%a0 if ( _Chain_Is_empty( header ) ) 5cdf8: b1cc cmpal %a4,%a0 5cdfa: 6714 beqs 5ce10 <_Watchdog_Adjust_to_chain+0x7c> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 5cdfc: 4aa8 0010 tstl %a0@(16) 5ce00: 67d0 beqs 5cdd2 <_Watchdog_Adjust_to_chain+0x3e> } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5ce02: 4a84 tstl %d4 5ce04: 66ba bnes 5cdc0 <_Watchdog_Adjust_to_chain+0x2c> if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5ce06: 46c1 movew %d1,%sr } 5ce08: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5 5ce0c: 4e5e unlk %fp 5ce0e: 4e75 rts */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5ce10: 204c moveal %a4,%a0 } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5ce12: 4a84 tstl %d4 5ce14: 66aa bnes 5cdc0 <_Watchdog_Adjust_to_chain+0x2c> 5ce16: 60ee bras 5ce06 <_Watchdog_Adjust_to_chain+0x72> <== ALWAYS TAKEN /* * 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; 5ce18: 9084 subl %d4,%d0 5ce1a: 2140 0010 movel %d0,%a0@(16) if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5ce1e: 46c1 movew %d1,%sr 5ce20: 60e6 bras 5ce08 <_Watchdog_Adjust_to_chain+0x74> <== ALWAYS TAKEN ... 00048e18 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 48e18: 4e56 ffec linkw %fp,#-20 48e1c: 226e 000c moveal %fp@(12),%a1 48e20: 48d7 043c moveml %d2-%d5/%a2,%sp@ 48e24: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 48e28: 2a3c 0000 0700 movel #1792,%d5 48e2e: 2005 movel %d5,%d0 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 48e30: 2839 0005 d9ee movel 5d9ee <_ISR_Nest_level>,%d4 _ISR_Disable( level ); 48e36: 40c3 movew %sr,%d3 48e38: 8083 orl %d3,%d0 48e3a: 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 ) { 48e3c: 4aa9 0008 tstl %a1@(8) 48e40: 6600 00c6 bnew 48f08 <_Watchdog_Insert+0xf0> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 48e44: 2039 0005 da90 movel 5da90 <_Watchdog_Sync_count>,%d0 48e4a: 5280 addql #1,%d0 48e4c: 23c0 0005 da90 movel %d0,5da90 <_Watchdog_Sync_count> if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 48e52: 7001 moveq #1,%d0 48e54: 2340 0008 movel %d0,%a1@(8) _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 48e58: 2029 000c movel %a1@(12),%d0 * cache *header!! * * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; 48e5c: 2052 moveal %a2@,%a0 ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 48e5e: 6764 beqs 48ec4 <_Watchdog_Insert+0xac> 48e60: 4a90 tstl %a0@ 48e62: 6760 beqs 48ec4 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 48e64: 2228 0010 movel %a0@(16),%d1 48e68: b280 cmpl %d0,%d1 48e6a: 6252 bhis 48ebe <_Watchdog_Insert+0xa6> * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 48e6c: 2405 movel %d5,%d2 48e6e: 46c3 movew %d3,%sr 48e70: 8483 orl %d3,%d2 48e72: 46c2 movew %d2,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 48e74: 7401 moveq #1,%d2 48e76: b4a9 0008 cmpl %a1@(8),%d2 48e7a: 666e bnes 48eea <_Watchdog_Insert+0xd2> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 48e7c: 2439 0005 da0a movel 5da0a <_Watchdog_Sync_level>,%d2 48e82: b484 cmpl %d4,%d2 48e84: 6230 bhis 48eb6 <_Watchdog_Insert+0x9e> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 48e86: 9081 subl %d1,%d0 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 48e88: 2050 moveal %a0@,%a0 */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 48e8a: 4a80 tstl %d0 48e8c: 6736 beqs 48ec4 <_Watchdog_Insert+0xac> 48e8e: 4a90 tstl %a0@ 48e90: 6732 beqs 48ec4 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 48e92: 2228 0010 movel %a0@(16),%d1 48e96: b081 cmpl %d1,%d0 48e98: 6524 bcss 48ebe <_Watchdog_Insert+0xa6> * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 48e9a: 2405 movel %d5,%d2 48e9c: 46c3 movew %d3,%sr 48e9e: 8483 orl %d3,%d2 48ea0: 46c2 movew %d2,%sr if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 48ea2: 9081 subl %d1,%d0 * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 48ea4: 7201 moveq #1,%d1 48ea6: b2a9 0008 cmpl %a1@(8),%d1 48eaa: 663e bnes 48eea <_Watchdog_Insert+0xd2> <== ALWAYS TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 48eac: 2239 0005 da0a movel 5da0a <_Watchdog_Sync_level>,%d1 48eb2: b284 cmpl %d4,%d1 48eb4: 63d2 blss 48e88 <_Watchdog_Insert+0x70> _Watchdog_Sync_level = insert_isr_nest_level; 48eb6: 23c4 0005 da0a movel %d4,5da0a <_Watchdog_Sync_level> goto restart; 48ebc: 609a bras 48e58 <_Watchdog_Insert+0x40> <== ALWAYS TAKEN if ( delta_interval == 0 || !_Watchdog_Next( after ) ) break; if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; 48ebe: 9280 subl %d0,%d1 48ec0: 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 ); 48ec4: 2068 0004 moveal %a0@(4),%a0 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 48ec8: 7402 moveq #2,%d2 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 48eca: 2450 moveal %a0@,%a2 the_watchdog->start_time = _Watchdog_Ticks_since_boot; 48ecc: 2239 0005 da94 movel 5da94 <_Watchdog_Ticks_since_boot>,%d1 after_node->next = the_node; 48ed2: 2089 movel %a1,%a0@ Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 48ed4: 2348 0004 movel %a0,%a1@(4) 48ed8: 2341 0014 movel %d1,%a1@(20) } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 48edc: 2340 0010 movel %d0,%a1@(16) before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; before_node->previous = the_node; 48ee0: 2549 0004 movel %a1,%a2@(4) 48ee4: 2342 0008 movel %d2,%a1@(8) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 48ee8: 228a movel %a2,%a1@ _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 48eea: 23c4 0005 da0a movel %d4,5da0a <_Watchdog_Sync_level> _Watchdog_Sync_count--; 48ef0: 2039 0005 da90 movel 5da90 <_Watchdog_Sync_count>,%d0 48ef6: 5380 subql #1,%d0 48ef8: 23c0 0005 da90 movel %d0,5da90 <_Watchdog_Sync_count> _ISR_Enable( level ); 48efe: 46c3 movew %d3,%sr } 48f00: 4cd7 043c moveml %sp@,%d2-%d5/%a2 48f04: 4e5e unlk %fp 48f06: 4e75 rts * 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 ) { _ISR_Enable( level ); 48f08: 46c3 movew %d3,%sr exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 48f0a: 4cd7 043c moveml %sp@,%d2-%d5/%a2 48f0e: 4e5e unlk %fp 48f10: 4e75 rts ... 00048f60 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48f60: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 48f66: 4e56 0000 linkw %fp,#0 48f6a: 206e 0008 moveal %fp@(8),%a0 48f6e: 2f0a movel %a2,%sp@- 48f70: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48f72: 40c1 movew %sr,%d1 48f74: 8081 orl %d1,%d0 48f76: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 48f78: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 48f7c: 7401 moveq #1,%d2 48f7e: b480 cmpl %d0,%d2 48f80: 6764 beqs 48fe6 <_Watchdog_Remove+0x86> 48f82: 6314 blss 48f98 <_Watchdog_Remove+0x38> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 48f84: 2279 0005 da94 moveal 5da94 <_Watchdog_Ticks_since_boot>,%a1 48f8a: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 48f8e: 46c1 movew %d1,%sr return( previous_state ); } 48f90: 241f movel %sp@+,%d2 48f92: 245f moveal %sp@+,%a2 48f94: 4e5e unlk %fp 48f96: 4e75 rts Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 48f98: 143c 0003 moveb #3,%d2 48f9c: b480 cmpl %d0,%d2 48f9e: 65e4 bcss 48f84 <_Watchdog_Remove+0x24> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 48fa0: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 48fa2: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 48fa6: 4a91 tstl %a1@ 48fa8: 6708 beqs 48fb2 <_Watchdog_Remove+0x52> next_watchdog->delta_interval += the_watchdog->delta_interval; 48faa: 2428 0010 movel %a0@(16),%d2 48fae: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 48fb2: 2479 0005 da90 moveal 5da90 <_Watchdog_Sync_count>,%a2 48fb8: 4a8a tstl %a2 48fba: 670c beqs 48fc8 <_Watchdog_Remove+0x68> _Watchdog_Sync_level = _ISR_Nest_level; 48fbc: 2479 0005 d9ee moveal 5d9ee <_ISR_Nest_level>,%a2 48fc2: 23ca 0005 da0a movel %a2,5da0a <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 48fc8: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 48fcc: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48fce: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 48fd2: 2279 0005 da94 moveal 5da94 <_Watchdog_Ticks_since_boot>,%a1 48fd8: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 48fdc: 46c1 movew %d1,%sr return( previous_state ); } 48fde: 241f movel %sp@+,%d2 48fe0: 245f moveal %sp@+,%a2 48fe2: 4e5e unlk %fp 48fe4: 4e75 rts _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 48fe6: 2279 0005 da94 moveal 5da94 <_Watchdog_Ticks_since_boot>,%a1 /* * 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; 48fec: 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; 48ff0: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 48ff4: 46c1 movew %d1,%sr return( previous_state ); } 48ff6: 241f movel %sp@+,%d2 48ff8: 245f moveal %sp@+,%a2 48ffa: 4e5e unlk %fp 48ffc: 4e75 rts ... 0004a4b0 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4a4b0: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4a4b6: 4e56 ffe8 linkw %fp,#-24 4a4ba: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4a4be: 242e 0008 movel %fp@(8),%d2 4a4c2: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4a4c6: 40c3 movew %sr,%d3 4a4c8: 8083 orl %d3,%d0 4a4ca: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4a4cc: 2f0b movel %a3,%sp@- 4a4ce: 4bf9 0004 402c lea 4402c ,%a5 4a4d4: 2f02 movel %d2,%sp@- 4a4d6: 4879 0005 d372 pea 5d372 <_Status_Object_name_errors_to_status+0x14> 4a4dc: 4e95 jsr %a5@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4a4de: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 4a4e0: 4fef 000c lea %sp@(12),%sp 4a4e4: b7ca cmpal %a2,%a3 4a4e6: 672c beqs 4a514 <_Watchdog_Report_chain+0x64> 4a4e8: 49f9 0004 a52c lea 4a52c <_Watchdog_Report>,%a4 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4a4ee: 2f0a movel %a2,%sp@- 4a4f0: 42a7 clrl %sp@- 4a4f2: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 4a4f4: 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 = header->first ; 4a4f6: 508f addql #8,%sp 4a4f8: b7ca cmpal %a2,%a3 4a4fa: 66f2 bnes 4a4ee <_Watchdog_Report_chain+0x3e> <== ALWAYS TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4a4fc: 2f02 movel %d2,%sp@- 4a4fe: 4879 0005 d389 pea 5d389 <_Status_Object_name_errors_to_status+0x2b> 4a504: 4e95 jsr %a5@ 4a506: 508f addql #8,%sp } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 4a508: 46c3 movew %d3,%sr } 4a50a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a510: 4e5e unlk %fp 4a512: 4e75 rts _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4a514: 4879 0005 d398 pea 5d398 <_Status_Object_name_errors_to_status+0x3a> 4a51a: 4e95 jsr %a5@ 4a51c: 588f addql #4,%sp } _ISR_Enable( level ); 4a51e: 46c3 movew %d3,%sr } 4a520: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a526: 4e5e unlk %fp 4a528: 4e75 rts ... 00049000 <_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 ); 49000: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 49006: 4e56 ffe8 linkw %fp,#-24 4900a: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4900e: 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 ); 49012: 40c2 movew %sr,%d2 49014: 8082 orl %d2,%d0 49016: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49018: 264c moveal %a4,%a3 4901a: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 4901c: b7ca cmpal %a2,%a3 4901e: 673e beqs 4905e <_Watchdog_Tickle+0x5e> * 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) { 49020: 202a 0010 movel %a2@(16),%d0 49024: 4bf9 0004 8f60 lea 48f60 <_Watchdog_Remove>,%a5 4902a: 6708 beqs 49034 <_Watchdog_Tickle+0x34> the_watchdog->delta_interval--; 4902c: 5380 subql #1,%d0 4902e: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 49032: 662a bnes 4905e <_Watchdog_Tickle+0x5e> case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 49034: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4903a: 2f0a movel %a2,%sp@- 4903c: 4e95 jsr %a5@ _ISR_Enable( level ); 4903e: 46c2 movew %d2,%sr switch( watchdog_state ) { 49040: 7202 moveq #2,%d1 49042: 588f addql #4,%sp 49044: b280 cmpl %d0,%d1 49046: 6722 beqs 4906a <_Watchdog_Tickle+0x6a> case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 49048: 2003 movel %d3,%d0 4904a: 40c2 movew %sr,%d2 4904c: 8082 orl %d2,%d0 4904e: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49050: 2014 movel %a4@,%d0 49052: 2440 moveal %d0,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 49054: b08b cmpl %a3,%d0 49056: 6706 beqs 4905e <_Watchdog_Tickle+0x5e> 49058: 4aaa 0010 tstl %a2@(16) 4905c: 67dc beqs 4903a <_Watchdog_Tickle+0x3a> leave: _ISR_Enable(level); 4905e: 46c2 movew %d2,%sr } 49060: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 49066: 4e5e unlk %fp 49068: 4e75 rts _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4906a: 2f2a 0024 movel %a2@(36),%sp@- 4906e: 2f2a 0020 movel %a2@(32),%sp@- 49072: 206a 001c moveal %a2@(28),%a0 49076: 4e90 jsr %a0@ 49078: 508f addql #8,%sp 4907a: 60cc bras 49048 <_Watchdog_Tickle+0x48> <== ALWAYS TAKEN 000490e4 <_Workspace_Handler_initialization>: /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 490e4: 4e56 0000 linkw %fp,#0 490e8: 2f03 movel %d3,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; 490ea: 2639 0005 c228 movel 5c228 ,%d3 /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 490f0: 2f02 movel %d2,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; 490f2: 2439 0005 c224 movel 5c224 ,%d2 uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) 490f8: 4a39 0005 c24c tstb 5c24c 490fe: 6628 bnes 49128 <_Workspace_Handler_initialization+0x44> memset( starting_address, 0, size ); memory_available = _Heap_Initialize( 49100: 4878 0004 pea 4 49104: 2f03 movel %d3,%sp@- 49106: 2f02 movel %d2,%sp@- 49108: 4879 0005 d976 pea 5d976 <_Workspace_Area> 4910e: 4eb9 0004 6c10 jsr 46c10 <_Heap_Initialize> starting_address, size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) 49114: 4fef 0010 lea %sp@(16),%sp 49118: 4a80 tstl %d0 4911a: 671e beqs 4913a <_Workspace_Handler_initialization+0x56> _Internal_error_Occurred( INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } 4911c: 242e fff8 movel %fp@(-8),%d2 49120: 262e fffc movel %fp@(-4),%d3 49124: 4e5e unlk %fp 49126: 4e75 rts uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) memset( starting_address, 0, size ); 49128: 2f03 movel %d3,%sp@- 4912a: 42a7 clrl %sp@- 4912c: 2f02 movel %d2,%sp@- 4912e: 4eb9 0004 e098 jsr 4e098 49134: 4fef 000c lea %sp@(12),%sp 49138: 60c6 bras 49100 <_Workspace_Handler_initialization+0x1c> <== ALWAYS TAKEN size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) _Internal_error_Occurred( 4913a: 4878 0003 pea 3 4913e: 4878 0001 pea 1 49142: 42a7 clrl %sp@- 49144: 4eb9 0004 6f7c jsr 46f7c <_Internal_error_Occurred> ... 0004cad8 : rtems_name name, rtems_attribute attribute_set, uint32_t maximum_waiters, rtems_id *id ) { 4cad8: 4e56 ffe8 linkw %fp,#-24 4cadc: 202e 0010 movel %fp@(16),%d0 4cae0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 4cae4: 242e 0008 movel %fp@(8),%d2 4cae8: 262e 000c movel %fp@(12),%d3 4caec: 246e 0014 moveal %fp@(20),%a2 Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4caf0: 4a82 tstl %d2 4caf2: 677a beqs 4cb6e return RTEMS_INVALID_NAME; if ( !id ) 4caf4: 4a8a tstl %a2 4caf6: 6700 00ce beqw 4cbc6 return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { 4cafa: 0803 0004 btst #4,%d3 4cafe: 677a beqs 4cb7a the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4cb00: 4a80 tstl %d0 4cb02: 6700 00b4 beqw 4cbb8 4cb06: 2239 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d1 4cb0c: 5281 addql #1,%d1 if ( !id ) return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4cb0e: 42ae fff8 clrl %fp@(-8) if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; the_attributes.maximum_count = maximum_waiters; 4cb12: 2d40 fffc movel %d0,%fp@(-4) 4cb16: 23c1 0005 d954 movel %d1,5d954 <_Thread_Dispatch_disable_level> * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void ) { return (Barrier_Control *) _Objects_Allocate( &_Barrier_Information ); 4cb1c: 4879 0005 db76 pea 5db76 <_Barrier_Information> 4cb22: 4eb9 0004 7040 jsr 47040 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4cb28: 588f addql #4,%sp 4cb2a: 2640 moveal %d0,%a3 4cb2c: 4a80 tstl %d0 4cb2e: 6776 beqs 4cba6 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_barrier->attribute_set = attribute_set; 4cb30: 2743 0010 movel %d3,%a3@(16) _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4cb34: 486e fff8 pea %fp@(-8) 4cb38: 486b 0014 pea %a3@(20) 4cb3c: 4eb9 0004 d06c jsr 4d06c <_CORE_barrier_Initialize> 4cb42: 202b 0008 movel %a3@(8),%d0 4cb46: 4281 clrl %d1 4cb48: 2079 0005 db8e moveal 5db8e <_Barrier_Information+0x18>,%a0 4cb4e: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4cb50: 2742 000c movel %d2,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4cb54: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Barrier_Information, &the_barrier->Object, (Objects_Name) name ); *id = the_barrier->Object.id; 4cb58: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4cb5a: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4cb60: 508f addql #8,%sp (Objects_Name) name ); *id = the_barrier->Object.id; _Thread_Enable_dispatch(); 4cb62: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4cb64: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4cb6a: 4e5e unlk %fp 4cb6c: 4e75 rts ) { Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4cb6e: 7003 moveq #3,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4cb70: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4cb76: 4e5e unlk %fp 4cb78: 4e75 rts if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; 4cb7a: 7201 moveq #1,%d1 4cb7c: 2d41 fff8 movel %d1,%fp@(-8) 4cb80: 2239 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d1 4cb86: 5281 addql #1,%d1 the_attributes.maximum_count = maximum_waiters; 4cb88: 2d40 fffc movel %d0,%fp@(-4) 4cb8c: 23c1 0005 d954 movel %d1,5d954 <_Thread_Dispatch_disable_level> 4cb92: 4879 0005 db76 pea 5db76 <_Barrier_Information> 4cb98: 4eb9 0004 7040 jsr 47040 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4cb9e: 588f addql #4,%sp 4cba0: 2640 moveal %d0,%a3 4cba2: 4a80 tstl %d0 4cba4: 668a bnes 4cb30 _Thread_Enable_dispatch(); 4cba6: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> 4cbac: 7005 moveq #5,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4cbae: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4cbb4: 4e5e unlk %fp 4cbb6: 4e75 rts return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4cbb8: 103c 000a moveb #10,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4cbbc: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4cbc2: 4e5e unlk %fp 4cbc4: 4e75 rts CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 4cbc6: 7009 moveq #9,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4cbc8: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4cbce: 4e5e unlk %fp 4cbd0: 4e75 rts ... 0004cbd4 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4cbd4: 4e56 fffc linkw %fp,#-4 4cbd8: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4cbda: 486e fffc pea %fp@(-4) 4cbde: 2f2e 0008 movel %fp@(8),%sp@- 4cbe2: 4879 0005 db76 pea 5db76 <_Barrier_Information> 4cbe8: 4eb9 0004 74dc jsr 474dc <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4cbee: 4fef 000c lea %sp@(12),%sp 4cbf2: 2440 moveal %d0,%a2 4cbf4: 4aae fffc tstl %fp@(-4) 4cbf8: 6640 bnes 4cc3a <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4cbfa: 4878 0002 pea 2 4cbfe: 42a7 clrl %sp@- 4cc00: 486a 0014 pea %a2@(20) 4cc04: 4eb9 0004 844c jsr 4844c <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4cc0a: 2f0a movel %a2,%sp@- 4cc0c: 4879 0005 db76 pea 5db76 <_Barrier_Information> 4cc12: 4eb9 0004 70d0 jsr 470d0 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4cc18: 2f0a movel %a2,%sp@- 4cc1a: 4879 0005 db76 pea 5db76 <_Barrier_Information> 4cc20: 4eb9 0004 7378 jsr 47378 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4cc26: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cc2c: 246e fff8 moveal %fp@(-8),%a2 _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 4cc30: 4fef 001c lea %sp@(28),%sp _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4cc34: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cc36: 4e5e unlk %fp 4cc38: 4e75 rts 4cc3a: 246e fff8 moveal %fp@(-8),%a2 { Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4cc3e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cc40: 4e5e unlk %fp 4cc42: 4e75 rts 0004b95c : #include rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { 4b95c: 4e56 ffec linkw %fp,#-20 4b960: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4b964: 246e 0008 moveal %fp@(8),%a2 if ( !time ) 4b968: 4a8a tstl %a2 4b96a: 6750 beqs 4b9bc <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 4b96c: 4a39 000a 527c tstb a527c <_TOD_Is_set> 4b972: 660c bnes 4b980 4b974: 700b moveq #11,%d0 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; } 4b976: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b97c: 4e5e unlk %fp 4b97e: 4e75 rts { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 4b980: 203c 0000 0700 movel #1792,%d0 4b986: 40c2 movew %sr,%d2 4b988: 8082 orl %d2,%d0 4b98a: 46c0 movew %d0,%sr _TOD_Get( &now ); 4b98c: 486e fff8 pea %fp@(-8) 4b990: 4eb9 0004 cf48 jsr 4cf48 <_TOD_Get> _ISR_Enable(level); 4b996: 46c2 movew %d2,%sr useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 4b998: 263c 0000 03e8 movel #1000,%d3 if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; 4b99e: 588f addql #4,%sp 4b9a0: 4280 clrl %d0 _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 4b9a2: 222e fffc movel %fp@(-4),%d1 useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 4b9a6: 4c43 1801 remsl %d3,%d1,%d1 4b9aa: 2541 0004 movel %d1,%a2@(4) _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 4b9ae: 24ae fff8 movel %fp@(-8),%a2@ } 4b9b2: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b9b8: 4e5e unlk %fp 4b9ba: 4e75 rts rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { if ( !time ) 4b9bc: 7009 moveq #9,%d0 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; } 4b9be: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b9c4: 4e5e unlk %fp 4b9c6: 4e75 rts 000482e4 : 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 ) { 482e4: 4e56 fff4 linkw %fp,#-12 482e8: 226e 000c moveal %fp@(12),%a1 482ec: 48d7 040c moveml %d2-%d3/%a2,%sp@ 482f0: 242e 0008 movel %fp@(8),%d2 482f4: 246e 0010 moveal %fp@(16),%a2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 482f8: 2039 0006 3de2 movel 63de2 <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 482fe: 2239 0006 3c36 movel 63c36 <_ISR_Nest_level>,%d1 48304: 6600 009c bnew 483a2 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 48308: 4a8a tstl %a2 4830a: 6700 00ea beqw 483f6 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 4830e: 2480 movel %d0,%a2@ if ( driver_table == NULL ) 48310: 4a89 tstl %a1 48312: 6700 00e2 beqw 483f6 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48316: 4a91 tstl %a1@ 48318: 6700 00d4 beqw 483ee return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 4831c: b480 cmpl %d0,%d2 4831e: 6476 bccs 48396 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48320: 2039 0006 3b9c movel 63b9c <_Thread_Dispatch_disable_level>,%d0 48326: 5280 addql #1,%d0 48328: 23c0 0006 3b9c movel %d0,63b9c <_Thread_Dispatch_disable_level> return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 4832e: 4a82 tstl %d2 48330: 667c bnes 483ae static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 48332: 2039 0006 3de2 movel 63de2 <_IO_Number_of_drivers>,%d0 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 48338: 6700 00fc beqw 48436 <== ALWAYS TAKEN 4833c: 2239 0006 3de6 movel 63de6 <_IO_Driver_address_table>,%d1 48342: 2041 moveal %d1,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48344: 4a90 tstl %a0@ 48346: 6700 008e beqw 483d6 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 ) { 4834a: 5282 addql #1,%d2 4834c: 41e8 0018 lea %a0@(24),%a0 48350: b480 cmpl %d0,%d2 48352: 65f0 bcss 48344 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 48354: 2482 movel %d2,%a2@ if ( m != n ) 48356: b480 cmpl %d0,%d2 48358: 6700 00de beqw 48438 4835c: 2602 movel %d2,%d3 4835e: 2002 movel %d2,%d0 48360: 2041 moveal %d1,%a0 48362: e78b lsll #3,%d3 48364: eb88 lsll #5,%d0 48366: 9083 subl %d3,%d0 48368: d1c0 addal %d0,%a0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4836a: 20d9 movel %a1@+,%a0@+ 4836c: 20d9 movel %a1@+,%a0@+ 4836e: 20d9 movel %a1@+,%a0@+ 48370: 20d9 movel %a1@+,%a0@+ 48372: 20d9 movel %a1@+,%a0@+ 48374: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 48376: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 4837c: 2d42 0008 movel %d2,%fp@(8) } 48380: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48386: 42ae 0010 clrl %fp@(16) 4838a: 42ae 000c clrl %fp@(12) } 4838e: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48390: 4ef9 0005 099c jmp 5099c return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 48396: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48398: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4839e: 4e5e unlk %fp 483a0: 4e75 rts rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 483a2: 7012 moveq #18,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483a4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483aa: 4e5e unlk %fp 483ac: 4e75 rts _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 483ae: 2202 movel %d2,%d1 483b0: 2002 movel %d2,%d0 483b2: e789 lsll #3,%d1 483b4: eb88 lsll #5,%d0 483b6: 2079 0006 3de6 moveal 63de6 <_IO_Driver_address_table>,%a0 483bc: 9081 subl %d1,%d0 483be: d1c0 addal %d0,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483c0: 4a90 tstl %a0@ 483c2: 673e beqs 48402 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(); 483c4: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> 483ca: 700c moveq #12,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483cc: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483d2: 4e5e unlk %fp 483d4: 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; 483d6: 4aa8 0004 tstl %a0@(4) 483da: 6700 ff78 beqw 48354 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 ) { 483de: 5282 addql #1,%d2 483e0: 41e8 0018 lea %a0@(24),%a0 483e4: b480 cmpl %d0,%d2 483e6: 6500 ff5c bcsw 48344 <== ALWAYS TAKEN 483ea: 6000 ff68 braw 48354 <== ALWAYS TAKEN static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483ee: 4aa9 0004 tstl %a1@(4) 483f2: 6600 ff28 bnew 4831c _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 483f6: 7009 moveq #9,%d0 } 483f8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483fe: 4e5e unlk %fp 48400: 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; 48402: 4aa8 0004 tstl %a0@(4) 48406: 66bc bnes 483c4 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 48408: 20d9 movel %a1@+,%a0@+ 4840a: 20d9 movel %a1@+,%a0@+ 4840c: 20d9 movel %a1@+,%a0@+ 4840e: 20d9 movel %a1@+,%a0@+ 48410: 20d9 movel %a1@+,%a0@+ 48412: 2091 movel %a1@,%a0@ if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 48414: 2482 movel %d2,%a2@ } _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); 48416: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 4841c: 2d42 0008 movel %d2,%fp@(8) } 48420: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48426: 42ae 0010 clrl %fp@(16) 4842a: 42ae 000c clrl %fp@(12) } 4842e: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48430: 4ef9 0005 099c jmp 5099c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 48436: 4292 clrl %a2@ <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 48438: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> 4843e: 7005 moveq #5,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48440: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 48446: 4e5e unlk %fp 48448: 4e75 rts ... 00048a40 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 48a40: 4e56 fff0 linkw %fp,#-16 48a44: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48a48: 266e 0008 moveal %fp@(8),%a3 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 48a4c: 4a8b tstl %a3 48a4e: 6744 beqs 48a94 <== ALWAYS TAKEN 48a50: 49f9 0006 7e90 lea 67e90 <_Objects_Information_table+0x4>,%a4 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 48a56: 2054 moveal %a4@,%a0 48a58: 4a88 tstl %a0 48a5a: 672e beqs 48a8a continue; information = _Objects_Information_table[ api_index ][ 1 ]; 48a5c: 2468 0004 moveal %a0@(4),%a2 if ( !information ) 48a60: 4a8a tstl %a2 48a62: 6726 beqs 48a8a continue; for ( i=1 ; i <= information->maximum ; i++ ) { 48a64: 4a6a 000e tstw %a2@(14) 48a68: 6720 beqs 48a8a <== ALWAYS TAKEN 48a6a: 7401 moveq #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; 48a6c: 206a 0018 moveal %a2@(24),%a0 48a70: 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++ ) { 48a74: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 48a76: 4a80 tstl %d0 48a78: 6706 beqs 48a80 <== ALWAYS TAKEN continue; (*routine)(the_thread); 48a7a: 2f00 movel %d0,%sp@- 48a7c: 4e93 jsr %a3@ 48a7e: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 48a80: 4280 clrl %d0 48a82: 302a 000e movew %a2@(14),%d0 48a86: b480 cmpl %d0,%d2 48a88: 63e2 blss 48a6c 48a8a: 588c addql #4,%a4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 48a8c: b9fc 0006 7ea0 cmpal #425632,%a4 48a92: 66c2 bnes 48a56 (*routine)(the_thread); } } } 48a94: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48a9a: 4e5e unlk %fp 48a9c: 4e75 rts ... 000476e8 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 476e8: 4e56 0000 linkw %fp,#0 476ec: 2f0a movel %a2,%sp@- 476ee: 246e 0010 moveal %fp@(16),%a2 476f2: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 476f4: 4a8a tstl %a2 476f6: 6766 beqs 4775e return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 476f8: 2f2e 000c movel %fp@(12),%sp@- 476fc: 2f2e 0008 movel %fp@(8),%sp@- 47700: 4eb9 0004 92a4 jsr 492a4 <_Objects_Get_information> if ( !obj_info ) 47706: 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 ); 47708: 2040 moveal %d0,%a0 if ( !obj_info ) 4770a: 4a80 tstl %d0 4770c: 675e beqs 4776c return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 4770e: 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; 47712: 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; 47714: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 4771a: 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; 4771e: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 47724: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 47728: 6750 beqs 4777a <== ALWAYS TAKEN 4772a: 2068 0018 moveal %a0@(24),%a0 4772e: 7201 moveq #1,%d1 47730: 7001 moveq #1,%d0 47732: 93c9 subal %a1,%a1 47734: 5280 addql #1,%d0 if ( !obj_info->local_table[i] ) 47736: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4) 4773a: 6718 beqs 47754 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++ ) 4773c: 2200 movel %d0,%d1 4773e: b082 cmpl %d2,%d0 47740: 63f2 blss 47734 <== NEVER TAKEN if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 47742: 2549 000e movel %a1,%a2@(14) 47746: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 47748: 242e fff8 movel %fp@(-8),%d2 4774c: 246e fffc moveal %fp@(-4),%a2 47750: 4e5e unlk %fp 47752: 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++; 47754: 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++ ) 47756: 2200 movel %d0,%d1 47758: b082 cmpl %d2,%d0 4775a: 63d8 blss 47734 <== ALWAYS TAKEN 4775c: 60e4 bras 47742 <== ALWAYS TAKEN unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 4775e: 242e fff8 movel %fp@(-8),%d2 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 47762: 7009 moveq #9,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 47764: 246e fffc moveal %fp@(-4),%a2 47768: 4e5e unlk %fp 4776a: 4e75 rts 4776c: 242e fff8 movel %fp@(-8),%d2 */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) 47770: 700a moveq #10,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 47772: 246e fffc moveal %fp@(-4),%a2 47776: 4e5e unlk %fp 47778: 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++ ) 4777a: 93c9 subal %a1,%a1 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 4777c: 4280 clrl %d0 <== NOT EXECUTED 4777e: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED 47782: 60c4 bras 47748 <== NOT EXECUTED 000477ec : */ rtems_status_code rtems_object_set_name( rtems_id id, const char *name ) { 477ec: 4e56 fff0 linkw %fp,#-16 477f0: 48d7 001c moveml %d2-%d4,%sp@ 477f4: 262e 0008 movel %fp@(8),%d3 477f8: 282e 000c movel %fp@(12),%d4 Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 477fc: 6764 beqs 47862 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 477fe: 4a83 tstl %d3 47800: 6754 beqs 47856 information = _Objects_Get_information_id( tmpId ); 47802: 2f03 movel %d3,%sp@- 47804: 4eb9 0004 9278 jsr 49278 <_Objects_Get_information_id> if ( !information ) 4780a: 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 ); 4780c: 2400 movel %d0,%d2 if ( !information ) 4780e: 673a beqs 4784a return RTEMS_INVALID_ID; the_object = _Objects_Get( information, tmpId, &location ); 47810: 486e fffc pea %fp@(-4) 47814: 2f03 movel %d3,%sp@- 47816: 2f00 movel %d0,%sp@- 47818: 4eb9 0004 9448 jsr 49448 <_Objects_Get> switch ( location ) { 4781e: 4fef 000c lea %sp@(12),%sp 47822: 4aae fffc tstl %fp@(-4) 47826: 6622 bnes 4784a case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); 47828: 2f04 movel %d4,%sp@- 4782a: 2f00 movel %d0,%sp@- 4782c: 2f02 movel %d2,%sp@- 4782e: 4eb9 0004 9654 jsr 49654 <_Objects_Set_name> _Thread_Enable_dispatch(); 47834: 4eb9 0004 9d68 jsr 49d68 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4783a: 4fef 000c lea %sp@(12),%sp the_object = _Objects_Get( information, tmpId, &location ); switch ( location ) { case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); _Thread_Enable_dispatch(); 4783e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47840: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 47846: 4e5e unlk %fp 47848: 4e75 rts switch ( location ) { case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 4784a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4784c: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 47852: 4e5e unlk %fp 47854: 4e75 rts Objects_Id tmpId; if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 47856: 2079 0006 09d6 moveal 609d6 <_Thread_Executing>,%a0 4785c: 2628 0008 movel %a0@(8),%d3 47860: 60a0 bras 47802 <== ALWAYS TAKEN Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 47862: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47864: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4786a: 4e5e unlk %fp 4786c: 4e75 rts ... 000561c8 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 561c8: 4e56 ffe8 linkw %fp,#-24 561cc: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 561d0: 242e 0008 movel %fp@(8),%d2 561d4: 2a2e 000c movel %fp@(12),%d5 561d8: 282e 0010 movel %fp@(16),%d4 561dc: 262e 0014 movel %fp@(20),%d3 561e0: 246e 001c moveal %fp@(28),%a2 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 561e4: 4a82 tstl %d2 561e6: 673a beqs 56222 return RTEMS_INVALID_NAME; if ( !starting_address ) 561e8: 4a85 tstl %d5 561ea: 671e beqs 5620a return RTEMS_INVALID_ADDRESS; if ( !id ) 561ec: 4a8a tstl %a2 561ee: 671a beqs 5620a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 561f0: 4a84 tstl %d4 561f2: 6722 beqs 56216 561f4: 4a83 tstl %d3 561f6: 671e beqs 56216 561f8: b684 cmpl %d4,%d3 561fa: 621a bhis 56216 561fc: 7003 moveq #3,%d0 561fe: c083 andl %d3,%d0 56200: 6614 bnes 56216 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 56202: 103c 0003 moveb #3,%d0 56206: c085 andl %d5,%d0 56208: 6724 beqs 5622e 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 5620a: 7009 moveq #9,%d0 } 5620c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 56212: 4e5e unlk %fp 56214: 4e75 rts 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 56216: 7008 moveq #8,%d0 } 56218: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 5621e: 4e5e unlk %fp 56220: 4e75 rts rtems_id *id ) { register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 56222: 7003 moveq #3,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 56224: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 5622a: 4e5e unlk %fp 5622c: 4e75 rts 5622e: 2039 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d0 56234: 5280 addql #1,%d0 56236: 23c0 0007 c8f0 movel %d0,7c8f0 <_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 ); 5623c: 4879 0007 c784 pea 7c784 <_Partition_Information> 56242: 4eb9 0005 ac40 jsr 5ac40 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 56248: 588f addql #4,%sp 5624a: 2640 moveal %d0,%a3 5624c: 4a80 tstl %d0 5624e: 675a beqs 562aa _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 56250: 2745 0010 movel %d5,%a3@(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, 56254: 2004 movel %d4,%d0 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 56256: 276e 0018 001c movel %fp@(24),%a3@(28) the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 5625c: 4c43 0000 remul %d3,%d0,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 56260: 2744 0014 movel %d4,%a3@(20) the_partition->buffer_size = buffer_size; 56264: 2743 0018 movel %d3,%a3@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 56268: 42ab 0020 clrl %a3@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 5626c: 2f03 movel %d3,%sp@- 5626e: 2f00 movel %d0,%sp@- 56270: 2f05 movel %d5,%sp@- 56272: 486b 0024 pea %a3@(36) 56276: 4eb9 0005 9790 jsr 59790 <_Chain_Initialize> 5627c: 202b 0008 movel %a3@(8),%d0 56280: 4281 clrl %d1 56282: 2079 0007 c79c moveal 7c79c <_Partition_Information+0x18>,%a0 56288: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 5628a: 2742 000c movel %d2,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5628e: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 56292: 2480 movel %d0,%a2@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 56294: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5629a: 4fef 0010 lea %sp@(16),%sp name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 5629e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 562a0: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 562a6: 4e5e unlk %fp 562a8: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 562aa: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 562b0: 7005 moveq #5,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 562b2: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 562b8: 4e5e unlk %fp 562ba: 4e75 rts 000563dc : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 563dc: 4e56 fffc linkw %fp,#-4 563e0: 2f0a movel %a2,%sp@- 563e2: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 563e4: 486e fffc pea %fp@(-4) 563e8: 2f2e 0008 movel %fp@(8),%sp@- 563ec: 4879 0007 c784 pea 7c784 <_Partition_Information> 563f2: 242e 000c movel %fp@(12),%d2 563f6: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 563fc: 4fef 000c lea %sp@(12),%sp 56400: 2440 moveal %d0,%a2 56402: 4aae fffc tstl %fp@(-4) 56406: 670e beqs 56416 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56408: 242e fff4 movel %fp@(-12),%d2 { register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 5640c: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5640e: 246e fff8 moveal %fp@(-8),%a2 56412: 4e5e unlk %fp 56414: 4e75 rts ) { void *starting; void *ending; starting = the_partition->starting_address; 56416: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 5641a: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 5641e: b082 cmpl %d2,%d0 56420: 623c bhis 5645e 56422: d280 addl %d0,%d1 56424: b282 cmpl %d2,%d1 56426: 6536 bcss 5645e <== ALWAYS TAKEN return ( 56428: 2202 movel %d2,%d1 5642a: 9280 subl %d0,%d1 5642c: 2001 movel %d1,%d0 5642e: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 56434: 4a81 tstl %d1 56436: 6626 bnes 5645e RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 56438: 2f02 movel %d2,%sp@- 5643a: 486a 0024 pea %a2@(36) 5643e: 4eb9 0005 971c jsr 5971c <_Chain_Append> switch ( location ) { case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 56444: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 56448: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5644e: 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(); return RTEMS_SUCCESSFUL; 56452: 508f addql #8,%sp 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(); 56454: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56456: 246e fff8 moveal %fp@(-8),%a2 5645a: 4e5e unlk %fp 5645c: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 5645e: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56464: 242e fff4 movel %fp@(-12),%d2 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 56468: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5646a: 246e fff8 moveal %fp@(-8),%a2 5646e: 4e5e unlk %fp 56470: 4e75 rts ... 000557d0 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 557d0: 4e56 fffc linkw %fp,#-4 557d4: 2f0a movel %a2,%sp@- 557d6: 246e 0010 moveal %fp@(16),%a2 557da: 2f02 movel %d2,%sp@- 557dc: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 557e0: 4a8a tstl %a2 557e2: 6762 beqs 55846 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 557e4: 486e fffc pea %fp@(-4) 557e8: 2f2e 0008 movel %fp@(8),%sp@- 557ec: 4879 0007 c74c pea 7c74c <_Dual_ported_memory_Information> 557f2: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 557f8: 4fef 000c lea %sp@(12),%sp 557fc: 4aae fffc tstl %fp@(-4) 55800: 6624 bnes 55826 case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); 55802: 2202 movel %d2,%d1 55804: 2040 moveal %d0,%a0 55806: 92a8 0014 subl %a0@(20),%d1 if ( ending > the_port->length ) 5580a: b2a8 0018 cmpl %a0@(24),%d1 5580e: 6324 blss 55834 *internal = external; 55810: 2482 movel %d2,%a2@ else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 55812: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 55818: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5581a: 242e fff4 movel %fp@(-12),%d2 5581e: 246e fff8 moveal %fp@(-8),%a2 55822: 4e5e unlk %fp 55824: 4e75 rts 55826: 242e fff4 movel %fp@(-12),%d2 if ( !internal ) return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 5582a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5582c: 246e fff8 moveal %fp@(-8),%a2 55830: 4e5e unlk %fp 55832: 4e75 rts case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) *internal = external; else *internal = _Addresses_Add_offset( the_port->internal_base, 55834: 2040 moveal %d0,%a0 55836: d2a8 0010 addl %a0@(16),%d1 5583a: 2481 movel %d1,%a2@ ending ); _Thread_Enable_dispatch(); 5583c: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 55842: 4280 clrl %d0 55844: 60d4 bras 5581a <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 55846: 242e fff4 movel %fp@(-12),%d2 { register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 5584a: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5584c: 246e fff8 moveal %fp@(-8),%a2 55850: 4e5e unlk %fp 55852: 4e75 rts 0005587c : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 5587c: 4e56 fffc linkw %fp,#-4 55880: 2f0a movel %a2,%sp@- 55882: 246e 0010 moveal %fp@(16),%a2 55886: 2f02 movel %d2,%sp@- 55888: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 5588c: 4a8a tstl %a2 5588e: 6762 beqs 558f2 55890: 486e fffc pea %fp@(-4) 55894: 2f2e 0008 movel %fp@(8),%sp@- 55898: 4879 0007 c74c pea 7c74c <_Dual_ported_memory_Information> 5589e: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 558a4: 4fef 000c lea %sp@(12),%sp 558a8: 4aae fffc tstl %fp@(-4) 558ac: 6624 bnes 558d2 case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); 558ae: 2202 movel %d2,%d1 558b0: 2040 moveal %d0,%a0 558b2: 92a8 0010 subl %a0@(16),%d1 if ( ending > the_port->length ) 558b6: b2a8 0018 cmpl %a0@(24),%d1 558ba: 6324 blss 558e0 *external = internal; 558bc: 2482 movel %d2,%a2@ else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 558be: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 558c4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558c6: 242e fff4 movel %fp@(-12),%d2 558ca: 246e fff8 moveal %fp@(-8),%a2 558ce: 4e5e unlk %fp 558d0: 4e75 rts 558d2: 242e fff4 movel %fp@(-12),%d2 if ( !external ) return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 558d6: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558d8: 246e fff8 moveal %fp@(-8),%a2 558dc: 4e5e unlk %fp 558de: 4e75 rts case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) *external = internal; else *external = _Addresses_Add_offset( the_port->external_base, 558e0: 2040 moveal %d0,%a0 558e2: d2a8 0014 addl %a0@(20),%d1 558e6: 2481 movel %d1,%a2@ ending ); _Thread_Enable_dispatch(); 558e8: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 558ee: 4280 clrl %d0 558f0: 60d4 bras 558c6 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558f2: 242e fff4 movel %fp@(-12),%d2 { register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 558f6: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558f8: 246e fff8 moveal %fp@(-8),%a2 558fc: 4e5e unlk %fp 558fe: 4e75 rts 0007a22c : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 7a22c: 4e56 ffec linkw %fp,#-20 7a230: 2f0a movel %a2,%sp@- 7a232: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 7a236: 4a8a tstl %a2 7a238: 6700 00a0 beqw 7a2da 7a23c: 486e fffc pea %fp@(-4) 7a240: 2f2e 0008 movel %fp@(8),%sp@- 7a244: 4879 000a 5692 pea a5692 <_Rate_monotonic_Information> 7a24a: 4eb9 0004 daa4 jsr 4daa4 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7a250: 4fef 000c lea %sp@(12),%sp 7a254: 4aae fffc tstl %fp@(-4) 7a258: 6634 bnes 7a28e case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 7a25a: 2240 moveal %d0,%a1 7a25c: 2069 0040 moveal %a1@(64),%a0 status->state = the_period->state; 7a260: 2229 0038 movel %a1@(56),%d1 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 7a264: 24a8 0008 movel %a0@(8),%a2@ status->state = the_period->state; 7a268: 2541 0004 movel %d1,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 7a26c: 662a bnes 7a298 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); _Timespec_Set_to_zero( &status->executed_since_last_period ); 7a26e: 42aa 0014 clrl %a2@(20) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 7a272: 42aa 0008 clrl %a2@(8) 7a276: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 7a27a: 42aa 0010 clrl %a2@(16) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 7a27e: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> 7a284: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a286: 246e ffe8 moveal %fp@(-24),%a2 7a28a: 4e5e unlk %fp 7a28c: 4e75 rts 7a28e: 246e ffe8 moveal %fp@(-24),%a2 if ( !status ) return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7a292: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a294: 4e5e unlk %fp 7a296: 4e75 rts /* * Grab the current status. */ valid_status = _Rate_monotonic_Get_status( 7a298: 486e fff4 pea %fp@(-12) 7a29c: 486e ffec pea %fp@(-20) 7a2a0: 2f00 movel %d0,%sp@- 7a2a2: 4eb9 0007 a372 jsr 7a372 <_Rate_monotonic_Get_status> the_period, &since_last_period, &executed ); if (!valid_status) { 7a2a8: 4fef 000c lea %sp@(12),%sp 7a2ac: 4a00 tstb %d0 7a2ae: 6734 beqs 7a2e4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 7a2b0: 202e fff4 movel %fp@(-12),%d0 7a2b4: 222e fff8 movel %fp@(-8),%d1 7a2b8: 2540 0010 movel %d0,%a2@(16) 7a2bc: 2541 0014 movel %d1,%a2@(20) _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 7a2c0: 202e ffec movel %fp@(-20),%d0 7a2c4: 222e fff0 movel %fp@(-16),%d1 7a2c8: 2540 0008 movel %d0,%a2@(8) 7a2cc: 2541 000c movel %d1,%a2@(12) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 7a2d0: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> 7a2d6: 4280 clrl %d0 7a2d8: 60ac bras 7a286 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a2da: 246e ffe8 moveal %fp@(-24),%a2 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 7a2de: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a2e0: 4e5e unlk %fp 7a2e2: 4e75 rts valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { _Thread_Enable_dispatch(); 7a2e4: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a2ea: 246e ffe8 moveal %fp@(-24),%a2 valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { _Thread_Enable_dispatch(); 7a2ee: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a2f0: 4e5e unlk %fp 7a2f2: 4e75 rts 0007a53c : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 7a53c: 4e56 ffec linkw %fp,#-20 7a540: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7a544: 486e fffc pea %fp@(-4) 7a548: 242e 0008 movel %fp@(8),%d2 7a54c: 2f02 movel %d2,%sp@- 7a54e: 4879 000a 5692 pea a5692 <_Rate_monotonic_Information> 7a554: 4eb9 0004 daa4 jsr 4daa4 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7a55a: 4fef 000c lea %sp@(12),%sp 7a55e: 2440 moveal %d0,%a2 7a560: 4aae fffc tstl %fp@(-4) 7a564: 661e bnes 7a584 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 7a566: 2039 000a 5322 movel a5322 <_Thread_Executing>,%d0 7a56c: b0aa 0040 cmpl %a2@(64),%d0 7a570: 671e beqs 7a590 _Thread_Enable_dispatch(); 7a572: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> 7a578: 7017 moveq #23,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a57a: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a580: 4e5e unlk %fp 7a582: 4e75 rts the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 7a584: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a586: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a58c: 4e5e unlk %fp 7a58e: 4e75 rts if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 7a590: 4aae 000c tstl %fp@(12) 7a594: 6700 00ce beqw 7a664 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 7a598: 203c 0000 0700 movel #1792,%d0 7a59e: 40c3 movew %sr,%d3 7a5a0: 8083 orl %d3,%d0 7a5a2: 46c0 movew %d0,%sr switch ( the_period->state ) { 7a5a4: 202a 0038 movel %a2@(56),%d0 7a5a8: 7202 moveq #2,%d1 7a5aa: b280 cmpl %d0,%d1 7a5ac: 6700 00dc beqw 7a68a 7a5b0: 123c 0004 moveb #4,%d1 7a5b4: b280 cmpl %d0,%d1 7a5b6: 6762 beqs 7a61a 7a5b8: 4a80 tstl %d0 7a5ba: 66c8 bnes 7a584 <== ALWAYS TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 7a5bc: 46c3 movew %d3,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 7a5be: 2f0a movel %a2,%sp@- 7a5c0: 2d40 fff8 movel %d0,%fp@(-8) 7a5c4: 4eb9 0007 a2f4 jsr 7a2f4 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7a5ca: 223c 0007 a728 movel #501544,%d1 the_watchdog->id = id; 7a5d0: 2542 0030 movel %d2,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7a5d4: 242e 000c movel %fp@(12),%d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7a5d8: 2541 002c movel %d1,%a2@(44) the_period->state = RATE_MONOTONIC_ACTIVE; 7a5dc: 7202 moveq #2,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7a5de: 2542 001c movel %d2,%a2@(28) 7a5e2: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 7a5e6: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 7a5ea: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 7a5ee: 2542 003c movel %d2,%a2@(60) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7a5f2: 486a 0010 pea %a2@(16) 7a5f6: 4879 000a 5340 pea a5340 <_Watchdog_Ticks_chain> 7a5fc: 4eb9 0004 f490 jsr 4f490 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7a602: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 7a608: 202e fff8 movel %fp@(-8),%d0 7a60c: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a610: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a616: 4e5e unlk %fp 7a618: 4e75 rts case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 7a61a: 2f0a movel %a2,%sp@- 7a61c: 4eb9 0007 a422 jsr 7a422 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 7a622: 46c3 movew %d3,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 7a624: 7202 moveq #2,%d1 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7a626: 7006 moveq #6,%d0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7a628: 242e 000c movel %fp@(12),%d2 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 7a62c: 2541 0038 movel %d1,%a2@(56) 7a630: 2542 001c movel %d2,%a2@(28) the_period->next_length = length; 7a634: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7a638: 486a 0010 pea %a2@(16) 7a63c: 4879 000a 5340 pea a5340 <_Watchdog_Ticks_chain> 7a642: 2d40 fff8 movel %d0,%fp@(-8) 7a646: 4eb9 0004 f490 jsr 4f490 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7a64c: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 7a652: 202e fff8 movel %fp@(-8),%d0 7a656: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a65a: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a660: 4e5e unlk %fp 7a662: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7a664: 202a 0038 movel %a2@(56),%d0 7a668: 7204 moveq #4,%d1 7a66a: b280 cmpl %d0,%d1 7a66c: 6400 009c bccw 7a70a <== NEVER TAKEN 7a670: 4280 clrl %d0 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7a672: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 7a676: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> <== NOT EXECUTED return( return_value ); 7a67c: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a680: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a686: 4e5e unlk %fp 7a688: 4e75 rts case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 7a68a: 2f0a movel %a2,%sp@- 7a68c: 4eb9 0007 a422 jsr 7a422 <_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; the_period->next_length = length; 7a692: 242e 000c movel %fp@(12),%d2 /* * 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; 7a696: 7001 moveq #1,%d0 the_period->next_length = length; 7a698: 2542 003c movel %d2,%a2@(60) /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 7a69c: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 7a6a0: 46c3 movew %d3,%sr _Thread_Executing->Wait.id = the_period->Object.id; 7a6a2: 2079 000a 5322 moveal a5322 <_Thread_Executing>,%a0 7a6a8: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7a6ae: 4878 4000 pea 4000 7a6b2: 2f08 movel %a0,%sp@- 7a6b4: 4eb9 0004 ec8c jsr 4ec8c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 7a6ba: 203c 0000 0700 movel #1792,%d0 7a6c0: 40c1 movew %sr,%d1 7a6c2: 8081 orl %d1,%d0 7a6c4: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 7a6c6: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 7a6c8: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 7a6cc: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 7a6d0: 46c1 movew %d1,%sr /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 7a6d2: 7203 moveq #3,%d1 7a6d4: 4fef 000c lea %sp@(12),%sp 7a6d8: b280 cmpl %d0,%d1 7a6da: 6712 beqs 7a6ee _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 7a6dc: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> 7a6e2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7a6e4: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7a6ea: 4e5e unlk %fp 7a6ec: 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 ); 7a6ee: 4878 4000 pea 4000 7a6f2: 2f39 000a 5322 movel a5322 <_Thread_Executing>,%sp@- 7a6f8: 4eb9 0004 dfec jsr 4dfec <_Thread_Clear_state> 7a6fe: 508f addql #8,%sp _Thread_Enable_dispatch(); 7a700: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> 7a706: 4280 clrl %d0 7a708: 60da bras 7a6e4 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7a70a: 41f9 0009 f320 lea 9f320 ,%a0 7a710: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7a714: 2d40 fff8 movel %d0,%fp@(-8) 7a718: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> return( return_value ); 7a71e: 202e fff8 movel %fp@(-8),%d0 7a722: 6000 ff5c braw 7a680 <== ALWAYS TAKEN ... 00069514 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 69514: 4e56 ff78 linkw %fp,#-136 69518: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 6951c: 262e 0008 movel %fp@(8),%d3 69520: 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 ) 69524: 4a8a tstl %a2 69526: 6700 0082 beqw 695aa <== ALWAYS TAKEN return; (*print)( context, "Period information by period\n" ); 6952a: 4879 0009 c022 pea 9c022 <_TOD_Days_per_month+0x68> 69530: 2f03 movel %d3,%sp@- 69532: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 69534: 4879 0009 c040 pea 9c040 <_TOD_Days_per_month+0x86> 6953a: 2f03 movel %d3,%sp@- 6953c: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 6953e: 4879 0009 c062 pea 9c062 <_TOD_Days_per_month+0xa8> 69544: 2f03 movel %d3,%sp@- 69546: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 69548: 4879 0009 c085 pea 9c085 <_TOD_Days_per_month+0xcb> 6954e: 2f03 movel %d3,%sp@- 69550: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 69552: 4fef 001c lea %sp@(28),%sp 69556: 2ebc 0009 c0d0 movel #639184,%sp@ 6955c: 2f03 movel %d3,%sp@- 6955e: 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 ; 69560: 2439 000a 5698 movel a5698 <_Rate_monotonic_Information+0x6>,%d2 69566: 508f addql #8,%sp 69568: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 6956e: 623a bhis 695aa <== ALWAYS TAKEN 69570: 280e movel %fp,%d4 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 69572: 2a0e movel %fp,%d5 69574: 0684 ffff ffa2 addil #-94,%d4 6957a: 47f9 0007 a16c lea 7a16c ,%a3 status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 69580: 4bf9 0007 a22c lea 7a22c ,%a5 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 69586: 5b85 subql #5,%d5 69588: 49f9 0004 be48 lea 4be48 ,%a4 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 ); 6958e: 2e3c 0006 ad64 movel #437604,%d7 * 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 ); 69594: 2f04 movel %d4,%sp@- 69596: 2f02 movel %d2,%sp@- 69598: 4e93 jsr %a3@ if ( status != RTEMS_SUCCESSFUL ) 6959a: 508f addql #8,%sp 6959c: 4a80 tstl %d0 6959e: 6714 beqs 695b4 <== ALWAYS TAKEN * 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++ ) { 695a0: 5282 addql #1,%d2 /* * 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 ; 695a2: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 695a8: 63ea blss 69594 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 695aa: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 695b0: 4e5e unlk %fp 695b2: 4e75 rts status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 695b4: 486e ffda pea %fp@(-38) 695b8: 2f02 movel %d2,%sp@- 695ba: 4e95 jsr %a5@ #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 695bc: 2f05 movel %d5,%sp@- 695be: 4878 0005 pea 5 695c2: 2f2e ffda movel %fp@(-38),%sp@- 695c6: 4e94 jsr %a4@ /* * Print part of report line that is not dependent on granularity */ (*print)( context, 695c8: 2f2e ffa6 movel %fp@(-90),%sp@- 695cc: 2f2e ffa2 movel %fp@(-94),%sp@- 695d0: 2f05 movel %d5,%sp@- 695d2: 2f02 movel %d2,%sp@- 695d4: 4879 0009 c11c pea 9c11c <_TOD_Days_per_month+0x162> 695da: 2f03 movel %d3,%sp@- 695dc: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 695de: 202e ffa2 movel %fp@(-94),%d0 695e2: 4fef 002c lea %sp@(44),%sp 695e6: 6618 bnes 69600 (*print)( context, "\n" ); 695e8: 4879 0009 d913 pea 9d913 <__FUNCTION__.5937+0x5d> * 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++ ) { 695ee: 5282 addql #1,%d2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 695f0: 2f03 movel %d3,%sp@- 695f2: 4e92 jsr %a2@ continue; 695f4: 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 ; 695f6: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 695fc: 6396 blss 69594 695fe: 60aa bras 695aa <== 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 ); 69600: 486e fff2 pea %fp@(-14) 69604: 2047 moveal %d7,%a0 * 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++ ) { 69606: 5282 addql #1,%d2 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 ); 69608: 2f00 movel %d0,%sp@- 6960a: 486e ffba pea %fp@(-70) 6960e: 4e90 jsr %a0@ (*print)( context, 69610: 202e fff6 movel %fp@(-10),%d0 69614: 223c 0000 03e8 movel #1000,%d1 6961a: 4c41 0800 remsl %d1,%d0,%d0 6961e: 2c2e ffb6 movel %fp@(-74),%d6 69622: 2f00 movel %d0,%sp@- 69624: 2001 movel %d1,%d0 69626: 2f2e fff2 movel %fp@(-14),%sp@- 6962a: 4c40 6806 remsl %d0,%d6,%d6 6962e: 202e ffae movel %fp@(-82),%d0 69632: 2246 moveal %d6,%a1 69634: 223c 0000 03e8 movel #1000,%d1 6963a: 2f09 movel %a1,%sp@- 6963c: 2f2e ffb2 movel %fp@(-78),%sp@- 69640: 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, 69644: 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, 6964a: 2f00 movel %d0,%sp@- 6964c: 2f2e ffaa movel %fp@(-86),%sp@- 69650: 4879 0009 c133 pea 9c133 <_TOD_Days_per_month+0x179> 69656: 2f03 movel %d3,%sp@- 69658: 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); 6965a: 4fef 002c lea %sp@(44),%sp 6965e: 2047 moveal %d7,%a0 69660: 486e fff2 pea %fp@(-14) 69664: 2f2e ffa2 movel %fp@(-94),%sp@- 69668: 486e ffd2 pea %fp@(-46) 6966c: 4e90 jsr %a0@ (*print)( context, 6966e: 202e fff6 movel %fp@(-10),%d0 69672: 4c46 0800 remsl %d6,%d0,%d0 69676: 222e ffce movel %fp@(-50),%d1 6967a: 2f00 movel %d0,%sp@- 6967c: 2f2e fff2 movel %fp@(-14),%sp@- 69680: 4c46 1801 remsl %d6,%d1,%d1 69684: 202e ffc6 movel %fp@(-58),%d0 69688: 2241 moveal %d1,%a1 6968a: 2f09 movel %a1,%sp@- 6968c: 2f2e ffca movel %fp@(-54),%sp@- 69690: 4c46 0800 remsl %d6,%d0,%d0 69694: 2f00 movel %d0,%sp@- 69696: 2f2e ffc2 movel %fp@(-62),%sp@- 6969a: 4879 0009 c152 pea 9c152 <_TOD_Days_per_month+0x198> 696a0: 2f03 movel %d3,%sp@- 696a2: 4e92 jsr %a2@ 696a4: 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 ; 696a8: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 696ae: 6300 fee4 blsw 69594 696b2: 6000 fef6 braw 695aa <== NOT EXECUTED 000696d0 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 696d0: 4e56 0000 linkw %fp,#0 696d4: 2039 000a 5268 movel a5268 <_Thread_Dispatch_disable_level>,%d0 696da: 5280 addql #1,%d0 696dc: 2f0a movel %a2,%sp@- 696de: 23c0 000a 5268 movel %d0,a5268 <_Thread_Dispatch_disable_level> 696e4: 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 ; 696e6: 2439 000a 5698 movel a5698 <_Rate_monotonic_Information+0x6>,%d2 696ec: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 696f2: 6216 bhis 6970a <== ALWAYS TAKEN 696f4: 45f9 0006 971c lea 6971c ,%a2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 696fa: 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++ ) { 696fc: 5282 addql #1,%d2 status = rtems_rate_monotonic_reset_statistics( id ); 696fe: 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 ; 69700: 588f addql #4,%sp 69702: b4b9 000a 569c cmpl a569c <_Rate_monotonic_Information+0xa>,%d2 69708: 63f0 blss 696fa /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 6970a: 242e fff8 movel %fp@(-8),%d2 6970e: 246e fffc moveal %fp@(-4),%a2 69712: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 69714: 4ef9 0004 e3c0 jmp 4e3c0 <_Thread_Enable_dispatch> ... 00056d04 : uintptr_t length, uintptr_t page_size, rtems_attribute attribute_set, rtems_id *id ) { 56d04: 4e56 ffec linkw %fp,#-20 56d08: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 56d0c: 262e 0008 movel %fp@(8),%d3 56d10: 242e 000c movel %fp@(12),%d2 56d14: 246e 001c moveal %fp@(28),%a2 rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 56d18: 4a83 tstl %d3 56d1a: 6700 0096 beqw 56db2 return RTEMS_INVALID_NAME; if ( !starting_address ) 56d1e: 4a82 tstl %d2 56d20: 670a beqs 56d2c return RTEMS_INVALID_ADDRESS; if ( !id ) 56d22: 4a8a tstl %a2 56d24: 6706 beqs 56d2c return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) 56d26: 7003 moveq #3,%d0 56d28: c082 andl %d2,%d0 56d2a: 670c beqs 56d38 return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); return return_status; 56d2c: 7009 moveq #9,%d0 } 56d2e: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56d34: 4e5e unlk %fp 56d36: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 56d38: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56d3e: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> * This function allocates a region control block from * the inactive chain of free region control blocks. */ RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void ) { return (Region_Control *) _Objects_Allocate( &_Region_Information ); 56d44: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 56d4a: 4eb9 0005 ac40 jsr 5ac40 <_Objects_Allocate> the_region = _Region_Allocate(); if ( !the_region ) 56d50: 508f addql #8,%sp 56d52: 2640 moveal %d0,%a3 56d54: 4a80 tstl %d0 56d56: 6766 beqs 56dbe return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 56d58: 2f2e 0014 movel %fp@(20),%sp@- 56d5c: 2f2e 0010 movel %fp@(16),%sp@- 56d60: 2f02 movel %d2,%sp@- 56d62: 486b 0068 pea %a3@(104) 56d66: 4eb9 0005 a6c4 jsr 5a6c4 <_Heap_Initialize> &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 56d6c: 4fef 0010 lea %sp@(16),%sp if ( !the_region ) return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 56d70: 2740 005c movel %d0,%a3@(92) &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 56d74: 6662 bnes 56dd8 */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 56d76: 2f0b movel %a3,%sp@- 56d78: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 56d7e: 103c 0008 moveb #8,%d0 56d82: 2d40 fffc movel %d0,%fp@(-4) 56d86: 4eb9 0005 af78 jsr 5af78 <_Objects_Free> 56d8c: 202e fffc movel %fp@(-4),%d0 56d90: 508f addql #8,%sp *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56d92: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56d98: 2d40 fffc movel %d0,%fp@(-4) 56d9c: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56da2: 202e fffc movel %fp@(-4),%d0 56da6: 588f addql #4,%sp } 56da8: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56dae: 4e5e unlk %fp 56db0: 4e75 rts ) { rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 56db2: 7003 moveq #3,%d0 } } _RTEMS_Unlock_allocator(); return return_status; } 56db4: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56dba: 4e5e unlk %fp 56dbc: 4e75 rts *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56dbe: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Allocate(); if ( !the_region ) 56dc4: 7005 moveq #5,%d0 *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56dc6: 2d40 fffc movel %d0,%fp@(-4) 56dca: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56dd0: 202e fffc movel %fp@(-4),%d0 56dd4: 588f addql #4,%sp 56dd6: 60d0 bras 56da8 <== ALWAYS TAKEN return_status = RTEMS_INVALID_SIZE; } else { the_region->starting_address = starting_address; 56dd8: 2742 0050 movel %d2,%a3@(80) the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56ddc: 222e 0018 movel %fp@(24),%d1 } else { the_region->starting_address = starting_address; the_region->length = length; 56de0: 202e 0010 movel %fp@(16),%d0 the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56de4: e489 lsrl #2,%d1 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 56de6: 242e 0014 movel %fp@(20),%d2 the_region->attribute_set = attribute_set; 56dea: 206e 0018 moveal %fp@(24),%a0 } else { the_region->starting_address = starting_address; the_region->length = length; 56dee: 2740 0054 movel %d0,%a3@(84) &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 56df2: 4280 clrl %d0 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 56df4: 2742 0058 movel %d2,%a3@(88) the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56df8: 7401 moveq #1,%d2 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; 56dfa: 2748 0060 movel %a0,%a3@(96) the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56dfe: c481 andl %d1,%d2 the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; 56e00: 42ab 0064 clrl %a3@(100) _Thread_queue_Initialize( 56e04: 4878 0006 pea 6 56e08: 4878 0040 pea 40 56e0c: 2f02 movel %d2,%sp@- 56e0e: 486b 0010 pea %a3@(16) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 56e12: 4282 clrl %d2 56e14: 2d40 fffc movel %d0,%fp@(-4) 56e18: 4eb9 0005 c178 jsr 5c178 <_Thread_queue_Initialize> 56e1e: 222b 0008 movel %a3@(8),%d1 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 56e22: 4fef 0010 lea %sp@(16),%sp 56e26: 2079 0007 c80c moveal 7c80c <_Region_Information+0x18>,%a0 56e2c: 3401 movew %d1,%d2 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 56e2e: 2743 000c movel %d3,%a3@(12) 56e32: 202e fffc movel %fp@(-4),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 56e36: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4) 56e3a: 2481 movel %d1,%a2@ return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56e3c: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56e42: 2d40 fffc movel %d0,%fp@(-4) 56e46: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56e4c: 202e fffc movel %fp@(-4),%d0 56e50: 588f addql #4,%sp 56e52: 6000 ff54 braw 56da8 <== ALWAYS TAKEN ... 00056f08 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 56f08: 4e56 fff8 linkw %fp,#-8 56f0c: 2f0a movel %a2,%sp@- 56f0e: 2f02 movel %d2,%sp@- 56f10: 242e 000c movel %fp@(12),%d2 Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 56f14: 677e beqs 56f94 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 56f16: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56f1c: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 56f22: 486e fff8 pea %fp@(-8) 56f26: 2f2e 0008 movel %fp@(8),%sp@- 56f2a: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 56f30: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 56f36: 4fef 0010 lea %sp@(16),%sp 56f3a: 2440 moveal %d0,%a2 56f3c: 4aae fff8 tstl %fp@(-8) 56f40: 6640 bnes 56f82 case OBJECTS_LOCAL: heap_status = _Heap_Extend( 56f42: 486e fffc pea %fp@(-4) 56f46: 2f2e 0010 movel %fp@(16),%sp@- 56f4a: 2f02 movel %d2,%sp@- 56f4c: 486a 0068 pea %a2@(104) 56f50: 4eb9 0005 a3b8 jsr 5a3b8 <_Heap_Extend> starting_address, length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { 56f56: 4fef 0010 lea %sp@(16),%sp 56f5a: 4a80 tstl %d0 56f5c: 6748 beqs 56fa6 the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56f5e: 7201 moveq #1,%d1 56f60: b280 cmpl %d0,%d1 56f62: 6760 beqs 56fc4 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f64: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56f6a: 7418 moveq #24,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f6c: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56f72: 588f addql #4,%sp } 56f74: 2002 movel %d2,%d0 56f76: 242e fff0 movel %fp@(-16),%d2 56f7a: 246e fff4 moveal %fp@(-12),%a2 56f7e: 4e5e unlk %fp 56f80: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f82: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Get( id, &location ); switch ( location ) { 56f88: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f8a: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56f90: 588f addql #4,%sp 56f92: 60e0 bras 56f74 <== ALWAYS TAKEN Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 56f94: 143c 0009 moveb #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 56f98: 2002 movel %d2,%d0 56f9a: 242e fff0 movel %fp@(-16),%d2 56f9e: 246e fff4 moveal %fp@(-12),%a2 56fa2: 4e5e unlk %fp 56fa4: 4e75 rts length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 56fa6: 202e fffc movel %fp@(-4),%d0 the_region->maximum_segment_size += amount_extended; 56faa: d1aa 005c addl %d0,%a2@(92) 56fae: 4282 clrl %d2 length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 56fb0: d1aa 0054 addl %d0,%a2@(84) default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fb4: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56fba: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56fc0: 588f addql #4,%sp 56fc2: 60b0 bras 56f74 <== ALWAYS TAKEN default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fc4: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56fca: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fcc: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 56fd2: 588f addql #4,%sp 56fd4: 609e bras 56f74 <== ALWAYS TAKEN ... 00056fd8 : rtems_status_code rtems_region_get_free_information( rtems_id id, Heap_Information_block *the_info ) { 56fd8: 4e56 fffc linkw %fp,#-4 56fdc: 2f0a movel %a2,%sp@- 56fde: 246e 000c moveal %fp@(12),%a2 56fe2: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 56fe4: 4a8a tstl %a2 56fe6: 6776 beqs 5705e <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 56fe8: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 56fee: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> 56ff4: 486e fffc pea %fp@(-4) 56ff8: 2f2e 0008 movel %fp@(8),%sp@- 56ffc: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 57002: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57008: 4fef 0010 lea %sp@(16),%sp 5700c: 4aae fffc tstl %fp@(-4) 57010: 663a bnes 5704c the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 57012: 2f0a movel %a2,%sp@- 57014: 2040 moveal %d0,%a0 57016: 4868 0068 pea %a0@(104) 5701a: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_info->Used.number = 0; 5701c: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 57020: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 57024: 42aa 0010 clrl %a2@(16) _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 57028: 4eb9 0005 a5e8 jsr 5a5e8 <_Heap_Get_free_information> return_status = RTEMS_SUCCESSFUL; break; 5702e: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57030: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 57036: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 5703c: 588f addql #4,%sp } 5703e: 2002 movel %d2,%d0 57040: 242e fff4 movel %fp@(-12),%d2 57044: 246e fff8 moveal %fp@(-8),%a2 57048: 4e5e unlk %fp 5704a: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5704c: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57052: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57054: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 5705a: 588f addql #4,%sp 5705c: 60e0 bras 5703e <== ALWAYS TAKEN { Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 5705e: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 57060: 2002 movel %d2,%d0 57062: 242e fff4 movel %fp@(-12),%d2 57066: 246e fff8 moveal %fp@(-8),%a2 5706a: 4e5e unlk %fp 5706c: 4e75 rts ... 00057070 : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 57070: 4e56 fffc linkw %fp,#-4 57074: 2f02 movel %d2,%sp@- 57076: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 5707a: 6766 beqs 570e2 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 5707c: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 57082: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> 57088: 486e fffc pea %fp@(-4) 5708c: 2f2e 0008 movel %fp@(8),%sp@- 57090: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 57096: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 5709c: 4fef 0010 lea %sp@(16),%sp 570a0: 4aae fffc tstl %fp@(-4) 570a4: 662a bnes 570d0 case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 570a6: 2f02 movel %d2,%sp@- 570a8: 2040 moveal %d0,%a0 570aa: 4868 0068 pea %a0@(104) 570ae: 4282 clrl %d2 570b0: 4eb9 0005 a63c jsr 5a63c <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 570b6: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570b8: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 570be: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 570c4: 588f addql #4,%sp } 570c6: 2002 movel %d2,%d0 570c8: 242e fff8 movel %fp@(-8),%d2 570cc: 4e5e unlk %fp 570ce: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570d0: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 570d6: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570d8: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 570de: 588f addql #4,%sp 570e0: 60e4 bras 570c6 <== ALWAYS TAKEN { Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 570e2: 143c 0009 moveb #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 570e6: 2002 movel %d2,%d0 570e8: 242e fff8 movel %fp@(-8),%d2 570ec: 4e5e unlk %fp 570ee: 4e75 rts 000570f0 : uintptr_t size, rtems_option option_set, rtems_interval timeout, void **segment ) { 570f0: 4e56 ffe4 linkw %fp,#-28 570f4: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 570f8: 262e 0008 movel %fp@(8),%d3 570fc: 242e 000c movel %fp@(12),%d2 57100: 246e 0018 moveal %fp@(24),%a2 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 57104: 4a8a tstl %a2 57106: 6700 00be beqw 571c6 return RTEMS_INVALID_ADDRESS; *segment = NULL; 5710a: 4292 clrl %a2@ if ( size == 0 ) 5710c: 4a82 tstl %d2 5710e: 660c bnes 5711c 57110: 7008 moveq #8,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 57112: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57118: 4e5e unlk %fp 5711a: 4e75 rts *segment = NULL; if ( size == 0 ) return RTEMS_INVALID_SIZE; _RTEMS_Lock_allocator(); 5711c: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 57122: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> 57128: 486e fffc pea %fp@(-4) 5712c: 2f03 movel %d3,%sp@- 5712e: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> executing = _Thread_Executing; 57134: 2879 0007 c9aa moveal 7c9aa <_Thread_Executing>,%a4 5713a: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57140: 4fef 0010 lea %sp@(16),%sp 57144: 2640 moveal %d0,%a3 57146: 4aae fffc tstl %fp@(-4) 5714a: 6628 bnes 57174 case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 5714c: b4ab 005c cmpl %a3@(92),%d2 57150: 633c blss 5718e default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57152: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 57158: 7008 moveq #8,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5715a: 2d40 fff8 movel %d0,%fp@(-8) 5715e: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 57164: 202e fff8 movel %fp@(-8),%d0 57168: 588f addql #4,%sp } 5716a: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57170: 4e5e unlk %fp 57172: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57174: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); _Thread_Enable_dispatch(); return (rtems_status_code) executing->Wait.return_code; 5717a: 7004 moveq #4,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5717c: 2d40 fff8 movel %d0,%fp@(-8) 57180: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 57186: 202e fff8 movel %fp@(-8),%d0 5718a: 588f addql #4,%sp 5718c: 60dc bras 5716a <== ALWAYS TAKEN * @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 ); 5718e: 42a7 clrl %sp@- 57190: 42a7 clrl %sp@- 57192: 2f02 movel %d2,%sp@- 57194: 486b 0068 pea %a3@(104) 57198: 4eb9 0005 a224 jsr 5a224 <_Heap_Allocate_aligned_with_boundary> the_segment = _Region_Allocate_segment( the_region, size ); _Region_Debug_Walk( the_region, 2 ); if ( the_segment ) { 5719e: 4fef 0010 lea %sp@(16),%sp 571a2: 2200 movel %d0,%d1 571a4: 672c beqs 571d2 the_region->number_of_used_blocks += 1; 571a6: 52ab 0064 addql #1,%a3@(100) *segment = the_segment; 571aa: 4280 clrl %d0 571ac: 2481 movel %d1,%a2@ default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571ae: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 571b4: 2d40 fff8 movel %d0,%fp@(-8) 571b8: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 571be: 202e fff8 movel %fp@(-8),%d0 571c2: 588f addql #4,%sp 571c4: 60a4 bras 5716a <== ALWAYS TAKEN Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 571c6: 7009 moveq #9,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 571c8: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 571ce: 4e5e unlk %fp 571d0: 4e75 rts if ( the_segment ) { the_region->number_of_used_blocks += 1; *segment = the_segment; return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 571d2: 202e 0010 movel %fp@(16),%d0 571d6: 0800 0000 btst #0,%d0 571da: 671c beqs 571f8 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571dc: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- if ( the_segment ) { the_region->number_of_used_blocks += 1; *segment = the_segment; return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 571e2: 700d moveq #13,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571e4: 2d40 fff8 movel %d0,%fp@(-8) 571e8: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 571ee: 202e fff8 movel %fp@(-8),%d0 571f2: 588f addql #4,%sp 571f4: 6000 ff74 braw 5716a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 571f8: 2039 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d0 571fe: 5280 addql #1,%d0 57200: 23c0 0007 c8f0 movel %d0,7c8f0 <_Thread_Dispatch_disable_level> * Switch from using the memory allocation mutex to using a * dispatching disabled critical section. We have to do this * because this thread is going to block. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 57206: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 5720c: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> executing->Wait.queue = &the_region->Wait_queue; 57212: 200b movel %a3,%d0 57214: 0680 0000 0010 addil #16,%d0 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; 5721a: 7201 moveq #1,%d1 5721c: 2940 0044 movel %d0,%a4@(68) 57220: 2741 0040 movel %d1,%a3@(64) executing->Wait.id = id; 57224: 2943 0020 movel %d3,%a4@(32) executing->Wait.count = size; 57228: 2942 0024 movel %d2,%a4@(36) executing->Wait.return_argument = segment; 5722c: 294a 0028 movel %a2,%a4@(40) _Thread_queue_Enter_critical_section( &the_region->Wait_queue ); _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); 57230: 4879 0005 c25c pea 5c25c <_Thread_queue_Timeout> 57236: 2f2e 0014 movel %fp@(20),%sp@- 5723a: 2f00 movel %d0,%sp@- 5723c: 4eb9 0005 befc jsr 5befc <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 57242: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> return (rtems_status_code) executing->Wait.return_code; 57248: 202c 0034 movel %a4@(52),%d0 5724c: 4fef 0010 lea %sp@(16),%sp break; } _RTEMS_Unlock_allocator(); return return_status; } 57250: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57256: 4e5e unlk %fp 57258: 4e75 rts ... 0005725c : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 5725c: 4e56 fffc linkw %fp,#-4 57260: 2f03 movel %d3,%sp@- 57262: 262e 0010 movel %fp@(16),%d3 57266: 2f02 movel %d2,%sp@- 57268: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 5726c: 6700 0092 beqw 57300 return RTEMS_INVALID_ADDRESS; if ( !size ) 57270: 4a83 tstl %d3 57272: 6700 008c beqw 57300 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 57276: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 5727c: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> 57282: 486e fffc pea %fp@(-4) 57286: 2f2e 0008 movel %fp@(8),%sp@- 5728a: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 57290: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57296: 222e fffc movel %fp@(-4),%d1 5729a: 4fef 0010 lea %sp@(16),%sp 5729e: 6636 bnes 572d6 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572a0: 2f03 movel %d3,%sp@- 572a2: 2040 moveal %d0,%a0 572a4: 2f02 movel %d2,%sp@- 572a6: 4868 0068 pea %a0@(104) 572aa: 4eb9 0005 ab18 jsr 5ab18 <_Heap_Size_of_alloc_area> 572b0: 4fef 000c lea %sp@(12),%sp 572b4: 4a00 tstb %d0 572b6: 6624 bnes 572dc <== NEVER TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572b8: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572be: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572c0: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> <== NOT EXECUTED return return_status; 572c6: 588f addql #4,%sp <== NOT EXECUTED } 572c8: 2002 movel %d2,%d0 572ca: 242e fff4 movel %fp@(-12),%d2 572ce: 262e fff8 movel %fp@(-8),%d3 572d2: 4e5e unlk %fp 572d4: 4e75 rts return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 572d6: 7001 moveq #1,%d0 572d8: b081 cmpl %d1,%d0 572da: 6712 beqs 572ee <== NEVER TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572dc: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572e2: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572e4: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 572ea: 588f addql #4,%sp 572ec: 60da bras 572c8 <== ALWAYS TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572ee: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 572f4: 7404 moveq #4,%d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572f6: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 572fc: 588f addql #4,%sp 572fe: 60c8 bras 572c8 <== ALWAYS TAKEN 57300: 7409 moveq #9,%d2 } 57302: 2002 movel %d2,%d0 57304: 242e fff4 movel %fp@(-12),%d2 57308: 262e fff8 movel %fp@(-8),%d3 5730c: 4e5e unlk %fp 5730e: 4e75 rts 0005740c : rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ) { 5740c: 4e56 fffc linkw %fp,#-4 57410: 2f0a movel %a2,%sp@- 57412: 2f02 movel %d2,%sp@- uint32_t size; #endif int status; register Region_Control *the_region; _RTEMS_Lock_allocator(); 57414: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- 5741a: 4eb9 0005 9688 jsr 59688 <_API_Mutex_Lock> 57420: 486e fffc pea %fp@(-4) 57424: 2f2e 0008 movel %fp@(8),%sp@- 57428: 4879 0007 c7f4 pea 7c7f4 <_Region_Information> 5742e: 4eb9 0005 b0dc jsr 5b0dc <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57434: 4fef 0010 lea %sp@(16),%sp 57438: 2440 moveal %d0,%a2 5743a: 4aae fffc tstl %fp@(-4) 5743e: 671e beqs 5745e default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57440: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- register Region_Control *the_region; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57446: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57448: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 5744e: 588f addql #4,%sp } 57450: 2002 movel %d2,%d0 57452: 242e fff4 movel %fp@(-12),%d2 57456: 246e fff8 moveal %fp@(-8),%a2 5745a: 4e5e unlk %fp 5745c: 4e75 rts RTEMS_INLINE_ROUTINE bool _Region_Free_segment ( Region_Control *the_region, void *the_segment ) { return _Heap_Free( &the_region->Memory, the_segment ); 5745e: 2f2e 000c movel %fp@(12),%sp@- 57462: 486a 0068 pea %a2@(104) 57466: 4eb9 0005 a468 jsr 5a468 <_Heap_Free> #endif status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) 5746c: 508f addql #8,%sp 5746e: 4a00 tstb %d0 57470: 6612 bnes 57484 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57472: 2f39 0007 c9a2 movel 7c9a2 <_RTEMS_Allocator_Mutex>,%sp@- else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 57478: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5747a: 4eb9 0005 96e8 jsr 596e8 <_API_Mutex_Unlock> return return_status; 57480: 588f addql #4,%sp 57482: 60cc bras 57450 <== ALWAYS TAKEN _Region_Debug_Walk( the_region, 4 ); if ( !status ) return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; 57484: 53aa 0064 subql #1,%a2@(100) _Region_Process_queue(the_region); /* unlocks allocator */ 57488: 4282 clrl %d2 5748a: 2f0a movel %a2,%sp@- 5748c: 4eb9 0005 ecac jsr 5ecac <_Region_Process_queue> break; } _RTEMS_Unlock_allocator(); return return_status; } 57492: 246e fff8 moveal %fp@(-8),%a2 57496: 2002 movel %d2,%d0 else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 57498: 588f addql #4,%sp break; } _RTEMS_Unlock_allocator(); return return_status; } 5749a: 242e fff4 movel %fp@(-12),%d2 5749e: 4e5e unlk %fp 574a0: 4e75 rts ... 00045a8c : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 45a8c: 4e56 ffd4 linkw %fp,#-44 45a90: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45a94: 262e 0008 movel %fp@(8),%d3 45a98: 242e 0010 movel %fp@(16),%d2 45a9c: 246e 0018 moveal %fp@(24),%a2 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 ) ) 45aa0: 4a83 tstl %d3 45aa2: 6748 beqs 45aec return RTEMS_INVALID_NAME; if ( !id ) 45aa4: 4a8a tstl %a2 45aa6: 6700 00ea beqw 45b92 * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 45aaa: 2002 movel %d2,%d0 45aac: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 45ab2: 6744 beqs 45af8 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45ab4: 7230 moveq #48,%d1 45ab6: 7810 moveq #16,%d4 45ab8: c282 andl %d2,%d1 45aba: b881 cmpl %d1,%d4 45abc: 670c beqs 45aca name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 45abe: 700b moveq #11,%d0 } 45ac0: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ac6: 4e5e unlk %fp 45ac8: 4e75 rts #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45aca: 44c2 movew %d2,%ccr 45acc: 66f0 bnes 45abe _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 45ace: 0c80 0000 00c0 cmpil #192,%d0 45ad4: 67e8 beqs 45abe _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 45ad6: 7001 moveq #1,%d0 45ad8: b0ae 000c cmpl %fp@(12),%d0 45adc: 6420 bccs 45afe 45ade: 103c 000a moveb #10,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45ae2: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ae8: 4e5e unlk %fp 45aea: 4e75 rts 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 ) ) 45aec: 7003 moveq #3,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45aee: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45af4: 4e5e unlk %fp 45af6: 4e75 rts */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 45af8: 7830 moveq #48,%d4 45afa: c882 andl %d2,%d4 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 ) ) 45afc: 66d8 bnes 45ad6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45afe: 2039 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d0 45b04: 5280 addql #1,%d0 45b06: 23c0 0005 d954 movel %d0,5d954 <_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 ); 45b0c: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45b12: 4eb9 0004 7040 jsr 47040 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 45b18: 588f addql #4,%sp 45b1a: 2640 moveal %d0,%a3 45b1c: 4a80 tstl %d0 45b1e: 6700 00d8 beqw 45bf8 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 45b22: 2742 0010 movel %d2,%a3@(16) /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 45b26: 4a84 tstl %d4 45b28: 6774 beqs 45b9e /* * 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; 45b2a: 44c2 movew %d2,%ccr 45b2c: 56c0 sne %d0 45b2e: 49c0 extbl %d0 45b30: 5280 addql #1,%d0 45b32: 2d40 fff0 movel %d0,%fp@(-16) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 45b36: 7010 moveq #16,%d0 45b38: b084 cmpl %d4,%d0 45b3a: 6700 00ce beqw 45c0a 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; 45b3e: 7202 moveq #2,%d1 the_mutex_attr.only_owner_release = false; 45b40: 4204 clrb %d4 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; 45b42: 2d41 ffea movel %d1,%fp@(-22) the_mutex_attr.only_owner_release = false; 45b46: 1d44 ffee moveb %d4,%fp@(-18) } mutex_status = _CORE_mutex_Initialize( 45b4a: 7001 moveq #1,%d0 45b4c: b0ae 000c cmpl %fp@(12),%d0 45b50: 57c0 seq %d0 45b52: 49c0 extbl %d0 45b54: 4480 negl %d0 45b56: 2f00 movel %d0,%sp@- 45b58: 486e ffea pea %fp@(-22) 45b5c: 486b 0014 pea %a3@(20) 45b60: 4eb9 0004 678c jsr 4678c <_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 ) { 45b66: 4fef 000c lea %sp@(12),%sp 45b6a: 7206 moveq #6,%d1 45b6c: b280 cmpl %d0,%d1 45b6e: 665e bnes 45bce */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45b70: 2f0b movel %a3,%sp@- 45b72: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45b78: 4eb9 0004 7378 jsr 47378 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b7e: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 45b84: 508f addql #8,%sp (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b86: 7013 moveq #19,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b88: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b8e: 4e5e unlk %fp 45b90: 4e75 rts CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 45b92: 7009 moveq #9,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b94: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b9a: 4e5e unlk %fp 45b9c: 4e75 rts * 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( 45b9e: 2f2e 000c movel %fp@(12),%sp@- */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45ba2: 72ff moveq #-1,%d1 * 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( 45ba4: 486e fff8 pea %fp@(-8) 45ba8: 486b 0014 pea %a3@(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; 45bac: 44c2 movew %d2,%ccr 45bae: 56c0 sne %d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45bb0: 2d41 fff8 movel %d1,%fp@(-8) if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bb4: 49c0 extbl %d0 45bb6: 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; 45bb8: 42ae ffea clrl %fp@(-22) * 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; 45bbc: 2d40 fffc movel %d0,%fp@(-4) /* * 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; 45bc0: 42ae fff4 clrl %fp@(-12) _CORE_semaphore_Initialize( 45bc4: 4eb9 0004 6ad4 jsr 46ad4 <_CORE_semaphore_Initialize> 45bca: 4fef 000c lea %sp@(12),%sp #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bce: 202b 0008 movel %a3@(8),%d0 45bd2: 4281 clrl %d1 45bd4: 2079 0005 d8a8 moveal 5d8a8 <_Semaphore_Information+0x18>,%a0 45bda: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45bdc: 2743 000c movel %d3,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45be0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 45be4: 2480 movel %d0,%a2@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45be6: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 45bec: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45bf2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45bf4: 4e5e unlk %fp 45bf6: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 45bf8: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> 45bfe: 7005 moveq #5,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45c00: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45c06: 4e5e unlk %fp 45c08: 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; 45c0a: 42ae ffea clrl %fp@(-22) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c0e: 7801 moveq #1,%d4 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; 45c10: 4201 clrb %d1 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; 45c12: 2d6e 0014 fff4 movel %fp@(20),%fp@(-12) the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 45c18: 1d41 ffee moveb %d1,%fp@(-18) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c1c: b8ae fff0 cmpl %fp@(-16),%d4 45c20: 6600 ff28 bnew 45b4a if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 45c24: 0802 0006 btst #6,%d2 45c28: 6712 beqs 45c3c the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45c2a: 103c 0002 moveb #2,%d0 the_mutex_attr.only_owner_release = true; 45c2e: 7201 moveq #1,%d1 the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 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; 45c30: 2d40 fff0 movel %d0,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c34: 1d41 ffee moveb %d1,%fp@(-18) 45c38: 6000 ff10 braw 45b4a <== ALWAYS TAKEN } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 45c3c: 4a02 tstb %d2 45c3e: 6c00 ff0a bgew 45b4a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 45c42: 7803 moveq #3,%d4 the_mutex_attr.only_owner_release = true; 45c44: 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; 45c46: 2d44 fff0 movel %d4,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c4a: 1d40 ffee moveb %d0,%fp@(-18) 45c4e: 6000 fefa braw 45b4a <== ALWAYS TAKEN ... 00045c54 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 45c54: 4e56 fffc linkw %fp,#-4 45c58: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 45c5a: 486e fffc pea %fp@(-4) 45c5e: 2f2e 0008 movel %fp@(8),%sp@- 45c62: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45c68: 4eb9 0004 74dc jsr 474dc <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c6e: 4fef 000c lea %sp@(12),%sp 45c72: 2440 moveal %d0,%a2 45c74: 4aae fffc tstl %fp@(-4) 45c78: 670a beqs 45c84 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c7a: 246e fff8 moveal %fp@(-8),%a2 { register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c7e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c80: 4e5e unlk %fp 45c82: 4e75 rts 45c84: 7030 moveq #48,%d0 45c86: c0aa 0010 andl %a2@(16),%d0 the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45c8a: 6760 beqs 45cec if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 45c8c: 4aaa 0062 tstl %a2@(98) 45c90: 6616 bnes 45ca8 45c92: 7220 moveq #32,%d1 45c94: b280 cmpl %d0,%d1 45c96: 6710 beqs 45ca8 !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 45c98: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c9e: 246e fff8 moveal %fp@(-8),%a2 case OBJECTS_LOCAL: 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(); 45ca2: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ca4: 4e5e unlk %fp 45ca6: 4e75 rts !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } _CORE_mutex_Flush( 45ca8: 4878 0004 pea 4 45cac: 42a7 clrl %sp@- 45cae: 486a 0014 pea %a2@(20) 45cb2: 4eb9 0004 6780 jsr 46780 <_CORE_mutex_Flush> 45cb8: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45cbc: 2f0a movel %a2,%sp@- 45cbe: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45cc4: 4eb9 0004 70d0 jsr 470d0 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45cca: 2f0a movel %a2,%sp@- 45ccc: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45cd2: 4eb9 0004 7378 jsr 47378 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45cd8: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45cde: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45ce2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ce4: 246e fff8 moveal %fp@(-8),%a2 45ce8: 4e5e unlk %fp 45cea: 4e75 rts &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 45cec: 4878 0002 pea 2 45cf0: 42a7 clrl %sp@- 45cf2: 486a 0014 pea %a2@(20) 45cf6: 4eb9 0004 6ac8 jsr 46ac8 <_CORE_semaphore_Flush> 45cfc: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45d00: 2f0a movel %a2,%sp@- 45d02: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45d08: 4eb9 0004 70d0 jsr 470d0 <_Objects_Close> 45d0e: 2f0a movel %a2,%sp@- 45d10: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45d16: 4eb9 0004 7378 jsr 47378 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d1c: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45d22: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d26: 4280 clrl %d0 45d28: 60ba bras 45ce4 <== ALWAYS TAKEN ... 000504d0 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 504d0: 4e56 fffc linkw %fp,#-4 504d4: 486e fffc pea %fp@(-4) 504d8: 2f2e 0008 movel %fp@(8),%sp@- 504dc: 4879 0006 3ad8 pea 63ad8 <_Semaphore_Information> 504e2: 4eb9 0004 9524 jsr 49524 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 504e8: 4fef 000c lea %sp@(12),%sp 504ec: 4aae fffc tstl %fp@(-4) 504f0: 6706 beqs 504f8 504f2: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 504f4: 4e5e unlk %fp 504f6: 4e75 rts the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 504f8: 7230 moveq #48,%d1 504fa: 2040 moveal %d0,%a0 504fc: c2a8 0010 andl %a0@(16),%d1 50500: 6720 beqs 50522 _CORE_mutex_Flush( 50502: 4878 0001 pea 1 50506: 42a7 clrl %sp@- 50508: 4868 0014 pea %a0@(20) 5050c: 4eb9 0004 872c jsr 4872c <_CORE_mutex_Flush> 50512: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50516: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> 5051c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5051e: 4e5e unlk %fp 50520: 4e75 rts &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 50522: 4878 0001 pea 1 50526: 2040 moveal %d0,%a0 50528: 42a7 clrl %sp@- 5052a: 4868 0014 pea %a0@(20) 5052e: 4eb9 0004 8a74 jsr 48a74 <_CORE_semaphore_Flush> 50534: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50538: 4eb9 0004 9e10 jsr 49e10 <_Thread_Enable_dispatch> 5053e: 4280 clrl %d0 50540: 60dc bras 5051e <== ALWAYS TAKEN ... 00045d2c : rtems_status_code rtems_semaphore_obtain( rtems_id id, rtems_option option_set, rtems_interval timeout ) { 45d2c: 4e56 ffec linkw %fp,#-20 45d30: 48d7 001c moveml %d2-%d4,%sp@ Objects_Id id, Objects_Locations *location, ISR_Level *level ) { return (Semaphore_Control *) 45d34: 486e fff8 pea %fp@(-8) 45d38: 486e fffc pea %fp@(-4) 45d3c: 242e 0008 movel %fp@(8),%d2 45d40: 2f02 movel %d2,%sp@- 45d42: 4879 0005 d890 pea 5d890 <_Semaphore_Information> 45d48: 262e 000c movel %fp@(12),%d3 45d4c: 282e 0010 movel %fp@(16),%d4 45d50: 4eb9 0004 747c jsr 4747c <_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 ) { 45d56: 4fef 0010 lea %sp@(16),%sp 45d5a: 4aae fffc tstl %fp@(-4) 45d5e: 670c beqs 45d6c 45d60: 7004 moveq #4,%d0 break; } return RTEMS_INVALID_ID; } 45d62: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45d68: 4e5e unlk %fp 45d6a: 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) ) { 45d6c: 7230 moveq #48,%d1 45d6e: 2040 moveal %d0,%a0 45d70: c2a8 0010 andl %a0@(16),%d1 45d74: 6738 beqs 45dae _CORE_mutex_Seize( 45d76: 2f2e fff8 movel %fp@(-8),%sp@- 45d7a: 7201 moveq #1,%d1 45d7c: c681 andl %d1,%d3 45d7e: 2f04 movel %d4,%sp@- 45d80: b781 eorl %d3,%d1 45d82: 2f01 movel %d1,%sp@- 45d84: 2f02 movel %d2,%sp@- 45d86: 4868 0014 pea %a0@(20) 45d8a: 4eb9 0004 6908 jsr 46908 <_CORE_mutex_Seize> id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 45d90: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 45d96: 2f28 0034 movel %a0@(52),%sp@- 45d9a: 4eb9 0004 5ef8 jsr 45ef8 <_Semaphore_Translate_core_mutex_return_code> 45da0: 4fef 0018 lea %sp@(24),%sp break; } return RTEMS_INVALID_ID; } 45da4: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45daa: 4e5e unlk %fp 45dac: 4e75 rts { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 45dae: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 45db4: 2240 moveal %d0,%a1 Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 45db6: 42a8 0034 clrl %a0@(52) if ( the_semaphore->count != 0 ) { 45dba: 2229 005c movel %a1@(92),%d1 45dbe: 662e bnes 45dee the_semaphore->count -= 1; _ISR_Enable( *level_p ); return; } if ( !wait ) { 45dc0: 0803 0000 btst #0,%d3 45dc4: 6748 beqs 45e0e _ISR_Enable( *level_p ); 45dc6: 202e fff8 movel %fp@(-8),%d0 45dca: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 45dcc: 7001 moveq #1,%d0 45dce: 2140 0034 movel %d0,%a0@(52) id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45dd2: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 45dd8: 2f28 0034 movel %a0@(52),%sp@- 45ddc: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45de2: 588f addql #4,%sp break; } return RTEMS_INVALID_ID; } 45de4: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45dea: 4e5e unlk %fp 45dec: 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; 45dee: 5381 subql #1,%d1 45df0: 2341 005c movel %d1,%a1@(92) _ISR_Enable( *level_p ); 45df4: 202e fff8 movel %fp@(-8),%d0 45df8: 46c0 movew %d0,%sr id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45dfa: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 45e00: 2f28 0034 movel %a0@(52),%sp@- 45e04: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45e0a: 588f addql #4,%sp 45e0c: 60d6 bras 45de4 <== ALWAYS TAKEN 45e0e: 2239 0005 d954 movel 5d954 <_Thread_Dispatch_disable_level>,%d1 45e14: 5281 addql #1,%d1 45e16: 23c1 0005 d954 movel %d1,5d954 <_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; 45e1c: 7201 moveq #1,%d1 45e1e: 2240 moveal %d0,%a1 return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 45e20: 0680 0000 0014 addil #20,%d0 45e26: 2341 0044 movel %d1,%a1@(68) executing->Wait.id = id; 45e2a: 2142 0020 movel %d2,%a0@(32) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 45e2e: 2140 0044 movel %d0,%a0@(68) executing->Wait.id = id; _ISR_Enable( *level_p ); 45e32: 222e fff8 movel %fp@(-8),%d1 45e36: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 45e38: 4879 0004 856c pea 4856c <_Thread_queue_Timeout> 45e3e: 2f04 movel %d4,%sp@- 45e40: 2f00 movel %d0,%sp@- 45e42: 4eb9 0004 820c jsr 4820c <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45e48: 4eb9 0004 7d48 jsr 47d48 <_Thread_Enable_dispatch> 45e4e: 2079 0005 da0e moveal 5da0e <_Thread_Executing>,%a0 45e54: 4fef 000c lea %sp@(12),%sp 45e58: 2f28 0034 movel %a0@(52),%sp@- 45e5c: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45e62: 588f addql #4,%sp 45e64: 6000 ff7e braw 45de4 <== ALWAYS TAKEN 000463f4 : void rtems_shutdown_executive( uint32_t result ) { if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 463f4: 7004 moveq #4,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 463f6: 4e56 0000 linkw %fp,#0 if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 463fa: b0b9 0005 dad6 cmpl 5dad6 <_System_state_Current>,%d0 46400: 6726 beqs 46428 * 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 ); 46402: 2039 0005 d950 movel 5d950 <_Thread_BSP_context+0x30>,%d0 46408: 2239 0005 d920 movel 5d920 <_Thread_BSP_context>,%d1 4640e: 46c1 movew %d1,%sr 46410: 2e40 moveal %d0,%sp 46412: 4e75 rts 46414: 23c0 0005 d950 movel %d0,5d950 <_Thread_BSP_context+0x30> <== NOT EXECUTED 4641a: 7004 moveq #4,%d0 <== NOT EXECUTED 4641c: 23c1 0005 d920 movel %d1,5d920 <_Thread_BSP_context> <== NOT EXECUTED 46422: 23c0 0005 dad6 movel %d0,5dad6 <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_SHUTDOWN ); _Thread_Stop_multitasking(); } } 46428: 4e5e unlk %fp 4642a: 4e75 rts 00057a1c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 57a1c: 4e56 fffc linkw %fp,#-4 57a20: 2f03 movel %d3,%sp@- 57a22: 2f02 movel %d2,%sp@- 57a24: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 57a28: 660e bnes 57a38 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a2a: 242e fff4 movel %fp@(-12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 57a2e: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a30: 262e fff8 movel %fp@(-8),%d3 57a34: 4e5e unlk %fp 57a36: 4e75 rts ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 57a38: 486e fffc pea %fp@(-4) 57a3c: 2f2e 0008 movel %fp@(8),%sp@- 57a40: 4eb9 0005 ba60 jsr 5ba60 <_Thread_Get> switch ( location ) { 57a46: 508f addql #8,%sp 57a48: 4aae fffc tstl %fp@(-4) 57a4c: 670e beqs 57a5c case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a4e: 242e fff4 movel %fp@(-12),%d2 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 57a52: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a54: 262e fff8 movel %fp@(-8),%d3 57a58: 4e5e unlk %fp 57a5a: 4e75 rts the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 57a5c: 2240 moveal %d0,%a1 57a5e: 2069 0108 moveal %a1@(264),%a0 asr = &api->Signal; 57a62: 4aa8 000a tstl %a0@(10) 57a66: 6770 beqs 57ad8 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 57a68: 4a28 0008 tstb %a0@(8) 57a6c: 673e beqs 57aac rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 57a6e: 223c 0000 0700 movel #1792,%d1 57a74: 40c3 movew %sr,%d3 57a76: 8283 orl %d3,%d1 57a78: 46c1 movew %d1,%sr *signal_set |= signals; 57a7a: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 57a7e: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 57a80: 2239 0007 c98a movel 7c98a <_ISR_Nest_level>,%d1 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 57a86: 7401 moveq #1,%d2 57a88: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 57a8c: 4a81 tstl %d1 57a8e: 6708 beqs 57a98 57a90: b0b9 0007 c9aa cmpl 7c9aa <_Thread_Executing>,%d0 57a96: 6730 beqs 57ac8 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57a98: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 57a9e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57aa0: 242e fff4 movel %fp@(-12),%d2 57aa4: 262e fff8 movel %fp@(-8),%d3 57aa8: 4e5e unlk %fp 57aaa: 4e75 rts rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 57aac: 203c 0000 0700 movel #1792,%d0 57ab2: 40c1 movew %sr,%d1 57ab4: 8081 orl %d1,%d0 57ab6: 46c0 movew %d0,%sr *signal_set |= signals; 57ab8: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 57abc: 46c1 movew %d1,%sr if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57abe: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 57ac4: 4280 clrl %d0 57ac6: 60d8 bras 57aa0 <== ALWAYS TAKEN _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 57ac8: 13c2 0007 ca34 moveb %d2,7ca34 <_ISR_Signals_to_thread_executing> } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57ace: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 57ad4: 4280 clrl %d0 57ad6: 60c8 bras 57aa0 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 57ad8: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57ade: 242e fff4 movel %fp@(-12),%d2 _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 57ae2: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57ae4: 262e fff8 movel %fp@(-8),%d3 57ae8: 4e5e unlk %fp 57aea: 4e75 rts 00045f24 : size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id ) { 45f24: 4e56 ffe8 linkw %fp,#-24 45f28: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 45f2c: 242e 0008 movel %fp@(8),%d2 45f30: 282e 000c movel %fp@(12),%d4 45f34: 262e 0014 movel %fp@(20),%d3 45f38: 2a2e 0018 movel %fp@(24),%d5 45f3c: 246e 001c moveal %fp@(28),%a2 Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 45f40: 4a8a tstl %a2 45f42: 6700 011c beqw 46060 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 45f46: 4a82 tstl %d2 45f48: 6700 00b4 beqw 45ffe /* * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { 45f4c: 4a45 tstw %d5 45f4e: 6d14 blts 45f64 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 45f50: 4a84 tstl %d4 45f52: 6700 00b6 beqw 4600a 45f56: 4280 clrl %d0 45f58: 1039 0005 c222 moveb 5c222 ,%d0 45f5e: b084 cmpl %d4,%d0 45f60: 6500 00a8 bcsw 4600a */ /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 45f64: 2f39 0005 da06 movel 5da06 <_RTEMS_Allocator_Mutex>,%sp@- 45f6a: 4eb9 0004 66b4 jsr 466b4 <_API_Mutex_Lock> * This function allocates a task control block from * the inactive chain of free task control blocks. */ RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information ); 45f70: 4879 0005 d8c8 pea 5d8c8 <_RTEMS_tasks_Information> 45f76: 4eb9 0004 7040 jsr 47040 <_Objects_Allocate> * the event of an error. */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { 45f7c: 508f addql #8,%sp 45f7e: 2640 moveal %d0,%a3 45f80: 4a80 tstl %d0 45f82: 6700 00c2 beqw 46046 /* * Initialize the core thread for this task. */ status = _Thread_Initialize( 45f86: 2f02 movel %d2,%sp@- 45f88: 7407 moveq #7,%d2 45f8a: 7009 moveq #9,%d0 45f8c: 2203 movel %d3,%d1 45f8e: e0a9 lsrl %d0,%d1 45f90: 2003 movel %d3,%d0 45f92: e088 lsrl #8,%d0 45f94: c483 andl %d3,%d2 45f96: 2f02 movel %d2,%sp@- 45f98: 7401 moveq #1,%d2 45f9a: 42a7 clrl %sp@- 45f9c: c481 andl %d1,%d2 45f9e: 7201 moveq #1,%d1 45fa0: 2f02 movel %d2,%sp@- 45fa2: 7401 moveq #1,%d2 45fa4: b380 eorl %d1,%d0 45fa6: c480 andl %d0,%d2 45fa8: 7001 moveq #1,%d0 45faa: 2f02 movel %d2,%sp@- 45fac: c085 andl %d5,%d0 45fae: 2f04 movel %d4,%sp@- 45fb0: 2f00 movel %d0,%sp@- 45fb2: 2f2e 0010 movel %fp@(16),%sp@- 45fb6: 42a7 clrl %sp@- 45fb8: 2f0b movel %a3,%sp@- 45fba: 4879 0005 d8c8 pea 5d8c8 <_RTEMS_tasks_Information> 45fc0: 4eb9 0004 7e0c jsr 47e0c <_Thread_Initialize> NULL, /* no budget algorithm callout */ _Modes_Get_interrupt_level(initial_modes), (Objects_Name) name ); if ( !status ) { 45fc6: 4fef 002c lea %sp@(44),%sp 45fca: 4a00 tstb %d0 45fcc: 6748 beqs 46016 } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 45fce: 720a moveq #10,%d1 45fd0: 7401 moveq #1,%d2 45fd2: e2ab lsrl %d1,%d3 45fd4: b583 eorl %d2,%d3 45fd6: 206b 0108 moveal %a3@(264),%a0 45fda: c682 andl %d2,%d3 *id = the_thread->Object.id; 45fdc: 24ab 0008 movel %a3@(8),%a2@ } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 45fe0: 1143 0008 moveb %d3,%a0@(8) ); } #endif _RTEMS_Unlock_allocator(); 45fe4: 2f39 0005 da06 movel 5da06 <_RTEMS_Allocator_Mutex>,%sp@- 45fea: 4eb9 0004 6714 jsr 46714 <_API_Mutex_Unlock> return RTEMS_SUCCESSFUL; 45ff0: 588f addql #4,%sp ); } #endif _RTEMS_Unlock_allocator(); 45ff2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45ff4: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 45ffa: 4e5e unlk %fp 45ffc: 4e75 rts if ( !id ) return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 45ffe: 7003 moveq #3,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46000: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46006: 4e5e unlk %fp 46008: 4e75 rts } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; 4600a: 7013 moveq #19,%d0 } 4600c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46012: 4e5e unlk %fp 46014: 4e75 rts */ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( Thread_Control *the_task ) { _Objects_Free( 46016: 2f2b 0008 movel %a3@(8),%sp@- 4601a: 4eb9 0004 73fc jsr 473fc <_Objects_Get_information_id> 46020: 2f0b movel %a3,%sp@- 46022: 2f00 movel %d0,%sp@- 46024: 4eb9 0004 7378 jsr 47378 <_Objects_Free> #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 4602a: 2f39 0005 da06 movel 5da06 <_RTEMS_Allocator_Mutex>,%sp@- 46030: 4eb9 0004 6714 jsr 46714 <_API_Mutex_Unlock> return RTEMS_UNSATISFIED; 46036: 4fef 0010 lea %sp@(16),%sp #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 4603a: 700d moveq #13,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 4603c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46042: 4e5e unlk %fp 46044: 4e75 rts */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46046: 2f39 0005 da06 movel 5da06 <_RTEMS_Allocator_Mutex>,%sp@- 4604c: 4eb9 0004 6714 jsr 46714 <_API_Mutex_Unlock> return RTEMS_TOO_MANY; 46052: 588f addql #4,%sp */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46054: 7005 moveq #5,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46056: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4605c: 4e5e unlk %fp 4605e: 4e75 rts Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 46060: 7009 moveq #9,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46062: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46068: 4e5e unlk %fp 4606a: 4e75 rts 0004cd28 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4cd28: 4e56 ffe4 linkw %fp,#-28 4cd2c: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4cd30: 2a2e 0008 movel %fp@(8),%d5 4cd34: 242e 000c movel %fp@(12),%d2 4cd38: 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 ) 4cd3c: 4a8c tstl %a4 4cd3e: 6700 0154 beqw 4ce94 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4cd42: 2479 0005 da0e moveal 5da0e <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4cd48: 4a2a 0075 tstb %a2@(117) 4cd4c: 57c0 seq %d0 4cd4e: 263c 0000 0100 movel #256,%d3 4cd54: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4cd56: 266a 0108 moveal %a2@(264),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4cd5a: c680 andl %d0,%d3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4cd5c: 4aaa 007a tstl %a2@(122) 4cd60: 6600 00d4 bnew 4ce36 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4cd64: 4a2b 0008 tstb %a3@(8) 4cd68: 57c0 seq %d0 4cd6a: 283c 0000 0400 movel #1024,%d4 4cd70: 49c0 extbl %d0 4cd72: c880 andl %d0,%d4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4cd74: 4eb9 0004 9210 jsr 49210 <_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; 4cd7a: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4cd7c: 8083 orl %d3,%d0 4cd7e: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4cd80: 0802 0008 btst #8,%d2 4cd84: 670e beqs 4cd94 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4cd86: 2005 movel %d5,%d0 4cd88: 7201 moveq #1,%d1 4cd8a: e088 lsrl #8,%d0 4cd8c: b380 eorl %d1,%d0 4cd8e: c081 andl %d1,%d0 4cd90: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4cd94: 0802 0009 btst #9,%d2 4cd98: 6718 beqs 4cdb2 if ( _Modes_Is_timeslice(mode_set) ) { 4cd9a: 0805 0009 btst #9,%d5 4cd9e: 6700 00c2 beqw 4ce62 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4cda2: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4cda4: 41f9 0005 d904 lea 5d904 <_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; 4cdaa: 2540 007a movel %d0,%a2@(122) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4cdae: 2550 0076 movel %a0@,%a2@(118) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4cdb2: 7007 moveq #7,%d0 4cdb4: c082 andl %d2,%d0 4cdb6: 6712 beqs 4cdca */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4cdb8: 40c0 movew %sr,%d0 4cdba: 7207 moveq #7,%d1 4cdbc: c285 andl %d5,%d1 4cdbe: 0280 0000 f8ff andil #63743,%d0 4cdc4: e189 lsll #8,%d1 4cdc6: 8081 orl %d1,%d0 4cdc8: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4cdca: 0802 000a btst #10,%d2 4cdce: 6758 beqs 4ce28 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4cdd0: 700a moveq #10,%d0 4cdd2: e0ad lsrl %d0,%d5 4cdd4: 7201 moveq #1,%d1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4cdd6: 4280 clrl %d0 4cdd8: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4cddc: b385 eorl %d1,%d5 4cdde: ca81 andl %d1,%d5 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4cde0: ba80 cmpl %d0,%d5 4cde2: 6744 beqs 4ce28 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4cde4: 203c 0000 0700 movel #1792,%d0 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; 4cdea: 1745 0008 moveb %d5,%a3@(8) 4cdee: 40c1 movew %sr,%d1 4cdf0: 8081 orl %d1,%d0 4cdf2: 46c0 movew %d0,%sr _signals = information->signals_pending; 4cdf4: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4cdf8: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4cdfe: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4ce02: 46c1 movew %d1,%sr if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4ce04: 4aab 0012 tstl %a3@(18) 4ce08: 671e beqs 4ce28 executing->do_post_task_switch_extension = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4ce0a: 7203 moveq #3,%d1 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4ce0c: 7001 moveq #1,%d0 4ce0e: 7401 moveq #1,%d2 4ce10: 1540 0074 moveb %d0,%a2@(116) } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4ce14: b2b9 0005 dad6 cmpl 5dad6 <_System_state_Current>,%d1 4ce1a: 6758 beqs 4ce74 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); 4ce1c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4ce1e: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4ce24: 4e5e unlk %fp 4ce26: 4e75 rts executing->do_post_task_switch_extension = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4ce28: 7203 moveq #3,%d1 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4ce2a: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4ce2c: b2b9 0005 dad6 cmpl 5dad6 <_System_state_Current>,%d1 4ce32: 66e8 bnes 4ce1c <== ALWAYS TAKEN 4ce34: 603e bras 4ce74 <== ALWAYS TAKEN if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4ce36: 4a2b 0008 tstb %a3@(8) 4ce3a: 57c0 seq %d0 4ce3c: 283c 0000 0400 movel #1024,%d4 4ce42: 49c0 extbl %d0 4ce44: c880 andl %d0,%d4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4ce46: 4eb9 0004 9210 jsr 49210 <_CPU_ISR_Get_level> 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; 4ce4c: 08c3 0009 bset #9,%d3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4ce50: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4ce52: 8083 orl %d3,%d0 4ce54: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4ce56: 0802 0008 btst #8,%d2 4ce5a: 6700 ff38 beqw 4cd94 4ce5e: 6000 ff26 braw 4cd86 <== ALWAYS TAKEN /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4ce62: 7007 moveq #7,%d0 4ce64: 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; 4ce66: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4ce6a: 4a80 tstl %d0 4ce6c: 6700 ff5c beqw 4cdca 4ce70: 6000 ff46 braw 4cdb8 <== ALWAYS TAKEN } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4ce74: 4eb9 0004 d178 jsr 4d178 <_Thread_Evaluate_mode> 4ce7a: 4a00 tstb %d0 4ce7c: 6604 bnes 4ce82 4ce7e: 4a02 tstb %d2 4ce80: 679a beqs 4ce1c _Thread_Dispatch(); 4ce82: 4eb9 0004 7bf0 jsr 47bf0 <_Thread_Dispatch> 4ce88: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4ce8a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4ce90: 4e5e unlk %fp 4ce92: 4e75 rts ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 4ce94: 7009 moveq #9,%d0 if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; } 4ce96: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4ce9c: 4e5e unlk %fp 4ce9e: 4e75 rts 0004afc0 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4afc0: 4e56 fffc linkw %fp,#-4 4afc4: 2f0a movel %a2,%sp@- 4afc6: 246e 0010 moveal %fp@(16),%a2 4afca: 2f02 movel %d2,%sp@- 4afcc: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4afd0: 670c beqs 4afde */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4afd2: 4280 clrl %d0 4afd4: 1039 0006 2692 moveb 62692 ,%d0 4afda: b082 cmpl %d2,%d0 4afdc: 6566 bcss 4b044 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4afde: 4a8a tstl %a2 4afe0: 6770 beqs 4b052 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4afe2: 486e fffc pea %fp@(-4) 4afe6: 2f2e 0008 movel %fp@(8),%sp@- 4afea: 4eb9 0004 cf40 jsr 4cf40 <_Thread_Get> switch ( location ) { 4aff0: 508f addql #8,%sp 4aff2: 4aae fffc tstl %fp@(-4) 4aff6: 663e bnes 4b036 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4aff8: 2040 moveal %d0,%a0 4affa: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4affe: 4a82 tstl %d2 4b000: 6720 beqs 4b022 the_thread->real_priority = new_priority; 4b002: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 4b006: 4aa8 001c tstl %a0@(28) 4b00a: 6706 beqs 4b012 the_thread->current_priority > new_priority ) 4b00c: b4a8 0014 cmpl %a0@(20),%d2 4b010: 6410 bccs 4b022 <== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 4b012: 42a7 clrl %sp@- 4b014: 2f02 movel %d2,%sp@- 4b016: 2f00 movel %d0,%sp@- 4b018: 4eb9 0004 c9c8 jsr 4c9c8 <_Thread_Change_priority> 4b01e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4b022: 4eb9 0004 cee8 jsr 4cee8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b028: 242e fff4 movel %fp@(-12),%d2 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); } _Thread_Enable_dispatch(); 4b02c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b02e: 246e fff8 moveal %fp@(-8),%a2 4b032: 4e5e unlk %fp 4b034: 4e75 rts 4b036: 242e fff4 movel %fp@(-12),%d2 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); switch ( location ) { 4b03a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b03c: 246e fff8 moveal %fp@(-8),%a2 4b040: 4e5e unlk %fp 4b042: 4e75 rts 4b044: 242e fff4 movel %fp@(-12),%d2 4b048: 7013 moveq #19,%d0 4b04a: 246e fff8 moveal %fp@(-8),%a2 4b04e: 4e5e unlk %fp 4b050: 4e75 rts 4b052: 242e fff4 movel %fp@(-12),%d2 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4b056: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b058: 246e fff8 moveal %fp@(-8),%a2 4b05c: 4e5e unlk %fp 4b05e: 4e75 rts 00069d24 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 69d24: 4e56 fffc linkw %fp,#-4 69d28: 2f02 movel %d2,%sp@- 69d2a: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 69d2e: 6762 beqs 69d92 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 69d30: 486e fffc pea %fp@(-4) 69d34: 2f2e 0008 movel %fp@(8),%sp@- 69d38: 4eb9 0004 e3e8 jsr 4e3e8 <_Thread_Get> switch (location) { 69d3e: 508f addql #8,%sp 69d40: 4aae fffc tstl %fp@(-4) 69d44: 663c bnes 69d82 case OBJECTS_LOCAL: tvp = the_thread->task_variables; 69d46: 2240 moveal %d0,%a1 69d48: 2069 0118 moveal %a1@(280),%a0 while (tvp) { 69d4c: 4a88 tstl %a0 69d4e: 673c beqs 69d8c if (tvp->ptr == ptr) { 69d50: b4a8 0004 cmpl %a0@(4),%d2 69d54: 6746 beqs 69d9c else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 69d56: 2248 moveal %a0,%a1 } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 69d58: 2050 moveal %a0@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 69d5a: 4a88 tstl %a0 69d5c: 672e beqs 69d8c <== ALWAYS TAKEN if (tvp->ptr == ptr) { 69d5e: b4a8 0004 cmpl %a0@(4),%d2 69d62: 66f2 bnes 69d56 if (prev) prev->next = tvp->next; 69d64: 2290 movel %a0@,%a1@ else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 69d66: 2f08 movel %a0,%sp@- 69d68: 2f00 movel %d0,%sp@- 69d6a: 4eb9 0006 9e44 jsr 69e44 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 69d70: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 69d76: 508f addql #8,%sp prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); 69d78: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69d7a: 242e fff8 movel %fp@(-8),%d2 69d7e: 4e5e unlk %fp 69d80: 4e75 rts 69d82: 242e fff8 movel %fp@(-8),%d2 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); switch (location) { 69d86: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69d88: 4e5e unlk %fp 69d8a: 4e75 rts return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 69d8c: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69d92: 242e fff8 movel %fp@(-8),%d2 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 69d96: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69d98: 4e5e unlk %fp 69d9a: 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; 69d9c: 2240 moveal %d0,%a1 69d9e: 2350 0118 movel %a0@,%a1@(280) _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 69da2: 2f08 movel %a0,%sp@- 69da4: 2f00 movel %d0,%sp@- 69da6: 4eb9 0006 9e44 jsr 69e44 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 69dac: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 69db2: 508f addql #8,%sp prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); 69db4: 4280 clrl %d0 69db6: 60c2 bras 69d7a <== ALWAYS TAKEN 00069db8 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 69db8: 4e56 fffc linkw %fp,#-4 69dbc: 2f0a movel %a2,%sp@- 69dbe: 246e 0010 moveal %fp@(16),%a2 69dc2: 2f02 movel %d2,%sp@- 69dc4: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 69dc8: 6752 beqs 69e1c return RTEMS_INVALID_ADDRESS; if ( !result ) 69dca: 4a8a tstl %a2 69dcc: 674e beqs 69e1c return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 69dce: 486e fffc pea %fp@(-4) 69dd2: 2f2e 0008 movel %fp@(8),%sp@- 69dd6: 4eb9 0004 e3e8 jsr 4e3e8 <_Thread_Get> switch (location) { 69ddc: 508f addql #8,%sp 69dde: 4aae fffc tstl %fp@(-4) 69de2: 662a bnes 69e0e case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 69de4: 2240 moveal %d0,%a1 69de6: 2069 0118 moveal %a1@(280),%a0 while (tvp) { 69dea: 4a88 tstl %a0 69dec: 670c beqs 69dfa if (tvp->ptr == ptr) { 69dee: b4a8 0004 cmpl %a0@(4),%d2 69df2: 6736 beqs 69e2a */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 69df4: 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) { 69df6: 4a88 tstl %a0 69df8: 66f4 bnes 69dee <== NEVER TAKEN _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 69dfa: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e00: 242e fff4 movel %fp@(-12),%d2 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 69e04: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e06: 246e fff8 moveal %fp@(-8),%a2 69e0a: 4e5e unlk %fp 69e0c: 4e75 rts 69e0e: 242e fff4 movel %fp@(-12),%d2 if ( !result ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); switch (location) { 69e12: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e14: 246e fff8 moveal %fp@(-8),%a2 69e18: 4e5e unlk %fp 69e1a: 4e75 rts 69e1c: 242e fff4 movel %fp@(-12),%d2 return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 69e20: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e22: 246e fff8 moveal %fp@(-8),%a2 69e26: 4e5e unlk %fp 69e28: 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; 69e2a: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 69e2e: 4eb9 0004 e3c0 jsr 4e3c0 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e34: 242e fff4 movel %fp@(-12),%d2 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; _Thread_Enable_dispatch(); 69e38: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 69e3a: 246e fff8 moveal %fp@(-8),%a2 69e3e: 4e5e unlk %fp 69e40: 4e75 rts ... 000471e4 : */ rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 471e4: 4e56 fffc linkw %fp,#-4 471e8: 2f0a movel %a2,%sp@- 471ea: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) 471ee: 4a39 0005 f2b0 tstb 5f2b0 <_TOD_Is_set> 471f4: 6700 00aa beqw 472a0 return RTEMS_NOT_DEFINED; if ( !time_buffer ) 471f8: 4a8a tstl %a2 471fa: 6700 00ae beqw 472aa <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 471fe: 42aa 0018 clrl %a2@(24) if ( !_TOD_Validate( time_buffer ) ) 47202: 2f0a movel %a2,%sp@- 47204: 4eb9 0004 64f0 jsr 464f0 <_TOD_Validate> 4720a: 588f addql #4,%sp 4720c: 4a00 tstb %d0 4720e: 660a bnes 4721a &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47210: 246e fff8 moveal %fp@(-8),%a2 _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47214: 7014 moveq #20,%d0 } 47216: 4e5e unlk %fp 47218: 4e75 rts time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 4721a: 2f0a movel %a2,%sp@- 4721c: 4eb9 0004 63e0 jsr 463e0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 47222: 588f addql #4,%sp 47224: b0b9 0005 f32e cmpl 5f32e <_TOD_Now>,%d0 4722a: 63e4 blss 47210 4722c: 2239 0005 f29c movel 5f29c <_Thread_Dispatch_disable_level>,%d1 47232: 5281 addql #1,%d1 47234: 23c1 0005 f29c movel %d1,5f29c <_Thread_Dispatch_disable_level> return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 4723a: 4878 0010 pea 10 4723e: 2f39 0005 f356 movel 5f356 <_Thread_Executing>,%sp@- 47244: 2d40 fffc movel %d0,%fp@(-4) 47248: 4eb9 0004 965c jsr 4965c <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 4724e: 2079 0005 f356 moveal 5f356 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 47254: 223c 0004 8bfc movel #297980,%d1 4725a: 2141 0064 movel %d1,%a0@(100) if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); _Watchdog_Initialize( 4725e: 2228 0008 movel %a0@(8),%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47262: 202e fffc movel %fp@(-4),%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 47266: 2141 0068 movel %d1,%a0@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4726a: 90b9 0005 f32e subl 5f32e <_TOD_Now>,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47270: 42a8 0050 clrl %a0@(80) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47274: 2140 0054 movel %d0,%a0@(84) ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 47278: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4727c: 4868 0048 pea %a0@(72) 47280: 4879 0005 f368 pea 5f368 <_Watchdog_Seconds_chain> 47286: 4eb9 0004 9ef4 jsr 49ef4 <_Watchdog_Insert> ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4728c: 4eb9 0004 8d90 jsr 48d90 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 47292: 246e fff8 moveal %fp@(-8),%a2 _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47296: 4fef 0010 lea %sp@(16),%sp ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4729a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4729c: 4e5e unlk %fp 4729e: 4e75 rts 472a0: 246e fff8 moveal %fp@(-8),%a2 rtems_time_of_day *time_buffer ) { Watchdog_Interval seconds; if ( !_TOD_Is_set ) 472a4: 700b moveq #11,%d0 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 472a6: 4e5e unlk %fp 472a8: 4e75 rts 472aa: 246e fff8 moveal %fp@(-8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !time_buffer ) 472ae: 7009 moveq #9,%d0 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 472b0: 4e5e unlk %fp 472b2: 4e75 rts 0005840c : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 5840c: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 58410: 486e fffc pea %fp@(-4) 58414: 2f2e 0008 movel %fp@(8),%sp@- 58418: 4879 0007 cb12 pea 7cb12 <_Timer_Information> 5841e: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58424: 4fef 000c lea %sp@(12),%sp 58428: 4aae fffc tstl %fp@(-4) 5842c: 6706 beqs 58434 5842e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58430: 4e5e unlk %fp 58432: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 58434: 7204 moveq #4,%d1 58436: 2040 moveal %d0,%a0 58438: b2a8 0038 cmpl %a0@(56),%d1 5843c: 670c beqs 5844a <== ALWAYS TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 5843e: 4868 0010 pea %a0@(16) 58442: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> 58448: 588f addql #4,%sp _Thread_Enable_dispatch(); 5844a: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 58450: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58452: 4e5e unlk %fp 58454: 4e75 rts ... 00058570 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 58570: 4e56 ffe8 linkw %fp,#-24 58574: 48d7 043c moveml %d2-%d5/%a2,%sp@ 58578: 282e 0008 movel %fp@(8),%d4 5857c: 242e 000c movel %fp@(12),%d2 58580: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 58584: 4a82 tstl %d2 58586: 6700 0094 beqw 5861c return RTEMS_INVALID_NUMBER; if ( !routine ) 5858a: 4a83 tstl %d3 5858c: 6700 00ae beqw 5863c RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 58590: 486e fffc pea %fp@(-4) 58594: 2f04 movel %d4,%sp@- 58596: 4879 0007 cb12 pea 7cb12 <_Timer_Information> 5859c: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 585a2: 4fef 000c lea %sp@(12),%sp 585a6: 2440 moveal %d0,%a2 585a8: 4aae fffc tstl %fp@(-4) 585ac: 6662 bnes 58610 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 585ae: 2a00 movel %d0,%d5 585b0: 0685 0000 0010 addil #16,%d5 585b6: 2f05 movel %d5,%sp@- 585b8: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> _ISR_Disable( level ); 585be: 203c 0000 0700 movel #1792,%d0 585c4: 40c1 movew %sr,%d1 585c6: 8081 orl %d1,%d0 585c8: 46c0 movew %d0,%sr /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { 585ca: 588f addql #4,%sp 585cc: 4aaa 0018 tstl %a2@(24) 585d0: 6656 bnes 58628 <== ALWAYS TAKEN Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 585d2: 2543 002c movel %d3,%a2@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 585d6: 256e 0014 0034 movel %fp@(20),%a2@(52) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 585dc: 2544 0030 movel %d4,%a2@(48) /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL; 585e0: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 585e4: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); 585e8: 46c1 movew %d1,%sr Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 585ea: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 585ee: 2f05 movel %d5,%sp@- 585f0: 4879 0007 c9c8 pea 7c9c8 <_Watchdog_Ticks_chain> 585f6: 4eb9 0005 ce24 jsr 5ce24 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 585fc: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 58602: 508f addql #8,%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 58604: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58606: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 5860c: 4e5e unlk %fp 5860e: 4e75 rts if ( !routine ) return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58610: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58612: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 58618: 4e5e unlk %fp 5861a: 4e75 rts { Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 5861c: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5861e: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 58624: 4e5e unlk %fp 58626: 4e75 rts * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); 58628: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 5862a: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 58630: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58632: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 58638: 4e5e unlk %fp 5863a: 4e75 rts ISR_Level level; if ( ticks == 0 ) return RTEMS_INVALID_NUMBER; if ( !routine ) 5863c: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5863e: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 58644: 4e5e unlk %fp 58646: 4e75 rts 00058a58 : rtems_status_code rtems_timer_initiate_server( uint32_t priority, uint32_t stack_size, rtems_attribute attribute_set ) { 58a58: 4e56 fffc linkw %fp,#-4 58a5c: 202e 0008 movel %fp@(8),%d0 58a60: 2f03 movel %d3,%sp@- 58a62: 2f02 movel %d2,%sp@- 58a64: 4a80 tstl %d0 58a66: 6748 beqs 58ab0 58a68: 4281 clrl %d1 58a6a: 1239 0007 6e12 moveb 76e12 ,%d1 58a70: b280 cmpl %d0,%d1 58a72: 644a bccs 58abe * structured so we check it is invalid before looking for * a specific invalid value as the default. */ _priority = priority; if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) 58a74: 72ff moveq #-1,%d1 58a76: b280 cmpl %d0,%d1 58a78: 6636 bnes 58ab0 58a7a: 2239 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d1 58a80: 5281 addql #1,%d1 58a82: 4283 clrl %d3 58a84: 23c1 0007 c8f0 movel %d1,7c8f0 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 58a8a: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 58a8c: 1439 0007 7d48 moveb 77d48 ,%d2 initialized = true; 58a92: 13c0 0007 7d48 moveb %d0,77d48 _Thread_Enable_dispatch(); 58a98: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> if ( tmpInitialized ) 58a9e: 4a02 tstb %d2 58aa0: 6744 beqs 58ae6 initialized = false; } #endif return status; } 58aa2: 242e fff4 movel %fp@(-12),%d2 _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; _Thread_Enable_dispatch(); if ( tmpInitialized ) 58aa6: 700e moveq #14,%d0 initialized = false; } #endif return status; } 58aa8: 262e fff8 movel %fp@(-8),%d3 58aac: 4e5e unlk %fp 58aae: 4e75 rts 58ab0: 242e fff4 movel %fp@(-12),%d2 if (status) { initialized = false; } #endif return status; 58ab4: 7013 moveq #19,%d0 } 58ab6: 262e fff8 movel %fp@(-8),%d3 58aba: 4e5e unlk %fp 58abc: 4e75 rts 58abe: 2239 0007 c8f0 movel 7c8f0 <_Thread_Dispatch_disable_level>,%d1 58ac4: 5281 addql #1,%d1 58ac6: 2600 movel %d0,%d3 58ac8: 23c1 0007 c8f0 movel %d1,7c8f0 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 58ace: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 58ad0: 1439 0007 7d48 moveb 77d48 ,%d2 initialized = true; 58ad6: 13c0 0007 7d48 moveb %d0,77d48 _Thread_Enable_dispatch(); 58adc: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> if ( tmpInitialized ) 58ae2: 4a02 tstb %d2 58ae4: 66bc bnes 58aa2 <== ALWAYS TAKEN * other library rules. For example, if using a TSR written in Ada the * Server should run at the same priority as the priority Ada task. * Otherwise, the priority ceiling for the mutex used to protect the * GNAT run-time is violated. */ status = rtems_task_create( 58ae6: 486e fffc pea %fp@(-4) 58aea: 222e 0010 movel %fp@(16),%d1 58aee: 08c1 000f bset #15,%d1 58af2: 2f01 movel %d1,%sp@- 58af4: 4878 0100 pea 100 58af8: 2f2e 000c movel %fp@(12),%sp@- 58afc: 2f03 movel %d3,%sp@- 58afe: 2f3c 5449 4d45 movel #1414090053,%sp@- 58b04: 4eb9 0005 7aec jsr 57aec /* user may want floating point but we need */ /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { 58b0a: 4fef 0018 lea %sp@(24),%sp 58b0e: 4a80 tstl %d0 58b10: 6714 beqs 58b26 initialized = false; } #endif return status; } 58b12: 242e fff4 movel %fp@(-12),%d2 /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { initialized = false; 58b16: 4201 clrb %d1 initialized = false; } #endif return status; } 58b18: 262e fff8 movel %fp@(-8),%d3 58b1c: 4e5e unlk %fp /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { initialized = false; 58b1e: 13c1 0007 7d48 moveb %d1,77d48 initialized = false; } #endif return status; } 58b24: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58b26: 41f9 0007 7d7e lea 77d7e <_Timer_server_Default+0x34>,%a0 /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b2c: 4282 clrl %d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58b2e: 223c 0007 7d7a movel #490874,%d1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58b34: 23c8 0007 7d7a movel %a0,77d7a <_Timer_server_Default+0x30> &_RTEMS_tasks_Information, _Objects_Get_index(id) 58b3a: 202e fffc movel %fp@(-4),%d0 58b3e: 41f9 0007 7db6 lea 77db6 <_Timer_server_Default+0x6c>,%a0 58b44: 23c8 0007 7db2 movel %a0,77db2 <_Timer_server_Default+0x68> /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b4a: 2079 0007 c87c moveal 7c87c <_RTEMS_tasks_Information+0x18>,%a0 58b50: 3400 movew %d0,%d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58b52: 23c1 0007 7d82 movel %d1,77d82 <_Timer_server_Default+0x38> * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; 58b58: 2239 0007 ca30 movel 7ca30 <_Watchdog_Ticks_since_boot>,%d1 /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b5e: 41f0 2c00 lea %a0@(00000000,%d2:l:4),%a0 58b62: 23d0 0007 7d4a movel %a0@,77d4a <_Timer_server_Default> 58b68: 41f9 0007 7db2 lea 77db2 <_Timer_server_Default+0x68>,%a0 58b6e: 23c8 0007 7dba movel %a0,77dba <_Timer_server_Default+0x70> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 58b74: 4879 0007 7d4a pea 77d4a <_Timer_server_Default> the_watchdog->routine = routine; 58b7a: 41f9 0005 b874 lea 5b874 <_Thread_Delay_ended>,%a0 58b80: 23c8 0007 7d6e movel %a0,77d6e <_Timer_server_Default+0x24> 58b86: 487a 0160 pea %pc@(58ce8 <_Timer_server_Body>) 58b8a: 23c8 0007 7da6 movel %a0,77da6 <_Timer_server_Default+0x5c> * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58b90: 41f9 0007 c982 lea 7c982 <_TOD_Now>,%a0 * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; 58b96: 23c1 0007 7d86 movel %d1,77d86 <_Timer_server_Default+0x3c> ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58b9c: 23d0 0007 7dbe movel %a0@,77dbe <_Timer_server_Default+0x74> /* * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; 58ba2: 223c 0005 8f24 movel #364324,%d1 ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 58ba8: 41f9 0007 7d4a lea 77d4a <_Timer_server_Default>,%a0 /* * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; 58bae: 23c1 0007 7d4e movel %d1,77d4e <_Timer_server_Default+0x4> ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ts->insert_chain = NULL; ts->active = false; 58bb4: 4201 clrb %d1 ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ts->insert_chain = NULL; 58bb6: 42b9 0007 7dc2 clrl 77dc2 <_Timer_server_Default+0x78> ts->active = false; 58bbc: 13c1 0007 7dc6 moveb %d1,77dc6 <_Timer_server_Default+0x7c> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 58bc2: 2f00 movel %d0,%sp@- ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 58bc4: 23c8 0007 cb4a movel %a0,7cb4a <_Timer_server> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 58bca: 42b9 0007 7d7e clrl 77d7e <_Timer_server_Default+0x34> 58bd0: 42b9 0007 7db6 clrl 77db6 <_Timer_server_Default+0x6c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58bd6: 42b9 0007 7d5a clrl 77d5a <_Timer_server_Default+0x10> the_watchdog->routine = routine; the_watchdog->id = id; 58bdc: 23c0 0007 7d72 movel %d0,77d72 <_Timer_server_Default+0x28> the_watchdog->user_data = user_data; 58be2: 42b9 0007 7d76 clrl 77d76 <_Timer_server_Default+0x2c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58be8: 42b9 0007 7d92 clrl 77d92 <_Timer_server_Default+0x48> the_watchdog->routine = routine; the_watchdog->id = id; 58bee: 23c0 0007 7daa movel %d0,77daa <_Timer_server_Default+0x60> the_watchdog->user_data = user_data; 58bf4: 42b9 0007 7dae clrl 77dae <_Timer_server_Default+0x64> /* * Start the timer server */ status = rtems_task_start( 58bfa: 4eb9 0005 81f4 jsr 581f4 initialized = false; } #endif return status; } 58c00: 242e fff4 movel %fp@(-12),%d2 if (status) { initialized = false; } #endif return status; 58c04: 4fef 000c lea %sp@(12),%sp } 58c08: 262e fff8 movel %fp@(-8),%d3 58c0c: 4e5e unlk %fp 58c0e: 4e75 rts 000587cc : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 587cc: 4e56 fff0 linkw %fp,#-16 587d0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 587d4: 486e fffc pea %fp@(-4) 587d8: 2f2e 0008 movel %fp@(8),%sp@- 587dc: 4879 0007 cb12 pea 7cb12 <_Timer_Information> 587e2: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 587e8: 4fef 000c lea %sp@(12),%sp 587ec: 2440 moveal %d0,%a2 587ee: 4aae fffc tstl %fp@(-4) 587f2: 670e beqs 58802 587f4: 7404 moveq #4,%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 587f6: 2002 movel %d2,%d0 587f8: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 587fe: 4e5e unlk %fp 58800: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 58802: 202a 0038 movel %a2@(56),%d0 58806: 671a beqs 58822 _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58808: 7201 moveq #1,%d1 5880a: b280 cmpl %d0,%d1 5880c: 673c beqs 5884a 5880e: 740b moveq #11,%d2 * 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(); 58810: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58816: 2002 movel %d2,%d0 58818: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 5881e: 4e5e unlk %fp 58820: 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 ); 58822: 45ea 0010 lea %a2@(16),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58826: 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 ); 58828: 2f0a movel %a2,%sp@- 5882a: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58830: 2f0a movel %a2,%sp@- 58832: 4879 0007 c9c8 pea 7c9c8 <_Watchdog_Ticks_chain> 58838: 4eb9 0005 ce24 jsr 5ce24 <_Watchdog_Insert> 5883e: 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(); 58842: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 58848: 60cc bras 58816 <== ALWAYS TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 5884a: 486a 0010 pea %a2@(16) (*timer_server->schedule_operation)( timer_server, the_timer ); 5884e: 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; 58850: 2679 0007 cb4a moveal 7cb4a <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 58856: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 5885c: 2f0a movel %a2,%sp@- 5885e: 2f0b movel %a3,%sp@- 58860: 206b 0004 moveal %a3@(4),%a0 58864: 4e90 jsr %a0@ 58866: 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(); 5886a: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> 58870: 60a4 bras 58816 <== ALWAYS TAKEN ... 0005895c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5895c: 4e56 ffec linkw %fp,#-20 58960: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 58964: 242e 000c movel %fp@(12),%d2 58968: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 5896c: 2479 0007 cb4a moveal 7cb4a <_Timer_server>,%a2 if ( !timer_server ) 58972: 4a8a tstl %a2 58974: 6700 00c8 beqw 58a3e return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 58978: 4a39 0007 c904 tstb 7c904 <_TOD_Is_set> 5897e: 6700 00a6 beqw 58a26 <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) 58982: 4a83 tstl %d3 58984: 6700 00ac beqw 58a32 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 58988: 2f02 movel %d2,%sp@- 5898a: 4eb9 0005 5630 jsr 55630 <_TOD_Validate> 58990: 588f addql #4,%sp 58992: 4a00 tstb %d0 58994: 660c bnes 589a2 the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 58996: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58998: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 5899e: 4e5e unlk %fp 589a0: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 589a2: 2f02 movel %d2,%sp@- 589a4: 4eb9 0005 5520 jsr 55520 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 589aa: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 589ac: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 589ae: b0b9 0007 c982 cmpl 7c982 <_TOD_Now>,%d0 589b4: 63e0 blss 58996 589b6: 486e fffc pea %fp@(-4) 589ba: 2f2e 0008 movel %fp@(8),%sp@- 589be: 4879 0007 cb12 pea 7cb12 <_Timer_Information> 589c4: 4eb9 0005 b118 jsr 5b118 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 589ca: 4fef 000c lea %sp@(12),%sp 589ce: 2640 moveal %d0,%a3 589d0: 4aae fffc tstl %fp@(-4) 589d4: 6674 bnes 58a4a case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 589d6: 486b 0010 pea %a3@(16) 589da: 4eb9 0005 cf6c jsr 5cf6c <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; 589e0: 202e 0008 movel %fp@(8),%d0 589e4: 2740 0030 movel %d0,%a3@(48) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 589e8: 94b9 0007 c982 subl 7c982 <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 589ee: 7003 moveq #3,%d0 the_watchdog->user_data = user_data; 589f0: 276e 0014 0034 movel %fp@(20),%a3@(52) 589f6: 2740 0038 movel %d0,%a3@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 589fa: 2742 001c movel %d2,%a3@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 589fe: 2743 002c movel %d3,%a3@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58a02: 42ab 0018 clrl %a3@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 58a06: 2f0b movel %a3,%sp@- 58a08: 2f0a movel %a2,%sp@- 58a0a: 206a 0004 moveal %a2@(4),%a0 58a0e: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 58a10: 4eb9 0005 ba08 jsr 5ba08 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 58a16: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 58a1a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a1c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a22: 4e5e unlk %fp 58a24: 4e75 rts Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 58a26: 700b moveq #11,%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a28: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 <== NOT EXECUTED 58a2e: 4e5e unlk %fp <== NOT EXECUTED 58a30: 4e75 rts <== NOT EXECUTED return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 58a32: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a34: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a3a: 4e5e unlk %fp 58a3c: 4e75 rts Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 58a3e: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a40: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a46: 4e5e unlk %fp 58a48: 4e75 rts seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58a4a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a4c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a52: 4e5e unlk %fp 58a54: 4e75 rts ...