00045710 <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 45710: 4e56 0000 linkw %fp,#0 45714: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 45716: 2479 0005 bbce moveal 5bbce <_API_extensions_List>,%a2 4571c: 6008 bras 45726 <_API_extensions_Run_postdriver+0x16> <== 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)(); 4571e: 206a 0008 moveal %a2@(8),%a0 45722: 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 ) { 45724: 2452 moveal %a2@,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 45726: b5fc 0005 bbd2 cmpal #375762,%a2 4572c: 66f0 bnes 4571e <_API_extensions_Run_postdriver+0xe> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 4572e: 246e fffc moveal %fp@(-4),%a2 45732: 4e5e unlk %fp 45734: 4e75 rts 00045736 <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 45736: 4e56 0000 linkw %fp,#0 4573a: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 4573c: 2479 0005 bbce moveal 5bbce <_API_extensions_List>,%a2 45742: 6010 bras 45754 <_API_extensions_Run_postswitch+0x1e> <== ALWAYS TAKEN * provide this hook. */ #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); 45744: 2f39 0005 baee movel 5baee <_Thread_Executing>,%sp@- 4574a: 206a 000c moveal %a2@(12),%a0 4574e: 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 ) { 45750: 2452 moveal %a2@,%a2 45752: 588f addql #4,%sp 45754: b5fc 0005 bbd2 cmpal #375762,%a2 4575a: 66e8 bnes 45744 <_API_extensions_Run_postswitch+0xe> #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); } } 4575c: 246e fffc moveal %fp@(-4),%a2 45760: 4e5e unlk %fp 45762: 4e75 rts 0004b3bc <_CORE_barrier_Release>: #else Objects_Id id __attribute__((unused)), CORE_barrier_API_mp_support_callout api_barrier_mp_support __attribute__((unused)) #endif ) { 4b3bc: 4e56 fff4 linkw %fp,#-12 4b3c0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4b3c4: 246e 0008 moveal %fp@(8),%a2 Thread_Control *the_thread; uint32_t count; count = 0; while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) { 4b3c8: 4282 clrl %d2 4b3ca: 47f9 0004 6f90 lea 46f90 <_Thread_queue_Dequeue>,%a3 4b3d0: 6002 bras 4b3d4 <_CORE_barrier_Release+0x18> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_barrier_mp_support) ( the_thread, id ); #endif count++; 4b3d2: 5282 addql #1,%d2 { Thread_Control *the_thread; uint32_t count; count = 0; while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) { 4b3d4: 2f0a movel %a2,%sp@- 4b3d6: 4e93 jsr %a3@ 4b3d8: 588f addql #4,%sp 4b3da: 4a80 tstl %d0 4b3dc: 66f4 bnes 4b3d2 <_CORE_barrier_Release+0x16> #endif count++; } the_barrier->number_of_waiting_threads = 0; return count; } 4b3de: 2002 movel %d2,%d0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_barrier_mp_support) ( the_thread, id ); #endif count++; } the_barrier->number_of_waiting_threads = 0; 4b3e0: 42aa 0048 clrl %a2@(72) return count; } 4b3e4: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 4b3ea: 4e5e unlk %fp 4b3ec: 4e75 rts ... 000518d0 <_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 ) { 518d0: 4e56 ffe0 linkw %fp,#-32 518d4: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 518d8: 246e 0008 moveal %fp@(8),%a2 518dc: 2a2e 000c movel %fp@(12),%d5 518e0: 262e 0010 movel %fp@(16),%d3 518e4: 286e 001c moveal %fp@(28),%a4 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 518e8: b6aa 004c cmpl %a2@(76),%d3 518ec: 6304 blss 518f2 <_CORE_message_queue_Broadcast+0x22> <== NEVER TAKEN 518ee: 7001 moveq #1,%d0 <== NOT EXECUTED 518f0: 6042 bras 51934 <_CORE_message_queue_Broadcast+0x64> <== NOT EXECUTED * 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 ) { 518f2: 4aaa 0048 tstl %a2@(72) 518f6: 6610 bnes 51908 <_CORE_message_queue_Broadcast+0x38> * 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))) { 518f8: 4282 clrl %d2 518fa: 283c 0005 3abc movel #342716,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 51900: 4bf9 0005 8aac lea 58aac ,%a5 51906: 601a bras 51922 <_CORE_message_queue_Broadcast+0x52> <== ALWAYS TAKEN * 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; 51908: 4294 clrl %a4@ 5190a: 6026 bras 51932 <_CORE_message_queue_Broadcast+0x62> <== ALWAYS TAKEN 5190c: 2f03 movel %d3,%sp@- */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 5190e: 5282 addql #1,%d2 51910: 2f05 movel %d5,%sp@- 51912: 2f2b 002c movel %a3@(44),%sp@- 51916: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 51918: 206b 0028 moveal %a3@(40),%a0 5191c: 4fef 000c lea %sp@(12),%sp 51920: 2083 movel %d3,%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))) { 51922: 2f0a movel %a2,%sp@- 51924: 2044 moveal %d4,%a0 51926: 4e90 jsr %a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 51928: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5192a: 2640 moveal %d0,%a3 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5192c: 4a80 tstl %d0 5192e: 66dc bnes 5190c <_CORE_message_queue_Broadcast+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 51930: 2882 movel %d2,%a4@ 51932: 4280 clrl %d0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 51934: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 5193a: 4e5e unlk %fp 5193c: 4e75 rts ... 0004dc8c <_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)) { 4dc8c: 7003 moveq #3,%d0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4dc8e: 4e56 fff4 linkw %fp,#-12 4dc92: 222e 0014 movel %fp@(20),%d1 4dc96: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4dc9a: 246e 0008 moveal %fp@(8),%a2 4dc9e: 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)) { 4dca2: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4dca4: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4dca8: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4dcac: 2541 004c movel %d1,%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)) { 4dcb0: 4a80 tstl %d0 4dcb2: 6604 bnes 4dcb8 <_CORE_message_queue_Initialize+0x2c> 4dcb4: 2001 movel %d1,%d0 4dcb6: 600c bras 4dcc4 <_CORE_message_queue_Initialize+0x38> <== ALWAYS TAKEN allocated_message_size += sizeof(uint32_t); 4dcb8: 2001 movel %d1,%d0 4dcba: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4dcbc: 76fc moveq #-4,%d3 4dcbe: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4dcc0: b280 cmpl %d0,%d1 4dcc2: 626e bhis 4dd32 <_CORE_message_queue_Initialize+0xa6> <== ALWAYS TAKEN /* * 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)); 4dcc4: 2600 movel %d0,%d3 4dcc6: 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 * 4dccc: 2203 movel %d3,%d1 4dcce: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4dcd2: b081 cmpl %d1,%d0 4dcd4: 625c bhis 4dd32 <_CORE_message_queue_Initialize+0xa6> <== ALWAYS TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dcd6: 2f01 movel %d1,%sp@- 4dcd8: 4eb9 0005 0500 jsr 50500 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dcde: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dce0: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dce4: 674c beqs 4dd32 <_CORE_message_queue_Initialize+0xa6> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4dce6: 2f03 movel %d3,%sp@- 4dce8: 2f02 movel %d2,%sp@- 4dcea: 2f00 movel %d0,%sp@- 4dcec: 486a 0060 pea %a2@(96) 4dcf0: 4eb9 0005 1db4 jsr 51db4 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dcf6: 4878 0006 pea 6 4dcfa: 7001 moveq #1,%d0 4dcfc: 206e 000c moveal %fp@(12),%a0 4dd00: b090 cmpl %a0@,%d0 4dd02: 57c0 seq %d0 4dd04: 4878 0080 pea 80 4dd08: 49c0 extbl %d0 4dd0a: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4dd0c: 41ea 0054 lea %a2@(84),%a0 4dd10: 2f00 movel %d0,%sp@- 4dd12: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4dd16: 41ea 0050 lea %a2@(80),%a0 4dd1a: 2548 0058 movel %a0,%a2@(88) 4dd1e: 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; 4dd20: 42aa 0054 clrl %a2@(84) 4dd24: 4eb9 0004 fa40 jsr 4fa40 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd2a: 4fef 0020 lea %sp@(32),%sp allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dd2e: 7001 moveq #1,%d0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd30: 6002 bras 4dd34 <_CORE_message_queue_Initialize+0xa8> <== ALWAYS TAKEN 4dd32: 4200 clrb %d0 } 4dd34: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dd3a: 4e5e unlk %fp 4dd3c: 4e75 rts ... 00051df4 <_CORE_message_queue_Insert_message>: #endif _CORE_message_queue_Set_message_priority( the_message, submit_type ); #if !defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) _ISR_Disable( level ); 51df4: 203c 0000 0700 movel #1792,%d0 void _CORE_message_queue_Insert_message( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message, CORE_message_queue_Submit_types submit_type ) { 51dfa: 4e56 0000 linkw %fp,#0 51dfe: 226e 0008 moveal %fp@(8),%a1 51e02: 206e 000c moveal %fp@(12),%a0 51e06: 2f0a movel %a2,%sp@- #endif _CORE_message_queue_Set_message_priority( the_message, submit_type ); #if !defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) _ISR_Disable( level ); 51e08: 40c1 movew %sr,%d1 51e0a: 8081 orl %d1,%d0 51e0c: 46c0 movew %d0,%sr SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 51e0e: 52a9 0048 addql #1,%a1@(72) if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) 51e12: 203c 7fff ffff movel #2147483647,%d0 51e18: b0ae 0010 cmpl %fp@(16),%d0 51e1c: 6616 bnes 51e34 <_CORE_message_queue_Insert_message+0x40> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 51e1e: 45e9 0054 lea %a1@(84),%a2 51e22: 208a movel %a2,%a0@ old_last_node = the_chain->last; 51e24: 2469 0058 moveal %a1@(88),%a2 the_chain->last = the_node; 51e28: 2348 0058 movel %a0,%a1@(88) old_last_node->next = the_node; the_node->previous = old_last_node; 51e2c: 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; 51e30: 2488 movel %a0,%a2@ 51e32: 6012 bras 51e46 <_CORE_message_queue_Insert_message+0x52> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 51e34: 43e9 0050 lea %a1@(80),%a1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 51e38: 2451 moveal %a1@,%a2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 51e3a: 2149 0004 movel %a1,%a0@(4) before_node = after_node->next; after_node->next = the_node; 51e3e: 2288 movel %a0,%a1@ the_node->next = before_node; before_node->previous = the_node; 51e40: 2548 0004 movel %a0,%a2@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 51e44: 208a movel %a2,%a0@ _CORE_message_queue_Append_unprotected(the_message_queue, the_message); else _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 51e46: 46c1 movew %d1,%sr * the message is actually in the queue at this point. */ if ( notify && the_message_queue->notify_handler ) (*the_message_queue->notify_handler)(the_message_queue->notify_argument); #endif } 51e48: 245f moveal %sp@+,%a2 51e4a: 4e5e unlk %fp 51e4c: 4e75 rts ... 0004dd40 <_CORE_message_queue_Seize>: CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dd40: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd46: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4dd4a: 2079 0006 5022 moveal 65022 <_Thread_Executing>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd50: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4dd54: 282e 000c movel %fp@(12),%d4 4dd58: 262e 001c movel %fp@(28),%d3 4dd5c: 246e 0008 moveal %fp@(8),%a2 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4dd60: 42a8 0034 clrl %a0@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd64: 242e 0010 movel %fp@(16),%d2 4dd68: 226e 0014 moveal %fp@(20),%a1 4dd6c: 1a2e 001b moveb %fp@(27),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dd70: 40c0 movew %sr,%d0 4dd72: 8280 orl %d0,%d1 4dd74: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dd76: 220a movel %a2,%d1 4dd78: 0681 0000 0054 addil #84,%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4dd7e: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dd82: b28b cmpl %a3,%d1 4dd84: 6752 beqs 4ddd8 <_CORE_message_queue_Seize+0x98> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4dd86: 2853 moveal %a3@,%a4 the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4dd88: 4bea 0050 lea %a2@(80),%a5 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 4dd8c: 254c 0050 movel %a4,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4dd90: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4dd94: 4a8b tstl %a3 4dd96: 6740 beqs 4ddd8 <_CORE_message_queue_Seize+0x98> <== ALWAYS TAKEN the_message_queue->number_of_pending_messages -= 1; 4dd98: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4dd9c: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; 4dd9e: 22ab 0008 movel %a3@(8),%a1@ _Thread_Executing->Wait.count = 4dda2: 2079 0006 5022 moveal 65022 <_Thread_Executing>,%a0 4dda8: 42a8 0024 clrl %a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ddac: 2f11 movel %a1@,%sp@- 4ddae: 486b 000c pea %a3@(12) RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4ddb2: 45ea 0060 lea %a2@(96),%a2 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ddb6: 2f02 movel %d2,%sp@- 4ddb8: 4eb9 0005 447c jsr 5447c RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4ddbe: 4fef 000c lea %sp@(12),%sp 4ddc2: 2d4a 0008 movel %a2,%fp@(8) 4ddc6: 2d4b 000c movel %a3,%fp@(12) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4ddca: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4ddd0: 4e5e unlk %fp 4ddd2: 4ef9 0004 dbc8 jmp 4dbc8 <_Chain_Append> return; } #endif } if ( !wait ) { 4ddd8: 4a05 tstb %d5 4ddda: 6612 bnes 4ddee <_CORE_message_queue_Seize+0xae> _ISR_Enable( level ); 4dddc: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4ddde: 7004 moveq #4,%d0 executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4dde0: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4dde6: 2140 0034 movel %d0,%a0@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4ddea: 4e5e unlk %fp 4ddec: 4e75 rts RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4ddee: 7201 moveq #1,%d1 4ddf0: 2541 0030 movel %d1,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4ddf4: 2149 0028 movel %a1,%a0@(40) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4ddf8: 2142 002c movel %d2,%a0@(44) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4ddfc: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4de00: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4de04: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4de06: 4bf9 0004 fafc lea 4fafc <_Thread_queue_Timeout>,%a5 4de0c: 2d43 000c movel %d3,%fp@(12) 4de10: 2d4d 0010 movel %a5,%fp@(16) 4de14: 2d4a 0008 movel %a2,%fp@(8) } 4de18: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de1e: 4e5e unlk %fp executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4de20: 4ef9 0004 f810 jmp 4f810 <_Thread_queue_Enqueue_with_handler> ... 0004de28 <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 4de28: 4e56 ffec linkw %fp,#-20 4de2c: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4de30: 246e 0008 moveal %fp@(8),%a2 4de34: 282e 000c movel %fp@(12),%d4 4de38: 242e 0010 movel %fp@(16),%d2 4de3c: 262e 001c movel %fp@(28),%d3 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 4de40: b4aa 004c cmpl %a2@(76),%d2 4de44: 6304 blss 4de4a <_CORE_message_queue_Submit+0x22> 4de46: 7001 moveq #1,%d0 4de48: 6074 bras 4debe <_CORE_message_queue_Submit+0x96> <== ALWAYS TAKEN } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 4de4a: 4aaa 0048 tstl %a2@(72) 4de4e: 6630 bnes 4de80 <_CORE_message_queue_Submit+0x58> the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4de50: 2f0a movel %a2,%sp@- 4de52: 4eb9 0004 f6d0 jsr 4f6d0 <_Thread_queue_Dequeue> if ( the_thread ) { 4de58: 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 ); 4de5a: 2640 moveal %d0,%a3 if ( the_thread ) { 4de5c: 4a80 tstl %d0 4de5e: 6720 beqs 4de80 <_CORE_message_queue_Submit+0x58> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de60: 2f02 movel %d2,%sp@- 4de62: 2f04 movel %d4,%sp@- 4de64: 2f2b 002c movel %a3@(44),%sp@- 4de68: 4eb9 0005 447c jsr 5447c _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 4de6e: 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; 4de72: 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; 4de76: 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; 4de78: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 4de7a: 2743 0024 movel %d3,%a3@(36) #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; 4de7e: 603e bras 4debe <_CORE_message_queue_Submit+0x96> <== ALWAYS TAKEN /* * 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 ) { 4de80: 202a 0044 movel %a2@(68),%d0 4de84: b0aa 0048 cmpl %a2@(72),%d0 4de88: 6204 bhis 4de8e <_CORE_message_queue_Submit+0x66> 4de8a: 7002 moveq #2,%d0 4de8c: 6030 bras 4debe <_CORE_message_queue_Submit+0x96> <== ALWAYS TAKEN 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 *) 4de8e: 486a 0060 pea %a2@(96) 4de92: 4eb9 0004 dc28 jsr 4dc28 <_Chain_Get> 4de98: 2640 moveal %d0,%a3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de9a: 2f02 movel %d2,%sp@- 4de9c: 2f04 movel %d4,%sp@- 4de9e: 486b 000c pea %a3@(12) 4dea2: 4eb9 0005 447c jsr 5447c _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 4dea8: 2742 0008 movel %d2,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 4deac: 2f03 movel %d3,%sp@- 4deae: 2f0b movel %a3,%sp@- 4deb0: 2f0a movel %a2,%sp@- 4deb2: 4eb9 0005 1df4 jsr 51df4 <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4deb8: 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( 4debc: 4280 clrl %d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 4debe: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4dec4: 4e5e unlk %fp 4dec6: 4e75 rts 000458c4 <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 458c4: 4e56 fff4 linkw %fp,#-12 458c8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 458cc: 4878 000e pea e CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 458d0: 266e 000c moveal %fp@(12),%a3 458d4: 246e 0008 moveal %fp@(8),%a2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 458d8: 2f0b movel %a3,%sp@- 458da: 486a 0040 pea %a2@(64) CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 458de: 242e 0010 movel %fp@(16),%d2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 458e2: 4eb9 0004 c200 jsr 4c200 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { 458e8: 4fef 000c lea %sp@(12),%sp rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; 458ec: 2542 004e movel %d2,%a2@(78) the_mutex->blocked_count = 0; 458f0: 42aa 0056 clrl %a2@(86) if ( initial_lock == CORE_MUTEX_LOCKED ) { 458f4: 4a82 tstl %d2 458f6: 663c bnes 45934 <_CORE_mutex_Initialize+0x70> the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 458f8: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 458fe: 7001 moveq #1,%d0 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 45900: 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; 45902: 2540 0052 movel %d0,%a2@(82) the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; 45906: 2568 0008 005e movel %a0@(8),%a2@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 4590c: 202a 0046 movel %a2@(70),%d0 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 45910: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 45914: b280 cmpl %d0,%d1 45916: 6708 beqs 45920 <_CORE_mutex_Initialize+0x5c> 45918: 123c 0003 moveb #3,%d1 4591c: b280 cmpl %d0,%d1 4591e: 6620 bnes 45940 <_CORE_mutex_Initialize+0x7c> _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 45920: 202a 004a movel %a2@(74),%d0 45924: b0a8 0014 cmpl %a0@(20),%d0 45928: 6304 blss 4592e <_CORE_mutex_Initialize+0x6a> 4592a: 7006 moveq #6,%d0 4592c: 6034 bras 45962 <_CORE_mutex_Initialize+0x9e> <== ALWAYS TAKEN _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 4592e: 52a8 001c addql #1,%a0@(28) 45932: 600c bras 45940 <_CORE_mutex_Initialize+0x7c> <== ALWAYS TAKEN } } else { the_mutex->nest_count = 0; 45934: 42aa 0052 clrl %a2@(82) the_mutex->holder = NULL; 45938: 42aa 005a clrl %a2@(90) the_mutex->holder_id = 0; 4593c: 42aa 005e clrl %a2@(94) } _Thread_queue_Initialize( 45940: 4aab 0006 tstl %a3@(6) 45944: 56c0 sne %d0 45946: 4878 0005 pea 5 4594a: 49c0 extbl %d0 4594c: 4878 0400 pea 400 45950: 4480 negl %d0 45952: 2f00 movel %d0,%sp@- 45954: 2f0a movel %a2,%sp@- 45956: 4eb9 0004 7300 jsr 47300 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 4595c: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 45960: 4280 clrl %d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 45962: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 45968: 4e5e unlk %fp 4596a: 4e75 rts 000459d0 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 459d0: 4e56 0000 linkw %fp,#0 459d4: 202e 0010 movel %fp@(16),%d0 459d8: 2f0a movel %a2,%sp@- 459da: 246e 0008 moveal %fp@(8),%a2 459de: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 459e0: 2239 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 459e6: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 459e8: 4a81 tstl %d1 459ea: 671c beqs 45a08 <_CORE_mutex_Seize+0x38> 459ec: 4a00 tstb %d0 459ee: 6718 beqs 45a08 <_CORE_mutex_Seize+0x38> <== ALWAYS TAKEN 459f0: 7001 moveq #1,%d0 459f2: b0b9 0005 bbb6 cmpl 5bbb6 <_System_state_Current>,%d0 459f8: 640e bccs 45a08 <_CORE_mutex_Seize+0x38> 459fa: 4878 0013 pea 13 459fe: 42a7 clrl %sp@- 45a00: 42a7 clrl %sp@- 45a02: 4eb9 0004 5f88 jsr 45f88 <_Internal_error_Occurred> 45a08: 486e 0018 pea %fp@(24) 45a0c: 2f0a movel %a2,%sp@- 45a0e: 4eb9 0004 9914 jsr 49914 <_CORE_mutex_Seize_interrupt_trylock> 45a14: 508f addql #8,%sp 45a16: 4a80 tstl %d0 45a18: 6750 beqs 45a6a <_CORE_mutex_Seize+0x9a> 45a1a: 4a02 tstb %d2 45a1c: 6614 bnes 45a32 <_CORE_mutex_Seize+0x62> 45a1e: 202e 0018 movel %fp@(24),%d0 45a22: 46c0 movew %d0,%sr 45a24: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 45a2a: 7001 moveq #1,%d0 45a2c: 2140 0034 movel %d0,%a0@(52) 45a30: 6038 bras 45a6a <_CORE_mutex_Seize+0x9a> <== ALWAYS TAKEN 45a32: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 45a38: 5280 addql #1,%d0 45a3a: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 45a40: 216e 000c 0020 movel %fp@(12),%a0@(32) 45a46: 23c0 0005 ba34 movel %d0,5ba34 <_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; 45a4c: 7001 moveq #1,%d0 45a4e: 214a 0044 movel %a2,%a0@(68) 45a52: 2540 0030 movel %d0,%a2@(48) 45a56: 202e 0018 movel %fp@(24),%d0 45a5a: 46c0 movew %d0,%sr 45a5c: 2f2e 0014 movel %fp@(20),%sp@- 45a60: 2f0a movel %a2,%sp@- 45a62: 4eb9 0004 596c jsr 4596c <_CORE_mutex_Seize_interrupt_blocking> 45a68: 508f addql #8,%sp } 45a6a: 242e fff8 movel %fp@(-8),%d2 45a6e: 246e fffc moveal %fp@(-4),%a2 45a72: 4e5e unlk %fp 45a74: 4e75 rts ... 00049914 <_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 ) { 49914: 4e56 0000 linkw %fp,#0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 49918: 2279 0005 baee moveal 5baee <_Thread_Executing>,%a1 4991e: 2f0b movel %a3,%sp@- 49920: 206e 0008 moveal %fp@(8),%a0 49924: 2f0a movel %a2,%sp@- 49926: 246e 000c moveal %fp@(12),%a2 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4992a: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4992e: 4aa8 004e tstl %a0@(78) 49932: 6700 0098 beqw 499cc <_CORE_mutex_Seize_interrupt_trylock+0xb8> the_mutex->lock = CORE_MUTEX_LOCKED; 49936: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4993a: 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; 4993c: 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; 49942: 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; 49946: 2141 0052 movel %d1,%a0@(82) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4994a: 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; 4994e: 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 ) || 49952: b280 cmpl %d0,%d1 49954: 6708 beqs 4995e <_CORE_mutex_Seize_interrupt_trylock+0x4a> 49956: 123c 0003 moveb #3,%d1 4995a: b280 cmpl %d0,%d1 4995c: 660a bnes 49968 <_CORE_mutex_Seize_interrupt_trylock+0x54> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4995e: 52a9 001c addql #1,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 49962: 7203 moveq #3,%d1 49964: b280 cmpl %d0,%d1 49966: 6706 beqs 4996e <_CORE_mutex_Seize_interrupt_trylock+0x5a> _ISR_Enable( *level_p ); 49968: 2012 movel %a2@,%d0 4996a: 46c0 movew %d0,%sr 4996c: 607c bras 499ea <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== ALWAYS TAKEN */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4996e: 2028 004a movel %a0@(74),%d0 current = executing->current_priority; 49972: 2229 0014 movel %a1@(20),%d1 if ( current == ceiling ) { 49976: b081 cmpl %d1,%d0 49978: 6606 bnes 49980 <_CORE_mutex_Seize_interrupt_trylock+0x6c> _ISR_Enable( *level_p ); 4997a: 2012 movel %a2@,%d0 4997c: 46c0 movew %d0,%sr 4997e: 606a bras 499ea <_CORE_mutex_Seize_interrupt_trylock+0xd6> return 0; } if ( current > ceiling ) { 49980: b081 cmpl %d1,%d0 49982: 642e bccs 499b2 <_CORE_mutex_Seize_interrupt_trylock+0x9e> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 49984: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 4998a: 5280 addql #1,%d0 4998c: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 49992: 2012 movel %a2@,%d0 49994: 46c0 movew %d0,%sr _Thread_Change_priority( 49996: 42a7 clrl %sp@- 49998: 2f28 004a movel %a0@(74),%sp@- 4999c: 2f28 005a movel %a0@(90),%sp@- 499a0: 4eb9 0004 6774 jsr 46774 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 499a6: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> 499ac: 4fef 000c lea %sp@(12),%sp 499b0: 6038 bras 499ea <_CORE_mutex_Seize_interrupt_trylock+0xd6> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 499b2: 7006 moveq #6,%d0 the_mutex->lock = CORE_MUTEX_UNLOCKED; 499b4: 7201 moveq #1,%d1 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 499b6: 2340 0034 movel %d0,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 499ba: 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; 499be: 2141 004e movel %d1,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 499c2: 53a9 001c subql #1,%a1@(28) _ISR_Enable( *level_p ); 499c6: 2012 movel %a2@,%d0 499c8: 46c0 movew %d0,%sr 499ca: 601e bras 499ea <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== 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 ) ) { 499cc: 2668 005a moveal %a0@(90),%a3 499d0: b3cb cmpal %a3,%a1 499d2: 6626 bnes 499fa <_CORE_mutex_Seize_interrupt_trylock+0xe6> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 499d4: 2028 0040 movel %a0@(64),%d0 499d8: 6708 beqs 499e2 <_CORE_mutex_Seize_interrupt_trylock+0xce> 499da: 7201 moveq #1,%d1 499dc: b280 cmpl %d0,%d1 499de: 661a bnes 499fa <_CORE_mutex_Seize_interrupt_trylock+0xe6> <== NEVER TAKEN 499e0: 600c bras 499ee <_CORE_mutex_Seize_interrupt_trylock+0xda> <== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 499e2: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 499e6: 2012 movel %a2@,%d0 499e8: 46c0 movew %d0,%sr 499ea: 4280 clrl %d0 499ec: 600e bras 499fc <_CORE_mutex_Seize_interrupt_trylock+0xe8> <== ALWAYS TAKEN return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 499ee: 7002 moveq #2,%d0 <== NOT EXECUTED 499f0: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED _ISR_Enable( *level_p ); 499f4: 2012 movel %a2@,%d0 <== NOT EXECUTED 499f6: 46c0 movew %d0,%sr <== NOT EXECUTED 499f8: 60f0 bras 499ea <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== NOT EXECUTED 499fa: 7001 moveq #1,%d0 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 499fc: 246e fff8 moveal %fp@(-8),%a2 49a00: 266e fffc moveal %fp@(-4),%a3 49a04: 4e5e unlk %fp 49a06: 4e75 rts 00045a78 <_CORE_mutex_Surrender>: #else Objects_Id id __attribute__((unused)), CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused)) #endif ) { 45a78: 4e56 0000 linkw %fp,#0 45a7c: 2f0a movel %a2,%sp@- 45a7e: 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; 45a82: 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 ) { 45a86: 4a2a 0044 tstb %a2@(68) 45a8a: 670e beqs 45a9a <_CORE_mutex_Surrender+0x22> if ( !_Thread_Is_executing( holder ) ) 45a8c: b1f9 0005 baee cmpal 5baee <_Thread_Executing>,%a0 45a92: 6706 beqs 45a9a <_CORE_mutex_Surrender+0x22> 45a94: 7003 moveq #3,%d0 45a96: 6000 00ce braw 45b66 <_CORE_mutex_Surrender+0xee> <== ALWAYS TAKEN return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 45a9a: 202a 0052 movel %a2@(82),%d0 45a9e: 6700 00c4 beqw 45b64 <_CORE_mutex_Surrender+0xec> return CORE_MUTEX_STATUS_SUCCESSFUL; the_mutex->nest_count--; 45aa2: 5380 subql #1,%d0 45aa4: 2540 0052 movel %d0,%a2@(82) if ( the_mutex->nest_count != 0 ) { 45aa8: 6600 00ba bnew 45b64 <_CORE_mutex_Surrender+0xec> 45aac: 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 ) || 45ab0: 7202 moveq #2,%d1 45ab2: b280 cmpl %d0,%d1 45ab4: 6708 beqs 45abe <_CORE_mutex_Surrender+0x46> 45ab6: 123c 0003 moveb #3,%d1 45aba: b280 cmpl %d0,%d1 45abc: 6604 bnes 45ac2 <_CORE_mutex_Surrender+0x4a> the_mutex->nest_count++; return CORE_MUTEX_RELEASE_NOT_ORDER; } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; 45abe: 53a8 001c subql #1,%a0@(28) 45ac2: 202a 0046 movel %a2@(70),%d0 /* * 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 ) || 45ac6: 7202 moveq #2,%d1 } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; 45ac8: 42aa 005a clrl %a2@(90) the_mutex->holder_id = 0; 45acc: 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 ) || 45ad0: b280 cmpl %d0,%d1 45ad2: 6708 beqs 45adc <_CORE_mutex_Surrender+0x64> 45ad4: 123c 0003 moveb #3,%d1 45ad8: b280 cmpl %d0,%d1 45ada: 6622 bnes 45afe <_CORE_mutex_Surrender+0x86> _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 && 45adc: 4aa8 001c tstl %a0@(28) 45ae0: 661c bnes 45afe <_CORE_mutex_Surrender+0x86> holder->real_priority != holder->current_priority ) { 45ae2: 2028 0018 movel %a0@(24),%d0 45ae6: b0a8 0014 cmpl %a0@(20),%d0 45aea: 6712 beqs 45afe <_CORE_mutex_Surrender+0x86> _Thread_Change_priority( holder, holder->real_priority, true ); 45aec: 4878 0001 pea 1 45af0: 2f00 movel %d0,%sp@- 45af2: 2f08 movel %a0,%sp@- 45af4: 4eb9 0004 6774 jsr 46774 <_Thread_Change_priority> 45afa: 4fef 000c lea %sp@(12),%sp /* * 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 ) ) ) { 45afe: 2f0a movel %a2,%sp@- 45b00: 4eb9 0004 6f90 jsr 46f90 <_Thread_queue_Dequeue> 45b06: 588f addql #4,%sp 45b08: 2040 moveal %d0,%a0 45b0a: 4a80 tstl %d0 45b0c: 674c beqs 45b5a <_CORE_mutex_Surrender+0xe2> #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 45b0e: 7201 moveq #1,%d1 } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 45b10: 2568 0008 005e movel %a0@(8),%a2@(94) the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 45b16: 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; 45b1a: 2541 0052 movel %d1,%a2@(82) switch ( the_mutex->Attributes.discipline ) { 45b1e: 123c 0002 moveb #2,%d1 } else #endif { the_mutex->holder = the_thread; 45b22: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 45b26: b280 cmpl %d0,%d1 45b28: 670a beqs 45b34 <_CORE_mutex_Surrender+0xbc> 45b2a: 123c 0003 moveb #3,%d1 45b2e: b280 cmpl %d0,%d1 45b30: 6632 bnes 45b64 <_CORE_mutex_Surrender+0xec> 45b32: 6006 bras 45b3a <_CORE_mutex_Surrender+0xc2> <== ALWAYS TAKEN 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++; 45b34: 52a8 001c addql #1,%a0@(28) 45b38: 602a bras 45b64 <_CORE_mutex_Surrender+0xec> <== 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++; 45b3a: 52a8 001c addql #1,%a0@(28) if (the_mutex->Attributes.priority_ceiling < 45b3e: 202a 004a movel %a2@(74),%d0 the_thread->current_priority){ 45b42: b0a8 0014 cmpl %a0@(20),%d0 45b46: 641c bccs 45b64 <_CORE_mutex_Surrender+0xec> _Thread_Change_priority( 45b48: 42a7 clrl %sp@- 45b4a: 2f00 movel %d0,%sp@- 45b4c: 2f08 movel %a0,%sp@- 45b4e: 4eb9 0004 6774 jsr 46774 <_Thread_Change_priority> 45b54: 4fef 000c lea %sp@(12),%sp 45b58: 600a bras 45b64 <_CORE_mutex_Surrender+0xec> <== ALWAYS TAKEN } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 45b5a: 7001 moveq #1,%d0 45b5c: 2540 004e movel %d0,%a2@(78) 45b60: 4200 clrb %d0 45b62: 6002 bras 45b66 <_CORE_mutex_Surrender+0xee> <== ALWAYS TAKEN 45b64: 4280 clrl %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 45b66: 246e fffc moveal %fp@(-4),%a2 45b6a: 4e5e unlk %fp 45b6c: 4e75 rts ... 00045bc4 <_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 ) { 45bc4: 4e56 0000 linkw %fp,#0 45bc8: 2f0a movel %a2,%sp@- 45bca: 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)) ) { 45bce: 2f0a movel %a2,%sp@- 45bd0: 4eb9 0004 6f90 jsr 46f90 <_Thread_queue_Dequeue> 45bd6: 588f addql #4,%sp 45bd8: 4a80 tstl %d0 45bda: 6704 beqs 45be0 <_CORE_semaphore_Surrender+0x1c> 45bdc: 4280 clrl %d0 45bde: 6024 bras 45c04 <_CORE_semaphore_Surrender+0x40> <== ALWAYS TAKEN if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 45be0: 203c 0000 0700 movel #1792,%d0 45be6: 40c1 movew %sr,%d1 45be8: 8081 orl %d1,%d0 45bea: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 45bec: 202a 0048 movel %a2@(72),%d0 45bf0: b0aa 0040 cmpl %a2@(64),%d0 45bf4: 6504 bcss 45bfa <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN 45bf6: 7004 moveq #4,%d0 <== NOT EXECUTED 45bf8: 6008 bras 45c02 <_CORE_semaphore_Surrender+0x3e> <== NOT EXECUTED the_semaphore->count += 1; 45bfa: 5280 addql #1,%d0 45bfc: 2540 0048 movel %d0,%a2@(72) 45c00: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 45c02: 46c1 movew %d1,%sr } return status; } 45c04: 246e fffc moveal %fp@(-4),%a2 45c08: 4e5e unlk %fp 45c0a: 4e75 rts 000498a0 <_Chain_Get>: { ISR_Level level; Chain_Node *return_node; return_node = NULL; _ISR_Disable( level ); 498a0: 203c 0000 0700 movel #1792,%d0 */ Chain_Node *_Chain_Get( Chain_Control *the_chain ) { 498a6: 4e56 0000 linkw %fp,#0 498aa: 206e 0008 moveal %fp@(8),%a0 498ae: 2f0a movel %a2,%sp@- ISR_Level level; Chain_Node *return_node; return_node = NULL; _ISR_Disable( level ); 498b0: 40c1 movew %sr,%d1 498b2: 8081 orl %d1,%d0 498b4: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 498b6: 2248 moveal %a0,%a1 498b8: 2019 movel %a1@+,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 498ba: b3c0 cmpal %d0,%a1 498bc: 6604 bnes 498c2 <_Chain_Get+0x22> 498be: 4280 clrl %d0 498c0: 600a bras 498cc <_Chain_Get+0x2c> <== ALWAYS TAKEN { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 498c2: 2440 moveal %d0,%a2 498c4: 2252 moveal %a2@,%a1 the_chain->first = new_first; 498c6: 2089 movel %a1,%a0@ new_first->previous = _Chain_Head(the_chain); 498c8: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( the_chain ) ) return_node = _Chain_Get_first_unprotected( the_chain ); _ISR_Enable( level ); 498cc: 46c1 movew %d1,%sr return return_node; } 498ce: 245f moveal %sp@+,%a2 498d0: 4e5e unlk %fp 498d2: 4e75 rts 000498d4 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 498d4: 4e56 0000 linkw %fp,#0 498d8: 202e 0010 movel %fp@(16),%d0 498dc: 2f0a movel %a2,%sp@- 498de: 246e 0008 moveal %fp@(8),%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 498e2: 204a moveal %a2,%a0 Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; 498e4: 42aa 0004 clrl %a2@(4) Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 498e8: 222e 0014 movel %fp@(20),%d1 Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; 498ec: 226e 000c moveal %fp@(12),%a1 while ( count-- ) { 498f0: 600c bras 498fe <_Chain_Initialize+0x2a> <== ALWAYS TAKEN current->next = next; next->previous = current; 498f2: 2348 0004 movel %a0,%a1@(4) current = next; next = (Chain_Node *) 498f6: 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; 498f8: 2089 movel %a1,%a0@ next->previous = current; current = next; next = (Chain_Node *) 498fa: 2049 moveal %a1,%a0 498fc: d3c1 addal %d1,%a1 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { 498fe: 4a80 tstl %d0 49900: 66f0 bnes 498f2 <_Chain_Initialize+0x1e> next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); 49902: 200a movel %a2,%d0 49904: 5880 addql #4,%d0 49906: 2080 movel %d0,%a0@ the_chain->last = current; 49908: 2548 0008 movel %a0,%a2@(8) } 4990c: 245f moveal %sp@+,%a2 4990e: 4e5e unlk %fp 49910: 4e75 rts ... 000449d8 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 449d8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449de: 4e56 ffec linkw %fp,#-20 449e2: 226e 0010 moveal %fp@(16),%a1 449e6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 449ea: 2479 0005 baee moveal 5baee <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449f0: 242e 0008 movel %fp@(8),%d2 449f4: 262e 000c movel %fp@(12),%d3 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 449f8: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449fc: 206e 0014 moveal %fp@(20),%a0 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 44a00: 266a 0108 moveal %a2@(264),%a3 _ISR_Disable( level ); 44a04: 40c1 movew %sr,%d1 44a06: 8081 orl %d1,%d0 44a08: 46c0 movew %d0,%sr pending_events = api->pending_events; 44a0a: 2813 movel %a3@,%d4 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 ); 44a0c: 2002 movel %d2,%d0 44a0e: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 44a10: 6716 beqs 44a28 <_Event_Seize+0x50> 44a12: b480 cmpl %d0,%d2 44a14: 6706 beqs 44a1c <_Event_Seize+0x44> 44a16: 0803 0001 btst #1,%d3 44a1a: 670c beqs 44a28 <_Event_Seize+0x50> <== ALWAYS TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 44a1c: 2400 movel %d0,%d2 44a1e: 4682 notl %d2 44a20: c484 andl %d4,%d2 44a22: 2682 movel %d2,%a3@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 44a24: 46c1 movew %d1,%sr 44a26: 600e bras 44a36 <_Event_Seize+0x5e> <== ALWAYS TAKEN *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 44a28: 0803 0000 btst #0,%d3 44a2c: 670e beqs 44a3c <_Event_Seize+0x64> _ISR_Enable( level ); 44a2e: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 44a30: 720d moveq #13,%d1 44a32: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 44a36: 2080 movel %d0,%a0@ return; 44a38: 6000 0096 braw 44ad0 <_Event_Seize+0xf8> <== ALWAYS TAKEN * * 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; 44a3c: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a40: 7401 moveq #1,%d2 * 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; 44a42: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 44a46: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a4a: 23c2 0005 bc12 movel %d2,5bc12 <_Event_Sync_state> _ISR_Enable( level ); 44a50: 46c1 movew %d1,%sr if ( ticks ) { 44a52: 4a89 tstl %a1 44a54: 6730 beqs 44a86 <_Event_Seize+0xae> _Watchdog_Initialize( 44a56: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a5a: 223c 0004 4c38 movel #281656,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 44a60: 2549 0054 movel %a1,%a2@(84) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a64: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 44a68: 2540 0068 movel %d0,%a2@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44a6c: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 44a70: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44a74: 486a 0048 pea %a2@(72) 44a78: 4879 0005 bb0c pea 5bb0c <_Watchdog_Ticks_chain> 44a7e: 4eb9 0004 7b78 jsr 47b78 <_Watchdog_Insert> 44a84: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 44a86: 4878 0100 pea 100 44a8a: 2f0a movel %a2,%sp@- 44a8c: 4eb9 0004 7464 jsr 47464 <_Thread_Set_state> _ISR_Disable( level ); 44a92: 203c 0000 0700 movel #1792,%d0 44a98: 40c1 movew %sr,%d1 44a9a: 8081 orl %d1,%d0 44a9c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44a9e: 7401 moveq #1,%d2 44aa0: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 44aa2: 2039 0005 bc12 movel 5bc12 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 44aa8: 42b9 0005 bc12 clrl 5bc12 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44aae: b480 cmpl %d0,%d2 44ab0: 6604 bnes 44ab6 <_Event_Seize+0xde> _ISR_Enable( level ); 44ab2: 46c1 movew %d1,%sr 44ab4: 601a bras 44ad0 <_Event_Seize+0xf8> <== ALWAYS TAKEN * 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 ); 44ab6: 2d4a 000c movel %a2,%fp@(12) 44aba: 2d41 0010 movel %d1,%fp@(16) } 44abe: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * 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 ); 44ac4: 2d40 0008 movel %d0,%fp@(8) } 44ac8: 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 ); 44aca: 4ef9 0004 6724 jmp 46724 <_Thread_blocking_operation_Cancel> } 44ad0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 44ad6: 4e5e unlk %fp 44ad8: 4e75 rts ... 00044b30 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 44b30: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 44b36: 4e56 ffe8 linkw %fp,#-24 44b3a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44b3e: 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 ]; 44b42: 206a 0108 moveal %a2@(264),%a0 option_set = (rtems_option) the_thread->Wait.option; 44b46: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 44b4a: 40c1 movew %sr,%d1 44b4c: 8081 orl %d1,%d0 44b4e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 44b50: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44b54: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 44b56: 2410 movel %a0@,%d2 44b58: 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 ) ) { 44b5a: 6606 bnes 44b62 <_Event_Surrender+0x32> _ISR_Enable( level ); 44b5c: 46c1 movew %d1,%sr return; 44b5e: 6000 00cc braw 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN /* * 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() && 44b62: 2279 0005 bace moveal 5bace <_ISR_Nest_level>,%a1 44b68: 4a89 tstl %a1 44b6a: 674a beqs 44bb6 <_Event_Surrender+0x86> 44b6c: b5f9 0005 baee cmpal 5baee <_Thread_Executing>,%a2 44b72: 6642 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 44b74: 2279 0005 bc12 moveal 5bc12 <_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() && 44b7a: 7a02 moveq #2,%d5 44b7c: ba89 cmpl %a1,%d5 44b7e: 670e beqs 44b8e <_Event_Surrender+0x5e> <== ALWAYS TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 44b80: 2279 0005 bc12 moveal 5bc12 <_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() && 44b86: 1a3c 0001 moveb #1,%d5 44b8a: ba89 cmpl %a1,%d5 44b8c: 6628 bnes 44bb6 <_Event_Surrender+0x86> _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) ) { 44b8e: b680 cmpl %d0,%d3 44b90: 6706 beqs 44b98 <_Event_Surrender+0x68> 44b92: 0804 0001 btst #1,%d4 44b96: 671a beqs 44bb2 <_Event_Surrender+0x82> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 44b98: 2600 movel %d0,%d3 44b9a: 4683 notl %d3 44b9c: c682 andl %d2,%d3 44b9e: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba0: 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; 44ba4: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba8: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 44baa: 7003 moveq #3,%d0 44bac: 23c0 0005 bc12 movel %d0,5bc12 <_Event_Sync_state> } _ISR_Enable( level ); 44bb2: 46c1 movew %d1,%sr return; 44bb4: 6076 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 44bb6: 2a2a 0010 movel %a2@(16),%d5 44bba: 0285 0000 0100 andil #256,%d5 44bc0: 6768 beqs 44c2a <_Event_Surrender+0xfa> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 44bc2: b680 cmpl %d0,%d3 44bc4: 6706 beqs 44bcc <_Event_Surrender+0x9c> 44bc6: 0804 0001 btst #1,%d4 44bca: 675e beqs 44c2a <_Event_Surrender+0xfa> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 44bcc: 2600 movel %d0,%d3 44bce: 4683 notl %d3 44bd0: c682 andl %d2,%d3 44bd2: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bd4: 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; 44bd8: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bdc: 2080 movel %d0,%a0@ _ISR_Flash( level ); 44bde: 203c 0000 0700 movel #1792,%d0 44be4: 46c1 movew %d1,%sr 44be6: 8081 orl %d1,%d0 44be8: 46c0 movew %d0,%sr 44bea: 47f9 0004 68b4 lea 468b4 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 44bf0: 7a02 moveq #2,%d5 44bf2: baaa 0050 cmpl %a2@(80),%d5 44bf6: 6710 beqs 44c08 <_Event_Surrender+0xd8> _ISR_Enable( level ); 44bf8: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 44bfa: 2f3c 1003 fff8 movel #268697592,%sp@- 44c00: 2f0a movel %a2,%sp@- 44c02: 4e93 jsr %a3@ 44c04: 508f addql #8,%sp 44c06: 6024 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 44c08: 7003 moveq #3,%d0 44c0a: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 44c0e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 44c10: 486a 0048 pea %a2@(72) 44c14: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 44c1a: 2f3c 1003 fff8 movel #268697592,%sp@- 44c20: 2f0a movel %a2,%sp@- 44c22: 4e93 jsr %a3@ 44c24: 4fef 000c lea %sp@(12),%sp 44c28: 6002 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 44c2a: 46c1 movew %d1,%sr } 44c2c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 44c32: 4e5e unlk %fp 44c34: 4e75 rts ... 00044c38 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 44c38: 4e56 fffc linkw %fp,#-4 44c3c: 2f03 movel %d3,%sp@- 44c3e: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 44c40: 486e fffc pea %fp@(-4) 44c44: 2f2e 0008 movel %fp@(8),%sp@- 44c48: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 44c4e: 508f addql #8,%sp 44c50: 4aae fffc tstl %fp@(-4) 44c54: 6656 bnes 44cac <_Event_Timeout+0x74> <== 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 ); 44c56: 223c 0000 0700 movel #1792,%d1 44c5c: 40c2 movew %sr,%d2 44c5e: 8282 orl %d2,%d1 44c60: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 44c62: 2040 moveal %d0,%a0 44c64: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 44c68: b0b9 0005 baee cmpl 5baee <_Thread_Executing>,%d0 44c6e: 6614 bnes 44c84 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 44c70: 2239 0005 bc12 movel 5bc12 <_Event_Sync_state>,%d1 44c76: 7601 moveq #1,%d3 44c78: b681 cmpl %d1,%d3 44c7a: 6608 bnes 44c84 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 44c7c: 7202 moveq #2,%d1 44c7e: 23c1 0005 bc12 movel %d1,5bc12 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 44c84: 7606 moveq #6,%d3 44c86: 2040 moveal %d0,%a0 44c88: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 44c8c: 46c2 movew %d2,%sr 44c8e: 2f3c 1003 fff8 movel #268697592,%sp@- 44c94: 2f00 movel %d0,%sp@- 44c96: 4eb9 0004 68b4 jsr 468b4 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 44c9c: 508f addql #8,%sp 44c9e: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 44ca4: 5380 subql #1,%d0 44ca6: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 44cac: 242e fff4 movel %fp@(-12),%d2 44cb0: 262e fff8 movel %fp@(-8),%d3 44cb4: 4e5e unlk %fp 44cb6: 4e75 rts 00049ae0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 49ae0: 4e56 ffc8 linkw %fp,#-56 49ae4: 202e 000c movel %fp@(12),%d0 49ae8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 49aec: 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; 49af0: 2840 moveal %d0,%a4 49af2: 588c addql #4,%a4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 49af4: 222e 0010 movel %fp@(16),%d1 49af8: 2a2e 0014 movel %fp@(20),%d5 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 49afc: 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; 49b00: 2e2a 0010 movel %a2@(16),%d7 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 49b04: b08c cmpl %a4,%d0 49b06: 6200 0120 bhiw 49c28 <_Heap_Allocate_aligned_with_boundary+0x148> <== ALWAYS TAKEN /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 49b0a: 4a85 tstl %d5 49b0c: 670c beqs 49b1a <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 49b0e: b085 cmpl %d5,%d0 49b10: 6200 0116 bhiw 49c28 <_Heap_Allocate_aligned_with_boundary+0x148> <== ALWAYS TAKEN return NULL; } if ( alignment == 0 ) { 49b14: 4a81 tstl %d1 49b16: 6602 bnes 49b1a <_Heap_Allocate_aligned_with_boundary+0x3a> 49b18: 2207 movel %d7,%d1 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; 49b1a: 2407 movel %d7,%d2 49b1c: 5e82 addql #7,%d2 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 49b1e: 4283 clrl %d3 49b20: 2a43 moveal %d3,%a5 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; 49b22: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 49b26: 7404 moveq #4,%d2 49b28: 9480 subl %d0,%d2 49b2a: 2d42 fff4 movel %d2,%fp@(-12) 49b2e: 6000 00c6 braw 49bf6 <_Heap_Allocate_aligned_with_boundary+0x116> <== ALWAYS TAKEN /* * 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 ) { 49b32: 2628 0004 movel %a0@(4),%d3 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 49b36: 528d addql #1,%a5 /* * 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 ) { 49b38: b9c3 cmpal %d3,%a4 49b3a: 6400 00b6 bccw 49bf2 <_Heap_Allocate_aligned_with_boundary+0x112> 49b3e: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 49b42: 4a81 tstl %d1 49b44: 6606 bnes 49b4c <_Heap_Allocate_aligned_with_boundary+0x6c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 49b46: 2409 movel %a1,%d2 49b48: 6000 00a4 braw 49bee <_Heap_Allocate_aligned_with_boundary+0x10e> <== ALWAYS TAKEN 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; 49b4c: 74fe moveq #-2,%d2 49b4e: c682 andl %d2,%d3 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 49b50: 266a 0014 moveal %a2@(20),%a3 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; 49b54: d688 addl %a0,%d3 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; 49b56: 282e fff8 movel %fp@(-8),%d4 49b5a: 988b subl %a3,%d4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 49b5c: 242e fff4 movel %fp@(-12),%d2 49b60: d483 addl %d3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 49b62: 2c02 movel %d2,%d6 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; 49b64: d684 addl %d4,%d3 49b66: 4c41 6004 remul %d1,%d4,%d6 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 49b6a: 2d4b fff0 movel %a3,%fp@(-16) 49b6e: 9484 subl %d4,%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 ) { 49b70: b682 cmpl %d2,%d3 49b72: 640a bccs 49b7e <_Heap_Allocate_aligned_with_boundary+0x9e> 49b74: 2803 movel %d3,%d4 49b76: 4c41 4002 remul %d1,%d2,%d4 49b7a: 9682 subl %d2,%d3 49b7c: 2403 movel %d3,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 49b7e: 4a85 tstl %d5 49b80: 674e beqs 49bd0 <_Heap_Allocate_aligned_with_boundary+0xf0> /* 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; 49b82: 2802 movel %d2,%d4 49b84: d880 addl %d0,%d4 49b86: 2604 movel %d4,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 49b88: 47f1 0800 lea %a1@(00000000,%d0:l),%a3 49b8c: 4c45 3006 remul %d5,%d6,%d3 49b90: 2d4b fffc movel %a3,%fp@(-4) 49b94: 2604 movel %d4,%d3 49b96: 9686 subl %d6,%d3 49b98: 2c03 movel %d3,%d6 49b9a: 266e fff0 moveal %fp@(-16),%a3 49b9e: 6020 bras 49bc0 <_Heap_Allocate_aligned_with_boundary+0xe0> <== ALWAYS TAKEN uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 49ba0: bcae fffc cmpl %fp@(-4),%d6 49ba4: 654c bcss 49bf2 <_Heap_Allocate_aligned_with_boundary+0x112> <== ALWAYS TAKEN 49ba6: 2803 movel %d3,%d4 49ba8: 4c41 4002 remul %d1,%d2,%d4 49bac: 9682 subl %d2,%d3 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 49bae: 2803 movel %d3,%d4 49bb0: d880 addl %d0,%d4 49bb2: 2403 movel %d3,%d2 49bb4: 2604 movel %d4,%d3 49bb6: 4c45 3006 remul %d5,%d6,%d3 49bba: 2604 movel %d4,%d3 49bbc: 9686 subl %d6,%d3 49bbe: 2c03 movel %d3,%d6 while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 49bc0: 2606 movel %d6,%d3 49bc2: 9680 subl %d0,%d3 /* 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 ) { 49bc4: bc82 cmpl %d2,%d6 49bc6: 6304 blss 49bcc <_Heap_Allocate_aligned_with_boundary+0xec> 49bc8: b886 cmpl %d6,%d4 49bca: 62d4 bhis 49ba0 <_Heap_Allocate_aligned_with_boundary+0xc0> 49bcc: 2d4b fff0 movel %a3,%fp@(-16) 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 ) { 49bd0: b3c2 cmpal %d2,%a1 49bd2: 621e bhis 49bf2 <_Heap_Allocate_aligned_with_boundary+0x112> 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; 49bd4: 2802 movel %d2,%d4 49bd6: 327c fff8 moveaw #-8,%a1 49bda: 93c8 subal %a0,%a1 49bdc: d3c2 addal %d2,%a1 49bde: 4c47 4003 remul %d7,%d3,%d4 49be2: 93c3 subal %d3,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 49be4: b3ee fff0 cmpal %fp@(-16),%a1 49be8: 6404 bccs 49bee <_Heap_Allocate_aligned_with_boundary+0x10e> 49bea: 4a89 tstl %a1 49bec: 6604 bnes 49bf2 <_Heap_Allocate_aligned_with_boundary+0x112> boundary ); } } if ( alloc_begin != 0 ) { 49bee: 4a82 tstl %d2 49bf0: 6610 bnes 49c02 <_Heap_Allocate_aligned_with_boundary+0x122> <== NEVER TAKEN break; } block = block->next; 49bf2: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 49bf6: b5c8 cmpal %a0,%a2 49bf8: 6600 ff38 bnew 49b32 <_Heap_Allocate_aligned_with_boundary+0x52> 49bfc: 260d movel %a5,%d3 49bfe: 4282 clrl %d2 49c00: 6018 bras 49c1a <_Heap_Allocate_aligned_with_boundary+0x13a> <== ALWAYS TAKEN if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 49c02: 2f00 movel %d0,%sp@- 49c04: 260d movel %a5,%d3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 49c06: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 49c0a: 2f02 movel %d2,%sp@- 49c0c: 2f08 movel %a0,%sp@- 49c0e: 2f0a movel %a2,%sp@- 49c10: 4eb9 0004 5e92 jsr 45e92 <_Heap_Block_allocate> 49c16: 4fef 0010 lea %sp@(16),%sp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 49c1a: b6aa 0044 cmpl %a2@(68),%d3 49c1e: 6304 blss 49c24 <_Heap_Allocate_aligned_with_boundary+0x144> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 49c20: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 49c24: 2002 movel %d2,%d0 49c26: 6002 bras 49c2a <_Heap_Allocate_aligned_with_boundary+0x14a> <== ALWAYS TAKEN 49c28: 4280 clrl %d0 } 49c2a: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 49c30: 4e5e unlk %fp 49c32: 4e75 rts 00045e92 <_Heap_Block_allocate>: Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45e92: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45e94: 4e56 ffe0 linkw %fp,#-32 45e98: 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; 45e9c: 2241 moveal %d1,%a1 45e9e: 5189 subql #8,%a1 45ea0: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 45ea4: 246e 000c moveal %fp@(12),%a2 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45ea8: 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; 45eaa: 2a49 moveal %a1,%a5 45eac: 240a movel %a2,%d2 45eae: 9bca subal %a2,%a5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45eb0: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45eb4: 266e 0008 moveal %fp@(8),%a3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45eb8: c6b2 0804 andl %a2@(00000004,%d0:l),%d3 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45ebc: 2a2e 0014 movel %fp@(20),%d5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45ec0: 4a03 tstb %d3 45ec2: 6626 bnes 45eea <_Heap_Block_allocate+0x58> free_list_anchor = block->prev; _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 45ec4: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 45ec8: 76fe moveq #-2,%d3 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; 45eca: 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; 45ece: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 45ed2: 2840 moveal %d0,%a4 stats->free_size -= _Heap_Block_size( block ); 45ed4: c6aa 0004 andl %a2@(4),%d3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { free_list_anchor = block->prev; 45ed8: 206a 000c moveal %a2@(12),%a0 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 45edc: 97ab 0030 subl %d3,%a3@(48) 45ee0: 2948 000c movel %a0,%a4@(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; 45ee4: 2140 0008 movel %d0,%a0@(8) 45ee8: 6002 bras 45eec <_Heap_Block_allocate+0x5a> <== ALWAYS TAKEN } else { free_list_anchor = _Heap_Free_list_head( heap ); 45eea: 204b moveal %a3,%a0 } if ( alloc_area_offset < heap->page_size ) { 45eec: 202b 0010 movel %a3@(16),%d0 45ef0: b08d cmpl %a5,%d0 45ef2: 630a blss 45efe <_Heap_Block_allocate+0x6c> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 45ef4: 4875 5800 pea %a5@(00000000,%d5:l) 45ef8: 2f08 movel %a0,%sp@- 45efa: 2f0a movel %a2,%sp@- 45efc: 6062 bras 45f60 <_Heap_Block_allocate+0xce> <== 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; 45efe: 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 ) 45f02: 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 ) ) { 45f06: 7201 moveq #1,%d1 45f08: 93c4 subal %d4,%a1 _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; 45f0a: 2009 movel %a1,%d0 45f0c: 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; 45f0e: d1ab 0030 addl %d0,%a3@(48) if ( _Heap_Is_prev_used( block ) ) { 45f12: c2aa 0004 andl %a2@(4),%d1 45f16: 671c beqs 45f34 <_Heap_Block_allocate+0xa2> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 45f18: 2a68 0008 moveal %a0@(8),%a5 _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 45f1c: 52ab 0038 addql #1,%a3@(56) 45f20: 220a movel %a2,%d1 new_block->next = next; 45f22: 254d 0008 movel %a5,%a2@(8) new_block->prev = block_before; 45f26: 2548 000c movel %a0,%a2@(12) block_before->next = new_block; 45f2a: 214a 0008 movel %a2,%a0@(8) next->prev = new_block; 45f2e: 2b4a 000c movel %a2,%a5@(12) 45f32: 600c bras 45f40 <_Heap_Block_allocate+0xae> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 45f34: 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; 45f36: 78fe moveq #-2,%d4 45f38: 2208 movel %a0,%d1 45f3a: c8aa 0004 andl %a2@(4),%d4 45f3e: 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; 45f40: 78fe moveq #-2,%d4 45f42: 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; 45f44: 7801 moveq #1,%d4 45f46: 8880 orl %d0,%d4 new_block->prev_size = block_size; 45f48: 2280 movel %d0,%a1@ new_block->size_and_flag = new_block_size; 45f4a: 2002 movel %d2,%d0 45f4c: d083 addl %d3,%d0 45f4e: 9089 subl %a1,%d0 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 45f50: 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 ); 45f54: 2449 moveal %a1,%a2 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 45f56: 2340 0004 movel %d0,%a1@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 45f5a: 2f05 movel %d5,%sp@- 45f5c: 2f01 movel %d1,%sp@- 45f5e: 2f09 movel %a1,%sp@- 45f60: 2f0b movel %a3,%sp@- 45f62: 4eb9 0004 5dc4 jsr 45dc4 <_Heap_Block_split> alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 45f68: 202b 0030 movel %a3@(48),%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; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 45f6c: 4fef 0010 lea %sp@(16),%sp Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { Heap_Statistics *const stats = &heap->stats; 45f70: b0ab 0034 cmpl %a3@(52),%d0 45f74: 6404 bccs 45f7a <_Heap_Block_allocate+0xe8> ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { stats->min_free_size = stats->free_size; 45f76: 2740 0034 movel %d0,%a3@(52) } return block; } 45f7a: 200a movel %a2,%d0 45f7c: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 45f82: 4e5e unlk %fp 45f84: 4e75 rts ... 00045dc4 <_Heap_Block_split>: - 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; 45dc4: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 45dc6: 4e56 ffe0 linkw %fp,#-32 45dca: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 45dce: 246e 0008 moveal %fp@(8),%a2 45dd2: 266e 000c moveal %fp@(12),%a3 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 45dd6: 282a 0014 movel %a2@(20),%d4 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; 45dda: 2044 moveal %d4,%a0 45ddc: 5188 subql #8,%a0 45dde: 262b 0004 movel %a3@(4),%d3 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 45de2: 286e 0010 moveal %fp@(16),%a4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; 45de6: 222a 0010 movel %a2@(16),%d1 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; 45dea: 242e 0014 movel %fp@(20),%d2 45dee: c083 andl %d3,%d0 45df0: b1c2 cmpal %d2,%a0 45df2: 6302 blss 45df6 <_Heap_Block_split+0x32> 45df4: 2408 movel %a0,%d2 45df6: 5082 addql #8,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45df8: 2c02 movel %d2,%d6 45dfa: 4c41 6005 remul %d1,%d5,%d6 if ( remainder != 0 ) { 45dfe: 4a85 tstl %d5 45e00: 6604 bnes 45e06 <_Heap_Block_split+0x42> 45e02: 2202 movel %d2,%d1 45e04: 6004 bras 45e0a <_Heap_Block_split+0x46> <== ALWAYS TAKEN return value - remainder + alignment; 45e06: d282 addl %d2,%d1 45e08: 9285 subl %d5,%d1 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 ) { 45e0a: 2240 moveal %d0,%a1 45e0c: 5889 addql #4,%a1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 45e0e: 41f3 0800 lea %a3@(00000000,%d0:l),%a0 45e12: 93c2 subal %d2,%a1 45e14: 5884 addql #4,%d4 45e16: b889 cmpl %a1,%d4 45e18: 626a bhis 45e84 <_Heap_Block_split+0xc0> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 45e1a: 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); 45e1c: 43f3 1800 lea %a3@(00000000,%d1:l),%a1 Heap_Block *const free_block = _Heap_Block_at( block, used_block_size ); uintptr_t free_block_size = block_size - used_block_size; 45e20: 9081 subl %d1,%d0 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 45e22: c682 andl %d2,%d3 45e24: 8283 orl %d3,%d1 45e26: 2741 0004 movel %d1,%a3@(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; 45e2a: d1aa 0030 addl %d0,%a2@(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; 45e2e: 72fe moveq #-2,%d1 45e30: c2a8 0004 andl %a0@(4),%d1 if ( _Heap_Is_used( next_block ) ) { 45e34: c4b0 1804 andl %a0@(00000004,%d1:l),%d2 45e38: 671a beqs 45e54 <_Heap_Block_split+0x90> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 45e3a: 266c 0008 moveal %a4@(8),%a3 _Heap_Free_list_insert_after( free_list_anchor, free_block ); /* Statistics */ ++stats->free_blocks; 45e3e: 52aa 0038 addql #1,%a2@(56) new_block->next = next; 45e42: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; 45e46: 234c 000c movel %a4,%a1@(12) block_before->next = new_block; 45e4a: 2949 0008 movel %a1,%a4@(8) next->prev = new_block; 45e4e: 2749 000c movel %a1,%a3@(12) 45e52: 601e bras 45e72 <_Heap_Block_split+0xae> <== ALWAYS TAKEN Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 45e54: 2668 000c moveal %a0@(12),%a3 } 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; 45e58: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 45e5a: 2468 0008 moveal %a0@(8),%a2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 45e5e: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 45e62: 234a 0008 movel %a2,%a1@(8) new_block->prev = prev; 45e66: 234b 000c movel %a3,%a1@(12) next->prev = new_block; prev->next = new_block; 45e6a: 2749 0008 movel %a1,%a3@(8) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 45e6e: 2549 000c movel %a1,%a2@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 45e72: 7201 moveq #1,%d1 next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 45e74: 74fe moveq #-2,%d2 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; 45e76: 8280 orl %d0,%d1 next_block->prev_size = free_block_size; 45e78: 2080 movel %d0,%a0@ 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; 45e7a: 2341 0004 movel %d1,%a1@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 45e7e: c5a8 0004 andl %d2,%a0@(4) 45e82: 6006 bras 45e8a <_Heap_Block_split+0xc6> <== ALWAYS TAKEN } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 45e84: 7001 moveq #1,%d0 45e86: 81a8 0004 orl %d0,%a0@(4) } } 45e8a: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 45e8e: 4e5e unlk %fp 45e90: 4e75 rts 0004dc84 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4dc84: 4e56 fff4 linkw %fp,#-12 4dc88: 206e 0008 moveal %fp@(8),%a0 4dc8c: 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; 4dc90: 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; 4dc94: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4dc98: 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; 4dc9c: b0a8 0018 cmpl %a0@(24),%d0 4dca0: 6508 bcss 4dcaa <_Heap_Extend+0x26> * 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 ) { 4dca2: b280 cmpl %d0,%d1 4dca4: 6304 blss 4dcaa <_Heap_Extend+0x26> 4dca6: 7001 moveq #1,%d0 4dca8: 606c bras 4dd16 <_Heap_Extend+0x92> <== ALWAYS TAKEN return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 4dcaa: b280 cmpl %d0,%d1 4dcac: 6704 beqs 4dcb2 <_Heap_Extend+0x2e> 4dcae: 7002 moveq #2,%d0 4dcb0: 6064 bras 4dd16 <_Heap_Extend+0x92> <== ALWAYS TAKEN { 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; 4dcb2: 2200 movel %d0,%d1 4dcb4: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 4dcb8: 70f8 moveq #-8,%d0 4dcba: 9089 subl %a1,%d0 4dcbc: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4dcbe: 2600 movel %d0,%d3 4dcc0: 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; 4dcc6: 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; 4dcca: 246e 0014 moveal %fp@(20),%a2 4dcce: 9082 subl %d2,%d0 4dcd0: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 4dcd2: b0a8 0014 cmpl %a0@(20),%d0 4dcd6: 653c bcss 4dd14 <_Heap_Extend+0x90> <== ALWAYS TAKEN uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 4dcd8: 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); 4dcda: 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; 4dcde: c4a9 0004 andl %a1@(4),%d2 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 = 4dce2: 2228 0020 movel %a0@(32),%d1 4dce6: 928a subl %a2,%d1 4dce8: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 4dcea: 214a 0024 movel %a2,%a0@(36) 4dcee: 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 = 4dcf2: 7401 moveq #1,%d2 4dcf4: 8481 orl %d1,%d2 4dcf6: 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 )); 4dcfa: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 4dcfe: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 4dd02: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 4dd06: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4dd0a: 2f08 movel %a0,%sp@- 4dd0c: 4eb9 0004 984c jsr 4984c <_Heap_Free> 4dd12: 508f addql #8,%sp 4dd14: 4280 clrl %d0 } return HEAP_EXTEND_SUCCESSFUL; } 4dd16: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dd1c: 4e5e unlk %fp 4dd1e: 4e75 rts 00049c34 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 49c34: 4e56 ffe8 linkw %fp,#-24 49c38: 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 ) 49c3c: 2240 moveal %d0,%a1 49c3e: 5189 subql #8,%a1 49c40: 206e 0008 moveal %fp@(8),%a0 49c44: 4c68 0001 0010 remul %a0@(16),%d1,%d0 49c4a: 48d7 0c3c moveml %d2-%d5/%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; 49c4e: 2828 0020 movel %a0@(32),%d4 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 ) 49c52: 93c1 subal %d1,%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 49c54: b889 cmpl %a1,%d4 49c56: 6200 0140 bhiw 49d98 <_Heap_Free+0x164> <== ALWAYS TAKEN 49c5a: b3e8 0024 cmpal %a0@(36),%a1 49c5e: 53c0 sls %d0 49c60: 49c0 extbl %d0 49c62: 4480 negl %d0 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 49c64: 4a00 tstb %d0 49c66: 6700 0130 beqw 49d98 <_Heap_Free+0x164> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 49c6a: 2629 0004 movel %a1@(4),%d3 49c6e: 70fe moveq #-2,%d0 49c70: c083 andl %d3,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 49c72: 45f1 0800 lea %a1@(00000000,%d0: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 49c76: b88a cmpl %a2,%d4 49c78: 6200 011e bhiw 49d98 <_Heap_Free+0x164> <== ALWAYS TAKEN 49c7c: b5e8 0024 cmpal %a0@(36),%a2 49c80: 53c1 sls %d1 49c82: 49c1 extbl %d1 49c84: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 49c86: 4a01 tstb %d1 49c88: 6700 010e beqw 49d98 <_Heap_Free+0x164> <== 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; 49c8c: 222a 0004 movel %a2@(4),%d1 _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 49c90: 7401 moveq #1,%d2 49c92: c481 andl %d1,%d2 49c94: 4a02 tstb %d2 49c96: 6700 0100 beqw 49d98 <_Heap_Free+0x164> <== 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; 49c9a: 74fe moveq #-2,%d2 return false; } 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 )); 49c9c: 2668 0024 moveal %a0@(36),%a3 49ca0: c282 andl %d2,%d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 49ca2: b7ca cmpal %a2,%a3 49ca4: 6604 bnes 49caa <_Heap_Free+0x76> 49ca6: 4282 clrl %d2 49ca8: 6010 bras 49cba <_Heap_Free+0x86> <== ALWAYS TAKEN 49caa: 7401 moveq #1,%d2 49cac: 7a01 moveq #1,%d5 49cae: c4b2 1804 andl %a2@(00000004,%d1:l),%d2 49cb2: bb82 eorl %d5,%d2 49cb4: 0282 0000 00ff andil #255,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 49cba: 7a01 moveq #1,%d5 49cbc: c685 andl %d5,%d3 49cbe: 4a03 tstb %d3 49cc0: 6662 bnes 49d24 <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 49cc2: 2611 movel %a1@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 49cc4: 93c3 subal %d3,%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 49cc6: b889 cmpl %a1,%d4 49cc8: 6200 00ce bhiw 49d98 <_Heap_Free+0x164> <== ALWAYS TAKEN 49ccc: b3cb cmpal %a3,%a1 49cce: 53c4 sls %d4 49cd0: 49c4 extbl %d4 49cd2: 4484 negl %d4 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 49cd4: 4a04 tstb %d4 49cd6: 6700 00c0 beqw 49d98 <_Heap_Free+0x164> <== 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) ) { 49cda: 7801 moveq #1,%d4 49cdc: c8a9 0004 andl %a1@(4),%d4 49ce0: 4a04 tstb %d4 49ce2: 6700 00b4 beqw 49d98 <_Heap_Free+0x164> <== ALWAYS TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 49ce6: 4a02 tstb %d2 49ce8: 6726 beqs 49d10 <_Heap_Free+0xdc> uintptr_t const size = block_size + prev_size + next_block_size; 49cea: d280 addl %d0,%d1 49cec: d681 addl %d1,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 49cee: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49cf2: 7201 moveq #1,%d1 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 49cf4: 266a 000c moveal %a2@(12),%a3 49cf8: 8283 orl %d3,%d1 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 49cfa: 246a 0008 moveal %a2@(8),%a2 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 49cfe: 2383 3800 movel %d3,%a1@(00000000,%d3:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49d02: 2341 0004 movel %d1,%a1@(4) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 49d06: 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; 49d0a: 274a 0008 movel %a2,%a3@(8) 49d0e: 6078 bras 49d88 <_Heap_Free+0x154> <== ALWAYS TAKEN 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; 49d10: d680 addl %d0,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49d12: 7401 moveq #1,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 49d14: 7afe moveq #-2,%d5 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49d16: 8483 orl %d3,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 49d18: 2483 movel %d3,%a2@ next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49d1a: 2342 0004 movel %d2,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 49d1e: cbaa 0004 andl %d5,%a2@(4) 49d22: 6064 bras 49d88 <_Heap_Free+0x154> <== ALWAYS TAKEN next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 49d24: 4a02 tstb %d2 49d26: 6728 beqs 49d50 <_Heap_Free+0x11c> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 49d28: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + next_block_size; 49d2c: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 49d2e: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 49d30: 246a 0008 moveal %a2@(8),%a2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 49d34: 234b 000c movel %a3,%a1@(12) 49d38: 8481 orl %d1,%d2 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 49d3a: 234a 0008 movel %a2,%a1@(8) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 49d3e: 2381 1800 movel %d1,%a1@(00000000,%d1:l) 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; 49d42: 2342 0004 movel %d2,%a1@(4) new_block->prev = prev; next->prev = new_block; 49d46: 2549 000c movel %a1,%a2@(12) prev->next = new_block; 49d4a: 2749 0008 movel %a1,%a3@(8) 49d4e: 6038 bras 49d88 <_Heap_Free+0x154> <== 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; 49d50: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 49d52: 72fe moveq #-2,%d1 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 49d54: 8a80 orl %d0,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 49d56: 2668 0008 moveal %a0@(8),%a3 49d5a: 2345 0004 movel %d5,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 49d5e: c3aa 0004 andl %d1,%a2@(4) next_block->prev_size = block_size; 49d62: 2480 movel %d0,%a2@ /* Statistics */ ++stats->free_blocks; 49d64: 2228 0038 movel %a0@(56),%d1 49d68: 5281 addql #1,%d1 new_block->next = next; 49d6a: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; 49d6e: 2348 000c movel %a0,%a1@(12) block_before->next = new_block; 49d72: 2149 0008 movel %a1,%a0@(8) next->prev = new_block; 49d76: 2749 000c movel %a1,%a3@(12) 49d7a: 2141 0038 movel %d1,%a0@(56) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 49d7e: b2a8 003c cmpl %a0@(60),%d1 49d82: 6304 blss 49d88 <_Heap_Free+0x154> 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; 49d84: 2141 003c movel %d1,%a0@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 49d88: d1a8 0030 addl %d0,%a0@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 49d8c: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 49d90: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 49d94: 7001 moveq #1,%d0 return( true ); 49d96: 6002 bras 49d9a <_Heap_Free+0x166> <== ALWAYS TAKEN 49d98: 4200 clrb %d0 } 49d9a: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 49d9e: 4e5e unlk %fp 49da0: 4e75 rts ... 00063444 <_Heap_Get_free_information>: void _Heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { 63444: 4e56 0000 linkw %fp,#0 63448: 206e 000c moveal %fp@(12),%a0 6344c: 2f0a movel %a2,%sp@- 6344e: 246e 0008 moveal %fp@(8),%a2 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 63452: 4290 clrl %a0@ return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 63454: 226a 0008 moveal %a2@(8),%a1 info->largest = 0; 63458: 42a8 0004 clrl %a0@(4) info->total = 0; 6345c: 42a8 0008 clrl %a0@(8) for(the_block = _Heap_Free_list_first(the_heap); 63460: 601a bras 6347c <_Heap_Get_free_information+0x38> <== 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; 63462: 70fe moveq #-2,%d0 63464: c0a9 0004 andl %a1@(4),%d0 uint32_t const the_size = _Heap_Block_size(the_block); /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; 63468: 5290 addql #1,%a0@ info->total += the_size; 6346a: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 6346e: b0a8 0004 cmpl %a0@(4),%d0 63472: 6304 blss 63478 <_Heap_Get_free_information+0x34> info->largest = the_size; 63474: 2140 0004 movel %d0,%a0@(4) info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 63478: 2269 0008 moveal %a1@(8),%a1 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 6347c: b5c9 cmpal %a1,%a2 6347e: 66e2 bnes 63462 <_Heap_Get_free_information+0x1e> info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 63480: 245f moveal %sp@+,%a2 63482: 4e5e unlk %fp 63484: 4e75 rts ... 00070e94 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 70e94: 4e56 fff4 linkw %fp,#-12 70e98: 206e 000c moveal %fp@(12),%a0 70e9c: 226e 0008 moveal %fp@(8),%a1 70ea0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 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; 70ea4: 2408 movel %a0,%d2 70ea6: 0682 0000 000c addil #12,%d2 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; 70eac: 4290 clrl %a0@ Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 70eae: 2229 0024 movel %a1@(36),%d1 _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; the_info->Free.total = 0; 70eb2: 42a8 0008 clrl %a0@(8) void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 70eb6: 2469 0020 moveal %a1@(32),%a2 _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; the_info->Free.total = 0; the_info->Free.largest = 0; 70eba: 42a8 0004 clrl %a0@(4) the_info->Used.number = 0; 70ebe: 42a8 000c clrl %a0@(12) the_info->Used.total = 0; 70ec2: 42a8 0014 clrl %a0@(20) the_info->Used.largest = 0; 70ec6: 42a8 0010 clrl %a0@(16) while ( the_block != end ) { 70eca: 6022 bras 70eee <_Heap_Get_information+0x5a> <== 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; 70ecc: 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) ) 70ece: 7601 moveq #1,%d3 70ed0: c0aa 0004 andl %a2@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 70ed4: d5c0 addal %d0,%a2 70ed6: c6aa 0004 andl %a2@(4),%d3 70eda: 6602 bnes 70ede <_Heap_Get_information+0x4a> 70edc: 2248 moveal %a0,%a1 info = &the_info->Used; else info = &the_info->Free; info->number++; 70ede: 5291 addql #1,%a1@ info->total += the_size; 70ee0: d1a9 0008 addl %d0,%a1@(8) if ( info->largest < the_size ) 70ee4: b0a9 0004 cmpl %a1@(4),%d0 70ee8: 6304 blss 70eee <_Heap_Get_information+0x5a> info->largest = the_size; 70eea: 2340 0004 movel %d0,%a1@(4) while ( the_block != end ) { 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) ) 70eee: 2242 moveal %d2,%a1 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 70ef0: b28a cmpl %a2,%d1 70ef2: 66d8 bnes 70ecc <_Heap_Get_information+0x38> /* * 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; 70ef4: 50a8 0014 addql #8,%a0@(20) } 70ef8: 4cd7 040c moveml %sp@,%d2-%d3/%a2 70efc: 4e5e unlk %fp 70efe: 4e75 rts 00045cb0 <_Heap_Initialize>: Heap_Control *heap, void *heap_area_begin_ptr, uintptr_t heap_area_size, uintptr_t page_size ) { 45cb0: 4e56 ffe8 linkw %fp,#-24 45cb4: 206e 0008 moveal %fp@(8),%a0 45cb8: 48d7 047c moveml %d2-%d6/%a2,%sp@ 45cbc: 262e 000c movel %fp@(12),%d3 45cc0: 242e 0010 movel %fp@(16),%d2 45cc4: 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 ) { 45cc8: 6606 bnes 45cd0 <_Heap_Initialize+0x20> 45cca: 123c 0004 moveb #4,%d1 45cce: 6012 bras 45ce2 <_Heap_Initialize+0x32> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45cd0: 7003 moveq #3,%d0 45cd2: c081 andl %d1,%d0 if ( remainder != 0 ) { 45cd4: 6704 beqs 45cda <_Heap_Initialize+0x2a> return value - remainder + alignment; 45cd6: 5881 addql #4,%d1 45cd8: 9280 subl %d0,%d1 page_size = CPU_ALIGNMENT; } else { page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT ); if ( page_size < CPU_ALIGNMENT ) { 45cda: 7003 moveq #3,%d0 45cdc: b081 cmpl %d1,%d0 45cde: 6400 00da bccw 45dba <_Heap_Initialize+0x10a> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45ce2: 7810 moveq #16,%d4 45ce4: 4c41 4000 remul %d1,%d0,%d4 if ( remainder != 0 ) { 45ce8: 4a80 tstl %d0 45cea: 6604 bnes 45cf0 <_Heap_Initialize+0x40> 45cec: 7810 moveq #16,%d4 45cee: 600a bras 45cfa <_Heap_Initialize+0x4a> <== ALWAYS TAKEN return value - remainder + alignment; 45cf0: 2801 movel %d1,%d4 45cf2: 0684 0000 0010 addil #16,%d4 45cf8: 9880 subl %d0,%d4 ) { 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; 45cfa: 2003 movel %d3,%d0 45cfc: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45cfe: 2c00 movel %d0,%d6 45d00: 4c41 6005 remul %d1,%d5,%d6 if ( remainder != 0 ) { 45d04: 4a85 tstl %d5 45d06: 6704 beqs 45d0c <_Heap_Initialize+0x5c> return value - remainder + alignment; 45d08: d081 addl %d1,%d0 45d0a: 9085 subl %d5,%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; 45d0c: 2c03 movel %d3,%d6 45d0e: dc82 addl %d2,%d6 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 ( 45d10: b686 cmpl %d6,%d3 45d12: 6200 00a6 bhiw 45dba <_Heap_Initialize+0x10a> } 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); 45d16: 2a00 movel %d0,%d5 45d18: 2240 moveal %d0,%a1 45d1a: 9a83 subl %d3,%d5 45d1c: 5189 subql #8,%a1 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 ( 45d1e: ba82 cmpl %d2,%d5 45d20: 6400 0098 bccw 45dba <_Heap_Initialize+0x10a> 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; 45d24: 9485 subl %d5,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 45d26: 2a02 movel %d2,%d5 45d28: 4c41 5000 remul %d1,%d0,%d5 45d2c: 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 ( 45d2e: b882 cmpl %d2,%d4 45d30: 6200 0088 bhiw 45dba <_Heap_Initialize+0x10a> } /* 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; 45d34: 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); 45d36: 45f1 2800 lea %a1@(00000000,%d2:l),%a2 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; 45d3a: 2002 movel %d2,%d0 45d3c: 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; 45d3e: 8a82 orl %d2,%d5 return 0; } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; 45d40: 2281 movel %d1,%a1@ first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 45d42: 2345 0004 movel %d5,%a1@(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; 45d46: 2a09 movel %a1,%d5 45d48: 9a8a subl %a2,%d5 45d4a: 2545 0004 movel %d5,%a2@(4) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45d4e: 2a39 0005 b1d8 movel 5b1d8 ,%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; 45d54: 2482 movel %d2,%a2@ last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; 45d56: 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; 45d5a: 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 ); 45d5c: 2348 0008 movel %a0,%a1@(8) first_block->prev = _Heap_Free_list_head( heap ); 45d60: 2348 000c movel %a0,%a1@(12) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45d64: 2145 0028 movel %d5,%a0@(40) 45d68: 5285 addql #1,%d5 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; 45d6a: 2144 0014 movel %d4,%a0@(20) heap->area_begin = heap_area_begin; 45d6e: 2143 0018 movel %d3,%a0@(24) heap->area_end = heap_area_end; 45d72: 2146 001c movel %d6,%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; 45d76: 2142 0034 movel %d2,%a0@(52) 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; 45d7a: 2142 002c movel %d2,%a0@(44) stats->free_size = first_block_size; 45d7e: 2142 0030 movel %d2,%a0@(48) stats->min_free_size = first_block_size; stats->free_blocks = 1; 45d82: 2141 0038 movel %d1,%a0@(56) stats->max_free_blocks = 1; 45d86: 2141 003c movel %d1,%a0@(60) stats->used_blocks = 0; 45d8a: 42a8 0040 clrl %a0@(64) stats->max_search = 0; 45d8e: 42a8 0044 clrl %a0@(68) stats->allocs = 0; 45d92: 42a8 0048 clrl %a0@(72) stats->searches = 0; 45d96: 42a8 004c clrl %a0@(76) stats->frees = 0; 45d9a: 42a8 0050 clrl %a0@(80) stats->resizes = 0; 45d9e: 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; 45da2: 214a 0024 movel %a2,%a0@(36) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45da6: 23c5 0005 b1d8 movel %d5,5b1d8 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; 45dac: 2149 000c movel %a1,%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; 45db0: 2149 0020 movel %a1,%a0@(32) heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; 45db4: 2149 0008 movel %a1,%a0@(8) ); _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; 45db8: 6002 bras 45dbc <_Heap_Initialize+0x10c> <== ALWAYS TAKEN 45dba: 4280 clrl %d0 } 45dbc: 4cd7 047c moveml %sp@,%d2-%d6/%a2 45dc0: 4e5e unlk %fp 45dc2: 4e75 rts 00058730 <_Heap_Resize_block>: void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 58730: 4e56 ffe0 linkw %fp,#-32 58734: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 58738: 242e 000c movel %fp@(12),%d2 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 ) 5873c: 2202 movel %d2,%d1 5873e: 2042 moveal %d2,%a0 58740: 5188 subql #8,%a0 58742: 246e 0008 moveal %fp@(8),%a2 58746: 286e 0014 moveal %fp@(20),%a4 5874a: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; 58750: 4294 clrl %a4@ void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 58752: 266e 0018 moveal %fp@(24),%a3 58756: 91c0 subal %d0,%a0 58758: 2a2e 0010 movel %fp@(16),%d5 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; *new_size = 0; 5875c: 4293 clrl %a3@ 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 5875e: b1ea 0020 cmpal %a2@(32),%a0 58762: 6500 0096 bcsw 587fa <_Heap_Resize_block+0xca> 58766: b1ea 0024 cmpal %a2@(36),%a0 5876a: 6200 008e bhiw 587fa <_Heap_Resize_block+0xca> - 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; 5876e: 70fe moveq #-2,%d0 58770: 72fe moveq #-2,%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 58772: 7801 moveq #1,%d4 58774: 7c01 moveq #1,%d6 uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 58776: 7604 moveq #4,%d3 58778: 9682 subl %d2,%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; 5877a: c0a8 0004 andl %a0@(4),%d0 { Heap_Statistics *const stats = &heap->stats; uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 5877e: 43f0 0800 lea %a0@(00000000,%d0:l),%a1 uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 58782: d689 addl %a1,%d3 58784: c2a9 0004 andl %a1@(4),%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 58788: c8b1 1804 andl %a1@(00000004,%d1:l),%d4 bool next_block_is_free = _Heap_Is_free( next_block );; _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; 5878c: 2883 movel %d3,%a4@ 5878e: bd84 eorl %d6,%d4 58790: 1c04 moveb %d4,%d6 if ( next_block_is_free ) { 58792: 6704 beqs 58798 <_Heap_Resize_block+0x68> block_size += next_block_size; 58794: d081 addl %d1,%d0 alloc_size += next_block_size; 58796: d681 addl %d1,%d3 } if ( new_alloc_size > alloc_size ) { 58798: b685 cmpl %d5,%d3 5879a: 6404 bccs 587a0 <_Heap_Resize_block+0x70> 5879c: 7001 moveq #1,%d0 5879e: 605c bras 587fc <_Heap_Resize_block+0xcc> <== ALWAYS TAKEN return HEAP_RESIZE_UNSATISFIED; } if ( next_block_is_free ) { 587a0: 4a06 tstb %d6 587a2: 672a beqs 587ce <_Heap_Resize_block+0x9e> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 587a4: 7601 moveq #1,%d3 587a6: c6a8 0004 andl %a0@(4),%d3 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 587aa: 2869 000c moveal %a1@(12),%a4 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 587ae: 8680 orl %d0,%d3 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 587b0: 2269 0008 moveal %a1@(8),%a1 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 587b4: 2143 0004 movel %d3,%a0@(4) _Heap_Block_set_size( block, block_size ); _Heap_Free_list_remove( next_block ); next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 587b8: 7601 moveq #1,%d3 587ba: 87b0 0804 orl %d3,%a0@(00000004,%d0:l) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 587be: 234c 000c movel %a4,%a1@(12) /* Statistics */ --stats->free_blocks; stats->free_size -= next_block_size; 587c2: 93aa 0030 subl %d1,%a2@(48) next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; /* Statistics */ --stats->free_blocks; 587c6: 53aa 0038 subql #1,%a2@(56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 587ca: 2949 0008 movel %a1,%a4@(8) stats->free_size -= next_block_size; } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 587ce: 2f05 movel %d5,%sp@- 587d0: 2f02 movel %d2,%sp@- 587d2: 2f08 movel %a0,%sp@- 587d4: 2f0a movel %a2,%sp@- 587d6: 4eb9 0004 5e92 jsr 45e92 <_Heap_Block_allocate> block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; /* Statistics */ ++stats->resizes; 587dc: 4fef 0010 lea %sp@(16),%sp block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 587e0: 72fe moveq #-2,%d1 /* Statistics */ --stats->free_blocks; stats->free_size -= next_block_size; } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 587e2: 2040 moveal %d0,%a0 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 587e4: 2240 moveal %d0,%a1 587e6: 93c2 subal %d2,%a1 /* Statistics */ ++stats->resizes; 587e8: 4280 clrl %d0 block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 587ea: c2a8 0004 andl %a0@(4),%d1 587ee: 43f1 1804 lea %a1@(00000004,%d1:l),%a1 587f2: 2689 movel %a1,%a3@ /* Statistics */ ++stats->resizes; 587f4: 52aa 0054 addql #1,%a2@(84) 587f8: 6002 bras 587fc <_Heap_Resize_block+0xcc> <== ALWAYS TAKEN 587fa: 7002 moveq #2,%d0 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 587fc: 4cee 1c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a4 58802: 4e5e unlk %fp 58804: 4e75 rts ... 00058808 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 58808: 4e56 0000 linkw %fp,#0 5880c: 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 ) 58810: 2040 moveal %d0,%a0 58812: 5188 subql #8,%a0 58814: 226e 0008 moveal %fp@(8),%a1 58818: 2f02 movel %d2,%sp@- 5881a: 2400 movel %d0,%d2 5881c: 4c69 2001 0010 remul %a1@(16),%d1,%d2 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; 58822: 2429 0020 movel %a1@(32),%d2 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 ) 58826: 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 58828: b488 cmpl %a0,%d2 5882a: 6244 bhis 58870 <_Heap_Size_of_alloc_area+0x68> 5882c: b1e9 0024 cmpal %a1@(36),%a0 58830: 53c1 sls %d1 58832: 49c1 extbl %d1 58834: 4481 negl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 58836: 4a01 tstb %d1 58838: 6736 beqs 58870 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5883a: 72fe moveq #-2,%d1 5883c: c2a8 0004 andl %a0@(4),%d1 58840: d1c1 addal %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 58842: b488 cmpl %a0,%d2 58844: 622a bhis 58870 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN 58846: b1e9 0024 cmpal %a1@(36),%a0 5884a: 53c1 sls %d1 5884c: 49c1 extbl %d1 5884e: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 58850: 4a01 tstb %d1 58852: 671c beqs 58870 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN 58854: 7201 moveq #1,%d1 58856: c2a8 0004 andl %a0@(4),%d1 5885a: 4a01 tstb %d1 5885c: 6712 beqs 58870 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5885e: 7204 moveq #4,%d1 58860: 9280 subl %d0,%d1 58862: 2001 movel %d1,%d0 58864: d088 addl %a0,%d0 58866: 226e 0010 moveal %fp@(16),%a1 5886a: 2280 movel %d0,%a1@ 5886c: 7001 moveq #1,%d0 return true; 5886e: 6002 bras 58872 <_Heap_Size_of_alloc_area+0x6a> <== ALWAYS TAKEN 58870: 4200 clrb %d0 } 58872: 241f movel %sp@+,%d2 58874: 4e5e unlk %fp 58876: 4e75 rts 0004694c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4694c: 4e56 ffd0 linkw %fp,#-48 46950: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 46954: 286e 0008 moveal %fp@(8),%a4 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; 46958: 47fa 031a lea %pc@(46c74 <_Heap_Walk_print>),%a3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4695c: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 46960: 2c2c 0010 movel %a4@(16),%d6 uintptr_t const min_block_size = heap->min_block_size; 46964: 262c 0014 movel %a4@(20),%d3 Heap_Block *const last_block = heap->last_block; 46968: 2a2c 0024 movel %a4@(36),%d5 Heap_Block *block = heap->first_block; 4696c: 246c 0020 moveal %a4@(32),%a2 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 46970: 4a2e 0013 tstb %fp@(19) 46974: 6604 bnes 4697a <_Heap_Walk+0x2e> 46976: 47fa ffcc lea %pc@(46944 <_Heap_Walk_print_nothing>),%a3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4697a: 7003 moveq #3,%d0 4697c: b0b9 0005 df3e cmpl 5df3e <_System_state_Current>,%d0 46982: 6600 02da bnew 46c5e <_Heap_Walk+0x312> <== ALWAYS TAKEN 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)( 46986: 2f2c 000c movel %a4@(12),%sp@- 4698a: 2f2c 0008 movel %a4@(8),%sp@- 4698e: 2f05 movel %d5,%sp@- 46990: 2f0a movel %a2,%sp@- 46992: 2f2c 001c movel %a4@(28),%sp@- 46996: 2f2c 0018 movel %a4@(24),%sp@- 4699a: 2f03 movel %d3,%sp@- 4699c: 2f06 movel %d6,%sp@- 4699e: 4879 0005 a302 pea 5a302 469a4: 42a7 clrl %sp@- 469a6: 2f02 movel %d2,%sp@- 469a8: 4e93 jsr %a3@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 469aa: 4fef 002c lea %sp@(44),%sp 469ae: 4a86 tstl %d6 469b0: 6608 bnes 469ba <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 469b2: 4879 0005 a393 pea 5a393 469b8: 607e bras 46a38 <_Heap_Walk+0xec> <== ALWAYS TAKEN return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 469ba: 7003 moveq #3,%d0 469bc: c086 andl %d6,%d0 469be: 670c beqs 469cc <_Heap_Walk+0x80> (*printer)( 469c0: 2f06 movel %d6,%sp@- 469c2: 4879 0005 a3a6 pea 5a3a6 469c8: 6000 0268 braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 469cc: 2203 movel %d3,%d1 469ce: 4c46 1000 remul %d6,%d0,%d1 469d2: 4a80 tstl %d0 469d4: 670c beqs 469e2 <_Heap_Walk+0x96> (*printer)( 469d6: 2f03 movel %d3,%sp@- 469d8: 4879 0005 a3c4 pea 5a3c4 469de: 6000 0252 braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( 469e2: 200a movel %a2,%d0 469e4: 5080 addql #8,%d0 469e6: 4c46 0001 remul %d6,%d1,%d0 469ea: 4a81 tstl %d1 469ec: 670c beqs 469fa <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 469ee: 2f0a movel %a2,%sp@- 469f0: 4879 0005 a3e8 pea 5a3e8 469f6: 6000 023a braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 469fa: 7001 moveq #1,%d0 469fc: c0aa 0004 andl %a2@(4),%d0 46a00: 4a00 tstb %d0 46a02: 6608 bnes 46a0c <_Heap_Walk+0xc0> (*printer)( 46a04: 4879 0005 a419 pea 5a419 46a0a: 602c bras 46a38 <_Heap_Walk+0xec> <== ALWAYS TAKEN ); return false; } if ( first_block->prev_size != page_size ) { 46a0c: 2812 movel %a2@,%d4 46a0e: bc84 cmpl %d4,%d6 46a10: 670e beqs 46a20 <_Heap_Walk+0xd4> (*printer)( 46a12: 2f06 movel %d6,%sp@- 46a14: 2f04 movel %d4,%sp@- 46a16: 4879 0005 a447 pea 5a447 46a1c: 6000 0150 braw 46b6e <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_free( last_block ) ) { 46a20: 2045 moveal %d5,%a0 46a22: 70fe moveq #-2,%d0 46a24: 7201 moveq #1,%d1 46a26: c0a8 0004 andl %a0@(4),%d0 46a2a: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46a2e: 4a01 tstb %d1 46a30: 6616 bnes 46a48 <_Heap_Walk+0xfc> (*printer)( 46a32: 4879 0005 a472 pea 5a472 46a38: 4878 0001 pea 1 46a3c: 2f02 movel %d2,%sp@- 46a3e: 4e93 jsr %a3@ 46a40: 4fef 000c lea %sp@(12),%sp 46a44: 6000 01f8 braw 46c3e <_Heap_Walk+0x2f2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 46a48: 2c2c 0010 movel %a4@(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; 46a4c: 220c movel %a4,%d1 46a4e: 206c 0008 moveal %a4@(8),%a0 46a52: 606a bras 46abe <_Heap_Walk+0x172> <== ALWAYS TAKEN 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 46a54: b1ec 0020 cmpal %a4@(32),%a0 46a58: 650e bcss 46a68 <_Heap_Walk+0x11c> 46a5a: b1ec 0024 cmpal %a4@(36),%a0 46a5e: 53c0 sls %d0 46a60: 49c0 extbl %d0 46a62: 4480 negl %d0 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 46a64: 4a00 tstb %d0 46a66: 660c bnes 46a74 <_Heap_Walk+0x128> <== NEVER TAKEN (*printer)( 46a68: 2f08 movel %a0,%sp@- 46a6a: 4879 0005 a487 pea 5a487 46a70: 6000 01c0 braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( 46a74: 4c46 7000 remul %d6,%d0,%d7 46a78: 4a80 tstl %d0 46a7a: 670c beqs 46a88 <_Heap_Walk+0x13c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 46a7c: 2f08 movel %a0,%sp@- 46a7e: 4879 0005 a4a7 pea 5a4a7 46a84: 6000 01ac braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( _Heap_Is_used( free_block ) ) { 46a88: 70fe moveq #-2,%d0 46a8a: 7e01 moveq #1,%d7 46a8c: c0a8 0004 andl %a0@(4),%d0 46a90: ceb0 0804 andl %a0@(00000004,%d0:l),%d7 46a94: 670c beqs 46aa2 <_Heap_Walk+0x156> (*printer)( 46a96: 2f08 movel %a0,%sp@- 46a98: 4879 0005 a4d7 pea 5a4d7 46a9e: 6000 0192 braw 46c32 <_Heap_Walk+0x2e6> ); return false; } if ( free_block->prev != prev_block ) { 46aa2: 2028 000c movel %a0@(12),%d0 46aa6: b280 cmpl %d0,%d1 46aa8: 670e beqs 46ab8 <_Heap_Walk+0x16c> (*printer)( 46aaa: 2f00 movel %d0,%sp@- 46aac: 2f08 movel %a0,%sp@- 46aae: 4879 0005 a4f3 pea 5a4f3 46ab4: 6000 00b8 braw 46b6e <_Heap_Walk+0x222> <== ALWAYS TAKEN return false; } prev_block = free_block; free_block = free_block->next; 46ab8: 2208 movel %a0,%d1 46aba: 2068 0008 moveal %a0@(8),%a0 ); return false; } if ( 46abe: 2e08 movel %a0,%d7 46ac0: 5087 addql #8,%d7 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 ) { 46ac2: b9c8 cmpal %a0,%a4 46ac4: 668e bnes 46a54 <_Heap_Walk+0x108> 46ac6: 6000 0190 braw 46c58 <_Heap_Walk+0x30c> - 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; 46aca: 202a 0004 movel %a2@(4),%d0 46ace: 7cfe moveq #-2,%d6 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 ) { 46ad0: 7201 moveq #1,%d1 46ad2: cc80 andl %d0,%d6 46ad4: 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); 46ad6: 4bf2 6800 lea %a2@(00000000,%d6:l),%a5 46ada: 4a00 tstb %d0 46adc: 6716 beqs 46af4 <_Heap_Walk+0x1a8> (*printer)( 46ade: 2f06 movel %d6,%sp@- 46ae0: 2f0a movel %a2,%sp@- 46ae2: 4879 0005 a525 pea 5a525 46ae8: 42a7 clrl %sp@- 46aea: 2f02 movel %d2,%sp@- 46aec: 4e93 jsr %a3@ 46aee: 4fef 0014 lea %sp@(20),%sp 46af2: 6016 bras 46b0a <_Heap_Walk+0x1be> <== ALWAYS TAKEN "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 46af4: 2f12 movel %a2@,%sp@- 46af6: 2f06 movel %d6,%sp@- 46af8: 2f0a movel %a2,%sp@- 46afa: 4879 0005 a53c pea 5a53c 46b00: 42a7 clrl %sp@- 46b02: 2f02 movel %d2,%sp@- 46b04: 4e93 jsr %a3@ 46b06: 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 46b0a: bbec 0020 cmpal %a4@(32),%a5 46b0e: 650e bcss 46b1e <_Heap_Walk+0x1d2> <== ALWAYS TAKEN 46b10: bbec 0024 cmpal %a4@(36),%a5 46b14: 53c0 sls %d0 46b16: 49c0 extbl %d0 46b18: 4480 negl %d0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 46b1a: 4a00 tstb %d0 46b1c: 660c bnes 46b2a <_Heap_Walk+0x1de> (*printer)( 46b1e: 2f0d movel %a5,%sp@- 46b20: 2f0a movel %a2,%sp@- 46b22: 4879 0005 a561 pea 5a561 46b28: 6044 bras 46b6e <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 46b2a: 2206 movel %d6,%d1 46b2c: 4c44 1000 remul %d4,%d0,%d1 46b30: 4a80 tstl %d0 46b32: 670c beqs 46b40 <_Heap_Walk+0x1f4> (*printer)( 46b34: 2f06 movel %d6,%sp@- 46b36: 2f0a movel %a2,%sp@- 46b38: 4879 0005 a58e pea 5a58e 46b3e: 602e bras 46b6e <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( block_size < min_block_size ) { 46b40: b686 cmpl %d6,%d3 46b42: 631c blss 46b60 <_Heap_Walk+0x214> (*printer)( 46b44: 2f03 movel %d3,%sp@- 46b46: 2f06 movel %d6,%sp@- 46b48: 2f0a movel %a2,%sp@- 46b4a: 4879 0005 a5bc pea 5a5bc 46b50: 4878 0001 pea 1 46b54: 2f02 movel %d2,%sp@- 46b56: 4e93 jsr %a3@ block, block_size, min_block_size ); return false; 46b58: 4fef 0018 lea %sp@(24),%sp 46b5c: 6000 00e0 braw 46c3e <_Heap_Walk+0x2f2> } if ( next_block_begin <= block_begin ) { 46b60: b5cd cmpal %a5,%a2 46b62: 651a bcss 46b7e <_Heap_Walk+0x232> (*printer)( 46b64: 2f0d movel %a5,%sp@- 46b66: 2f0a movel %a2,%sp@- 46b68: 4879 0005 a5e7 pea 5a5e7 46b6e: 4878 0001 pea 1 46b72: 2f02 movel %d2,%sp@- 46b74: 4e93 jsr %a3@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 46b76: 4fef 0014 lea %sp@(20),%sp 46b7a: 6000 00c2 braw 46c3e <_Heap_Walk+0x2f2> } if ( !_Heap_Is_prev_used( next_block ) ) { 46b7e: 7001 moveq #1,%d0 46b80: c0ad 0004 andl %a5@(4),%d0 46b84: 4a00 tstb %d0 46b86: 6600 00ce bnew 46c56 <_Heap_Walk+0x30a> <== 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; 46b8a: 2e2a 0004 movel %a2@(4),%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; 46b8e: 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; 46b90: 43f9 0005 a61b lea 5a61b ,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46b96: 206c 0008 moveal %a4@(8),%a0 - 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; 46b9a: cc87 andl %d7,%d6 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; 46b9c: 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); 46ba0: 2e0a movel %a2,%d7 46ba2: de86 addl %d6,%d7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46ba4: 2d48 fff8 movel %a0,%fp@(-8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46ba8: 206a 0008 moveal %a2@(8),%a0 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 46bac: b1ec 000c cmpal %a4@(12),%a0 46bb0: 6710 beqs 46bc2 <_Heap_Walk+0x276> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 46bb2: 43f9 0005 a625 lea 5a625 ,%a1 46bb8: b9c8 cmpal %a0,%a4 46bba: 6706 beqs 46bc2 <_Heap_Walk+0x276> 46bbc: 43f9 0005 a252 lea 5a252 ,%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)( 46bc2: 202a 000c movel %a2@(12),%d0 46bc6: 223c 0005 a62f movel #370223,%d1 46bcc: b0ae fff8 cmpl %fp@(-8),%d0 46bd0: 6710 beqs 46be2 <_Heap_Walk+0x296> "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)" : ""), 46bd2: 223c 0005 a63a movel #370234,%d1 46bd8: b9c0 cmpal %d0,%a4 46bda: 6706 beqs 46be2 <_Heap_Walk+0x296> 46bdc: 223c 0005 a252 movel #369234,%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46be2: 2f09 movel %a1,%sp@- 46be4: 2f08 movel %a0,%sp@- 46be6: 2f01 movel %d1,%sp@- 46be8: 2f00 movel %d0,%sp@- 46bea: 2f0a movel %a2,%sp@- 46bec: 4879 0005 a644 pea 5a644 46bf2: 42a7 clrl %sp@- 46bf4: 2f02 movel %d2,%sp@- 46bf6: 4e93 jsr %a3@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 46bf8: 4fef 0020 lea %sp@(32),%sp 46bfc: 2047 moveal %d7,%a0 46bfe: 2010 movel %a0@,%d0 46c00: b086 cmpl %d6,%d0 46c02: 671c beqs 46c20 <_Heap_Walk+0x2d4> (*printer)( 46c04: 2f07 movel %d7,%sp@- 46c06: 2f00 movel %d0,%sp@- 46c08: 2f06 movel %d6,%sp@- 46c0a: 2f0a movel %a2,%sp@- 46c0c: 4879 0005 a670 pea 5a670 46c12: 4878 0001 pea 1 46c16: 2f02 movel %d2,%sp@- 46c18: 4e93 jsr %a3@ 46c1a: 4fef 001c lea %sp@(28),%sp 46c1e: 601e bras 46c3e <_Heap_Walk+0x2f2> <== ALWAYS TAKEN ); return false; } if ( !prev_used ) { 46c20: 7001 moveq #1,%d0 46c22: c0ae fffc andl %fp@(-4),%d0 46c26: 4a00 tstb %d0 46c28: 6618 bnes 46c42 <_Heap_Walk+0x2f6> (*printer)( 46c2a: 2f0a movel %a2,%sp@- 46c2c: 4879 0005 a6a9 pea 5a6a9 46c32: 4878 0001 pea 1 46c36: 2f02 movel %d2,%sp@- 46c38: 4e93 jsr %a3@ 46c3a: 4fef 0010 lea %sp@(16),%sp 46c3e: 4200 clrb %d0 46c40: 601e bras 46c60 <_Heap_Walk+0x314> <== ALWAYS TAKEN return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46c42: 206c 0008 moveal %a4@(8),%a0 46c46: 6008 bras 46c50 <_Heap_Walk+0x304> <== ALWAYS TAKEN { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 46c48: b5c8 cmpal %a0,%a2 46c4a: 670a beqs 46c56 <_Heap_Walk+0x30a> return true; } free_block = free_block->next; 46c4c: 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 ) { 46c50: b9c8 cmpal %a0,%a4 46c52: 66f4 bnes 46c48 <_Heap_Walk+0x2fc> 46c54: 6014 bras 46c6a <_Heap_Walk+0x31e> <== ALWAYS TAKEN 46c56: 244d moveal %a5,%a2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 46c58: ba8a cmpl %a2,%d5 46c5a: 6600 fe6e bnew 46aca <_Heap_Walk+0x17e> <== ALWAYS TAKEN 46c5e: 7001 moveq #1,%d0 block = next_block; } return true; } 46c60: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 46c66: 4e5e unlk %fp 46c68: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 46c6a: 2f0a movel %a2,%sp@- 46c6c: 4879 0005 a6d8 pea 5a6d8 46c72: 60be bras 46c32 <_Heap_Walk+0x2e6> <== ALWAYS TAKEN 00046c74 <_Heap_Walk_print>: { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { 46c74: 41f9 0004 3474 lea 43474 ,%a0 46c7a: 4e56 0000 linkw %fp,#0 46c7e: 202e 0008 movel %fp@(8),%d0 va_list ap; if ( error ) { 46c82: 4a2e 000f tstb %fp@(15) 46c86: 670a beqs 46c92 <_Heap_Walk_print+0x1e> printk( "FAIL[%d]: ", source ); 46c88: 2f00 movel %d0,%sp@- 46c8a: 4879 0005 a703 pea 5a703 46c90: 6008 bras 46c9a <_Heap_Walk_print+0x26> <== ALWAYS TAKEN } else { printk( "PASS[%d]: ", source ); 46c92: 2f00 movel %d0,%sp@- 46c94: 4879 0005 a70e pea 5a70e 46c9a: 4e90 jsr %a0@ 46c9c: 508f addql #8,%sp } va_start( ap, fmt ); vprintk( fmt, ap ); 46c9e: 486e 0014 pea %fp@(20) 46ca2: 2f2e 0010 movel %fp@(16),%sp@- 46ca6: 4eb9 0004 4df8 jsr 44df8 46cac: 508f addql #8,%sp va_end( ap ); } 46cae: 4e5e unlk %fp 46cb0: 4e75 rts ... 000455d4 <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 455d4: 4e56 0000 linkw %fp,#0 455d8: 2f0a movel %a2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) (void) rtems_io_initialize( major, 0, NULL ); 455da: 45f9 0004 9820 lea 49820 ,%a2 * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 455e0: 2f02 movel %d2,%sp@- 455e2: 4282 clrl %d2 rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455e4: 600e bras 455f4 <_IO_Initialize_all_drivers+0x20> <== ALWAYS TAKEN (void) rtems_io_initialize( major, 0, NULL ); 455e6: 42a7 clrl %sp@- 455e8: 42a7 clrl %sp@- 455ea: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455ec: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 455ee: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455f0: 4fef 000c lea %sp@(12),%sp 455f4: b4b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d2 455fa: 65ea bcss 455e6 <_IO_Initialize_all_drivers+0x12> (void) rtems_io_initialize( major, 0, NULL ); } 455fc: 242e fff8 movel %fp@(-8),%d2 45600: 246e fffc moveal %fp@(-4),%a2 45604: 4e5e unlk %fp 45606: 4e75 rts 00045608 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 45608: 4e56 ffe0 linkw %fp,#-32 4560c: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%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; 45610: 2479 0005 a336 moveal 5a336 ,%a2 drivers_in_table = Configuration.number_of_device_drivers; 45616: 2a39 0005 a332 movel 5a332 ,%d5 number_of_drivers = Configuration.maximum_drivers; 4561c: 2439 0005 a32e movel 5a32e ,%d2 /* * 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 ) 45622: ba82 cmpl %d2,%d5 45624: 6440 bccs 45666 <_IO_Manager_initialization+0x5e> /* * 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 *) 45626: 2002 movel %d2,%d0 45628: 2602 movel %d2,%d3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 4562a: 4284 clrl %d4 4562c: 4286 clrl %d6 4562e: 49f9 0004 c200 lea 4c200 ,%a4 /* * 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 *) 45634: e788 lsll #3,%d0 45636: eb8b lsll #5,%d3 45638: 9680 subl %d0,%d3 4563a: 2f03 movel %d3,%sp@- 4563c: 4eb9 0004 7d8c jsr 47d8c <_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( 45642: 2f03 movel %d3,%sp@- 45644: 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; 45646: 23c2 0005 bc4e movel %d2,5bc4e <_IO_Number_of_drivers> memset( 4564c: 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 *) 4564e: 23c0 0005 bc52 movel %d0,5bc52 <_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( 45654: 4eb9 0004 c270 jsr 4c270 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 4565a: 2679 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 45660: 4fef 0010 lea %sp@(16),%sp 45664: 6028 bras 4568e <_IO_Manager_initialization+0x86> <== ALWAYS TAKEN * 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; 45666: 23ca 0005 bc52 movel %a2,5bc52 <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 4566c: 23c5 0005 bc4e movel %d5,5bc4e <_IO_Number_of_drivers> return; 45672: 601e bras 45692 <_IO_Manager_initialization+0x8a> <== ALWAYS TAKEN _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 45674: 4878 0018 pea 18 45678: 4872 4800 pea %a2@(00000000,%d4:l) 4567c: 4873 4800 pea %a3@(00000000,%d4:l) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 45680: 5286 addql #1,%d6 45682: 0684 0000 0018 addil #24,%d4 _IO_Driver_address_table[index] = driver_table[index]; 45688: 4e94 jsr %a4@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 4568a: 4fef 000c lea %sp@(12),%sp 4568e: ba86 cmpl %d6,%d5 45690: 62e2 bhis 45674 <_IO_Manager_initialization+0x6c> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 45692: 4cee 1c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a4 45698: 4e5e unlk %fp 4569a: 4e75 rts 00045f88 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f88: 4e56 0000 linkw %fp,#0 45f8c: 222e 000c movel %fp@(12),%d1 45f90: 2f03 movel %d3,%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; _User_extensions_Fatal( the_source, is_internal, the_error ); 45f92: 4283 clrl %d3 45f94: 1601 moveb %d1,%d3 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f96: 2f02 movel %d2,%sp@- 45f98: 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 ); 45f9c: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f9e: 202e 0008 movel %fp@(8),%d0 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45fa2: 2f03 movel %d3,%sp@- _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 45fa4: 263c 0000 0700 movel #1792,%d3 _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 ); 45faa: 2f00 movel %d0,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 45fac: 13c1 0005 bade moveb %d1,5bade <_Internal_errors_What_happened+0x4> bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 45fb2: 23c0 0005 bada movel %d0,5bada <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 45fb8: 23c2 0005 bae0 movel %d2,5bae0 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 45fbe: 4eb9 0004 7a32 jsr 47a32 <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 45fc4: 40c0 movew %sr,%d0 45fc6: 8083 orl %d3,%d0 45fc8: 46c0 movew %d0,%sr 45fca: 2002 movel %d2,%d0 <== NOT EXECUTED 45fcc: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 45fd2: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 45fd4: 7005 moveq #5,%d0 45fd6: 4fef 000c lea %sp@(12),%sp 45fda: 23c0 0005 bbb6 movel %d0,5bbb6 <_System_state_Current> 45fe0: 60fe bras 45fe0 <_Internal_error_Occurred+0x58> <== ALWAYS TAKEN ... 00049da4 <_Objects_API_maximum_class>: case OBJECTS_NO_API: default: break; } return 0; } 49da4: 7203 moveq #3,%d1 #include unsigned int _Objects_API_maximum_class( uint32_t api ) { 49da6: 4e56 0000 linkw %fp,#0 case OBJECTS_NO_API: default: break; } return 0; } 49daa: 202e 0008 movel %fp@(8),%d0 49dae: 5380 subql #1,%d0 49db0: b280 cmpl %d0,%d1 49db2: 6404 bccs 49db8 <_Objects_API_maximum_class+0x14> 49db4: 4280 clrl %d0 49db6: 600a bras 49dc2 <_Objects_API_maximum_class+0x1e> <== ALWAYS TAKEN 49db8: 41f9 0005 97a8 lea 597a8 ,%a0 49dbe: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 49dc2: 4e5e unlk %fp 49dc4: 4e75 rts ... 0004604c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 4604c: 4e56 fff0 linkw %fp,#-16 46050: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46054: 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 ) 46058: 4aaa 0014 tstl %a2@(20) 4605c: 6604 bnes 46062 <_Objects_Allocate+0x16> <== NEVER TAKEN 4605e: 4280 clrl %d0 <== NOT EXECUTED 46060: 605e bras 460c0 <_Objects_Allocate+0x74> <== NOT EXECUTED /* * 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 ); 46062: 240a movel %a2,%d2 46064: 0682 0000 001c addil #28,%d2 4606a: 47f9 0004 98a0 lea 498a0 <_Chain_Get>,%a3 46070: 2f02 movel %d2,%sp@- 46072: 4e93 jsr %a3@ if ( information->auto_extend ) { 46074: 588f addql #4,%sp 46076: 4a2a 0010 tstb %a2@(16) 4607a: 6744 beqs 460c0 <_Objects_Allocate+0x74> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 4607c: 4a80 tstl %d0 4607e: 6612 bnes 46092 <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 46080: 2f0a movel %a2,%sp@- 46082: 4eb9 0004 60f8 jsr 460f8 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46088: 2f02 movel %d2,%sp@- 4608a: 4e93 jsr %a3@ } if ( the_object ) { 4608c: 508f addql #8,%sp 4608e: 4a80 tstl %d0 46090: 672e beqs 460c0 <_Objects_Allocate+0x74> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46092: 2040 moveal %d0,%a0 46094: 4281 clrl %d1 46096: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46098: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4609a: 362a 0008 movew %a2@(8),%d3 4609e: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460a2: 342a 0012 movew %a2@(18),%d2 information->inactive--; 460a6: 306a 0028 moveaw %a2@(40),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460aa: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460ac: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 460b0: 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 ]--; 460b2: e589 lsll #2,%d1 information->inactive--; 460b4: 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 ]--; 460b8: 206a 002a moveal %a2@(42),%a0 460bc: d1c1 addal %d1,%a0 460be: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 460c0: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 460c6: 4e5e unlk %fp 460c8: 4e75 rts ... 000460f8 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 460f8: 4e56 ffc8 linkw %fp,#-56 460fc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 46100: 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 ); 46104: 4283 clrl %d3 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 46106: 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 ); 4610a: 362a 0008 movew %a2@(8),%d3 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4610e: 4a88 tstl %a0 46110: 6608 bnes 4611a <_Objects_Extend_information+0x22> 46112: 2403 movel %d3,%d2 46114: 4284 clrl %d4 46116: 4285 clrl %d5 46118: 602a bras 46144 <_Objects_Extend_information+0x4c> <== ALWAYS TAKEN block_count = 0; else { block_count = information->maximum / information->allocation_size; 4611a: 4280 clrl %d0 4611c: 2403 movel %d3,%d2 4611e: 4284 clrl %d4 46120: 302a 0012 movew %a2@(18),%d0 46124: 3a2a 000e movew %a2@(14),%d5 46128: 0285 0000 ffff andil #65535,%d5 4612e: 8ac0 divuw %d0,%d5 46130: 0285 0000 ffff andil #65535,%d5 for ( ; block < block_count; block++ ) { 46136: 6008 bras 46140 <_Objects_Extend_information+0x48> <== ALWAYS TAKEN if ( information->object_blocks[ block ] == NULL ) 46138: 4a98 tstl %a0@+ 4613a: 6708 beqs 46144 <_Objects_Extend_information+0x4c> 4613c: d480 addl %d0,%d2 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 4613e: 5284 addql #1,%d4 46140: ba84 cmpl %d4,%d5 46142: 62f4 bhis 46138 <_Objects_Extend_information+0x40> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 46144: 4280 clrl %d0 46146: 4287 clrl %d7 46148: 302a 0012 movew %a2@(18),%d0 4614c: 3e2a 000e movew %a2@(14),%d7 46150: de80 addl %d0,%d7 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 46152: 0c87 0000 ffff cmpil #65535,%d7 46158: 6200 01da bhiw 46334 <_Objects_Extend_information+0x23c> <== 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; 4615c: 41ea 0014 lea %a2@(20),%a0 46160: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 46164: 4a2a 0010 tstb %a2@(16) 46168: 6712 beqs 4617c <_Objects_Extend_information+0x84> new_object_block = _Workspace_Allocate( block_size ); 4616a: 2f00 movel %d0,%sp@- 4616c: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> if ( !new_object_block ) 46172: 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 ); 46174: 2c00 movel %d0,%d6 if ( !new_object_block ) 46176: 6610 bnes 46188 <_Objects_Extend_information+0x90> 46178: 6000 01ba braw 46334 <_Objects_Extend_information+0x23c> <== ALWAYS TAKEN return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 4617c: 2f00 movel %d0,%sp@- 4617e: 4eb9 0004 7d8c jsr 47d8c <_Workspace_Allocate_or_fatal_error> 46184: 588f addql #4,%sp 46186: 2c00 movel %d0,%d6 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 46188: 4280 clrl %d0 4618a: 302a 000e movew %a2@(14),%d0 4618e: b082 cmpl %d2,%d0 46190: 6200 0112 bhiw 462a4 <_Objects_Extend_information+0x1ac> */ /* * Up the block count and maximum */ block_count++; 46194: 2845 moveal %d5,%a4 46196: 528c addql #1,%a4 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 46198: 2007 movel %d7,%d0 4619a: d083 addl %d3,%d0 4619c: 41f4 ca00 lea %a4@(00000000,%a4:l:2),%a0 461a0: d088 addl %a0,%d0 461a2: e588 lsll #2,%d0 461a4: 2f00 movel %d0,%sp@- 461a6: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> if ( !object_blocks ) { 461ac: 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 ); 461ae: 2640 moveal %d0,%a3 if ( !object_blocks ) { 461b0: 4a80 tstl %d0 461b2: 660e bnes 461c2 <_Objects_Extend_information+0xca> _Workspace_Free( new_object_block ); 461b4: 2f06 movel %d6,%sp@- 461b6: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> return; 461bc: 588f addql #4,%sp 461be: 6000 0174 braw 46334 <_Objects_Extend_information+0x23c> <== ALWAYS TAKEN } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 461c2: 200c movel %a4,%d0 461c4: e588 lsll #2,%d0 461c6: 2840 moveal %d0,%a4 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 461c8: 4280 clrl %d0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 461ca: 4bf3 c800 lea %a3@(00000000,%a4:l),%a5 461ce: 49f5 c800 lea %a5@(00000000,%a4:l),%a4 461d2: 302a 000e movew %a2@(14),%d0 461d6: b680 cmpl %d0,%d3 461d8: 6506 bcss 461e0 <_Objects_Extend_information+0xe8> 461da: 204c moveal %a4,%a0 461dc: 4280 clrl %d0 461de: 604a bras 4622a <_Objects_Extend_information+0x132> <== 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, 461e0: 2205 movel %d5,%d1 461e2: e589 lsll #2,%d1 461e4: 2f01 movel %d1,%sp@- 461e6: 2f2a 002e movel %a2@(46),%sp@- 461ea: 2d41 fff0 movel %d1,%fp@(-16) 461ee: 2f0b movel %a3,%sp@- 461f0: 4eb9 0004 c200 jsr 4c200 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 461f6: 222e fff0 movel %fp@(-16),%d1 461fa: 2f01 movel %d1,%sp@- 461fc: 2f2a 002a movel %a2@(42),%sp@- 46200: 2f0d movel %a5,%sp@- 46202: 4eb9 0004 c200 jsr 4c200 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 46208: 4280 clrl %d0 4620a: 302a 000e movew %a2@(14),%d0 4620e: d680 addl %d0,%d3 46210: e58b lsll #2,%d3 46212: 2f03 movel %d3,%sp@- 46214: 2f2a 0018 movel %a2@(24),%sp@- 46218: 2f0c movel %a4,%sp@- 4621a: 4eb9 0004 c200 jsr 4c200 46220: 4fef 0024 lea %sp@(36),%sp 46224: 6008 bras 4622e <_Objects_Extend_information+0x136> <== ALWAYS TAKEN /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 46226: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 46228: 5280 addql #1,%d0 4622a: b680 cmpl %d0,%d3 4622c: 62f8 bhis 46226 <_Objects_Extend_information+0x12e> */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 4622e: 4281 clrl %d1 46230: 2002 movel %d2,%d0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 46232: e58d lsll #2,%d5 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 46234: 322a 0012 movew %a2@(18),%d1 46238: 41f4 2c00 lea %a4@(00000000,%d2:l:4),%a0 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 4623c: 42b5 5800 clrl %a5@(00000000,%d5:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 46240: d282 addl %d2,%d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 46242: 42b3 5800 clrl %a3@(00000000,%d5:l) inactive_per_block[block_count] = 0; for ( index=index_base ; 46246: 6004 bras 4624c <_Objects_Extend_information+0x154> <== ALWAYS TAKEN index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 46248: 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++ ) { 4624a: 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 ; 4624c: b280 cmpl %d0,%d1 4624e: 62f8 bhis 46248 <_Objects_Extend_information+0x150> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 46250: 203c 0000 0700 movel #1792,%d0 46256: 40c3 movew %sr,%d3 46258: 8083 orl %d3,%d0 4625a: 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( 4625c: 2012 movel %a2@,%d0 4625e: 7218 moveq #24,%d1 46260: 4285 clrl %d5 46262: e3a8 lsll %d1,%d0 46264: 3a07 movew %d7,%d5 46266: 4281 clrl %d1 46268: 2245 moveal %d5,%a1 4626a: 7a1b moveq #27,%d5 4626c: 322a 0004 movew %a2@(4),%d1 46270: 08c0 0010 bset #16,%d0 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; 46274: 3547 000e movew %d7,%a2@(14) information->maximum_id = _Objects_Build_id( 46278: eba9 lsll %d5,%d1 4627a: 2e09 movel %a1,%d7 4627c: 8081 orl %d1,%d0 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 4627e: 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( 46282: 8e80 orl %d0,%d7 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 46284: 254b 002e movel %a3,%a2@(46) information->inactive_per_block = inactive_per_block; 46288: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 4628c: 2547 000a movel %d7,%a2@(10) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 46290: 254c 0018 movel %a4,%a2@(24) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 46294: 46c3 movew %d3,%sr if ( old_tables ) 46296: 4a88 tstl %a0 46298: 670a beqs 462a4 <_Objects_Extend_information+0x1ac> _Workspace_Free( old_tables ); 4629a: 2f08 movel %a0,%sp@- 4629c: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> 462a2: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 462a4: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 462a8: 4281 clrl %d1 462aa: 200e movel %fp,%d0 462ac: 0680 ffff fff4 addil #-12,%d0 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 462b2: 2a00 movel %d0,%d5 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 462b4: 260a movel %a2,%d3 462b6: 0683 0000 001c addil #28,%d3 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 462bc: 49f9 0004 98a0 lea 498a0 <_Chain_Get>,%a4 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 462c2: 47f9 0004 5880 lea 45880 <_Chain_Append>,%a3 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 462c8: e58c lsll #2,%d4 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 462ca: 322a 0012 movew %a2@(18),%d1 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 462ce: 2186 4800 movel %d6,%a0@(00000000,%d4:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 462d2: 2f2a 0014 movel %a2@(20),%sp@- 462d6: 2f01 movel %d1,%sp@- 462d8: 2f06 movel %d6,%sp@- 462da: 2f00 movel %d0,%sp@- 462dc: 4eb9 0004 98d4 jsr 498d4 <_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 ) { 462e2: 4fef 0010 lea %sp@(16),%sp 462e6: 6028 bras 46310 <_Objects_Extend_information+0x218> <== ALWAYS TAKEN the_object->id = _Objects_Build_id( 462e8: 2212 movel %a2@,%d1 462ea: 7c18 moveq #24,%d6 462ec: 7e1b moveq #27,%d7 462ee: 2040 moveal %d0,%a0 462f0: eda9 lsll %d6,%d1 462f2: 4286 clrl %d6 462f4: 3c2a 0004 movew %a2@(4),%d6 462f8: 08c1 0010 bset #16,%d1 462fc: efae lsll %d7,%d6 462fe: 8286 orl %d6,%d1 46300: 8282 orl %d2,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 46302: 5282 addql #1,%d2 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 46304: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 46308: 2f00 movel %d0,%sp@- 4630a: 2f03 movel %d3,%sp@- 4630c: 4e93 jsr %a3@ index++; 4630e: 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 ) { 46310: 2f05 movel %d5,%sp@- 46312: 4e94 jsr %a4@ 46314: 588f addql #4,%sp 46316: 4a80 tstl %d0 46318: 66ce bnes 462e8 <_Objects_Extend_information+0x1f0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4631a: 4280 clrl %d0 information->inactive = 4631c: 322a 0028 movew %a2@(40),%d1 46320: 326a 0012 moveaw %a2@(18),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 46324: 206a 002a moveal %a2@(42),%a0 information->inactive = 46328: d289 addl %a1,%d1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4632a: 3009 movew %a1,%d0 information->inactive = 4632c: 3541 0028 movew %d1,%a2@(40) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 46330: 2180 4800 movel %d0,%a0@(00000000,%d4:l) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 46334: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4633a: 4e5e unlk %fp 4633c: 4e75 rts ... 00046498 <_Objects_Get>: * always NULL. * * If the Id is valid but the object has not been created yet, then * the local_table entry will be NULL. */ index = id - information->minimum_id + 1; 46498: 7001 moveq #1,%d0 /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 4649a: 4281 clrl %d1 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 4649c: 4e56 0000 linkw %fp,#0 464a0: 206e 0008 moveal %fp@(8),%a0 * always NULL. * * If the Id is valid but the object has not been created yet, then * the local_table entry will be NULL. */ index = id - information->minimum_id + 1; 464a4: 90a8 0006 subl %a0@(6),%d0 464a8: d0ae 000c addl %fp@(12),%d0 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 464ac: 2f0a movel %a2,%sp@- 464ae: 246e 0010 moveal %fp@(16),%a2 /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 464b2: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 464b6: 2f02 movel %d2,%sp@- /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 464b8: b280 cmpl %d0,%d1 464ba: 6528 bcss 464e4 <_Objects_Get+0x4c> 464bc: 2239 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d1 464c2: 5281 addql #1,%d1 464c4: 23c1 0005 ba34 movel %d1,5ba34 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( (the_object = information->local_table[ index ]) != NULL ) { 464ca: 2068 0018 moveal %a0@(24),%a0 464ce: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 464d2: 6704 beqs 464d8 <_Objects_Get+0x40> *location = OBJECTS_LOCAL; 464d4: 4292 clrl %a2@ return the_object; 464d6: 6012 bras 464ea <_Objects_Get+0x52> <== ALWAYS TAKEN /* * Valid Id for this API, Class and Node but the object has not * been allocated yet. */ _Thread_Enable_dispatch(); 464d8: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> *location = OBJECTS_ERROR; 464de: 7201 moveq #1,%d1 464e0: 2481 movel %d1,%a2@ return NULL; 464e2: 6006 bras 464ea <_Objects_Get+0x52> <== ALWAYS TAKEN /* * Object Id is not within this API and Class on this node. So * it may be global in a multiprocessing system. But it is clearly * invalid on a single processor system. */ *location = OBJECTS_ERROR; 464e4: 7001 moveq #1,%d0 464e6: 4282 clrl %d2 464e8: 2480 movel %d0,%a2@ _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; #else return NULL; #endif } 464ea: 2002 movel %d2,%d0 464ec: 242e fff8 movel %fp@(-8),%d2 464f0: 246e fffc moveal %fp@(-4),%a2 464f4: 4e5e unlk %fp 464f6: 4e75 rts 000463f0 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 463f0: 4e56 0000 linkw %fp,#0 463f4: 2f03 movel %d3,%sp@- 463f6: 262e 0008 movel %fp@(8),%d3 463fa: 2f02 movel %d2,%sp@- 463fc: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46400: 672e beqs 46430 <_Objects_Get_information+0x40> /* * 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 ); 46402: 2f03 movel %d3,%sp@- 46404: 4eb9 0004 9da4 jsr 49da4 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 4640a: 588f addql #4,%sp 4640c: 4a80 tstl %d0 4640e: 6720 beqs 46430 <_Objects_Get_information+0x40> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46410: b082 cmpl %d2,%d0 46412: 651c bcss 46430 <_Objects_Get_information+0x40> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46414: 41f9 0005 b9ec lea 5b9ec <_Objects_Information_table>,%a0 4641a: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 4641e: 4a88 tstl %a0 46420: 670e beqs 46430 <_Objects_Get_information+0x40> <== ALWAYS TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46422: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46426: 670a beqs 46432 <_Objects_Get_information+0x42> <== 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 ) 46428: 2040 moveal %d0,%a0 4642a: 4a68 000e tstw %a0@(14) 4642e: 6602 bnes 46432 <_Objects_Get_information+0x42> 46430: 4280 clrl %d0 return NULL; #endif return info; } 46432: 242e fff8 movel %fp@(-8),%d2 46436: 262e fffc movel %fp@(-4),%d3 4643a: 4e5e unlk %fp 4643c: 4e75 rts ... 00046440 <_Objects_Get_isr_disable>: { Objects_Control *the_object; uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; 46440: 7001 moveq #1,%d0 Objects_Information *information, Objects_Id id, Objects_Locations *location, ISR_Level *level_p ) { 46442: 4e56 0000 linkw %fp,#0 46446: 226e 0008 moveal %fp@(8),%a1 Objects_Control *the_object; uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; 4644a: 90a9 0006 subl %a1@(6),%d0 4644e: d0ae 000c addl %fp@(12),%d0 Objects_Information *information, Objects_Id id, Objects_Locations *location, ISR_Level *level_p ) { 46452: 2f02 movel %d2,%sp@- 46454: 206e 0010 moveal %fp@(16),%a0 uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; _ISR_Disable( level ); 46458: 243c 0000 0700 movel #1792,%d2 4645e: 40c1 movew %sr,%d1 46460: 8481 orl %d1,%d2 46462: 46c2 movew %d2,%sr if ( information->maximum >= index ) { 46464: 4282 clrl %d2 46466: 3429 000e movew %a1@(14),%d2 4646a: b082 cmpl %d2,%d0 4646c: 621c bhis 4648a <_Objects_Get_isr_disable+0x4a> if ( (the_object = information->local_table[ index ]) != NULL ) { 4646e: 2269 0018 moveal %a1@(24),%a1 46472: 2031 0c00 movel %a1@(00000000,%d0:l:4),%d0 46476: 670a beqs 46482 <_Objects_Get_isr_disable+0x42> *location = OBJECTS_LOCAL; *level_p = level; 46478: 226e 0014 moveal %fp@(20),%a1 index = id - information->minimum_id + 1; _ISR_Disable( level ); if ( information->maximum >= index ) { if ( (the_object = information->local_table[ index ]) != NULL ) { *location = OBJECTS_LOCAL; 4647c: 4290 clrl %a0@ *level_p = level; 4647e: 2281 movel %d1,%a1@ return the_object; 46480: 6010 bras 46492 <_Objects_Get_isr_disable+0x52> <== ALWAYS TAKEN } _ISR_Enable( level ); 46482: 46c1 movew %d1,%sr *location = OBJECTS_ERROR; 46484: 7201 moveq #1,%d1 46486: 2081 movel %d1,%a0@ return NULL; 46488: 6008 bras 46492 <_Objects_Get_isr_disable+0x52> <== ALWAYS TAKEN } _ISR_Enable( level ); 4648a: 46c1 movew %d1,%sr *location = OBJECTS_ERROR; 4648c: 7001 moveq #1,%d0 4648e: 2080 movel %d0,%a0@ 46490: 4280 clrl %d0 _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; #else return NULL; #endif } 46492: 241f movel %sp@+,%d2 46494: 4e5e unlk %fp 46496: 4e75 rts 0004ff6c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 4ff6c: 4e56 ffdc linkw %fp,#-36 4ff70: 48d7 047c moveml %d2-%d6/%a2,%sp@ 4ff74: 262e 0008 movel %fp@(8),%d3 4ff78: 282e 000c movel %fp@(12),%d4 4ff7c: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 4ff80: 4a84 tstl %d4 4ff82: 6700 00a8 beqw 5002c <_Objects_Get_name_as_string+0xc0> return NULL; if ( name == NULL ) 4ff86: 4a82 tstl %d2 4ff88: 6700 00a4 beqw 5002e <_Objects_Get_name_as_string+0xc2> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4ff8c: 4a83 tstl %d3 4ff8e: 660a bnes 4ff9a <_Objects_Get_name_as_string+0x2e> 4ff90: 2079 0006 7186 moveal 67186 <_Thread_Executing>,%a0 4ff96: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 4ff9a: 2f03 movel %d3,%sp@- 4ff9c: 4eb9 0004 9d24 jsr 49d24 <_Objects_Get_information_id> if ( !information ) 4ffa2: 588f addql #4,%sp 4ffa4: 4a80 tstl %d0 4ffa6: 6700 0084 beqw 5002c <_Objects_Get_name_as_string+0xc0> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 4ffaa: 486e fffc pea %fp@(-4) 4ffae: 2f03 movel %d3,%sp@- 4ffb0: 2f00 movel %d0,%sp@- 4ffb2: 4eb9 0004 9df8 jsr 49df8 <_Objects_Get> switch ( location ) { 4ffb8: 4fef 000c lea %sp@(12),%sp 4ffbc: 4aae fffc tstl %fp@(-4) 4ffc0: 666a bnes 5002c <_Objects_Get_name_as_string+0xc0> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 4ffc2: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 4ffc4: 7218 moveq #24,%d1 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 4ffc6: 5384 subql #1,%d4 4ffc8: 43ee fff7 lea %fp@(-9),%a1 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 4ffcc: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 4ffd0: 2c00 movel %d0,%d6 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 4ffd2: 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; 4ffd4: 2600 movel %d0,%d3 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 4ffd6: e2ae lsrl %d1,%d6 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 4ffd8: e08d lsrl #8,%d5 lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 4ffda: 2042 moveal %d2,%a0 4ffdc: 4201 clrb %d1 uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; 4ffde: 1d40 fffa moveb %d0,%fp@(-6) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 4ffe2: 4243 clrw %d3 4ffe4: 4843 swap %d3 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 4ffe6: 4200 clrb %d0 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 4ffe8: 1d46 fff7 moveb %d6,%fp@(-9) lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 4ffec: 1d45 fff9 moveb %d5,%fp@(-7) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 4fff0: 1d43 fff8 moveb %d3,%fp@(-8) lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 4fff4: 1d40 fffb moveb %d0,%fp@(-5) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 4fff8: 6018 bras 50012 <_Objects_Get_name_as_string+0xa6> <== ALWAYS TAKEN *d = (isprint((unsigned char)*s)) ? *s : '*'; 4fffa: 2479 0006 5370 moveal 65370 <__ctype_ptr__>,%a2 50000: 1632 3801 moveb %a2@(00000001,%d3:l),%d3 50004: 49c3 extbl %d3 50006: 0283 0000 0097 andil #151,%d3 5000c: 6602 bnes 50010 <_Objects_Get_name_as_string+0xa4> 5000e: 702a moveq #42,%d0 50010: 10c0 moveb %d0,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 50012: b881 cmpl %d1,%d4 50014: 630c blss 50022 <_Objects_Get_name_as_string+0xb6> *d = (isprint((unsigned char)*s)) ? *s : '*'; 50016: 4283 clrl %d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 50018: 1031 1800 moveb %a1@(00000000,%d1:l),%d0 5001c: 5281 addql #1,%d1 *d = (isprint((unsigned char)*s)) ? *s : '*'; 5001e: 1600 moveb %d0,%d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 50020: 66d8 bnes 4fffa <_Objects_Get_name_as_string+0x8e> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 50022: 4210 clrb %a0@ _Thread_Enable_dispatch(); 50024: 4eb9 0004 a6ca jsr 4a6ca <_Thread_Enable_dispatch> return name; 5002a: 6002 bras 5002e <_Objects_Get_name_as_string+0xc2> <== ALWAYS TAKEN 5002c: 4282 clrl %d2 } return NULL; /* unreachable path */ } 5002e: 2002 movel %d2,%d0 50030: 4cee 047c ffdc moveml %fp@(-36),%d2-%d6/%a2 50036: 4e5e unlk %fp 50038: 4e75 rts ... 00052390 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 52390: 4e56 ffec linkw %fp,#-20 52394: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 52398: 266e 0008 moveal %fp@(8),%a3 5239c: 242e 000c movel %fp@(12),%d2 523a0: 246e 0010 moveal %fp@(16),%a2 523a4: 286e 0014 moveal %fp@(20),%a4 Objects_Control *object; Objects_Id next_id; if ( !information ) 523a8: 4a8b tstl %a3 523aa: 6746 beqs 523f2 <_Objects_Get_next+0x62> return NULL; if ( !location_p ) 523ac: 4a8a tstl %a2 523ae: 6742 beqs 523f2 <_Objects_Get_next+0x62> return NULL; if ( !next_id_p ) 523b0: 4a8c tstl %a4 523b2: 673e beqs 523f2 <_Objects_Get_next+0x62> return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 523b4: 4a42 tstw %d2 523b6: 6604 bnes 523bc <_Objects_Get_next+0x2c> next_id = information->minimum_id; 523b8: 242b 0006 movel %a3@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 523bc: 4bf9 0004 9df8 lea 49df8 <_Objects_Get>,%a5 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 523c2: 4281 clrl %d1 523c4: 4280 clrl %d0 523c6: 322b 000e movew %a3@(14),%d1 523ca: 3002 movew %d2,%d0 523cc: b081 cmpl %d1,%d0 523ce: 630c blss 523dc <_Objects_Get_next+0x4c> { *location_p = OBJECTS_ERROR; 523d0: 7401 moveq #1,%d2 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 523d2: 72ff moveq #-1,%d1 523d4: 4280 clrl %d0 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 523d6: 2482 movel %d2,%a2@ *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 523d8: 2881 movel %d1,%a4@ return 0; 523da: 6018 bras 523f4 <_Objects_Get_next+0x64> <== ALWAYS TAKEN *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 523dc: 2f0a movel %a2,%sp@- 523de: 2f02 movel %d2,%sp@- next_id++; 523e0: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 523e2: 2f0b movel %a3,%sp@- 523e4: 4e95 jsr %a5@ next_id++; } while (*location_p != OBJECTS_LOCAL); 523e6: 4fef 000c lea %sp@(12),%sp 523ea: 4a92 tstl %a2@ 523ec: 66d4 bnes 523c2 <_Objects_Get_next+0x32> *next_id_p = next_id; 523ee: 2882 movel %d2,%a4@ return object; 523f0: 6002 bras 523f4 <_Objects_Get_next+0x64> <== ALWAYS TAKEN final: *next_id_p = OBJECTS_ID_FINAL; return 0; 523f2: 4280 clrl %d0 } 523f4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 523fa: 4e5e unlk %fp 523fc: 4e75 rts ... 00052ed8 <_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; 52ed8: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 52eda: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 52edc: 4e56 0000 linkw %fp,#0 52ee0: 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; 52ee4: 90a8 0006 subl %a0@(6),%d0 52ee8: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 52eec: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 52ef0: 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 ) { 52ef4: b081 cmpl %d1,%d0 52ef6: 620e bhis 52f06 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 52ef8: 2068 0018 moveal %a0@(24),%a0 52efc: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 52f00: 6704 beqs 52f06 <_Objects_Get_no_protection+0x2e> <== ALWAYS TAKEN *location = OBJECTS_LOCAL; 52f02: 4291 clrl %a1@ return the_object; 52f04: 6006 bras 52f0c <_Objects_Get_no_protection+0x34> <== ALWAYS TAKEN /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 52f06: 7001 moveq #1,%d0 52f08: 2280 movel %d0,%a1@ 52f0a: 4280 clrl %d0 return NULL; } 52f0c: 4e5e unlk %fp 52f0e: 4e75 rts 00049e58 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 49e58: 4e56 fffc linkw %fp,#-4 49e5c: 222e 0008 movel %fp@(8),%d1 49e60: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 49e62: 4a81 tstl %d1 49e64: 660a bnes 49e70 <_Objects_Id_to_name+0x18> 49e66: 2079 0006 7186 moveal 67186 <_Thread_Executing>,%a0 49e6c: 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); 49e70: 7418 moveq #24,%d2 49e72: 2001 movel %d1,%d0 49e74: e4a8 lsrl %d2,%d0 49e76: 143c 0007 moveb #7,%d2 49e7a: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 49e7c: 143c 0003 moveb #3,%d2 49e80: 2040 moveal %d0,%a0 49e82: 5388 subql #1,%a0 49e84: b488 cmpl %a0,%d2 49e86: 6538 bcss 49ec0 <_Objects_Id_to_name+0x68> 49e88: 6040 bras 49eca <_Objects_Id_to_name+0x72> <== ALWAYS TAKEN if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 49e8a: 2001 movel %d1,%d0 49e8c: 741b moveq #27,%d2 49e8e: e4a8 lsrl %d2,%d0 49e90: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 49e94: 672a beqs 49ec0 <_Objects_Id_to_name+0x68> <== 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 ); 49e96: 486e fffc pea %fp@(-4) 49e9a: 2f01 movel %d1,%sp@- 49e9c: 2f00 movel %d0,%sp@- 49e9e: 4eb9 0004 9df8 jsr 49df8 <_Objects_Get> if ( !the_object ) 49ea4: 4fef 000c lea %sp@(12),%sp 49ea8: 4a80 tstl %d0 49eaa: 6714 beqs 49ec0 <_Objects_Id_to_name+0x68> return OBJECTS_INVALID_ID; *name = the_object->name; 49eac: 206e 000c moveal %fp@(12),%a0 49eb0: 2240 moveal %d0,%a1 49eb2: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 49eb6: 4eb9 0004 a6ca jsr 4a6ca <_Thread_Enable_dispatch> 49ebc: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 49ebe: 6002 bras 49ec2 <_Objects_Id_to_name+0x6a> <== ALWAYS TAKEN 49ec0: 7003 moveq #3,%d0 } 49ec2: 242e fff8 movel %fp@(-8),%d2 49ec6: 4e5e unlk %fp 49ec8: 4e75 rts the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 49eca: 41f9 0006 7084 lea 67084 <_Objects_Information_table>,%a0 49ed0: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 49ed4: 4a88 tstl %a0 49ed6: 66b2 bnes 49e8a <_Objects_Id_to_name+0x32> 49ed8: 60e6 bras 49ec0 <_Objects_Id_to_name+0x68> <== ALWAYS TAKEN ... 000464f8 <_Objects_Initialize_information>: information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 464f8: 41f9 0005 b9ec lea 5b9ec <_Objects_Information_table>,%a0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 464fe: 4e56 fff0 linkw %fp,#-16 46502: 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; 46506: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4650a: 48d7 003c moveml %d2-%d5,%sp@ 4650e: 222e 0014 movel %fp@(20),%d1 46512: 4285 clrl %d5 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46514: 2601 movel %d1,%d3 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46516: 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; 4651a: 4242 clrw %d2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4651c: 3a2e 001a movew %fp@(26),%d5 46520: 282e 0010 movel %fp@(16),%d4 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46524: d683 addl %d3,%d3 46526: 9783 subxl %d3,%d3 46528: 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; 4652a: 3142 0028 movew %d2,%a0@(40) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 4652e: 3142 000e movew %d2,%a0@(14) , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46532: 242e 0020 movel %fp@(32),%d2 #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 46536: 3144 0004 movew %d4,%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 = 4653a: 1143 0010 moveb %d3,%a0@(16) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 4653e: 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; 46542: 2388 4c00 movel %a0,%a1@(00000000,%d4: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; 46546: 0881 001f bclr #31,%d1 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 4654a: 2080 movel %d0,%a0@ information->the_class = the_class; information->size = size; information->local_table = 0; 4654c: 42a8 0018 clrl %a0@(24) information->inactive_per_block = 0; 46550: 42a8 002a clrl %a0@(42) information->object_blocks = 0; 46554: 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) { 46558: 4a03 tstb %d3 4655a: 6714 beqs 46570 <_Objects_Initialize_information+0x78> 4655c: 4a81 tstl %d1 4655e: 6610 bnes 46570 <_Objects_Initialize_information+0x78> _Internal_error_Occurred( 46560: 4878 0014 pea 14 46564: 4878 0001 pea 1 46568: 42a7 clrl %sp@- 4656a: 4eb9 0004 5f88 jsr 45f88 <_Internal_error_Occurred> /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46570: 7a18 moveq #24,%d5 46572: 4a81 tstl %d1 46574: 56c3 sne %d3 46576: eba8 lsll %d5,%d0 46578: 1a3c 001b moveb #27,%d5 4657c: 49c3 extbl %d3 4657e: 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; 46580: 43f9 0005 b1dc lea 5b1dc ,%a1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46586: ebac lsll %d5,%d4 46588: 08c0 0010 bset #16,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 4658c: 1a3c 0003 moveb #3,%d5 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46590: 8084 orl %d4,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46592: ca82 andl %d2,%d5 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 46594: 3141 0012 movew %d1,%a0@(18) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46598: 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; 4659a: 2149 0018 movel %a1,%a0@(24) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 4659e: 2140 0006 movel %d0,%a0@(6) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 465a2: 4a85 tstl %d5 465a4: 6604 bnes 465aa <_Objects_Initialize_information+0xb2> <== ALWAYS TAKEN 465a6: 2002 movel %d2,%d0 465a8: 6008 bras 465b2 <_Objects_Initialize_information+0xba> <== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 465aa: 2002 movel %d2,%d0 <== NOT EXECUTED 465ac: 5880 addql #4,%d0 <== NOT EXECUTED 465ae: 74fc moveq #-4,%d2 <== NOT EXECUTED 465b0: c082 andl %d2,%d0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 465b2: 43e8 0020 lea %a0@(32),%a1 465b6: 2149 001c movel %a1,%a0@(28) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 465ba: 43e8 001c lea %a0@(28),%a1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 465be: 3140 0032 movew %d0,%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; 465c2: 42a8 0020 clrl %a0@(32) the_chain->last = _Chain_Head(the_chain); 465c6: 2149 0024 movel %a1,%a0@(36) _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 465ca: 4a81 tstl %d1 465cc: 6712 beqs 465e0 <_Objects_Initialize_information+0xe8> /* * 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 ); 465ce: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 465d2: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 465d8: 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 ); 465da: 4ef9 0004 60f8 jmp 460f8 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 465e0: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 465e6: 4e5e unlk %fp 465e8: 4e75 rts ... 000465fc <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 465fc: 4e56 fff4 linkw %fp,#-12 46600: 226e 0008 moveal %fp@(8),%a1 46604: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46608: 242e 000c movel %fp@(12),%d2 4660c: 202e 0010 movel %fp@(16),%d0 46610: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 46614: 4a8a tstl %a2 46616: 6604 bnes 4661c <_Objects_Name_to_id_u32+0x20> 46618: 7002 moveq #2,%d0 4661a: 6048 bras 46664 <_Objects_Name_to_id_u32+0x68> <== ALWAYS TAKEN return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 4661c: 4a82 tstl %d2 4661e: 6742 beqs 46662 <_Objects_Name_to_id_u32+0x66> return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 46620: 3229 000e movew %a1@(14),%d1 46624: 673c beqs 46662 <_Objects_Name_to_id_u32+0x66> 46626: 4a80 tstl %d0 46628: 672c beqs 46656 <_Objects_Name_to_id_u32+0x5a> 4662a: 0c80 7fff ffff cmpil #2147483647,%d0 46630: 6724 beqs 46656 <_Objects_Name_to_id_u32+0x5a> 46632: 7601 moveq #1,%d3 46634: b680 cmpl %d0,%d3 46636: 662a bnes 46662 <_Objects_Name_to_id_u32+0x66> 46638: 601c bras 46656 <_Objects_Name_to_id_u32+0x5a> <== ALWAYS TAKEN if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { the_object = information->local_table[ index ]; 4663a: 2069 0018 moveal %a1@(24),%a0 4663e: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 46642: 5280 addql #1,%d0 the_object = information->local_table[ index ]; if ( !the_object ) 46644: 4a88 tstl %a0 46646: 6716 beqs 4665e <_Objects_Name_to_id_u32+0x62> continue; if ( name == the_object->name.name_u32 ) { 46648: b4a8 000c cmpl %a0@(12),%d2 4664c: 6610 bnes 4665e <_Objects_Name_to_id_u32+0x62> *id = the_object->id; 4664e: 24a8 0008 movel %a0@(8),%a2@ 46652: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 46654: 600e bras 46664 <_Objects_Name_to_id_u32+0x68> <== ALWAYS TAKEN search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 46656: 7001 moveq #1,%d0 46658: 0281 0000 ffff andil #65535,%d1 4665e: b280 cmpl %d0,%d1 46660: 64d8 bccs 4663a <_Objects_Name_to_id_u32+0x3e> 46662: 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 } 46664: 4cd7 040c moveml %sp@,%d2-%d3/%a2 46668: 4e5e unlk %fp 4666a: 4e75 rts 0004811c <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4811c: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 4811e: 4e56 fff0 linkw %fp,#-16 48122: 206e 0008 moveal %fp@(8),%a0 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 48126: 3028 0032 movew %a0@(50),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 4812a: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4812e: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 48132: 2f00 movel %d0,%sp@- 48134: 2f0a movel %a2,%sp@- 48136: 4eb9 0004 e8ac jsr 4e8ac d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4813c: 508f addql #8,%sp 4813e: 7201 moveq #1,%d1 48140: 1812 moveb %a2@,%d4 48142: b280 cmpl %d0,%d1 48144: 644a bccs 48190 <_Objects_Set_name+0x74> 48146: 7602 moveq #2,%d3 48148: 142a 0001 moveb %a2@(1),%d2 4814c: 49c2 extbl %d2 4814e: 4842 swap %d2 48150: 4242 clrw %d2 48152: b680 cmpl %d0,%d3 48154: 643e bccs 48194 <_Objects_Set_name+0x78> 48156: 163c 0003 moveb #3,%d3 4815a: 122a 0002 moveb %a2@(2),%d1 4815e: 49c1 extbl %d1 48160: e189 lsll #8,%d1 48162: b680 cmpl %d0,%d3 48164: 6506 bcss 4816c <_Objects_Set_name+0x50> 48166: 163c 0020 moveb #32,%d3 4816a: 6006 bras 48172 <_Objects_Set_name+0x56> <== ALWAYS TAKEN 4816c: 162a 0003 moveb %a2@(3),%d3 48170: 49c3 extbl %d3 48172: 7018 moveq #24,%d0 48174: e1ac lsll %d0,%d4 48176: 206e 000c moveal %fp@(12),%a0 4817a: 8484 orl %d4,%d2 ); } return true; } 4817c: 7001 moveq #1,%d0 d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4817e: 8481 orl %d1,%d2 48180: 8483 orl %d3,%d2 48182: 2142 000c movel %d2,%a0@(12) ); } return true; } 48186: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4818c: 4e5e unlk %fp 4818e: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 48190: 7420 moveq #32,%d2 48192: 4842 swap %d2 48194: 223c 0000 2000 movel #8192,%d1 4819a: 7620 moveq #32,%d3 4819c: 60d4 bras 48172 <_Objects_Set_name+0x56> <== ALWAYS TAKEN ... 0004666c <_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) / 4666c: 4280 clrl %d0 4666e: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 46670: 4e56 ffec linkw %fp,#-20 46674: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 46678: 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 ); 4667c: 4283 clrl %d3 block_count = (information->maximum - index_base) / 4667e: 4284 clrl %d4 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 46680: 362a 0008 movew %a2@(8),%d3 block_count = (information->maximum - index_base) / 46684: 302a 000e movew %a2@(14),%d0 46688: 322a 0012 movew %a2@(18),%d1 4668c: 9083 subl %d3,%d0 4668e: 4c41 0000 remul %d1,%d0,%d0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 46692: 6070 bras 46704 <_Objects_Shrink_information+0x98> <== ALWAYS TAKEN 46694: 2404 movel %d4,%d2 46696: 5284 addql #1,%d4 46698: e58a lsll #2,%d2 if ( information->inactive_per_block[ block ] == 4669a: 206a 002a moveal %a2@(42),%a0 4669e: b2b0 2800 cmpl %a0@(00000000,%d2:l),%d1 466a2: 665e bnes 46702 <_Objects_Shrink_information+0x96> information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 466a4: 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 ); 466a8: 47f9 0004 9878 lea 49878 <_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 ); 466ae: 4280 clrl %d0 466b0: 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; 466b4: 2810 movel %a0@,%d4 if ((index >= index_base) && 466b6: b680 cmpl %d0,%d3 466b8: 6212 bhis 466cc <_Objects_Shrink_information+0x60> (index < (index_base + information->allocation_size))) { 466ba: 4281 clrl %d1 466bc: 322a 0012 movew %a2@(18),%d1 466c0: d283 addl %d3,%d1 466c2: b280 cmpl %d0,%d1 466c4: 6306 blss 466cc <_Objects_Shrink_information+0x60> _Chain_Extract( &extract_me->Node ); 466c6: 2f08 movel %a0,%sp@- 466c8: 4e93 jsr %a3@ 466ca: 588f addql #4,%sp } } while ( the_object ); 466cc: 2044 moveal %d4,%a0 466ce: 4a84 tstl %d4 466d0: 66dc bnes 466ae <_Objects_Shrink_information+0x42> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 466d2: 206a 002e moveal %a2@(46),%a0 466d6: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 466da: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> information->object_blocks[ block ] = NULL; 466e0: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 466e4: 588f addql #4,%sp * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 466e6: 226a 002a moveal %a2@(42),%a1 information->inactive -= information->allocation_size; 466ea: 302a 0028 movew %a2@(40),%d0 466ee: 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; 466f2: 42b1 2800 clrl %a1@(00000000,%d2:l) information->inactive -= information->allocation_size; 466f6: 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; 466f8: 42b0 2800 clrl %a0@(00000000,%d2:l) information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 466fc: 3540 0028 movew %d0,%a2@(40) return; 46700: 6006 bras 46708 <_Objects_Shrink_information+0x9c> <== ALWAYS TAKEN } index_base += information->allocation_size; 46702: d681 addl %d1,%d3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 46704: b084 cmpl %d4,%d0 46706: 628c bhis 46694 <_Objects_Shrink_information+0x28> return; } index_base += information->allocation_size; } } 46708: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4670e: 4e5e unlk %fp 46710: 4e75 rts ... 00063664 <_Protected_heap_Get_information>: bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 63664: 4e56 0000 linkw %fp,#0 63668: 2f03 movel %d3,%sp@- 6366a: 262e 000c movel %fp@(12),%d3 6366e: 2f02 movel %d2,%sp@- 63670: 242e 0008 movel %fp@(8),%d2 if ( !the_heap ) 63674: 672e beqs 636a4 <_Protected_heap_Get_information+0x40> return false; if ( !the_info ) 63676: 4a83 tstl %d3 63678: 672a beqs 636a4 <_Protected_heap_Get_information+0x40> return false; _RTEMS_Lock_allocator(); 6367a: 2f39 0009 a87a movel 9a87a <_RTEMS_Allocator_Mutex>,%sp@- 63680: 4eb9 0004 ab70 jsr 4ab70 <_API_Mutex_Lock> _Heap_Get_information( the_heap, the_info ); 63686: 2f03 movel %d3,%sp@- 63688: 2f02 movel %d2,%sp@- 6368a: 4eb9 0007 0e94 jsr 70e94 <_Heap_Get_information> _RTEMS_Unlock_allocator(); 63690: 2f39 0009 a87a movel 9a87a <_RTEMS_Allocator_Mutex>,%sp@- 63696: 4eb9 0004 abd0 jsr 4abd0 <_API_Mutex_Unlock> return true; 6369c: 4fef 0010 lea %sp@(16),%sp if ( !the_info ) return false; _RTEMS_Lock_allocator(); _Heap_Get_information( the_heap, the_info ); _RTEMS_Unlock_allocator(); 636a0: 7001 moveq #1,%d0 return true; 636a2: 6002 bras 636a6 <_Protected_heap_Get_information+0x42> <== ALWAYS TAKEN 636a4: 4200 clrb %d0 } 636a6: 242e fff8 movel %fp@(-8),%d2 636aa: 262e fffc movel %fp@(-4),%d3 636ae: 4e5e unlk %fp 636b0: 4e75 rts ... 00049790 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 49790: 4e56 0000 linkw %fp,#0 void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { 49794: 2039 0005 baee movel 5baee <_Thread_Executing>,%d0 void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4979a: 2f0a movel %a2,%sp@- 4979c: 246e 000c moveal %fp@(12),%a2 void (*dtor)(void *); void *value; dtor = tvp->dtor; 497a0: 206a 0010 moveal %a2@(16),%a0 if (_Thread_Is_executing(the_thread)) { 497a4: b0ae 0008 cmpl %fp@(8),%d0 497a8: 660c bnes 497b6 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x26> value = *tvp->ptr; 497aa: 226a 0004 moveal %a2@(4),%a1 497ae: 2011 movel %a1@,%d0 *tvp->ptr = tvp->gval; 497b0: 22aa 0008 movel %a2@(8),%a1@ 497b4: 6004 bras 497ba <_RTEMS_Tasks_Invoke_task_variable_dtor+0x2a> <== ALWAYS TAKEN } else { value = tvp->tval; 497b6: 202a 000c movel %a2@(12),%d0 } if ( dtor ) 497ba: 4a88 tstl %a0 497bc: 6706 beqs 497c4 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x34> (*dtor)(value); 497be: 2f00 movel %d0,%sp@- 497c0: 4e90 jsr %a0@ 497c2: 588f addql #4,%sp _Workspace_Free(tvp); 497c4: 2d4a 0008 movel %a2,%fp@(8) } 497c8: 246e fffc moveal %fp@(-4),%a2 497cc: 4e5e unlk %fp } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 497ce: 4ef9 0004 7ddc jmp 47ddc <_Workspace_Free> 0004971a <_RTEMS_tasks_Create_extension>: bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 4971a: 4e56 0000 linkw %fp,#0 4971e: 2f0a movel %a2,%sp@- 49720: 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() ) 49724: 4a39 0005 a2d4 tstb 5a2d4 4972a: 6604 bnes 49730 <_RTEMS_tasks_Create_extension+0x16> 4972c: 701e moveq #30,%d0 4972e: 6002 bras 49732 <_RTEMS_tasks_Create_extension+0x18> <== ALWAYS TAKEN 49730: 705e moveq #94,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 49732: 2f00 movel %d0,%sp@- 49734: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> if ( !api ) 4973a: 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 ); 4973c: 2040 moveal %d0,%a0 if ( !api ) 4973e: 4a80 tstl %d0 49740: 6604 bnes 49746 <_RTEMS_tasks_Create_extension+0x2c> 49742: 4200 clrb %d0 49744: 6042 bras 49788 <_RTEMS_tasks_Create_extension+0x6e> <== 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; 49746: 42aa 0118 clrl %a2@(280) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 4974a: 4200 clrb %d0 api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4974c: 2548 0108 movel %a0,%a2@(264) 49750: 1140 0008 moveb %d0,%a0@(8) api->pending_events = EVENT_SETS_NONE_PENDING; 49754: 4290 clrl %a0@ api->event_condition = 0; 49756: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4975a: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4975e: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 49762: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 49766: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4976a: 42a8 001a clrl %a0@(26) _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { 4976e: 4a39 0005 a2d4 tstb 5a2d4 49774: 6710 beqs 49786 <_RTEMS_tasks_Create_extension+0x6c> 49776: 41e8 001e lea %a0@(30),%a0 4977a: 4280 clrl %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4977c: 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++) 4977e: 5280 addql #1,%d0 49780: 7210 moveq #16,%d1 49782: b280 cmpl %d0,%d1 49784: 66f6 bnes 4977c <_RTEMS_tasks_Create_extension+0x62> 49786: 7001 moveq #1,%d0 api->Notepads[i] = 0; } return true; } 49788: 246e fffc moveal %fp@(-4),%a2 4978c: 4e5e unlk %fp 4978e: 4e75 rts 000496d4 <_RTEMS_tasks_Delete_extension>: void _RTEMS_tasks_Delete_extension( Thread_Control *executing, Thread_Control *deleted ) { 496d4: 4e56 fff4 linkw %fp,#-12 496d8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 496dc: 246e 000c moveal %fp@(12),%a2 tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { next = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 496e0: 47f9 0004 9790 lea 49790 <_RTEMS_Tasks_Invoke_task_variable_dtor>,%a3 /* * Free per task variable memory */ tvp = deleted->task_variables; 496e6: 206a 0118 moveal %a2@(280),%a0 deleted->task_variables = NULL; 496ea: 42aa 0118 clrl %a2@(280) while (tvp) { 496ee: 600c bras 496fc <_RTEMS_tasks_Delete_extension+0x28> <== ALWAYS TAKEN next = (rtems_task_variable_t *)tvp->next; 496f0: 2410 movel %a0@,%d2 _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 496f2: 2f08 movel %a0,%sp@- 496f4: 2f0a movel %a2,%sp@- 496f6: 4e93 jsr %a3@ 496f8: 508f addql #8,%sp 496fa: 2042 moveal %d2,%a0 * Free per task variable memory */ tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { 496fc: 4a88 tstl %a0 496fe: 66f0 bnes 496f0 <_RTEMS_tasks_Delete_extension+0x1c> /* * Free API specific memory */ (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] ); 49700: 2f2a 0108 movel %a2@(264),%sp@- 49704: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL; 4970a: 588f addql #4,%sp 4970c: 42aa 0108 clrl %a2@(264) } 49710: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 49716: 4e5e unlk %fp 49718: 4e75 rts 000452dc <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 452dc: 4e56 ffe4 linkw %fp,#-28 452e0: 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; 452e4: 2479 0005 a2fa moveal 5a2fa ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 452ea: 2839 0005 a2f6 movel 5a2f6 ,%d4 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 452f0: 4a8a tstl %a2 452f2: 6762 beqs 45356 <_RTEMS_tasks_Initialize_user_tasks_body+0x7a> /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 452f4: 260e movel %fp,%d3 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 452f6: 4282 clrl %d2 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 452f8: 5983 subql #4,%d3 452fa: 49f9 0004 50e4 lea 450e4 ,%a4 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 45300: 47f9 0004 5360 lea 45360 ,%a3 45306: 604a bras 45352 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> <== ALWAYS TAKEN /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 45308: 2f03 movel %d3,%sp@- 4530a: 2f2a 000c movel %a2@(12),%sp@- 4530e: 2f2a 0014 movel %a2@(20),%sp@- 45312: 2f2a 0004 movel %a2@(4),%sp@- 45316: 2f2a 0008 movel %a2@(8),%sp@- 4531a: 2f12 movel %a2@,%sp@- 4531c: 4e94 jsr %a4@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 4531e: 4fef 0018 lea %sp@(24),%sp 45322: 4a80 tstl %d0 45324: 661a bnes 45340 <_RTEMS_tasks_Initialize_user_tasks_body+0x64> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 45326: 2f2a 0018 movel %a2@(24),%sp@- 4532a: 2f2a 0010 movel %a2@(16),%sp@- 4532e: 45ea 001c lea %a2@(28),%a2 45332: 2f2e fffc movel %fp@(-4),%sp@- 45336: 4e93 jsr %a3@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 45338: 4fef 000c lea %sp@(12),%sp 4533c: 4a80 tstl %d0 4533e: 6710 beqs 45350 <_RTEMS_tasks_Initialize_user_tasks_body+0x74> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 45340: 2f00 movel %d0,%sp@- 45342: 4878 0001 pea 1 45346: 4878 0001 pea 1 4534a: 4eb9 0004 5f88 jsr 45f88 <_Internal_error_Occurred> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 45350: 5282 addql #1,%d2 45352: b882 cmpl %d2,%d4 45354: 62b2 bhis 45308 <_RTEMS_tasks_Initialize_user_tasks_body+0x2c> user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 45356: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 4535c: 4e5e unlk %fp 4535e: 4e75 rts 00049662 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49662: 4e56 ffec linkw %fp,#-20 49666: 206e 0008 moveal %fp@(8),%a0 4966a: 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 ]; 4966e: 2468 0108 moveal %a0@(264),%a2 if ( !api ) 49672: 4a8a tstl %a2 49674: 6754 beqs 496ca <_RTEMS_tasks_Post_switch_extension+0x68> <== ALWAYS TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 49676: 203c 0000 0700 movel #1792,%d0 4967c: 40c1 movew %sr,%d1 4967e: 8081 orl %d1,%d0 49680: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 49682: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 49686: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4968a: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4968c: 4a83 tstl %d3 4968e: 673a beqs 496ca <_RTEMS_tasks_Post_switch_extension+0x68> <== ALWAYS TAKEN return; asr->nest_level += 1; 49690: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49694: 240e movel %fp,%d2 49696: 5982 subql #4,%d2 49698: 47f9 0004 b0a4 lea 4b0a4 ,%a3 4969e: 2f02 movel %d2,%sp@- 496a0: 2f3c 0000 ffff movel #65535,%sp@- 496a6: 2f2a 000e movel %a2@(14),%sp@- 496aa: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 496ac: 2f03 movel %d3,%sp@- 496ae: 206a 000a moveal %a2@(10),%a0 496b2: 4e90 jsr %a0@ asr->nest_level -= 1; 496b4: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 496b8: 2f02 movel %d2,%sp@- 496ba: 2f3c 0000 ffff movel #65535,%sp@- 496c0: 2f2e fffc movel %fp@(-4),%sp@- 496c4: 4e93 jsr %a3@ 496c6: 4fef 001c lea %sp@(28),%sp } 496ca: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 496d0: 4e5e unlk %fp 496d2: 4e75 rts 000495c2 <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 495c2: 4e56 0000 linkw %fp,#0 495c6: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 495ca: 2068 0118 moveal %a0@(280),%a0 while (tvp) { 495ce: 600e bras 495de <_RTEMS_tasks_Switch_extension+0x1c> <== ALWAYS TAKEN tvp->tval = *tvp->ptr; 495d0: 2268 0004 moveal %a0@(4),%a1 495d4: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 495d8: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 495dc: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 495de: 4a88 tstl %a0 495e0: 66ee bnes 495d0 <_RTEMS_tasks_Switch_extension+0xe> tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 495e2: 206e 000c moveal %fp@(12),%a0 495e6: 2068 0118 moveal %a0@(280),%a0 while (tvp) { 495ea: 600e bras 495fa <_RTEMS_tasks_Switch_extension+0x38> <== ALWAYS TAKEN tvp->gval = *tvp->ptr; 495ec: 2268 0004 moveal %a0@(4),%a1 495f0: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 495f4: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 495f8: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 495fa: 4a88 tstl %a0 495fc: 66ee bnes 495ec <_RTEMS_tasks_Switch_extension+0x2a> tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 495fe: 4e5e unlk %fp 49600: 4e75 rts 000706cc <_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 ) { 706cc: 4e56 ffcc linkw %fp,#-52 706d0: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 706d4: 280e movel %fp,%d4 706d6: 5184 subql #8,%d4 _Timestamp_Subtract( 706d8: 45f9 0004 cf00 lea 4cf00 <_Timespec_Subtract>,%a2 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 ) { 706de: 266e 0008 moveal %fp@(8),%a3 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 706e2: 2f04 movel %d4,%sp@- ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 706e4: 286b 0040 moveal %a3@(64),%a4 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 706e8: 4eb9 0006 3084 jsr 63084 <_TOD_Get_uptime> _Timestamp_Subtract( 706ee: 2f2e 000c movel %fp@(12),%sp@- 706f2: 2f04 movel %d4,%sp@- 706f4: 486b 004c pea %a3@(76) 706f8: 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) { 706fa: 4fef 0010 lea %sp@(16),%sp #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 706fe: 202c 0082 movel %a4@(130),%d0 70702: 222c 0086 movel %a4@(134),%d1 70706: 2d40 fff0 movel %d0,%fp@(-16) 7070a: 2d41 fff4 movel %d1,%fp@(-12) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7070e: b9f9 0009 a882 cmpal 9a882 <_Thread_Executing>,%a4 70714: 6652 bnes 70768 <_Rate_monotonic_Get_status+0x9c> Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 70716: 2a0e movel %fp,%d5 70718: 0685 ffff ffe8 addil #-24,%d5 &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7071e: 240e movel %fp,%d2 70720: 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)) 70726: 260b movel %a3,%d3 70728: 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( 7072e: 2f05 movel %d5,%sp@- 70730: 2f04 movel %d4,%sp@- 70732: 4879 0009 a88a pea 9a88a <_Thread_Time_of_last_context_switch> 70738: 4e92 jsr %a2@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7073a: 2f05 movel %d5,%sp@- 7073c: 2f02 movel %d2,%sp@- 7073e: 4eb9 0004 cec0 jsr 4cec0 <_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)) 70744: 2f03 movel %d3,%sp@- 70746: 2f02 movel %d2,%sp@- 70748: 4eb9 0007 1044 jsr 71044 <_Timespec_Less_than> 7074e: 4fef 001c lea %sp@(28),%sp 70752: 4a00 tstb %d0 70754: 6704 beqs 7075a <_Rate_monotonic_Get_status+0x8e> 70756: 4200 clrb %d0 70758: 6010 bras 7076a <_Rate_monotonic_Get_status+0x9e> <== ALWAYS TAKEN return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 7075a: 2f2e 0010 movel %fp@(16),%sp@- 7075e: 2f02 movel %d2,%sp@- 70760: 2f03 movel %d3,%sp@- 70762: 4e92 jsr %a2@ 70764: 4fef 000c lea %sp@(12),%sp 70768: 7001 moveq #1,%d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7076a: 4cee 1c3c ffcc moveml %fp@(-52),%d2-%d5/%a2-%a4 70770: 4e5e unlk %fp 70772: 4e75 rts 000709dc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 709dc: 4e56 fffc linkw %fp,#-4 709e0: 2f0a movel %a2,%sp@- 709e2: 486e fffc pea %fp@(-4) 709e6: 2f2e 0008 movel %fp@(8),%sp@- 709ea: 4879 0009 abf2 pea 9abf2 <_Rate_monotonic_Information> 709f0: 4eb9 0004 ba10 jsr 4ba10 <_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 ) { 709f6: 4fef 000c lea %sp@(12),%sp 709fa: 2440 moveal %d0,%a2 709fc: 4aae fffc tstl %fp@(-4) 70a00: 6600 0096 bnew 70a98 <_Rate_monotonic_Timeout+0xbc> <== ALWAYS TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 70a04: 206a 0040 moveal %a2@(64),%a0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 70a08: 2028 0010 movel %a0@(16),%d0 70a0c: 0280 0000 4000 andil #16384,%d0 70a12: 673c beqs 70a50 <_Rate_monotonic_Timeout+0x74> the_thread->Wait.id == the_period->Object.id ) { 70a14: 202a 0008 movel %a2@(8),%d0 70a18: b0a8 0020 cmpl %a0@(32),%d0 70a1c: 6632 bnes 70a50 <_Rate_monotonic_Timeout+0x74> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 70a1e: 2f3c 1003 fff8 movel #268697592,%sp@- 70a24: 2f08 movel %a0,%sp@- 70a26: 4eb9 0004 beec jsr 4beec <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 70a2c: 2f0a movel %a2,%sp@- 70a2e: 4eb9 0007 0654 jsr 70654 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 70a34: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 70a3a: 486a 0010 pea %a2@(16) 70a3e: 4879 0009 a8a0 pea 9a8a0 <_Watchdog_Ticks_chain> 70a44: 4eb9 0004 d1b0 jsr 4d1b0 <_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 ) && 70a4a: 4fef 0014 lea %sp@(20),%sp 70a4e: 603a bras 70a8a <_Rate_monotonic_Timeout+0xae> <== ALWAYS TAKEN _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 ) { 70a50: 7001 moveq #1,%d0 70a52: b0aa 0038 cmpl %a2@(56),%d0 70a56: 662c bnes 70a84 <_Rate_monotonic_Timeout+0xa8> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 70a58: 103c 0003 moveb #3,%d0 70a5c: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 70a60: 2f0a movel %a2,%sp@- 70a62: 4eb9 0007 0654 jsr 70654 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 70a68: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 70a6e: 486a 0010 pea %a2@(16) 70a72: 4879 0009 a8a0 pea 9a8a0 <_Watchdog_Ticks_chain> 70a78: 4eb9 0004 d1b0 jsr 4d1b0 <_Watchdog_Insert> 70a7e: 4fef 000c lea %sp@(12),%sp 70a82: 6006 bras 70a8a <_Rate_monotonic_Timeout+0xae> <== ALWAYS TAKEN _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 70a84: 7004 moveq #4,%d0 70a86: 2540 0038 movel %d0,%a2@(56) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 70a8a: 2039 0009 a7c8 movel 9a7c8 <_Thread_Dispatch_disable_level>,%d0 70a90: 5380 subql #1,%d0 70a92: 23c0 0009 a7c8 movel %d0,9a7c8 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 70a98: 246e fff8 moveal %fp@(-8),%a2 70a9c: 4e5e unlk %fp 70a9e: 4e75 rts 00056368 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 56368: 4e56 ffe4 linkw %fp,#-28 5636c: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 56372: 5280 addql #1,%d0 56374: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 56378: 266e 0008 moveal %fp@(8),%a3 5637c: 23c0 0007 38e0 movel %d0,738e0 <_Thread_Dispatch_disable_level> * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 56382: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 56388: 240b movel %a3,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 5638a: 280b movel %a3,%d4 5638c: 0682 0000 0010 addil #16,%d2 56392: 0684 0000 0068 addil #104,%d4 56398: 4bf9 0005 2198 lea 52198 <_Heap_Allocate_aligned_with_boundary>,%a5 if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 5639e: 49f9 0005 69fc lea 569fc <_Thread_queue_Extract>,%a4 * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 563a4: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> 563aa: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 563ac: 263c 0005 6b00 movel #355072,%d3 563b2: 2f02 movel %d2,%sp@- 563b4: 2043 moveal %d3,%a0 563b6: 4e90 jsr %a0@ if ( the_thread == NULL ) 563b8: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 563ba: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 563bc: 4a80 tstl %d0 563be: 672c beqs 563ec <_Region_Process_queue+0x84> 563c0: 42a7 clrl %sp@- 563c2: 42a7 clrl %sp@- 563c4: 2f2a 0024 movel %a2@(36),%sp@- 563c8: 2f04 movel %d4,%sp@- 563ca: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 563cc: 4fef 0010 lea %sp@(16),%sp 563d0: 4a80 tstl %d0 563d2: 6718 beqs 563ec <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 563d4: 206a 0028 moveal %a2@(40),%a0 the_region->number_of_used_blocks += 1; 563d8: 52ab 0064 addql #1,%a3@(100) ); if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; 563dc: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 563de: 2f0a movel %a2,%sp@- 563e0: 2f02 movel %d2,%sp@- 563e2: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 563e4: 508f addql #8,%sp break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; 563e6: 42aa 0034 clrl %a2@(52) } 563ea: 60c6 bras 563b2 <_Region_Process_queue+0x4a> <== ALWAYS TAKEN _Thread_Enable_dispatch(); } 563ec: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 563f2: 4e5e unlk %fp *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 563f4: 4ef9 0005 376a jmp 5376a <_Thread_Enable_dispatch> ... 00049a08 <_TOD_Get>: /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 49a08: 203c 0000 0700 movel #1792,%d0 */ void _TOD_Get( struct timespec *time ) { 49a0e: 4e56 fff0 linkw %fp,#-16 49a12: 2f02 movel %d2,%sp@- /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 49a14: 40c2 movew %sr,%d2 49a16: 8082 orl %d2,%d0 49a18: 46c0 movew %d0,%sr now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 49a1a: 2079 0005 bbba moveal 5bbba <_Watchdog_Nanoseconds_since_tick_handler>,%a0 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 49a20: 2039 0005 bac6 movel 5bac6 <_TOD_Now>,%d0 49a26: 2239 0005 baca movel 5baca <_TOD_Now+0x4>,%d1 49a2c: 2d40 fff0 movel %d0,%fp@(-16) 49a30: 2d41 fff4 movel %d1,%fp@(-12) if ( _Watchdog_Nanoseconds_since_tick_handler ) 49a34: 4a88 tstl %a0 49a36: 6604 bnes 49a3c <_TOD_Get+0x34> 49a38: 4280 clrl %d0 49a3a: 6002 bras 49a3e <_TOD_Get+0x36> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 49a3c: 4e90 jsr %a0@ _ISR_Enable( level ); 49a3e: 46c2 movew %d2,%sr _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &now, &offset ); 49a40: 486e fff8 pea %fp@(-8) 49a44: 486e fff0 pea %fp@(-16) now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 49a48: 2d40 fffc movel %d0,%fp@(-4) 49a4c: 42ae fff8 clrl %fp@(-8) _Timestamp_Add_to( &now, &offset ); 49a50: 4eb9 0004 7888 jsr 47888 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 49a56: 206e 0008 moveal %fp@(8),%a0 49a5a: 508f addql #8,%sp 49a5c: 202e fff0 movel %fp@(-16),%d0 49a60: 222e fff4 movel %fp@(-12),%d1 } 49a64: 242e ffec movel %fp@(-20),%d2 49a68: 4e5e unlk %fp nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &now, &offset ); _Timestamp_To_timespec( &now, time ); 49a6a: 2080 movel %d0,%a0@ 49a6c: 2141 0004 movel %d1,%a0@(4) } 49a70: 4e75 rts ... 00049a74 <_TOD_Get_uptime>: /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 49a74: 203c 0000 0700 movel #1792,%d0 */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 49a7a: 4e56 fff0 linkw %fp,#-16 49a7e: 2f02 movel %d2,%sp@- /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 49a80: 40c2 movew %sr,%d2 49a82: 8082 orl %d2,%d0 49a84: 46c0 movew %d0,%sr up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 49a86: 2079 0005 bbba moveal 5bbba <_Watchdog_Nanoseconds_since_tick_handler>,%a0 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 49a8c: 2039 0005 bab2 movel 5bab2 <_TOD_Uptime>,%d0 49a92: 2239 0005 bab6 movel 5bab6 <_TOD_Uptime+0x4>,%d1 49a98: 2d40 fff0 movel %d0,%fp@(-16) 49a9c: 2d41 fff4 movel %d1,%fp@(-12) if ( _Watchdog_Nanoseconds_since_tick_handler ) 49aa0: 4a88 tstl %a0 49aa2: 6604 bnes 49aa8 <_TOD_Get_uptime+0x34> 49aa4: 4280 clrl %d0 49aa6: 6002 bras 49aaa <_TOD_Get_uptime+0x36> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 49aa8: 4e90 jsr %a0@ _ISR_Enable( level ); 49aaa: 46c2 movew %d2,%sr _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &up, &offset ); 49aac: 486e fff8 pea %fp@(-8) 49ab0: 486e fff0 pea %fp@(-16) up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 49ab4: 2d40 fffc movel %d0,%fp@(-4) 49ab8: 42ae fff8 clrl %fp@(-8) _Timestamp_Add_to( &up, &offset ); 49abc: 4eb9 0004 7888 jsr 47888 <_Timespec_Add_to> *uptime = up; 49ac2: 206e 0008 moveal %fp@(8),%a0 49ac6: 508f addql #8,%sp 49ac8: 202e fff0 movel %fp@(-16),%d0 49acc: 222e fff4 movel %fp@(-12),%d1 } 49ad0: 242e ffec movel %fp@(-20),%d2 49ad4: 4e5e unlk %fp nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &up, &offset ); *uptime = up; 49ad6: 2080 movel %d0,%a0@ 49ad8: 2141 0004 movel %d1,%a0@(4) } 49adc: 4e75 rts ... 00046e50 <_TOD_Set>: */ void _TOD_Set( const struct timespec *time ) { 46e50: 4e56 0000 linkw %fp,#0 46e54: 2039 0006 58a4 movel 658a4 <_Thread_Dispatch_disable_level>,%d0 46e5a: 5280 addql #1,%d0 46e5c: 2f0a movel %a2,%sp@- 46e5e: 246e 0008 moveal %fp@(8),%a2 46e62: 23c0 0006 58a4 movel %d0,658a4 <_Thread_Dispatch_disable_level> long seconds; _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds = _TOD_Seconds_since_epoch(); 46e68: 2039 0006 5936 movel 65936 <_TOD_Now>,%d0 46e6e: 41f9 0004 90a4 lea 490a4 <_Watchdog_Adjust>,%a0 if ( time->tv_sec < seconds ) 46e74: 2212 movel %a2@,%d1 46e76: b081 cmpl %d1,%d0 46e78: 6f0a bles 46e84 <_TOD_Set+0x34> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 46e7a: 9081 subl %d1,%d0 46e7c: 2f00 movel %d0,%sp@- 46e7e: 4878 0001 pea 1 46e82: 6006 bras 46e8a <_TOD_Set+0x3a> <== ALWAYS TAKEN 46e84: 9280 subl %d0,%d1 46e86: 2f01 movel %d1,%sp@- 46e88: 42a7 clrl %sp@- 46e8a: 4879 0006 5970 pea 65970 <_Watchdog_Seconds_chain> 46e90: 4e90 jsr %a0@ _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds - time->tv_sec ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); 46e92: 23d2 0006 5936 movel %a2@,65936 <_TOD_Now> 46e98: 588a addql #4,%a2 46e9a: 4fef 000c lea %sp@(12),%sp 46e9e: 23d2 0006 593a movel %a2@,6593a <_TOD_Now+0x4> _TOD_Is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 46ea4: 246e fffc moveal %fp@(-4),%a2 46ea8: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); _TOD_Is_set = true; 46eaa: 7001 moveq #1,%d0 46eac: 13c0 0006 58b8 moveb %d0,658b8 <_TOD_Is_set> _TOD_Activate(); _Thread_Enable_dispatch(); 46eb2: 4ef9 0004 7fa6 jmp 47fa6 <_Thread_Enable_dispatch> 00045c3c <_TOD_Tickle_ticks>: * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 45c3c: 4e56 ffe8 linkw %fp,#-24 Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 45c40: 2239 0005 a310 movel 5a310 ,%d1 * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 45c46: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45c4a: 240e movel %fp,%d2 45c4c: 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() ); 45c4e: 263c 0000 03e8 movel #1000,%d3 45c54: 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 ); 45c58: 45f9 0004 7888 lea 47888 <_Timespec_Add_to>,%a2 */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void ) { _Watchdog_Tickle( &_Watchdog_Seconds_chain ); 45c5e: 47f9 0004 7d10 lea 47d10 <_Watchdog_Tickle>,%a3 /* 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; 45c64: 2039 0005 bb74 movel 5bb74 <_Watchdog_Ticks_since_boot>,%d0 45c6a: 5280 addql #1,%d0 /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45c6c: 2f02 movel %d2,%sp@- 45c6e: 4879 0005 bab2 pea 5bab2 <_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() ); 45c74: 2d41 fffc movel %d1,%fp@(-4) /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 45c78: 23c0 0005 bb74 movel %d0,5bb74 <_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() ); 45c7e: 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 ); 45c82: 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 ); 45c84: 2f02 movel %d2,%sp@- 45c86: 4879 0005 bac6 pea 5bac6 <_TOD_Now> 45c8c: 4e92 jsr %a2@ while ( seconds ) { 45c8e: 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 ); 45c92: 2400 movel %d0,%d2 while ( seconds ) { 45c94: 600c bras 45ca2 <_TOD_Tickle_ticks+0x66> <== ALWAYS TAKEN 45c96: 4879 0005 bb00 pea 5bb00 <_Watchdog_Seconds_chain> _Watchdog_Tickle_seconds(); seconds--; 45c9c: 5382 subql #1,%d2 45c9e: 4e93 jsr %a3@ 45ca0: 588f addql #4,%sp _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 ) { 45ca2: 4a82 tstl %d2 45ca4: 66f0 bnes 45c96 <_TOD_Tickle_ticks+0x5a> _Watchdog_Tickle_seconds(); seconds--; } } 45ca6: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 45cac: 4e5e unlk %fp 45cae: 4e75 rts 000457c8 <_TOD_To_seconds>: */ uint32_t _TOD_To_seconds( const rtems_time_of_day *the_tod ) { 457c8: 43f9 0005 b312 lea 5b312 <_TOD_Days_to_date>,%a1 457ce: 4e56 fff0 linkw %fp,#-16 457d2: 206e 0008 moveal %fp@(8),%a0 457d6: 48d7 041c moveml %d2-%d4/%a2,%sp@ uint32_t time; uint32_t year_mod_4; time = the_tod->day - 1; year_mod_4 = the_tod->year & 3; 457da: 2210 movel %a0@,%d1 457dc: 7603 moveq #3,%d3 ) { uint32_t time; uint32_t year_mod_4; time = the_tod->day - 1; 457de: 2028 0008 movel %a0@(8),%d0 457e2: 5380 subql #1,%d0 year_mod_4 = the_tod->year & 3; 457e4: c681 andl %d1,%d3 if ( year_mod_4 == 0 ) 457e6: 660c bnes 457f4 <_TOD_To_seconds+0x2c> time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; 457e8: 2428 0004 movel %a0@(4),%d2 457ec: 0682 0000 000d addil #13,%d2 457f2: 6004 bras 457f8 <_TOD_To_seconds+0x30> <== ALWAYS TAKEN else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 457f4: 2428 0004 movel %a0@(4),%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 457f8: 45f9 0005 b346 lea 5b346 <_TOD_Days_since_last_leap_year>,%a2 457fe: 283c 0000 05b5 movel #1461,%d4 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 45804: 3431 2a00 movew %a1@(00000000,%d2:l:2),%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45808: 3632 3a00 movew %a2@(00000000,%d3:l:2),%d3 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 4580c: 0282 0000 ffff andil #65535,%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45812: 0283 0000 ffff andil #65535,%d3 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 45818: 2242 moveal %d2,%a1 4581a: d3c0 addal %d0,%a1 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 4581c: 2001 movel %d1,%d0 4581e: 0680 ffff f83c addil #-1988,%d0 45824: e488 lsrl #2,%d0 45826: 4c04 0800 mulsl %d4,%d0 time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4582a: 2428 000c movel %a0@(12),%d2 4582e: 2202 movel %d2,%d1 if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45830: d083 addl %d3,%d0 ( (TOD_DAYS_PER_YEAR * 4) + 1); time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; 45832: 263c 0001 5180 movel #86400,%d3 time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * ( (TOD_DAYS_PER_YEAR * 4) + 1); time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; 45838: d089 addl %a1,%d0 time *= TOD_SECONDS_PER_DAY; 4583a: 4c03 0800 mulsl %d3,%d0 time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4583e: e58a lsll #2,%d2 45840: ed89 lsll #6,%d1 45842: 9282 subl %d2,%d1 45844: d2a8 0010 addl %a0@(16),%d1 45848: 2401 movel %d1,%d2 4584a: e589 lsll #2,%d1 4584c: ed8a lsll #6,%d2 time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) 4584e: 2068 0014 moveal %a0@(20),%a0 * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 45852: 9481 subl %d1,%d2 time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) 45854: d1fc 21da e500 addal #567993600,%a0 * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4585a: d488 addl %a0,%d2 time += TOD_SECONDS_1970_THROUGH_1988; return( time ); } 4585c: d082 addl %d2,%d0 4585e: 4cd7 041c moveml %sp@,%d2-%d4/%a2 45862: 4e5e unlk %fp 45864: 4e75 rts ... 00045868 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 45868: 4e56 0000 linkw %fp,#0 4586c: 206e 0008 moveal %fp@(8),%a0 45870: 2f03 movel %d3,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 45872: 2039 0005 c3c0 movel 5c3c0 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 45878: 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) || 4587a: 4a88 tstl %a0 4587c: 6762 beqs 458e0 <_TOD_Validate+0x78> <== ALWAYS TAKEN (the_tod->ticks >= ticks_per_second) || 4587e: 243c 000f 4240 movel #1000000,%d2 45884: 4c40 2002 remul %d0,%d2,%d2 45888: b4a8 0018 cmpl %a0@(24),%d2 4588c: 6352 blss 458e0 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4588e: 763b moveq #59,%d3 45890: b6a8 0014 cmpl %a0@(20),%d3 45894: 654a bcss 458e0 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 45896: b6a8 0010 cmpl %a0@(16),%d3 4589a: 6544 bcss 458e0 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || 4589c: 7017 moveq #23,%d0 4589e: b0a8 000c cmpl %a0@(12),%d0 458a2: 653c bcss 458e0 <_TOD_Validate+0x78> (the_tod->month == 0) || 458a4: 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) || 458a8: 6736 beqs 458e0 <_TOD_Validate+0x78> <== ALWAYS TAKEN 458aa: 720c moveq #12,%d1 458ac: b280 cmpl %d0,%d1 458ae: 6530 bcss 458e0 <_TOD_Validate+0x78> (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) || 458b0: 2410 movel %a0@,%d2 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) || 458b2: 0c82 0000 07c3 cmpil #1987,%d2 458b8: 6326 blss 458e0 <_TOD_Validate+0x78> (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) ) 458ba: 2228 0008 movel %a0@(8),%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) || 458be: 6720 beqs 458e0 <_TOD_Validate+0x78> <== 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 ) 458c0: 163c 0003 moveb #3,%d3 458c4: 41f9 0005 b34e lea 5b34e <_TOD_Days_per_month>,%a0 458ca: c483 andl %d3,%d2 458cc: 6606 bnes 458d4 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 458ce: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 458d2: 6004 bras 458d8 <_TOD_Validate+0x70> <== ALWAYS TAKEN else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 458d4: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 458d8: b081 cmpl %d1,%d0 458da: 54c0 scc %d0 458dc: 4480 negl %d0 458de: 6002 bras 458e2 <_TOD_Validate+0x7a> <== ALWAYS TAKEN 458e0: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 458e2: 241f movel %sp@+,%d2 458e4: 261f movel %sp@+,%d3 458e6: 4e5e unlk %fp 458e8: 4e75 rts ... 00046774 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 46774: 4e56 fff0 linkw %fp,#-16 46778: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4677c: 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 ); 46780: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 46782: 262e 000c movel %fp@(12),%d3 */ /* * Save original state */ original_state = the_thread->current_state; 46786: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4678a: 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 ); 4678e: 4eb9 0004 754c jsr 4754c <_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 ) 46794: 588f addql #4,%sp 46796: b6aa 0014 cmpl %a2@(20),%d3 4679a: 670c beqs 467a8 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 4679c: 2f03 movel %d3,%sp@- 4679e: 2f0a movel %a2,%sp@- 467a0: 4eb9 0004 73f4 jsr 473f4 <_Thread_Set_priority> 467a6: 508f addql #8,%sp _ISR_Disable( level ); 467a8: 223c 0000 0700 movel #1792,%d1 467ae: 40c0 movew %sr,%d0 467b0: 8280 orl %d0,%d1 467b2: 46c1 movew %d1,%sr 467b4: 7604 moveq #4,%d3 /* * 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; 467b6: 222a 0010 movel %a2@(16),%d1 467ba: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 467bc: b681 cmpl %d1,%d3 467be: 6730 beqs 467f0 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 467c0: 4a82 tstl %d2 467c2: 6608 bnes 467cc <_Thread_Change_priority+0x58> <== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 467c4: 74fb moveq #-5,%d2 467c6: c481 andl %d1,%d2 467c8: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 467cc: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 467ce: 0281 0003 bee0 andil #245472,%d1 467d4: 6700 00d2 beqw 468a8 <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 467d8: 2d4a 000c movel %a2,%fp@(12) 467dc: 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 ); } 467e2: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 467e8: 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 ); 467ea: 4ef9 0004 7358 jmp 47358 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 467f0: 4a82 tstl %d2 467f2: 6650 bnes 46844 <_Thread_Change_priority+0xd0> <== 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; 467f4: 226a 008e moveal %a2@(142),%a1 467f8: 322a 0094 movew %a2@(148),%d1 467fc: 3411 movew %a1@,%d2 467fe: 206a 008a moveal %a2@(138),%a0 46802: 8282 orl %d2,%d1 * 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 ); 46804: 42aa 0010 clrl %a2@(16) 46808: 3281 movew %d1,%a1@ _Priority_Major_bit_map |= the_priority_map->ready_major; 4680a: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 46810: 342a 0092 movew %a2@(146),%d2 46814: 8282 orl %d2,%d1 46816: 33c1 0005 bae4 movew %d1,5bae4 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 4681c: 4a04 tstb %d4 4681e: 6710 beqs 46830 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 46820: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 46822: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 46826: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 46828: 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; 4682c: 2489 movel %a1,%a2@ 4682e: 6014 bras 46844 <_Thread_Change_priority+0xd0> <== ALWAYS TAKEN Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 46830: 2608 movel %a0,%d3 46832: 5883 addql #4,%d3 46834: 2483 movel %d3,%a2@ old_last_node = the_chain->last; 46836: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 4683a: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4683e: 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; 46842: 228a movel %a2,%a1@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 46844: 223c 0000 0700 movel #1792,%d1 4684a: 46c0 movew %d0,%sr 4684c: 8280 orl %d0,%d1 4684e: 46c1 movew %d1,%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 ); 46850: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 46856: 4841 swap %d1 46858: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4685a: 4282 clrl %d2 4685c: 41f9 0005 bb50 lea 5bb50 <_Priority_Bit_map>,%a0 46862: 3401 movew %d1,%d2 46864: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 46868: 4841 swap %d1 4686a: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 4686c: 4283 clrl %d3 4686e: e98a lsll #4,%d2 46870: 3601 movew %d1,%d3 46872: 2279 0005 b9e0 moveal 5b9e0 <_Thread_Ready_chain>,%a1 46878: 2202 movel %d2,%d1 4687a: d283 addl %d3,%d1 4687c: 2401 movel %d1,%d2 4687e: e58a lsll #2,%d2 46880: e989 lsll #4,%d1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 46882: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 46888: 93c2 subal %d2,%a1 4688a: 2231 1800 movel %a1@(00000000,%d1:l),%d1 4688e: 23c1 0005 bac2 movel %d1,5bac2 <_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() && 46894: b288 cmpl %a0,%d1 46896: 670e beqs 468a6 <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) 46898: 4a28 0075 tstb %a0@(117) 4689c: 6708 beqs 468a6 <_Thread_Change_priority+0x132> _Context_Switch_necessary = true; 4689e: 7201 moveq #1,%d1 468a0: 13c1 0005 bafe moveb %d1,5bafe <_Context_Switch_necessary> _ISR_Enable( level ); 468a6: 46c0 movew %d0,%sr } 468a8: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 468ae: 4e5e unlk %fp 468b0: 4e75 rts ... 000468b4 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 468b4: 4e56 ffec linkw %fp,#-20 468b8: 206e 0008 moveal %fp@(8),%a0 468bc: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 468c0: 263c 0000 0700 movel #1792,%d3 468c6: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 468c8: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 468cc: 40c2 movew %sr,%d2 468ce: 8282 orl %d2,%d1 468d0: 46c1 movew %d1,%sr current_state = the_thread->current_state; 468d2: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 468d6: 2800 movel %d0,%d4 468d8: c881 andl %d1,%d4 468da: 6778 beqs 46954 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 468dc: 4680 notl %d0 468de: c081 andl %d1,%d0 current_state = 468e0: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 468e4: 666e bnes 46954 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 468e6: 2668 008e moveal %a0@(142),%a3 468ea: 3028 0094 movew %a0@(148),%d0 468ee: 3213 movew %a3@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 468f0: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 468f4: 2809 movel %a1,%d4 468f6: 5884 addql #4,%d4 468f8: 8081 orl %d1,%d0 468fa: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 468fc: 2469 0008 moveal %a1@(8),%a2 46900: 3680 movew %d0,%a3@ the_chain->last = the_node; 46902: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 46906: 3039 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d0 4690c: 3228 0092 movew %a0@(146),%d1 old_last_node->next = the_node; the_node->previous = old_last_node; 46910: 214a 0004 movel %a2,%a0@(4) 46914: 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; 46916: 2488 movel %a0,%a2@ 46918: 33c0 0005 bae4 movew %d0,5bae4 <_Priority_Major_bit_map> _ISR_Flash( level ); 4691e: 2003 movel %d3,%d0 46920: 46c2 movew %d2,%sr 46922: 8082 orl %d2,%d0 46924: 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 ) { 46926: 2028 0014 movel %a0@(20),%d0 4692a: 2279 0005 bac2 moveal 5bac2 <_Thread_Heir>,%a1 46930: b0a9 0014 cmpl %a1@(20),%d0 46934: 641e bccs 46954 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 46936: 23c8 0005 bac2 movel %a0,5bac2 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4693c: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 46942: 4a28 0075 tstb %a0@(117) 46946: 6604 bnes 4694c <_Thread_Clear_state+0x98> 46948: 4a80 tstl %d0 4694a: 6608 bnes 46954 <_Thread_Clear_state+0xa0> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4694c: 7001 moveq #1,%d0 4694e: 13c0 0005 bafe moveb %d0,5bafe <_Context_Switch_necessary> } } } _ISR_Enable( level ); 46954: 46c2 movew %d2,%sr } 46956: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4695a: 4e5e unlk %fp 4695c: 4e75 rts ... 00046ae0 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 46ae0: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 46ae4: 486e fffc pea %fp@(-4) 46ae8: 2f2e 0008 movel %fp@(8),%sp@- 46aec: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 46af2: 508f addql #8,%sp 46af4: 4aae fffc tstl %fp@(-4) 46af8: 661e bnes 46b18 <_Thread_Delay_ended+0x38> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 46afa: 2f3c 1000 0018 movel #268435480,%sp@- 46b00: 2f00 movel %d0,%sp@- 46b02: 4eb9 0004 68b4 jsr 468b4 <_Thread_Clear_state> 46b08: 508f addql #8,%sp 46b0a: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 46b10: 5380 subql #1,%d0 46b12: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 46b18: 4e5e unlk %fp 46b1a: 4e75 rts 00046b1c <_Thread_Dispatch>: Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 46b1c: 307c 0700 moveaw #1792,%a0 46b20: 2208 movel %a0,%d1 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 46b22: 4e56 ffc8 linkw %fp,#-56 46b26: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 46b2a: 2479 0005 baee moveal 5baee <_Thread_Executing>,%a2 _ISR_Disable( level ); 46b30: 40c0 movew %sr,%d0 46b32: 8280 orl %d0,%d1 46b34: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b36: 260e movel %fp,%d3 _Timestamp_Subtract( 46b38: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b3a: 5183 subql #8,%d3 _Timestamp_Subtract( 46b3c: 0682 ffff fff0 addil #-16,%d2 46b42: 2e3c 0004 78c8 movel #293064,%d7 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46b48: 2c3c 0004 7888 movel #293000,%d6 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 46b4e: 2a3c 0004 7b40 movel #293696,%d5 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); 46b54: 4bf9 0004 7fa8 lea 47fa8 <_CPU_Context_restore_fp>,%a5 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46b5a: 49f9 0004 7f86 lea 47f86 <_CPU_Context_save_fp>,%a4 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46b60: 283c 0004 7e58 movel #294488,%d4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46b66: 6000 00d0 braw 46c38 <_Thread_Dispatch+0x11c> <== ALWAYS TAKEN heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 46b6a: 7201 moveq #1,%d1 46b6c: 23c1 0005 ba34 movel %d1,5ba34 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 46b72: 2679 0005 bac2 moveal 5bac2 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 46b78: 4201 clrb %d1 _Thread_Executing = heir; 46b7a: 23cb 0005 baee movel %a3,5baee <_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; 46b80: 13c1 0005 bafe moveb %d1,5bafe <_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 ) 46b86: 7201 moveq #1,%d1 46b88: b2ab 007a cmpl %a3@(122),%d1 46b8c: 660a bnes 46b98 <_Thread_Dispatch+0x7c> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 46b8e: 41f9 0005 b9e4 lea 5b9e4 <_Thread_Ticks_per_timeslice>,%a0 46b94: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 46b98: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b9a: 2f03 movel %d3,%sp@- 46b9c: 4eb9 0004 9a74 jsr 49a74 <_TOD_Get_uptime> _Timestamp_Subtract( 46ba2: 2047 moveal %d7,%a0 46ba4: 2f02 movel %d2,%sp@- 46ba6: 2f03 movel %d3,%sp@- 46ba8: 4879 0005 baf6 pea 5baf6 <_Thread_Time_of_last_context_switch> 46bae: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46bb0: 2046 moveal %d6,%a0 46bb2: 2f02 movel %d2,%sp@- 46bb4: 486a 0082 pea %a2@(130) 46bb8: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46bba: 2079 0005 babe moveal 5babe <_Thread_libc_reent>,%a0 46bc0: 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; 46bc4: 202e fff8 movel %fp@(-8),%d0 46bc8: 222e fffc movel %fp@(-4),%d1 46bcc: 23c0 0005 baf6 movel %d0,5baf6 <_Thread_Time_of_last_context_switch> 46bd2: 23c1 0005 bafa movel %d1,5bafa <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46bd8: 4a88 tstl %a0 46bda: 6708 beqs 46be4 <_Thread_Dispatch+0xc8> <== ALWAYS TAKEN executing->libc_reent = *_Thread_libc_reent; 46bdc: 2550 0104 movel %a0@,%a2@(260) *_Thread_libc_reent = heir->libc_reent; 46be0: 20ab 0104 movel %a3@(260),%a0@ } _User_extensions_Thread_switch( executing, heir ); 46be4: 2f0b movel %a3,%sp@- 46be6: 2045 moveal %d5,%a0 46be8: 2f0a movel %a2,%sp@- 46bea: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46bec: 486b 00cc pea %a3@(204) 46bf0: 2044 moveal %d4,%a0 46bf2: 486a 00cc pea %a2@(204) 46bf6: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 46bf8: 4fef 0010 lea %sp@(16),%sp 46bfc: 4aaa 0100 tstl %a2@(256) 46c00: 6724 beqs 46c26 <_Thread_Dispatch+0x10a> #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 ); 46c02: 2079 0005 baba moveal 5baba <_Thread_Allocated_fp>,%a0 46c08: b1ca cmpal %a2,%a0 46c0a: 671a beqs 46c26 <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 46c0c: 4a88 tstl %a0 46c0e: 6708 beqs 46c18 <_Thread_Dispatch+0xfc> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46c10: 4868 0100 pea %a0@(256) 46c14: 4e94 jsr %a4@ 46c16: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 46c18: 486a 0100 pea %a2@(256) 46c1c: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 46c1e: 588f addql #4,%sp 46c20: 23ca 0005 baba movel %a2,5baba <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 46c26: 2479 0005 baee moveal 5baee <_Thread_Executing>,%a2 _ISR_Disable( level ); 46c2c: 223c 0000 0700 movel #1792,%d1 46c32: 40c0 movew %sr,%d0 46c34: 8280 orl %d0,%d1 46c36: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46c38: 1239 0005 bafe moveb 5bafe <_Context_Switch_necessary>,%d1 46c3e: 6600 ff2a bnew 46b6a <_Thread_Dispatch+0x4e> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 46c42: 42b9 0005 ba34 clrl 5ba34 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 46c48: 46c0 movew %d0,%sr if ( _Thread_Do_post_task_switch_extension || 46c4a: 4ab9 0005 bad6 tstl 5bad6 <_Thread_Do_post_task_switch_extension> 46c50: 6606 bnes 46c58 <_Thread_Dispatch+0x13c> <== ALWAYS TAKEN executing->do_post_task_switch_extension ) { 46c52: 4a2a 0074 tstb %a2@(116) 46c56: 670c beqs 46c64 <_Thread_Dispatch+0x148> executing->do_post_task_switch_extension = false; 46c58: 4200 clrb %d0 46c5a: 1540 0074 moveb %d0,%a2@(116) _API_extensions_Run_postswitch(); 46c5e: 4eb9 0004 5736 jsr 45736 <_API_extensions_Run_postswitch> } } 46c64: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 46c6a: 4e5e unlk %fp 46c6c: 4e75 rts 0004b484 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4b484: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4b488: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4b48e: 4aa8 0010 tstl %a0@(16) 4b492: 660e bnes 4b4a2 <_Thread_Evaluate_mode+0x1e> <== ALWAYS TAKEN 4b494: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 4b49a: 6710 beqs 4b4ac <_Thread_Evaluate_mode+0x28> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4b49c: 4a28 0075 tstb %a0@(117) 4b4a0: 670a beqs 4b4ac <_Thread_Evaluate_mode+0x28> <== ALWAYS TAKEN _Context_Switch_necessary = true; 4b4a2: 7001 moveq #1,%d0 4b4a4: 13c0 0005 bafe moveb %d0,5bafe <_Context_Switch_necessary> return true; 4b4aa: 6002 bras 4b4ae <_Thread_Evaluate_mode+0x2a> <== ALWAYS TAKEN 4b4ac: 4200 clrb %d0 } return false; } 4b4ae: 4e5e unlk %fp 4b4b0: 4e75 rts ... 00046c94 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 46c94: 4e56 0000 linkw %fp,#0 46c98: 202e 0008 movel %fp@(8),%d0 46c9c: 2f03 movel %d3,%sp@- 46c9e: 206e 000c moveal %fp@(12),%a0 46ca2: 2f02 movel %d2,%sp@- uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 46ca4: 4a80 tstl %d0 46ca6: 6618 bnes 46cc0 <_Thread_Get+0x2c> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46ca8: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 46cae: 5280 addql #1,%d0 46cb0: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 46cb6: 4290 clrl %a0@ tp = _Thread_Executing; 46cb8: 2039 0005 baee movel 5baee <_Thread_Executing>,%d0 goto done; 46cbe: 6044 bras 46d04 <_Thread_Get+0x70> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 46cc0: 7418 moveq #24,%d2 46cc2: 2200 movel %d0,%d1 46cc4: e4a9 lsrl %d2,%d1 46cc6: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 46cc8: 143c 0003 moveb #3,%d2 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 46ccc: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 46cce: 2241 moveal %d1,%a1 46cd0: 5389 subql #1,%a1 46cd2: b489 cmpl %a1,%d2 46cd4: 643a bccs 46d10 <_Thread_Get+0x7c> 46cd6: 6014 bras 46cec <_Thread_Get+0x58> <== ALWAYS TAKEN if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 46cd8: 43f9 0005 b9ec lea 5b9ec <_Objects_Information_table>,%a1 46cde: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 if ( !api_information ) { 46ce2: 4a89 tstl %a1 46ce4: 6706 beqs 46cec <_Thread_Get+0x58> *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 46ce6: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 46cea: 6608 bnes 46cf4 <_Thread_Get+0x60> *location = OBJECTS_ERROR; 46cec: 7001 moveq #1,%d0 46cee: 2080 movel %d0,%a0@ 46cf0: 4280 clrl %d0 goto done; 46cf2: 6010 bras 46d04 <_Thread_Get+0x70> <== ALWAYS TAKEN } tp = (Thread_Control *) _Objects_Get( information, id, location ); 46cf4: 2f08 movel %a0,%sp@- 46cf6: 2f00 movel %d0,%sp@- 46cf8: 2f01 movel %d1,%sp@- 46cfa: 4eb9 0004 6498 jsr 46498 <_Objects_Get> 46d00: 4fef 000c lea %sp@(12),%sp done: return tp; } 46d04: 242e fff8 movel %fp@(-8),%d2 46d08: 262e fffc movel %fp@(-4),%d3 46d0c: 4e5e unlk %fp 46d0e: 4e75 rts *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 46d10: 761b moveq #27,%d3 46d12: 2400 movel %d0,%d2 46d14: e6aa lsrl %d3,%d2 46d16: 163c 0001 moveb #1,%d3 46d1a: b682 cmpl %d2,%d3 46d1c: 67ba beqs 46cd8 <_Thread_Get+0x44> 46d1e: 60cc bras 46cec <_Thread_Get+0x58> <== ALWAYS TAKEN 0004b4b4 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4b4b4: 4e56 0000 linkw %fp,#0 4b4b8: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4b4ba: 2479 0005 baee moveal 5baee <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4b4c0: 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; 4b4c2: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4b4c6: 40c0 movew %sr,%d0 4b4c8: e189 lsll #8,%d1 4b4ca: 0280 0000 f8ff andil #63743,%d0 4b4d0: 8081 orl %d1,%d0 4b4d2: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4b4d4: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4b4d6: 1439 0005 b1e8 moveb 5b1e8 ,%d2 doneConstructors = 1; 4b4dc: 13c0 0005 b1e8 moveb %d0,5b1e8 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4b4e2: 4aaa 0100 tstl %a2@(256) 4b4e6: 6720 beqs 4b508 <_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 ); 4b4e8: 2079 0005 baba moveal 5baba <_Thread_Allocated_fp>,%a0 4b4ee: b1ca cmpal %a2,%a0 4b4f0: 6716 beqs 4b508 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4b4f2: 4a88 tstl %a0 4b4f4: 670c beqs 4b502 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4b4f6: 4868 0100 pea %a0@(256) 4b4fa: 4eb9 0004 7f86 jsr 47f86 <_CPU_Context_save_fp> 4b500: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4b502: 23ca 0005 baba movel %a2,5baba <_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 ); 4b508: 2f0a movel %a2,%sp@- 4b50a: 4eb9 0004 79c0 jsr 479c0 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4b510: 4eb9 0004 6c6e jsr 46c6e <_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) */ { 4b516: 588f addql #4,%sp 4b518: 4a02 tstb %d2 4b51a: 6606 bnes 4b522 <_Thread_Handler+0x6e> INIT_NAME (); 4b51c: 4eb9 0005 8910 jsr 58910 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4b522: 4aaa 009e tstl %a2@(158) 4b526: 6610 bnes 4b538 <_Thread_Handler+0x84> <== ALWAYS TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4b528: 2f2a 00a6 movel %a2@(166),%sp@- 4b52c: 206a 009a moveal %a2@(154),%a0 4b530: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4b532: 588f addql #4,%sp 4b534: 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 ); 4b538: 2f0a movel %a2,%sp@- 4b53a: 4eb9 0004 79f8 jsr 479f8 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4b540: 4878 0006 pea 6 4b544: 4878 0001 pea 1 4b548: 42a7 clrl %sp@- 4b54a: 4eb9 0004 5f88 jsr 45f88 <_Internal_error_Occurred> 00046d20 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d20: 4e56 ffe4 linkw %fp,#-28 46d24: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 46d28: 242e 0014 movel %fp@(20),%d2 46d2c: 246e 000c moveal %fp@(12),%a2 /* * 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 ); 46d30: 2f02 movel %d2,%sp@- Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d32: 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; 46d36: 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 ) { 46d3a: 282e 001c movel %fp@(28),%d4 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 46d3e: 42aa 010c clrl %a2@(268) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d42: 1a2e 0023 moveb %fp@(35),%d5 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 46d46: 42aa 0110 clrl %a2@(272) extensions_area = NULL; the_thread->libc_reent = NULL; 46d4a: 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 ); 46d4e: 2f0a movel %a2,%sp@- 46d50: 4eb9 0004 75c8 jsr 475c8 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 46d56: 508f addql #8,%sp 46d58: 4a80 tstl %d0 46d5a: 6700 014c beqw 46ea8 <_Thread_Initialize+0x188> 46d5e: b480 cmpl %d0,%d2 46d60: 6200 0146 bhiw 46ea8 <_Thread_Initialize+0x188> <== ALWAYS TAKEN void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 46d64: 2540 00bc movel %d0,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 46d68: 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 ) { 46d6e: 4a03 tstb %d3 46d70: 6604 bnes 46d76 <_Thread_Initialize+0x56> 46d72: 4283 clrl %d3 46d74: 6016 bras 46d8c <_Thread_Initialize+0x6c> <== ALWAYS TAKEN fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 46d76: 4878 001c pea 1c 46d7a: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> if ( !fp_area ) 46d80: 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 ); 46d82: 2600 movel %d0,%d3 if ( !fp_area ) 46d84: 6606 bnes 46d8c <_Thread_Initialize+0x6c> 46d86: 4282 clrl %d2 46d88: 6000 00c6 braw 46e50 <_Thread_Initialize+0x130> <== ALWAYS TAKEN #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46d8c: 2039 0005 bad2 movel 5bad2 <_Thread_Maximum_extensions>,%d0 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; 46d92: 2543 0100 movel %d3,%a2@(256) the_thread->Start.fp_context = fp_area; 46d96: 2543 00c4 movel %d3,%a2@(196) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46d9a: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 46d9e: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 46da2: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 46da6: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46daa: 4a80 tstl %d0 46dac: 6604 bnes 46db2 <_Thread_Initialize+0x92> 46dae: 4282 clrl %d2 46db0: 6016 bras 46dc8 <_Thread_Initialize+0xa8> <== ALWAYS TAKEN extensions_area = _Workspace_Allocate( 46db2: e588 lsll #2,%d0 46db4: 2040 moveal %d0,%a0 46db6: 4868 0004 pea %a0@(4) 46dba: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46dc0: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 46dc2: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46dc4: 6700 008a beqw 46e50 <_Thread_Initialize+0x130> goto failed; } the_thread->extensions = (void **) extensions_area; 46dc8: 2542 0114 movel %d2,%a2@(276) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 46dcc: 6718 beqs 46de6 <_Thread_Initialize+0xc6> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46dce: 2239 0005 bad2 movel 5bad2 <_Thread_Maximum_extensions>,%d1 46dd4: 4280 clrl %d0 46dd6: 600a bras 46de2 <_Thread_Initialize+0xc2> <== ALWAYS TAKEN the_thread->extensions[i] = NULL; 46dd8: 206a 0114 moveal %a2@(276),%a0 46ddc: 42b0 0c00 clrl %a0@(00000000,%d0: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++ ) 46de0: 5280 addql #1,%d0 46de2: b280 cmpl %d0,%d1 46de4: 64f2 bccs 46dd8 <_Thread_Initialize+0xb8> #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 ); 46de6: 2f04 movel %d4,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 46de8: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 46dee: 7001 moveq #1,%d0 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 46df0: 256e 0024 00ac movel %fp@(36),%a2@(172) the_thread->Start.budget_callout = budget_callout; 46df6: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 46dfc: 1545 00aa moveb %d5,%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 ); 46e00: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 46e02: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 46e06: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 46e0a: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 46e0e: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 46e12: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 46e16: 4eb9 0004 73f4 jsr 473f4 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46e1c: 206e 0008 moveal %fp@(8),%a0 46e20: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 46e22: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46e28: 2068 0018 moveal %a0@(24),%a0 46e2c: 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 ); 46e30: 42aa 0082 clrl %a2@(130) 46e34: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 46e38: 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 ); 46e3c: 2f0a movel %a2,%sp@- 46e3e: 4eb9 0004 7a7c jsr 47a7c <_User_extensions_Thread_create> if ( extension_status ) 46e44: 4fef 000c lea %sp@(12),%sp 46e48: 4a00 tstb %d0 46e4a: 6704 beqs 46e50 <_Thread_Initialize+0x130> 46e4c: 7001 moveq #1,%d0 46e4e: 605a bras 46eaa <_Thread_Initialize+0x18a> <== ALWAYS TAKEN return true; failed: if ( the_thread->libc_reent ) 46e50: 202a 0104 movel %a2@(260),%d0 46e54: 670a beqs 46e60 <_Thread_Initialize+0x140> _Workspace_Free( the_thread->libc_reent ); 46e56: 2f00 movel %d0,%sp@- 46e58: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> 46e5e: 588f addql #4,%sp 46e60: 47ea 0108 lea %a2@(264),%a3 46e64: 4284 clrl %d4 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); 46e66: 49f9 0004 7ddc lea 47ddc <_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] ) 46e6c: 2013 movel %a3@,%d0 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 46e6e: 5284 addql #1,%d4 46e70: 588b addql #4,%a3 if ( the_thread->API_Extensions[i] ) 46e72: 4a80 tstl %d0 46e74: 6706 beqs 46e7c <_Thread_Initialize+0x15c> _Workspace_Free( the_thread->API_Extensions[i] ); 46e76: 2f00 movel %d0,%sp@- 46e78: 4e94 jsr %a4@ 46e7a: 588f addql #4,%sp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 46e7c: 7003 moveq #3,%d0 46e7e: b084 cmpl %d4,%d0 46e80: 66ea bnes 46e6c <_Thread_Initialize+0x14c> if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); if ( extensions_area ) 46e82: 4a82 tstl %d2 46e84: 670a beqs 46e90 <_Thread_Initialize+0x170> (void) _Workspace_Free( extensions_area ); 46e86: 2f02 movel %d2,%sp@- 46e88: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> 46e8e: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 46e90: 4a83 tstl %d3 46e92: 670a beqs 46e9e <_Thread_Initialize+0x17e> (void) _Workspace_Free( fp_area ); 46e94: 2f03 movel %d3,%sp@- 46e96: 4eb9 0004 7ddc jsr 47ddc <_Workspace_Free> 46e9c: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 46e9e: 2f0a movel %a2,%sp@- 46ea0: 4eb9 0004 7614 jsr 47614 <_Thread_Stack_Free> return false; 46ea6: 588f addql #4,%sp 46ea8: 4200 clrb %d0 } 46eaa: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 46eb0: 4e5e unlk %fp 46eb2: 4e75 rts 0004a1a4 <_Thread_Reset_timeslice>: * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4a1a4: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 4a1a8: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4a1ae: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4a1b2: 243c 0000 0700 movel #1792,%d2 4a1b8: 2202 movel %d2,%d1 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 4a1ba: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4a1be: 40c0 movew %sr,%d0 4a1c0: 8280 orl %d0,%d1 4a1c2: 46c1 movew %d1,%sr if ( _Chain_Has_only_one_node( ready ) ) { 4a1c4: 2229 0008 movel %a1@(8),%d1 4a1c8: b291 cmpl %a1@,%d1 4a1ca: 6604 bnes 4a1d0 <_Thread_Reset_timeslice+0x2c> _ISR_Enable( level ); 4a1cc: 46c0 movew %d0,%sr return; 4a1ce: 6040 bras 4a210 <_Thread_Reset_timeslice+0x6c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4a1d0: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4a1d2: 2209 movel %a1,%d1 4a1d4: 5881 addql #4,%d1 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4a1d6: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4a1da: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4a1dc: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4a1e0: 2081 movel %d1,%a0@ old_last_node = the_chain->last; 4a1e2: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4a1e6: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4a1ea: 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; 4a1ee: 2488 movel %a0,%a2@ } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 4a1f0: 2202 movel %d2,%d1 4a1f2: 46c0 movew %d0,%sr 4a1f4: 8280 orl %d0,%d1 4a1f6: 46c1 movew %d1,%sr if ( _Thread_Is_heir( executing ) ) 4a1f8: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 4a1fe: 6606 bnes 4a206 <_Thread_Reset_timeslice+0x62> <== ALWAYS TAKEN _Thread_Heir = (Thread_Control *) ready->first; 4a200: 23d1 0005 bac2 movel %a1@,5bac2 <_Thread_Heir> _Context_Switch_necessary = true; 4a206: 7201 moveq #1,%d1 4a208: 13c1 0005 bafe moveb %d1,5bafe <_Context_Switch_necessary> _ISR_Enable( level ); 4a20e: 46c0 movew %d0,%sr } 4a210: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4a214: 4e5e unlk %fp 4a216: 4e75 rts 00047b00 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 47b00: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 47b02: 4e56 0000 linkw %fp,#0 47b06: 2f0a movel %a2,%sp@- 47b08: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 47b0c: c0aa 0010 andl %a2@(16),%d0 47b10: 4a00 tstb %d0 47b12: 6704 beqs 47b18 <_Thread_Restart+0x18> 47b14: 4200 clrb %d0 47b16: 6070 bras 47b88 <_Thread_Restart+0x88> <== ALWAYS TAKEN _Thread_Set_transient( the_thread ); 47b18: 2f0a movel %a2,%sp@- 47b1a: 4eb9 0004 7ce8 jsr 47ce8 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 47b20: 2f2e 0010 movel %fp@(16),%sp@- 47b24: 2f2e 000c movel %fp@(12),%sp@- 47b28: 2f0a movel %a2,%sp@- 47b2a: 4eb9 0004 a980 jsr 4a980 <_Thread_Reset> _Thread_Load_environment( the_thread ); 47b30: 2f0a movel %a2,%sp@- 47b32: 4eb9 0004 a61c jsr 4a61c <_Thread_Load_environment> _Thread_Ready( the_thread ); 47b38: 2f0a movel %a2,%sp@- 47b3a: 4eb9 0004 a8c0 jsr 4a8c0 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 47b40: 2f0a movel %a2,%sp@- 47b42: 4eb9 0004 829c jsr 4829c <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 47b48: 4fef 001c lea %sp@(28),%sp 47b4c: b5f9 0005 c576 cmpal 5c576 <_Thread_Executing>,%a2 47b52: 6704 beqs 47b58 <_Thread_Restart+0x58> 47b54: 7001 moveq #1,%d0 47b56: 6030 bras 47b88 <_Thread_Restart+0x88> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 47b58: 4aaa 0100 tstl %a2@(256) 47b5c: 670c beqs 47b6a <_Thread_Restart+0x6a> _Context_Restore_fp( &_Thread_Executing->fp_context ); 47b5e: 486a 0100 pea %a2@(256) 47b62: 4eb9 0004 8784 jsr 48784 <_CPU_Context_restore_fp> 47b68: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 47b6a: 2079 0005 c576 moveal 5c576 <_Thread_Executing>,%a0 47b70: 2028 00fc movel %a0@(252),%d0 47b74: 2228 00cc movel %a0@(204),%d1 47b78: 46c1 movew %d1,%sr 47b7a: 2e40 moveal %d0,%sp 47b7c: 4e75 rts 47b7e: 2140 00fc movel %d0,%a0@(252) <== NOT EXECUTED 47b82: 7001 moveq #1,%d0 <== NOT EXECUTED 47b84: 2141 00cc movel %d1,%a0@(204) <== NOT EXECUTED return true; } return false; } 47b88: 246e fffc moveal %fp@(-4),%a2 47b8c: 4e5e unlk %fp 47b8e: 4e75 rts 0004ab38 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4ab38: 4e56 ffec linkw %fp,#-20 4ab3c: 206e 0008 moveal %fp@(8),%a0 4ab40: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4ab44: 243c 0000 0700 movel #1792,%d2 4ab4a: 2002 movel %d2,%d0 4ab4c: 40c1 movew %sr,%d1 4ab4e: 8081 orl %d1,%d0 4ab50: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4ab52: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4ab56: 0800 0001 btst #1,%d0 4ab5a: 6778 beqs 4abd4 <_Thread_Resume+0x9c> <== ALWAYS TAKEN 4ab5c: 76fd moveq #-3,%d3 4ab5e: c083 andl %d3,%d0 current_state = 4ab60: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4ab64: 666e bnes 4abd4 <_Thread_Resume+0x9c> <== 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; 4ab66: 2668 008e moveal %a0@(142),%a3 4ab6a: 3028 0094 movew %a0@(148),%d0 4ab6e: 3613 movew %a3@,%d3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ab70: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ab74: 2809 movel %a1,%d4 4ab76: 5884 addql #4,%d4 4ab78: 8083 orl %d3,%d0 4ab7a: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4ab7c: 2469 0008 moveal %a1@(8),%a2 4ab80: 3680 movew %d0,%a3@ the_chain->last = the_node; 4ab82: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4ab86: 3039 0006 0c7c movew 60c7c <_Priority_Major_bit_map>,%d0 4ab8c: 3628 0092 movew %a0@(146),%d3 old_last_node->next = the_node; the_node->previous = old_last_node; 4ab90: 214a 0004 movel %a2,%a0@(4) 4ab94: 8083 orl %d3,%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; 4ab96: 2488 movel %a0,%a2@ 4ab98: 33c0 0006 0c7c movew %d0,60c7c <_Priority_Major_bit_map> _ISR_Flash( level ); 4ab9e: 2002 movel %d2,%d0 4aba0: 46c1 movew %d1,%sr 4aba2: 8081 orl %d1,%d0 4aba4: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4aba6: 2028 0014 movel %a0@(20),%d0 4abaa: 2279 0006 0c5a moveal 60c5a <_Thread_Heir>,%a1 4abb0: b0a9 0014 cmpl %a1@(20),%d0 4abb4: 641e bccs 4abd4 <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4abb6: 23c8 0006 0c5a movel %a0,60c5a <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4abbc: 2079 0006 0c86 moveal 60c86 <_Thread_Executing>,%a0 4abc2: 4a28 0075 tstb %a0@(117) 4abc6: 6604 bnes 4abcc <_Thread_Resume+0x94> 4abc8: 4a80 tstl %d0 4abca: 6608 bnes 4abd4 <_Thread_Resume+0x9c> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4abcc: 7001 moveq #1,%d0 4abce: 13c0 0006 0c96 moveb %d0,60c96 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4abd4: 46c1 movew %d1,%sr } 4abd6: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4abda: 4e5e unlk %fp 4abdc: 4e75 rts ... 00047464 <_Thread_Set_state>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 47464: 223c 0000 0700 movel #1792,%d1 void _Thread_Set_state( Thread_Control *the_thread, States_Control state ) { 4746a: 4e56 fff4 linkw %fp,#-12 4746e: 206e 0008 moveal %fp@(8),%a0 47472: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47476: 242e 000c movel %fp@(12),%d2 ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 4747a: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4747e: 40c0 movew %sr,%d0 47480: 8280 orl %d0,%d1 47482: 46c1 movew %d1,%sr if ( !_States_Is_ready( the_thread->current_state ) ) { 47484: 2228 0010 movel %a0@(16),%d1 47488: 670c beqs 47496 <_Thread_Set_state+0x32> the_thread->current_state = 4748a: 8481 orl %d1,%d2 4748c: 2142 0010 movel %d2,%a0@(16) _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); 47490: 46c0 movew %d0,%sr return; 47492: 6000 00ae braw 47542 <_Thread_Set_state+0xde> <== ALWAYS TAKEN } the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { 47496: 2229 0008 movel %a1@(8),%d1 _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = state; 4749a: 2142 0010 movel %d2,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 4749e: b291 cmpl %a1@,%d1 474a0: 6632 bnes 474d4 <_Thread_Set_state+0x70> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 474a2: 2209 movel %a1,%d1 474a4: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 474a6: 2468 008e moveal %a0@(142),%a2 474aa: 2281 movel %d1,%a1@ 474ac: 3412 movew %a2@,%d2 474ae: 3228 0098 movew %a0@(152),%d1 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 474b2: 2349 0008 movel %a1,%a1@(8) 474b6: c282 andl %d2,%d1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 474b8: 42a9 0004 clrl %a1@(4) 474bc: 3481 movew %d1,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 474be: 6620 bnes 474e0 <_Thread_Set_state+0x7c> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 474c0: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 474c6: 3428 0096 movew %a0@(150),%d2 474ca: c282 andl %d2,%d1 474cc: 33c1 0005 bae4 movew %d1,5bae4 <_Priority_Major_bit_map> 474d2: 600c bras 474e0 <_Thread_Set_state+0x7c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 474d4: 2250 moveal %a0@,%a1 previous = the_node->previous; 474d6: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 474da: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 474dc: 234a 0004 movel %a2,%a1@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 474e0: 223c 0000 0700 movel #1792,%d1 474e6: 46c0 movew %d0,%sr 474e8: 8280 orl %d0,%d1 474ea: 46c1 movew %d1,%sr if ( _Thread_Is_heir( the_thread ) ) 474ec: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 474f2: 663c bnes 47530 <_Thread_Set_state+0xcc> 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 ); 474f4: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 474fa: 4841 swap %d1 474fc: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 474fe: 4282 clrl %d2 47500: 43f9 0005 bb50 lea 5bb50 <_Priority_Bit_map>,%a1 47506: 3401 movew %d1,%d2 47508: 3231 2a00 movew %a1@(00000000,%d2:l:2),%d1 4750c: 4841 swap %d1 4750e: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 47510: 4283 clrl %d3 47512: e98a lsll #4,%d2 47514: 3601 movew %d1,%d3 47516: 2279 0005 b9e0 moveal 5b9e0 <_Thread_Ready_chain>,%a1 4751c: 2202 movel %d2,%d1 4751e: d283 addl %d3,%d1 47520: 2401 movel %d1,%d2 47522: e58a lsll #2,%d2 47524: e989 lsll #4,%d1 47526: 93c2 subal %d2,%a1 47528: d3c1 addal %d1,%a1 4752a: 23d1 0005 bac2 movel %a1@,5bac2 <_Thread_Heir> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 47530: b1f9 0005 baee cmpal 5baee <_Thread_Executing>,%a0 47536: 6608 bnes 47540 <_Thread_Set_state+0xdc> _Context_Switch_necessary = true; 47538: 7201 moveq #1,%d1 4753a: 13c1 0005 bafe moveb %d1,5bafe <_Context_Switch_necessary> _ISR_Enable( level ); 47540: 46c0 movew %d0,%sr } 47542: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47546: 4e5e unlk %fp 47548: 4e75 rts ... 0004754c <_Thread_Set_transient>: ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 4754c: 203c 0000 0700 movel #1792,%d0 */ void _Thread_Set_transient( Thread_Control *the_thread ) { 47552: 4e56 0000 linkw %fp,#0 47556: 206e 0008 moveal %fp@(8),%a0 4755a: 2f0a movel %a2,%sp@- ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; 4755c: 2268 008a moveal %a0@(138),%a1 */ void _Thread_Set_transient( Thread_Control *the_thread ) { 47560: 2f02 movel %d2,%sp@- ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 47562: 40c1 movew %sr,%d1 47564: 8081 orl %d1,%d0 47566: 46c0 movew %d0,%sr old_state = the_thread->current_state; 47568: 2028 0010 movel %a0@(16),%d0 the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state ); 4756c: 7404 moveq #4,%d2 4756e: 8480 orl %d0,%d2 47570: 2142 0010 movel %d2,%a0@(16) if ( _States_Is_ready( old_state ) ) { 47574: 4a80 tstl %d0 47576: 6646 bnes 475be <_Thread_Set_transient+0x72> if ( _Chain_Has_only_one_node( ready ) ) { 47578: 2029 0008 movel %a1@(8),%d0 4757c: b091 cmpl %a1@,%d0 4757e: 6632 bnes 475b2 <_Thread_Set_transient+0x66> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47580: 2409 movel %a1,%d2 47582: 5882 addql #4,%d2 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 47584: 2468 008e moveal %a0@(142),%a2 47588: 2282 movel %d2,%a1@ 4758a: 3412 movew %a2@,%d2 4758c: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47590: 2349 0008 movel %a1,%a1@(8) 47594: 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; 47596: 42a9 0004 clrl %a1@(4) 4759a: 3480 movew %d0,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 4759c: 6620 bnes 475be <_Thread_Set_transient+0x72> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 4759e: 3428 0096 movew %a0@(150),%d2 475a2: 3039 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d0 475a8: c082 andl %d2,%d0 475aa: 33c0 0005 bae4 movew %d0,5bae4 <_Priority_Major_bit_map> 475b0: 600c bras 475be <_Thread_Set_transient+0x72> <== ALWAYS TAKEN { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 475b2: 2268 0004 moveal %a0@(4),%a1 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 475b6: 2050 moveal %a0@,%a0 previous = the_node->previous; next->previous = previous; previous->next = next; 475b8: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 475ba: 2149 0004 movel %a1,%a0@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); } _ISR_Enable( level ); 475be: 46c1 movew %d1,%sr } 475c0: 241f movel %sp@+,%d2 475c2: 245f moveal %sp@+,%a2 475c4: 4e5e unlk %fp 475c6: 4e75 rts 000475c8 <_Thread_Stack_Allocate>: size_t _Thread_Stack_Allocate( Thread_Control *the_thread, size_t stack_size ) { 475c8: 4e56 0000 linkw %fp,#0 475cc: 2039 0005 a2fe movel 5a2fe ,%d0 475d2: 2f02 movel %d2,%sp@- 475d4: 242e 000c movel %fp@(12),%d2 475d8: b082 cmpl %d2,%d0 475da: 6302 blss 475de <_Thread_Stack_Allocate+0x16> 475dc: 2400 movel %d0,%d2 * Call ONLY the CPU table stack allocate hook, _or_ the * the RTEMS workspace allocate. This is so the stack free * routine can call the correct deallocation routine. */ if ( Configuration.stack_allocate_hook ) { 475de: 2079 0005 a324 moveal 5a324 ,%a0 475e4: 4a88 tstl %a0 475e6: 6706 beqs 475ee <_Thread_Stack_Allocate+0x26> stack_addr = (*Configuration.stack_allocate_hook)( the_stack_size ); 475e8: 2f02 movel %d2,%sp@- 475ea: 4e90 jsr %a0@ 475ec: 6008 bras 475f6 <_Thread_Stack_Allocate+0x2e> <== ALWAYS TAKEN * get and keep the stack adjust factor, the stack alignment, and * the context initialization sequence in sync. */ the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); 475ee: 2f02 movel %d2,%sp@- 475f0: 4eb9 0004 7dc0 jsr 47dc0 <_Workspace_Allocate> } if ( !stack_addr ) 475f6: 4a80 tstl %d0 475f8: 56c1 sne %d1 the_stack_size = 0; the_thread->Start.stack = stack_addr; 475fa: 206e 0008 moveal %fp@(8),%a0 * get and keep the stack adjust factor, the stack alignment, and * the context initialization sequence in sync. */ the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); 475fe: 588f addql #4,%sp } if ( !stack_addr ) the_stack_size = 0; the_thread->Start.stack = stack_addr; 47600: 2140 00c8 movel %d0,%a0@(200) the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); } if ( !stack_addr ) 47604: 1001 moveb %d1,%d0 47606: 49c0 extbl %d0 the_stack_size = 0; the_thread->Start.stack = stack_addr; return the_stack_size; } 47608: c082 andl %d2,%d0 4760a: 242e fffc movel %fp@(-4),%d2 4760e: 4e5e unlk %fp 47610: 4e75 rts ... 000476e0 <_Thread_Suspend>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 476e0: 223c 0000 0700 movel #1792,%d1 */ void _Thread_Suspend( Thread_Control *the_thread ) { 476e6: 4e56 fff4 linkw %fp,#-12 476ea: 206e 0008 moveal %fp@(8),%a0 476ee: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 476f2: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 476f6: 40c0 movew %sr,%d0 476f8: 8280 orl %d0,%d1 476fa: 46c1 movew %d1,%sr #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { 476fc: 2228 0010 movel %a0@(16),%d1 47700: 670e beqs 47710 <_Thread_Suspend+0x30> the_thread->current_state = 47702: 7402 moveq #2,%d2 47704: 8481 orl %d1,%d2 47706: 2142 0010 movel %d2,%a0@(16) _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); 4770a: 46c0 movew %d0,%sr return; 4770c: 6000 00b0 braw 477be <_Thread_Suspend+0xde> <== ALWAYS TAKEN } the_thread->current_state = STATES_SUSPENDED; 47710: 7202 moveq #2,%d1 if ( _Chain_Has_only_one_node( ready ) ) { 47712: 2429 0008 movel %a1@(8),%d2 _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 47716: 2141 0010 movel %d1,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 4771a: b491 cmpl %a1@,%d2 4771c: 6632 bnes 47750 <_Thread_Suspend+0x70> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4771e: 2209 movel %a1,%d1 47720: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 47722: 2468 008e moveal %a0@(142),%a2 47726: 2281 movel %d1,%a1@ 47728: 3412 movew %a2@,%d2 4772a: 3228 0098 movew %a0@(152),%d1 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4772e: 2349 0008 movel %a1,%a1@(8) 47732: c282 andl %d2,%d1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47734: 42a9 0004 clrl %a1@(4) 47738: 3481 movew %d1,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 4773a: 6620 bnes 4775c <_Thread_Suspend+0x7c> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 4773c: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 47742: 3428 0096 movew %a0@(150),%d2 47746: c282 andl %d2,%d1 47748: 33c1 0005 bae4 movew %d1,5bae4 <_Priority_Major_bit_map> 4774e: 600c bras 4775c <_Thread_Suspend+0x7c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47750: 2250 moveal %a0@,%a1 previous = the_node->previous; 47752: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47756: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47758: 234a 0004 movel %a2,%a1@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 4775c: 223c 0000 0700 movel #1792,%d1 47762: 46c0 movew %d0,%sr 47764: 8280 orl %d0,%d1 47766: 46c1 movew %d1,%sr if ( _Thread_Is_heir( the_thread ) ) 47768: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 4776e: 663c bnes 477ac <_Thread_Suspend+0xcc> 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 ); 47770: 3239 0005 bae4 movew 5bae4 <_Priority_Major_bit_map>,%d1 47776: 4841 swap %d1 47778: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4777a: 4282 clrl %d2 4777c: 43f9 0005 bb50 lea 5bb50 <_Priority_Bit_map>,%a1 47782: 3401 movew %d1,%d2 47784: 3231 2a00 movew %a1@(00000000,%d2:l:2),%d1 47788: 4841 swap %d1 4778a: 04c1 ff1 %d1 4778c: 4283 clrl %d3 4778e: e98a lsll #4,%d2 47790: 3601 movew %d1,%d3 47792: 2279 0005 b9e0 moveal 5b9e0 <_Thread_Ready_chain>,%a1 47798: 2202 movel %d2,%d1 4779a: d283 addl %d3,%d1 4779c: 2401 movel %d1,%d2 4779e: e58a lsll #2,%d2 477a0: e989 lsll #4,%d1 477a2: 93c2 subal %d2,%a1 477a4: d3c1 addal %d1,%a1 477a6: 23d1 0005 bac2 movel %a1@,5bac2 <_Thread_Heir> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 477ac: b1f9 0005 baee cmpal 5baee <_Thread_Executing>,%a0 477b2: 6608 bnes 477bc <_Thread_Suspend+0xdc> _Context_Switch_necessary = true; 477b4: 7401 moveq #1,%d2 477b6: 13c2 0005 bafe moveb %d2,5bafe <_Context_Switch_necessary> _ISR_Enable( level ); 477bc: 46c0 movew %d0,%sr } 477be: 4cd7 040c moveml %sp@,%d2-%d3/%a2 477c2: 4e5e unlk %fp 477c4: 4e75 rts ... 0004780c <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 4780c: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 47810: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 47816: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4781a: 243c 0000 0700 movel #1792,%d2 47820: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 47822: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 47826: 40c1 movew %sr,%d1 47828: 8081 orl %d1,%d0 4782a: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 4782c: 2029 0008 movel %a1@(8),%d0 47830: b091 cmpl %a1@,%d0 47832: 6738 beqs 4786c <_Thread_Yield_processor+0x60> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47834: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47836: 2009 movel %a1,%d0 47838: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4783a: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4783e: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47840: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47844: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 47846: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4784a: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4784e: 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; 47852: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 47854: 2002 movel %d2,%d0 47856: 46c1 movew %d1,%sr 47858: 8081 orl %d1,%d0 4785a: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 4785c: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 47862: 6610 bnes 47874 <_Thread_Yield_processor+0x68> <== ALWAYS TAKEN _Thread_Heir = (Thread_Control *) ready->first; 47864: 23d1 0005 bac2 movel %a1@,5bac2 <_Thread_Heir> 4786a: 6008 bras 47874 <_Thread_Yield_processor+0x68> <== ALWAYS TAKEN _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 4786c: b1f9 0005 bac2 cmpal 5bac2 <_Thread_Heir>,%a0 47872: 6708 beqs 4787c <_Thread_Yield_processor+0x70> <== NEVER TAKEN _Context_Switch_necessary = true; 47874: 7001 moveq #1,%d0 47876: 13c0 0005 bafe moveb %d0,5bafe <_Context_Switch_necessary> _ISR_Enable( level ); 4787c: 46c1 movew %d1,%sr } 4787e: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 47882: 4e5e unlk %fp 47884: 4e75 rts ... 00046724 <_Thread_blocking_operation_Cancel>: /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 46724: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 46726: 4e56 0000 linkw %fp,#0 4672a: 202e 0010 movel %fp@(16),%d0 4672e: 2f0a movel %a2,%sp@- 46730: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 46734: 42aa 0044 clrl %a2@(68) /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 46738: b2aa 0050 cmpl %a2@(80),%d1 4673c: 6618 bnes 46756 <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4673e: 123c 0003 moveb #3,%d1 46742: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 46746: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 46748: 486a 0048 pea %a2@(72) 4674c: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 46752: 588f addql #4,%sp 46754: 6002 bras 46758 <_Thread_blocking_operation_Cancel+0x34> <== ALWAYS TAKEN } else _ISR_Enable( level ); 46756: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 46758: 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 } 4675c: 246e fffc moveal %fp@(-4),%a2 46760: 203c 1003 fff8 movel #268697592,%d0 46766: 2d40 000c movel %d0,%fp@(12) 4676a: 4e5e unlk %fp 4676c: 4ef9 0004 68b4 jmp 468b4 <_Thread_Clear_state> ... 00049ec4 <_Thread_queue_Dequeue_fifo>: ) { ISR_Level level; Thread_Control *the_thread; _ISR_Disable( level ); 49ec4: 223c 0000 0700 movel #1792,%d1 */ Thread_Control *_Thread_queue_Dequeue_fifo( Thread_queue_Control *the_thread_queue ) { 49eca: 4e56 fff4 linkw %fp,#-12 49ece: 206e 0008 moveal %fp@(8),%a0 49ed2: 48d7 1c00 moveml %a2-%a4,%sp@ ISR_Level level; Thread_Control *the_thread; _ISR_Disable( level ); 49ed6: 40c0 movew %sr,%d0 49ed8: 8280 orl %d0,%d1 49eda: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49edc: 2248 moveal %a0,%a1 49ede: 2459 moveal %a1@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 49ee0: b3ca cmpal %a2,%a1 49ee2: 674e beqs 49f32 <_Thread_queue_Dequeue_fifo+0x6e> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 49ee4: 2252 moveal %a2@,%a1 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) { the_thread = (Thread_Control *) 49ee6: 264a moveal %a2,%a3 49ee8: 49f9 0004 68b4 lea 468b4 <_Thread_Clear_state>,%a4 _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 49eee: 7202 moveq #2,%d1 the_chain->first = new_first; 49ef0: 2089 movel %a1,%a0@ new_first->previous = _Chain_Head(the_chain); 49ef2: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) { the_thread = (Thread_Control *) _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo ); the_thread->Wait.queue = NULL; 49ef6: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 49efa: b2aa 0050 cmpl %a2@(80),%d1 49efe: 6710 beqs 49f10 <_Thread_queue_Dequeue_fifo+0x4c> _ISR_Enable( level ); 49f00: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 49f02: 2f3c 1003 fff8 movel #268697592,%sp@- 49f08: 2f0a movel %a2,%sp@- 49f0a: 4e94 jsr %a4@ 49f0c: 508f addql #8,%sp 49f0e: 6026 bras 49f36 <_Thread_queue_Dequeue_fifo+0x72> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 49f10: 7203 moveq #3,%d1 49f12: 2541 0050 movel %d1,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 49f16: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 49f18: 486a 0048 pea %a2@(72) 49f1c: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 49f22: 2f3c 1003 fff8 movel #268697592,%sp@- 49f28: 2f0a movel %a2,%sp@- 49f2a: 4e94 jsr %a4@ 49f2c: 4fef 000c lea %sp@(12),%sp 49f30: 6004 bras 49f36 <_Thread_queue_Dequeue_fifo+0x72> <== ALWAYS TAKEN #endif return the_thread; } _ISR_Enable( level ); 49f32: 46c0 movew %d0,%sr 49f34: 97cb subal %a3,%a3 return NULL; } 49f36: 200b movel %a3,%d0 49f38: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 49f3e: 4e5e unlk %fp 49f40: 4e75 rts ... 00046fec <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 46fec: 203c 0000 0700 movel #1792,%d0 */ Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 46ff2: 4e56 ffec linkw %fp,#-20 46ff6: 226e 0008 moveal %fp@(8),%a1 46ffa: 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 ); 46ffe: 40c1 movew %sr,%d1 47000: 8081 orl %d1,%d0 47002: 46c0 movew %d0,%sr 47004: 4280 clrl %d0 47006: 2049 moveal %a1,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47008: 2408 movel %a0,%d2 4700a: 5882 addql #4,%d2 4700c: b490 cmpl %a0@,%d2 4700e: 6728 beqs 47038 <_Thread_queue_Dequeue_priority+0x4c> 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 *) 47010: 2400 movel %d0,%d2 47012: e588 lsll #2,%d0 47014: e98a lsll #4,%d2 47016: 9480 subl %d0,%d2 47018: 2471 2800 moveal %a1@(00000000,%d2:l),%a2 4701c: 200a movel %a2,%d0 4701e: 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; 47024: 206a 0038 moveal %a2@(56),%a0 new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 47028: 2652 moveal %a2@,%a3 previous_node = the_thread->Object.Node.previous; 4702a: 226a 0004 moveal %a2@(4),%a1 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 4702e: 42aa 0044 clrl %a2@(68) 47032: b088 cmpl %a0,%d0 47034: 6614 bnes 4704a <_Thread_queue_Dequeue_priority+0x5e> 47036: 6046 bras 4707e <_Thread_queue_Dequeue_priority+0x92> <== ALWAYS TAKEN Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 47038: 5280 addql #1,%d0 4703a: 41e8 000c lea %a0@(12),%a0 Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 4703e: 7404 moveq #4,%d2 47040: b480 cmpl %d0,%d2 47042: 66c4 bnes 47008 <_Thread_queue_Dequeue_priority+0x1c> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 47044: 46c1 movew %d1,%sr 47046: 95ca subal %a2,%a2 return NULL; 47048: 6078 bras 470c2 <_Thread_queue_Dequeue_priority+0xd6> <== ALWAYS TAKEN 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; 4704a: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4704e: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 47050: 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; 47054: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 47056: 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; 4705a: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4705c: 226a 0040 moveal %a2@(64),%a1 47060: b3ea 0038 cmpal %a2@(56),%a1 47064: 671e beqs 47084 <_Thread_queue_Dequeue_priority+0x98> /* > two threads on 2-n */ new_second_node->previous = 47066: 43e8 0038 lea %a0@(56),%a1 4706a: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4706e: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 47072: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 47076: 41e8 003c lea %a0@(60),%a0 4707a: 2888 movel %a0,%a4@ 4707c: 6006 bras 47084 <_Thread_queue_Dequeue_priority+0x98> <== ALWAYS TAKEN } } else { previous_node->next = next_node; next_node->previous = previous_node; 4707e: 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; 47082: 228b movel %a3,%a1@ 47084: 47f9 0004 68b4 lea 468b4 <_Thread_Clear_state>,%a3 next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4708a: 7002 moveq #2,%d0 4708c: b0aa 0050 cmpl %a2@(80),%d0 47090: 6710 beqs 470a2 <_Thread_queue_Dequeue_priority+0xb6> _ISR_Enable( level ); 47092: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 47094: 2f3c 1003 fff8 movel #268697592,%sp@- 4709a: 2f0a movel %a2,%sp@- 4709c: 4e93 jsr %a3@ 4709e: 508f addql #8,%sp 470a0: 6020 bras 470c2 <_Thread_queue_Dequeue_priority+0xd6> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 470a2: 7403 moveq #3,%d2 470a4: 2542 0050 movel %d2,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 470a8: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 470aa: 486a 0048 pea %a2@(72) 470ae: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 470b4: 2f3c 1003 fff8 movel #268697592,%sp@- 470ba: 2f0a movel %a2,%sp@- 470bc: 4e93 jsr %a3@ 470be: 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 ); } 470c2: 200a movel %a2,%d0 470c4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 470ca: 4e5e unlk %fp 470cc: 4e75 rts ... 00049f44 <_Thread_queue_Enqueue_fifo>: ) { Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 49f44: 203c 0000 0700 movel #1792,%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_fifo ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 49f4a: 4e56 0000 linkw %fp,#0 49f4e: 206e 0008 moveal %fp@(8),%a0 49f52: 2f0a movel %a2,%sp@- 49f54: 226e 000c moveal %fp@(12),%a1 49f58: 2f02 movel %d2,%sp@- Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 49f5a: 40c1 movew %sr,%d1 49f5c: 8081 orl %d1,%d0 49f5e: 46c0 movew %d0,%sr sync_state = the_thread_queue->sync_state; 49f60: 2028 0030 movel %a0@(48),%d0 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 49f64: 7401 moveq #1,%d2 ISR_Level level; _ISR_Disable( level ); sync_state = the_thread_queue->sync_state; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 49f66: 42a8 0030 clrl %a0@(48) if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 49f6a: b480 cmpl %d0,%d2 49f6c: 661c bnes 49f8a <_Thread_queue_Enqueue_fifo+0x46> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 49f6e: 2408 movel %a0,%d2 49f70: 5882 addql #4,%d2 49f72: 2282 movel %d2,%a1@ old_last_node = the_chain->last; 49f74: 2468 0008 moveal %a0@(8),%a2 the_chain->last = the_node; 49f78: 2149 0008 movel %a1,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 49f7c: 234a 0004 movel %a2,%a1@(4) _Chain_Append_unprotected( &the_thread_queue->Queues.Fifo, &the_thread->Object.Node ); the_thread->Wait.queue = the_thread_queue; 49f80: 2348 0044 movel %a0,%a1@(68) 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; 49f84: 2489 movel %a1,%a2@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; _ISR_Enable( level ); 49f86: 46c1 movew %d1,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 49f88: 6006 bras 49f90 <_Thread_queue_Enqueue_fifo+0x4c> <== ALWAYS 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; 49f8a: 206e 0010 moveal %fp@(16),%a0 49f8e: 2081 movel %d1,%a0@ return sync_state; } 49f90: 241f movel %sp@+,%d2 49f92: 245f moveal %sp@+,%a2 49f94: 4e5e unlk %fp 49f96: 4e75 rts 00047168 <_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 ) { 47168: 4e56 ffe4 linkw %fp,#-28 4716c: 206e 000c moveal %fp@(12),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47170: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 47174: 2028 0014 movel %a0@(20),%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47178: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 4717c: 2400 movel %d0,%d2 4717e: ec8a lsrl #6,%d2 47180: 2202 movel %d2,%d1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 47182: 283c 0000 0700 movel #1792,%d4 _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 ]; 47188: e989 lsll #4,%d1 4718a: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 4718c: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47190: 9282 subl %d2,%d1 47192: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 47196: 2149 0038 movel %a1,%a0@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4719a: 43e8 0038 lea %a0@(56),%a1 block_state = the_thread_queue->state; 4719e: 2a2a 0038 movel %a2@(56),%d5 471a2: 2149 0040 movel %a1,%a0@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 471a6: 42a8 003c clrl %a0@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 471aa: 0800 0005 btst #5,%d0 471ae: 6660 bnes 47210 <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 471b0: 2c0b movel %a3,%d6 471b2: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 471b4: 2404 movel %d4,%d2 471b6: 40c1 movew %sr,%d1 471b8: 8481 orl %d1,%d2 471ba: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->first; 471bc: 2253 moveal %a3@,%a1 471be: 76ff moveq #-1,%d3 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 471c0: 601e bras 471e0 <_Thread_queue_Enqueue_priority+0x78> <== ALWAYS TAKEN search_priority = search_thread->current_priority; 471c2: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 471c6: b680 cmpl %d0,%d3 471c8: 641a bccs 471e4 <_Thread_queue_Enqueue_priority+0x7c> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 471ca: 2404 movel %d4,%d2 471cc: 46c1 movew %d1,%sr 471ce: 8481 orl %d1,%d2 471d0: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 471d2: 2405 movel %d5,%d2 471d4: c4a9 0010 andl %a1@(16),%d2 471d8: 6604 bnes 471de <_Thread_queue_Enqueue_priority+0x76> <== NEVER TAKEN _ISR_Enable( level ); 471da: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 471dc: 60d6 bras 471b4 <_Thread_queue_Enqueue_priority+0x4c> <== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 471de: 2251 moveal %a1@,%a1 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 ) ) { 471e0: bc89 cmpl %a1,%d6 471e2: 66de bnes 471c2 <_Thread_queue_Enqueue_priority+0x5a> 471e4: 2401 movel %d1,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 471e6: 7801 moveq #1,%d4 471e8: b8aa 0030 cmpl %a2@(48),%d4 471ec: 6600 00a4 bnew 47292 <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 471f0: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 471f4: b680 cmpl %d0,%d3 471f6: 677e beqs 47276 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 471f8: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 471fc: 2089 movel %a1,%a0@ the_node->previous = previous_node; 471fe: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47202: 214a 0044 movel %a2,%a0@(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; 47206: 2688 movel %a0,%a3@ search_node->previous = the_node; 47208: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4720c: 46c1 movew %d1,%sr 4720e: 6062 bras 47272 <_Thread_queue_Enqueue_priority+0x10a> <== ALWAYS TAKEN return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47210: 4283 clrl %d3 47212: 1639 0005 a302 moveb 5a302 ,%d3 _ISR_Disable( level ); 47218: 2404 movel %d4,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4721a: 5283 addql #1,%d3 _ISR_Disable( level ); 4721c: 40c1 movew %sr,%d1 4721e: 8481 orl %d1,%d2 47220: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->last; 47222: 226b 0008 moveal %a3@(8),%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 47226: 6020 bras 47248 <_Thread_queue_Enqueue_priority+0xe0> <== ALWAYS TAKEN search_priority = search_thread->current_priority; 47228: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 4722c: b680 cmpl %d0,%d3 4722e: 631c blss 4724c <_Thread_queue_Enqueue_priority+0xe4> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 47230: 2404 movel %d4,%d2 47232: 46c1 movew %d1,%sr 47234: 8481 orl %d1,%d2 47236: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 47238: 2405 movel %d5,%d2 4723a: c4a9 0010 andl %a1@(16),%d2 4723e: 6604 bnes 47244 <_Thread_queue_Enqueue_priority+0xdc> _ISR_Enable( level ); 47240: 46c1 movew %d1,%sr goto restart_reverse_search; 47242: 60cc bras 47210 <_Thread_queue_Enqueue_priority+0xa8> <== ALWAYS TAKEN } search_thread = (Thread_Control *) 47244: 2269 0004 moveal %a1@(4),%a1 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 ) ) { 47248: b7c9 cmpal %a1,%a3 4724a: 66dc bnes 47228 <_Thread_queue_Enqueue_priority+0xc0> 4724c: 2401 movel %d1,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 4724e: 7801 moveq #1,%d4 47250: b8aa 0030 cmpl %a2@(48),%d4 47254: 663c bnes 47292 <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47256: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 4725a: b680 cmpl %d0,%d3 4725c: 6718 beqs 47276 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 4725e: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 47260: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 47264: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47266: 214a 0044 movel %a2,%a0@(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; 4726a: 2288 movel %a0,%a1@ next_node->previous = the_node; 4726c: 2748 0004 movel %a0,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47270: 46c1 movew %d1,%sr 47272: 7001 moveq #1,%d0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47274: 6026 bras 4729c <_Thread_queue_Enqueue_priority+0x134> <== ALWAYS TAKEN 47276: 43e9 003c lea %a1@(60),%a1 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 4727a: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 4727e: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47280: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47284: 214a 0044 movel %a2,%a0@(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; 47288: 2688 movel %a0,%a3@ search_node->previous = the_node; 4728a: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4728e: 46c2 movew %d2,%sr 47290: 60e0 bras 47272 <_Thread_queue_Enqueue_priority+0x10a> <== ALWAYS 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; 47292: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 47296: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 4729a: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 4729c: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 472a0: 4e5e unlk %fp 472a2: 4e75 rts 0004b550 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4b550: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4b556: 4e56 0000 linkw %fp,#0 4b55a: 2f0a movel %a2,%sp@- 4b55c: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4b560: 40c0 movew %sr,%d0 4b562: 8280 orl %d0,%d1 4b564: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4b566: 222a 0010 movel %a2@(16),%d1 4b56a: 0281 0003 bee0 andil #245472,%d1 4b570: 660a bnes 4b57c <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4b572: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4b574: 246e fffc moveal %fp@(-4),%a2 4b578: 4e5e unlk %fp 4b57a: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4b57c: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4b57e: 7202 moveq #2,%d1 previous = the_node->previous; 4b580: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4b584: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4b588: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4b58a: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4b58e: b2aa 0050 cmpl %a2@(80),%d1 4b592: 6704 beqs 4b598 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4b594: 46c0 movew %d0,%sr 4b596: 6014 bras 4b5ac <_Thread_queue_Extract_fifo+0x5c> <== ALWAYS TAKEN 4b598: 7203 moveq #3,%d1 4b59a: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4b59e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4b5a0: 486a 0048 pea %a2@(72) 4b5a4: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 4b5aa: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4b5ac: 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 } 4b5b0: 246e fffc moveal %fp@(-4),%a2 4b5b4: 203c 1003 fff8 movel #268697592,%d0 4b5ba: 2d40 000c movel %d0,%fp@(12) 4b5be: 4e5e unlk %fp 4b5c0: 4ef9 0004 68b4 jmp 468b4 <_Thread_Clear_state> ... 00049fd0 <_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 ); 49fd0: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 49fd6: 4e56 ffec linkw %fp,#-20 49fda: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 49fde: 246e 000c moveal %fp@(12),%a2 49fe2: 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 ); 49fe6: 40c0 movew %sr,%d0 49fe8: 8280 orl %d0,%d1 49fea: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 49fec: 222a 0010 movel %a2@(16),%d1 49ff0: 0281 0003 bee0 andil #245472,%d1 49ff6: 6606 bnes 49ffe <_Thread_queue_Extract_priority_helper+0x2e> _ISR_Enable( level ); 49ff8: 46c0 movew %d0,%sr return; 49ffa: 6000 0096 braw 4a092 <_Thread_queue_Extract_priority_helper+0xc2> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 49ffe: 220a movel %a2,%d1 4a000: 0681 0000 003c addil #60,%d1 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 4a006: 2652 moveal %a2@,%a3 previous_node = the_node->previous; 4a008: 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)); 4a00c: 206a 0038 moveal %a2@(56),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a010: b288 cmpl %a0,%d1 4a012: 6734 beqs 4a048 <_Thread_queue_Extract_priority_helper+0x78> 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; 4a014: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4a018: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4a01a: 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; 4a01e: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4a020: 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; 4a024: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4a026: 222a 0040 movel %a2@(64),%d1 4a02a: b2aa 0038 cmpl %a2@(56),%d1 4a02e: 671e beqs 4a04e <_Thread_queue_Extract_priority_helper+0x7e> /* > two threads on 2-n */ new_second_node->previous = 4a030: 43e8 0038 lea %a0@(56),%a1 4a034: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4a038: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4a03c: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4a040: 41e8 003c lea %a0@(60),%a0 4a044: 2888 movel %a0,%a4@ 4a046: 6006 bras 4a04e <_Thread_queue_Extract_priority_helper+0x7e> <== ALWAYS TAKEN } } else { previous_node->next = next_node; next_node->previous = previous_node; 4a048: 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; 4a04c: 228b movel %a3,%a1@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4a04e: 4a02 tstb %d2 4a050: 6704 beqs 4a056 <_Thread_queue_Extract_priority_helper+0x86> _ISR_Enable( level ); 4a052: 46c0 movew %d0,%sr 4a054: 603c bras 4a092 <_Thread_queue_Extract_priority_helper+0xc2> <== ALWAYS TAKEN return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a056: 7202 moveq #2,%d1 4a058: b2aa 0050 cmpl %a2@(80),%d1 4a05c: 6704 beqs 4a062 <_Thread_queue_Extract_priority_helper+0x92> _ISR_Enable( level ); 4a05e: 46c0 movew %d0,%sr 4a060: 6014 bras 4a076 <_Thread_queue_Extract_priority_helper+0xa6> <== ALWAYS TAKEN 4a062: 7203 moveq #3,%d1 4a064: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4a068: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4a06a: 486a 0048 pea %a2@(72) 4a06e: 4eb9 0004 7c94 jsr 47c94 <_Watchdog_Remove> 4a074: 588f addql #4,%sp 4a076: 2d4a 0008 movel %a2,%fp@(8) 4a07a: 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 } 4a080: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a086: 2d49 000c movel %a1,%fp@(12) 4a08a: 4e5e unlk %fp 4a08c: 4ef9 0004 68b4 jmp 468b4 <_Thread_Clear_state> 4a092: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a098: 4e5e unlk %fp 4a09a: 4e75 rts 00056b24 <_Thread_queue_First_priority>: */ Thread_Control *_Thread_queue_First_priority ( Thread_queue_Control *the_thread_queue ) { 56b24: 4280 clrl %d0 56b26: 4e56 0000 linkw %fp,#0 56b2a: 226e 0008 moveal %fp@(8),%a1 56b2e: 2049 moveal %a1,%a0 56b30: 2208 movel %a0,%d1 56b32: 5881 addql #4,%d1 56b34: b290 cmpl %a0@,%d1 56b36: 670e beqs 56b46 <_Thread_queue_First_priority+0x22> for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) return (Thread_Control *) 56b38: 2200 movel %d0,%d1 56b3a: e588 lsll #2,%d0 56b3c: e989 lsll #4,%d1 56b3e: 9280 subl %d0,%d1 56b40: 2031 1800 movel %a1@(00000000,%d1:l),%d0 56b44: 600e bras 56b54 <_Thread_queue_First_priority+0x30> <== ALWAYS TAKEN { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 56b46: 5280 addql #1,%d0 56b48: 41e8 000c lea %a0@(12),%a0 Thread_queue_Control *the_thread_queue ) { uint32_t index; for( index=0 ; 56b4c: 7204 moveq #4,%d1 56b4e: b280 cmpl %d0,%d1 56b50: 66de bnes 56b30 <_Thread_queue_First_priority+0xc> 56b52: 4280 clrl %d0 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) return (Thread_Control *) the_thread_queue->Queues.Priority[ index ].first; } return NULL; } 56b54: 4e5e unlk %fp 56b56: 4e75 rts 000472cc <_Thread_queue_Flush>: #else Thread_queue_Flush_callout remote_extract_callout __attribute__((unused)), #endif uint32_t status ) { 472cc: 4e56 fff4 linkw %fp,#-12 472d0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 472d4: 262e 0008 movel %fp@(8),%d3 Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 472d8: 45f9 0004 6f90 lea 46f90 <_Thread_queue_Dequeue>,%a2 #else Thread_queue_Flush_callout remote_extract_callout __attribute__((unused)), #endif uint32_t status ) { 472de: 242e 0010 movel %fp@(16),%d2 Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 472e2: 6006 bras 472ea <_Thread_queue_Flush+0x1e> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) ( *remote_extract_callout )( the_thread ); else #endif the_thread->Wait.return_code = status; 472e4: 2040 moveal %d0,%a0 472e6: 2142 0034 movel %d2,%a0@(52) uint32_t status ) { Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 472ea: 2f03 movel %d3,%sp@- 472ec: 4e92 jsr %a2@ 472ee: 588f addql #4,%sp 472f0: 4a80 tstl %d0 472f2: 66f0 bnes 472e4 <_Thread_queue_Flush+0x18> ( *remote_extract_callout )( the_thread ); else #endif the_thread->Wait.return_code = status; } } 472f4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 472fa: 4e5e unlk %fp 472fc: 4e75 rts ... 00047300 <_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 ) { 47300: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 47302: 4e56 0000 linkw %fp,#0 47306: 206e 0008 moveal %fp@(8),%a0 the_thread_queue->state = state; 4730a: 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 ) { 47310: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 47314: 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; 4731a: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4731e: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 47322: b280 cmpl %d0,%d1 47324: 6620 bnes 47346 <_Thread_queue_Initialize+0x46> * timeout_status - return on a timeout * * Output parameters: NONE */ void _Thread_queue_Initialize( 47326: 2008 movel %a0,%d0 47328: 0680 0000 0030 addil #48,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4732e: 2208 movel %a0,%d1 47330: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 47332: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47336: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47338: 2148 0008 movel %a0,%a0@(8) 4733c: 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 ; 47340: b088 cmpl %a0,%d0 47342: 66ea bnes 4732e <_Thread_queue_Initialize+0x2e> 47344: 600e bras 47354 <_Thread_queue_Initialize+0x54> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47346: 2008 movel %a0,%d0 47348: 5880 addql #4,%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4734a: 2148 0008 movel %a0,%a0@(8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4734e: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 47350: 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 ); } } 47354: 4e5e unlk %fp 47356: 4e75 rts 0004a09c <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4a09c: 4e56 0000 linkw %fp,#0 4a0a0: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4a0a4: 2268 0044 moveal %a0@(68),%a1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4a0a8: 2029 0030 movel %a1@(48),%d0 4a0ac: 671c beqs 4a0ca <_Thread_queue_Process_timeout+0x2e> 4a0ae: b1f9 0005 baee cmpal 5baee <_Thread_Executing>,%a0 4a0b4: 6614 bnes 4a0ca <_Thread_queue_Process_timeout+0x2e> _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4a0b6: 7203 moveq #3,%d1 4a0b8: b280 cmpl %d0,%d1 4a0ba: 6722 beqs 4a0de <_Thread_queue_Process_timeout+0x42> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a0bc: 7002 moveq #2,%d0 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a0be: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a0c4: 2340 0030 movel %d0,%a1@(48) 4a0c8: 6014 bras 4a0de <_Thread_queue_Process_timeout+0x42> <== ALWAYS TAKEN } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a0ca: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4a0d0: 2f08 movel %a0,%sp@- 4a0d2: 2f28 0044 movel %a0@(68),%sp@- 4a0d6: 4eb9 0004 9f98 jsr 49f98 <_Thread_queue_Extract> 4a0dc: 508f addql #8,%sp } } 4a0de: 4e5e unlk %fp 4a0e0: 4e75 rts ... 00047358 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47358: 4e56 fff0 linkw %fp,#-16 4735c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47360: 246e 0008 moveal %fp@(8),%a2 47364: 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 ) 47368: 4a8a tstl %a2 4736a: 6746 beqs 473b2 <_Thread_queue_Requeue+0x5a> <== 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 ) { 4736c: 7001 moveq #1,%d0 4736e: b0aa 0034 cmpl %a2@(52),%d0 47372: 663e bnes 473b2 <_Thread_queue_Requeue+0x5a> <== ALWAYS TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47374: 303c 0700 movew #1792,%d0 47378: 40c2 movew %sr,%d2 4737a: 8082 orl %d2,%d0 4737c: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4737e: 202b 0010 movel %a3@(16),%d0 47382: 0280 0003 bee0 andil #245472,%d0 47388: 6726 beqs 473b0 <_Thread_queue_Requeue+0x58> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4738a: 4878 0001 pea 1 4738e: 7001 moveq #1,%d0 47390: 2f0b movel %a3,%sp@- 47392: 2540 0030 movel %d0,%a2@(48) 47396: 2f0a movel %a2,%sp@- 47398: 4eb9 0004 9fd0 jsr 49fd0 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4739e: 486e fffc pea %fp@(-4) 473a2: 2f0b movel %a3,%sp@- 473a4: 2f0a movel %a2,%sp@- 473a6: 4eb9 0004 7168 jsr 47168 <_Thread_queue_Enqueue_priority> 473ac: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 473b0: 46c2 movew %d2,%sr } } 473b2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 473b8: 4e5e unlk %fp 473ba: 4e75 rts 000473bc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 473bc: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 473c0: 486e fffc pea %fp@(-4) 473c4: 2f2e 0008 movel %fp@(8),%sp@- 473c8: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 473ce: 508f addql #8,%sp 473d0: 4aae fffc tstl %fp@(-4) 473d4: 6618 bnes 473ee <_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 ); 473d6: 2f00 movel %d0,%sp@- 473d8: 4eb9 0004 a09c jsr 4a09c <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 473de: 588f addql #4,%sp 473e0: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 473e6: 5380 subql #1,%d0 473e8: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 473ee: 4e5e unlk %fp 473f0: 4e75 rts ... 00050edc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 50edc: 4e56 ffb4 linkw %fp,#-76 50ee0: 200e movel %fp,%d0 50ee2: 0680 ffff fff4 addil #-12,%d0 50ee8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 50eec: 246e 0008 moveal %fp@(8),%a2 50ef0: 240e movel %fp,%d2 50ef2: 2a0e movel %fp,%d5 50ef4: 260e movel %fp,%d3 50ef6: 0682 ffff ffe8 addil #-24,%d2 50efc: 5185 subql #8,%d5 50efe: 0683 ffff ffec addil #-20,%d3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50f04: 41ea 0008 lea %a2@(8),%a0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 50f08: 4bea 0040 lea %a2@(64),%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f0c: 2e0a movel %a2,%d7 /* * 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 ); 50f0e: 280a movel %a2,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f10: 0687 0000 0030 addil #48,%d7 /* * 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 ); 50f16: 0684 0000 0068 addil #104,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f1c: 49f9 0005 48fc lea 548fc <_Watchdog_Adjust_to_chain>,%a4 ) { 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 ); 50f22: 47f9 0005 498c lea 5498c <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50f28: 2d48 ffe4 movel %a0,%fp@(-28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50f2c: 2d45 fff4 movel %d5,%fp@(-12) the_chain->permanent_null = NULL; 50f30: 42ae fff8 clrl %fp@(-8) the_chain->last = _Chain_Head(the_chain); 50f34: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50f38: 2d43 ffe8 movel %d3,%fp@(-24) the_chain->permanent_null = NULL; 50f3c: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 50f40: 2d42 fff0 movel %d2,%fp@(-16) 50f44: 2d4d ffe0 movel %a5,%fp@(-32) { /* * 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; 50f48: 41ee fff4 lea %fp@(-12),%a0 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 50f4c: 3a7c 0700 moveaw #1792,%a5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 50f50: 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; 50f54: 2039 0007 3a20 movel 73a20 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 50f5a: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 50f5e: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f62: 486e ffe8 pea %fp@(-24) 50f66: 9081 subl %d1,%d0 50f68: 2f00 movel %d0,%sp@- 50f6a: 2f07 movel %d7,%sp@- 50f6c: 4e94 jsr %a4@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 50f6e: 2039 0007 3972 movel 73972 <_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 ) { 50f74: 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; 50f78: 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 ) { 50f7c: b280 cmpl %d0,%d1 50f7e: 6414 bccs 50f94 <_Timer_server_Body+0xb8> /* * 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 ); 50f80: 486e ffe8 pea %fp@(-24) 50f84: 2c00 movel %d0,%d6 50f86: 9c81 subl %d1,%d6 50f88: 2f06 movel %d6,%sp@- 50f8a: 2d40 ffdc movel %d0,%fp@(-36) 50f8e: 2f04 movel %d4,%sp@- 50f90: 4e94 jsr %a4@ 50f92: 6018 bras 50fac <_Timer_server_Body+0xd0> <== ALWAYS TAKEN } else if ( snapshot < last_snapshot ) { 50f94: b280 cmpl %d0,%d1 50f96: 631c blss 50fb4 <_Timer_server_Body+0xd8> /* * 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 ); 50f98: 9280 subl %d0,%d1 50f9a: 2f01 movel %d1,%sp@- 50f9c: 4878 0001 pea 1 50fa0: 2d40 ffdc movel %d0,%fp@(-36) 50fa4: 2f04 movel %d4,%sp@- 50fa6: 4eb9 0005 487c jsr 5487c <_Watchdog_Adjust> 50fac: 202e ffdc movel %fp@(-36),%d0 50fb0: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 50fb4: 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 ); 50fb8: 202a 0078 movel %a2@(120),%d0 50fbc: 2f00 movel %d0,%sp@- 50fbe: 4eb9 0005 185c jsr 5185c <_Chain_Get> if ( timer == NULL ) { 50fc4: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 50fc6: 2040 moveal %d0,%a0 if ( timer == NULL ) { 50fc8: 4a80 tstl %d0 50fca: 6724 beqs 50ff0 <_Timer_server_Body+0x114> <== NEVER TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 50fcc: 2028 0038 movel %a0@(56),%d0 <== NOT EXECUTED 50fd0: 7201 moveq #1,%d1 <== NOT EXECUTED 50fd2: b280 cmpl %d0,%d1 <== NOT EXECUTED 50fd4: 6608 bnes 50fde <_Timer_server_Body+0x102> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 50fd6: 4868 0010 pea %a0@(16) <== NOT EXECUTED 50fda: 2f07 movel %d7,%sp@- <== NOT EXECUTED 50fdc: 600c bras 50fea <_Timer_server_Body+0x10e> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 50fde: 7c03 moveq #3,%d6 <== NOT EXECUTED 50fe0: bc80 cmpl %d0,%d6 <== NOT EXECUTED 50fe2: 66d4 bnes 50fb8 <_Timer_server_Body+0xdc> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 50fe4: 4868 0010 pea %a0@(16) <== NOT EXECUTED 50fe8: 2f04 movel %d4,%sp@- <== NOT EXECUTED 50fea: 4e93 jsr %a3@ <== NOT EXECUTED 50fec: 508f addql #8,%sp <== NOT EXECUTED 50fee: 60c8 bras 50fb8 <_Timer_server_Body+0xdc> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 50ff0: 200d movel %a5,%d0 50ff2: 40c1 movew %sr,%d1 50ff4: 8081 orl %d1,%d0 50ff6: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 50ff8: baae fff4 cmpl %fp@(-12),%d5 50ffc: 6612 bnes 51010 <_Timer_server_Body+0x134> <== ALWAYS TAKEN ts->insert_chain = NULL; 50ffe: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 51002: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51004: 3a7c 0700 moveaw #1792,%a5 _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 ) ) { 51008: b6ae ffe8 cmpl %fp@(-24),%d3 5100c: 6608 bnes 51016 <_Timer_server_Body+0x13a> 5100e: 6042 bras 51052 <_Timer_server_Body+0x176> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 51010: 46c1 movew %d1,%sr <== NOT EXECUTED 51012: 6000 ff40 braw 50f54 <_Timer_server_Body+0x78> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51016: 220d movel %a5,%d1 51018: 40c0 movew %sr,%d0 5101a: 8280 orl %d0,%d1 5101c: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5101e: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 51022: b688 cmpl %a0,%d3 51024: 6726 beqs 5104c <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 51026: 2250 moveal %a0@,%a1 the_chain->first = new_first; 51028: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 5102c: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 51030: 4a88 tstl %a0 51032: 6718 beqs 5104c <_Timer_server_Body+0x170> <== ALWAYS TAKEN watchdog->state = WATCHDOG_INACTIVE; 51034: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 51038: 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 ); 5103a: 2f28 0024 movel %a0@(36),%sp@- 5103e: 2f28 0020 movel %a0@(32),%sp@- 51042: 2068 001c moveal %a0@(28),%a0 51046: 4e90 jsr %a0@ } 51048: 508f addql #8,%sp 5104a: 60ca bras 51016 <_Timer_server_Body+0x13a> <== ALWAYS TAKEN watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 5104c: 46c0 movew %d0,%sr 5104e: 6000 fef8 braw 50f48 <_Timer_server_Body+0x6c> <== ALWAYS TAKEN * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 51052: 4200 clrb %d0 51054: 1540 007c moveb %d0,%a2@(124) 51058: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 5105e: 5280 addql #1,%d0 51060: 23c0 0007 38e0 movel %d0,738e0 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 51066: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5106a: 4bf9 0005 4aa8 lea 54aa8 <_Watchdog_Remove>,%a5 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 51070: 2f12 movel %a2@,%sp@- 51072: 4eb9 0005 40c8 jsr 540c8 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 51078: 2f0a movel %a2,%sp@- 5107a: 4eba fd9c jsr %pc@(50e18 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 5107e: 2f0a movel %a2,%sp@- 51080: 4eba fdf6 jsr %pc@(50e78 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 51084: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> ts->active = true; 5108a: 7201 moveq #1,%d1 5108c: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51090: 2f2e ffe4 movel %fp@(-28),%sp@- 51094: 4e95 jsr %a5@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51096: 2f2e ffe0 movel %fp@(-32),%sp@- 5109a: 4e95 jsr %a5@ 5109c: 4fef 0018 lea %sp@(24),%sp 510a0: 6000 fea6 braw 50f48 <_Timer_server_Body+0x6c> <== ALWAYS TAKEN 00050e18 <_Timer_server_Reset_interval_system_watchdog>: } static void _Timer_server_Reset_interval_system_watchdog( Timer_server_Control *ts ) { 50e18: 4e56 0000 linkw %fp,#0 50e1c: 2f0a movel %a2,%sp@- 50e1e: 246e 0008 moveal %fp@(8),%a2 50e22: 2f02 movel %d2,%sp@- static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50e24: 240a movel %a2,%d2 50e26: 5082 addql #8,%d2 50e28: 2f02 movel %d2,%sp@- 50e2a: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> { ISR_Level level; _Timer_server_Stop_interval_system_watchdog( ts ); _ISR_Disable( level ); 50e30: 203c 0000 0700 movel #1792,%d0 50e36: 40c1 movew %sr,%d1 50e38: 8081 orl %d1,%d0 50e3a: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50e3c: 200a movel %a2,%d0 50e3e: 588f addql #4,%sp 50e40: 0680 0000 0034 addil #52,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 50e46: 206a 0030 moveal %a2@(48),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50e4a: b088 cmpl %a0,%d0 50e4c: 671c beqs 50e6a <_Timer_server_Reset_interval_system_watchdog+0x52> if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { Watchdog_Interval delta_interval = _Watchdog_First( &ts->Interval_watchdogs.Chain )->delta_interval; 50e4e: 2028 0010 movel %a0@(16),%d0 _ISR_Enable( level ); 50e52: 46c1 movew %d1,%sr ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 50e54: 2f02 movel %d2,%sp@- 50e56: 4879 0007 39b8 pea 739b8 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 50e5c: 2540 0014 movel %d0,%a2@(20) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 50e60: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> 50e66: 508f addql #8,%sp 50e68: 6002 bras 50e6c <_Timer_server_Reset_interval_system_watchdog+0x54> <== ALWAYS TAKEN _Watchdog_Insert_ticks( &ts->Interval_watchdogs.System_watchdog, delta_interval ); } else { _ISR_Enable( level ); 50e6a: 46c1 movew %d1,%sr } } 50e6c: 242e fff8 movel %fp@(-8),%d2 50e70: 246e fffc moveal %fp@(-4),%a2 50e74: 4e5e unlk %fp 50e76: 4e75 rts 00050e78 <_Timer_server_Reset_tod_system_watchdog>: } static void _Timer_server_Reset_tod_system_watchdog( Timer_server_Control *ts ) { 50e78: 4e56 0000 linkw %fp,#0 50e7c: 2f0a movel %a2,%sp@- 50e7e: 246e 0008 moveal %fp@(8),%a2 50e82: 2f02 movel %d2,%sp@- static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 50e84: 240a movel %a2,%d2 50e86: 0682 0000 0040 addil #64,%d2 50e8c: 2f02 movel %d2,%sp@- 50e8e: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> { ISR_Level level; _Timer_server_Stop_tod_system_watchdog( ts ); _ISR_Disable( level ); 50e94: 203c 0000 0700 movel #1792,%d0 50e9a: 40c1 movew %sr,%d1 50e9c: 8081 orl %d1,%d0 50e9e: 46c0 movew %d0,%sr 50ea0: 200a movel %a2,%d0 50ea2: 588f addql #4,%sp 50ea4: 0680 0000 006c addil #108,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 50eaa: 206a 0068 moveal %a2@(104),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50eae: b088 cmpl %a0,%d0 50eb0: 671c beqs 50ece <_Timer_server_Reset_tod_system_watchdog+0x56> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { Watchdog_Interval delta_interval = _Watchdog_First( &ts->TOD_watchdogs.Chain )->delta_interval; 50eb2: 2028 0010 movel %a0@(16),%d0 _ISR_Enable( level ); 50eb6: 46c1 movew %d1,%sr ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 50eb8: 2f02 movel %d2,%sp@- 50eba: 4879 0007 39ac pea 739ac <_Watchdog_Seconds_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 50ec0: 2540 004c movel %d0,%a2@(76) _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 50ec4: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> 50eca: 508f addql #8,%sp 50ecc: 6002 bras 50ed0 <_Timer_server_Reset_tod_system_watchdog+0x58> <== ALWAYS TAKEN _Watchdog_Insert_seconds( &ts->TOD_watchdogs.System_watchdog, delta_interval ); } else { _ISR_Enable( level ); 50ece: 46c1 movew %d1,%sr } } 50ed0: 242e fff8 movel %fp@(-8),%d2 50ed4: 246e fffc moveal %fp@(-4),%a2 50ed8: 4e5e unlk %fp 50eda: 4e75 rts 000510a4 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 510a4: 4e56 fff0 linkw %fp,#-16 510a8: 206e 000c moveal %fp@(12),%a0 510ac: 48d7 041c moveml %d2-%d4/%a2,%sp@ 510b0: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 510b4: 202a 0078 movel %a2@(120),%d0 510b8: 6600 00f8 bnew 511b2 <_Timer_server_Schedule_operation_method+0x10e> <== ALWAYS TAKEN 510bc: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 510c2: 5280 addql #1,%d0 510c4: 23c0 0007 38e0 movel %d0,738e0 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 510ca: 2028 0038 movel %a0@(56),%d0 510ce: 7201 moveq #1,%d1 510d0: b280 cmpl %d0,%d1 510d2: 6660 bnes 51134 <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 510d4: 203c 0000 0700 movel #1792,%d0 510da: 40c3 movew %sr,%d3 510dc: 8083 orl %d3,%d0 510de: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 510e0: 2039 0007 3a20 movel 73a20 <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 510e6: 220a movel %a2,%d1 510e8: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 510ee: 242a 003c movel %a2@(60),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 510f2: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 510f6: b289 cmpl %a1,%d1 510f8: 6716 beqs 51110 <_Timer_server_Schedule_operation_method+0x6c> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 510fa: 2800 movel %d0,%d4 510fc: 9882 subl %d2,%d4 delta_interval = first_watchdog->delta_interval; 510fe: 2229 0010 movel %a1@(16),%d1 if (delta_interval > delta) { 51102: b881 cmpl %d1,%d4 51104: 6504 bcss 5110a <_Timer_server_Schedule_operation_method+0x66> 51106: 4281 clrl %d1 51108: 6002 bras 5110c <_Timer_server_Schedule_operation_method+0x68> <== ALWAYS TAKEN delta_interval -= delta; 5110a: 9284 subl %d4,%d1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 5110c: 2341 0010 movel %d1,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 51110: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 51114: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 51116: 4868 0010 pea %a0@(16) 5111a: 486a 0030 pea %a2@(48) 5111e: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> if ( !ts->active ) { 51124: 508f addql #8,%sp 51126: 102a 007c moveb %a2@(124),%d0 5112a: 6678 bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_interval_system_watchdog( ts ); 5112c: 2f0a movel %a2,%sp@- 5112e: 4eba fce8 jsr %pc@(50e18 <_Timer_server_Reset_interval_system_watchdog>) 51132: 606e bras 511a2 <_Timer_server_Schedule_operation_method+0xfe> <== ALWAYS TAKEN } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51134: 7203 moveq #3,%d1 51136: b280 cmpl %d0,%d1 51138: 666a bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5113a: 203c 0000 0700 movel #1792,%d0 51140: 40c3 movew %sr,%d3 51142: 8083 orl %d3,%d0 51144: 46c0 movew %d0,%sr 51146: 200a movel %a2,%d0 51148: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 5114e: 2239 0007 3972 movel 73972 <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 51154: 242a 0074 movel %a2@(116),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 51158: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5115c: b089 cmpl %a1,%d0 5115e: 6720 beqs 51180 <_Timer_server_Schedule_operation_method+0xdc> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 51160: 2029 0010 movel %a1@(16),%d0 if ( snapshot > last_snapshot ) { 51164: b481 cmpl %d1,%d2 51166: 6410 bccs 51178 <_Timer_server_Schedule_operation_method+0xd4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 51168: 2801 movel %d1,%d4 5116a: 9882 subl %d2,%d4 if (delta_interval > delta) { 5116c: b880 cmpl %d0,%d4 5116e: 6504 bcss 51174 <_Timer_server_Schedule_operation_method+0xd0> <== NEVER TAKEN 51170: 4280 clrl %d0 <== NOT EXECUTED 51172: 6008 bras 5117c <_Timer_server_Schedule_operation_method+0xd8> <== NOT EXECUTED delta_interval -= delta; 51174: 9084 subl %d4,%d0 51176: 6004 bras 5117c <_Timer_server_Schedule_operation_method+0xd8> <== ALWAYS TAKEN } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 51178: d082 addl %d2,%d0 delta_interval += delta; 5117a: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 5117c: 2340 0010 movel %d0,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 51180: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 51184: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51186: 4868 0010 pea %a0@(16) 5118a: 486a 0068 pea %a2@(104) 5118e: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> if ( !ts->active ) { 51194: 508f addql #8,%sp 51196: 102a 007c moveb %a2@(124),%d0 5119a: 6608 bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_tod_system_watchdog( ts ); 5119c: 2f0a movel %a2,%sp@- 5119e: 4eba fcd8 jsr %pc@(50e78 <_Timer_server_Reset_tod_system_watchdog>) 511a2: 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 ); } } 511a4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 511aa: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 511ac: 4ef9 0005 376a jmp 5376a <_Thread_Enable_dispatch> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 511b2: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED 511b6: 2d48 000c movel %a0,%fp@(12) <== NOT EXECUTED } } 511ba: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 511c0: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } 511c4: 4e5e unlk %fp <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 511c6: 4ef9 0005 1824 jmp 51824 <_Chain_Append> <== NOT EXECUTED 00047888 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 47888: 4e56 0000 linkw %fp,#0 4788c: 206e 0008 moveal %fp@(8),%a0 47890: 2f0a movel %a2,%sp@- 47892: 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; 47896: 226a 0004 moveal %a2@(4),%a1 4789a: d3e8 0004 addal %a0@(4),%a1 4789e: 2209 movel %a1,%d1 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 478a0: 2012 movel %a2@,%d0 /* Add the basics */ time->tv_sec += add->tv_sec; 478a2: d190 addl %d0,%a0@ time->tv_nsec += add->tv_nsec; 478a4: 2149 0004 movel %a1,%a0@(4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 478a8: 600a bras 478b4 <_Timespec_Add_to+0x2c> <== ALWAYS TAKEN time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; 478aa: 5290 addql #1,%a0@ seconds++; 478ac: 5280 addql #1,%d0 478ae: 0681 c465 3600 addil #-1000000000,%d1 /* 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 ) { 478b4: 0c81 3b9a c9ff cmpil #999999999,%d1 478ba: 62ee bhis 478aa <_Timespec_Add_to+0x22> time->tv_sec++; seconds++; } return seconds; } 478bc: 245f moveal %sp@+,%a2 478be: 4e5e unlk %fp /* 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 ) { 478c0: 2141 0004 movel %d1,%a0@(4) time->tv_sec++; seconds++; } return seconds; } 478c4: 4e75 rts ... 00048cd8 <_Timespec_Divide>: const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48cd8: 4e56 ffdc linkw %fp,#-36 48cdc: 206e 0008 moveal %fp@(8),%a0 48ce0: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48ce4: 2f3c 3b9a ca00 movel #1000000000,%sp@- const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48cea: 266e 000c moveal %fp@(12),%a3 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48cee: 45f9 0005 8ea0 lea 58ea0 <__muldi3>,%a2 48cf4: 42a7 clrl %sp@- /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; 48cf6: 2428 0004 movel %a0@(4),%d2 right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48cfa: 2f13 movel %a3@,%sp@- 48cfc: 5bc0 smi %d0 48cfe: 49c0 extbl %d0 48d00: 2f00 movel %d0,%sp@- /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48d02: 2a10 movel %a0@,%d5 left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48d04: 4e92 jsr %a2@ const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48d06: 286e 0010 moveal %fp@(16),%a4 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48d0a: 2040 moveal %d0,%a0 48d0c: 2241 moveal %d1,%a1 48d0e: 4fef 0010 lea %sp@(16),%sp right += rhs->tv_nsec; 48d12: 282b 0004 movel %a3@(4),%d4 48d16: 5bc3 smi %d3 48d18: 49c3 extbl %d3 const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48d1a: 266e 0014 moveal %fp@(20),%a3 * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; right += rhs->tv_nsec; 48d1e: 2c08 movel %a0,%d6 48d20: d889 addl %a1,%d4 48d22: d786 addxl %d6,%d3 if ( right == 0 ) { 48d24: 6606 bnes 48d2c <_Timespec_Divide+0x54> *ival_percentage = 0; 48d26: 4294 clrl %a4@ *fval_percentage = 0; 48d28: 4293 clrl %a3@ return; 48d2a: 607a bras 48da6 <_Timespec_Divide+0xce> <== ALWAYS TAKEN * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48d2c: 4bf9 0005 8f08 lea 58f08 <__udivdi3>,%a5 /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48d32: 2f3c 3b9a ca00 movel #1000000000,%sp@- 48d38: 42a7 clrl %sp@- 48d3a: 2f05 movel %d5,%sp@- 48d3c: 5bc6 smi %d6 48d3e: 49c6 extbl %d6 48d40: 2f06 movel %d6,%sp@- 48d42: 4e92 jsr %a2@ 48d44: 4fef 0010 lea %sp@(16),%sp 48d48: 2040 moveal %d0,%a0 48d4a: 2241 moveal %d1,%a1 * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48d4c: 2f3c 0001 86a0 movel #100000,%sp@- 48d52: 2a08 movel %a0,%d5 48d54: 2c09 movel %a1,%d6 48d56: 2202 movel %d2,%d1 48d58: 5bc0 smi %d0 48d5a: 49c0 extbl %d0 48d5c: 42a7 clrl %sp@- 48d5e: dc81 addl %d1,%d6 48d60: db80 addxl %d0,%d5 48d62: 2f06 movel %d6,%sp@- 48d64: 2f05 movel %d5,%sp@- 48d66: 4e92 jsr %a2@ 48d68: 4fef 000c lea %sp@(12),%sp 48d6c: 2e84 movel %d4,%sp@ 48d6e: 2f03 movel %d3,%sp@- 48d70: 2f01 movel %d1,%sp@- 48d72: 2f00 movel %d0,%sp@- 48d74: 4e95 jsr %a5@ 48d76: 4fef 0010 lea %sp@(16),%sp 48d7a: 2400 movel %d0,%d2 *ival_percentage = answer / 1000; 48d7c: 4878 03e8 pea 3e8 * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48d80: 2601 movel %d1,%d3 *ival_percentage = answer / 1000; 48d82: 42a7 clrl %sp@- 48d84: 2f01 movel %d1,%sp@- 48d86: 2f02 movel %d2,%sp@- 48d88: 4e95 jsr %a5@ 48d8a: 4fef 0010 lea %sp@(16),%sp *fval_percentage = answer % 1000; 48d8e: 4878 03e8 pea 3e8 48d92: 42a7 clrl %sp@- * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; *ival_percentage = answer / 1000; 48d94: 2881 movel %d1,%a4@ *fval_percentage = answer % 1000; 48d96: 2f03 movel %d3,%sp@- 48d98: 2f02 movel %d2,%sp@- 48d9a: 4eb9 0005 92a4 jsr 592a4 <__umoddi3> 48da0: 4fef 0010 lea %sp@(16),%sp 48da4: 2681 movel %d1,%a3@ } 48da6: 4cee 3c7c ffdc moveml %fp@(-36),%d2-%d6/%a2-%a5 48dac: 4e5e unlk %fp 48dae: 4e75 rts 00071014 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 71014: 4e56 0000 linkw %fp,#0 71018: 226e 0008 moveal %fp@(8),%a1 7101c: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec > rhs->tv_sec ) 71020: 2211 movel %a1@,%d1 71022: 2010 movel %a0@,%d0 71024: b081 cmpl %d1,%d0 71026: 6c04 bges 7102c <_Timespec_Greater_than+0x18> 71028: 7001 moveq #1,%d0 7102a: 6014 bras 71040 <_Timespec_Greater_than+0x2c> <== ALWAYS TAKEN return true; if ( lhs->tv_sec < rhs->tv_sec ) 7102c: b081 cmpl %d1,%d0 7102e: 6f04 bles 71034 <_Timespec_Greater_than+0x20> <== NEVER TAKEN 71030: 4200 clrb %d0 <== NOT EXECUTED 71032: 600c bras 71040 <_Timespec_Greater_than+0x2c> <== NOT EXECUTED #include #include #include bool _Timespec_Greater_than( 71034: 2068 0004 moveal %a0@(4),%a0 71038: b1e9 0004 cmpal %a1@(4),%a0 7103c: 5dc0 slt %d0 7103e: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 71040: 4e5e unlk %fp 71042: 4e75 rts 0006120c <_Timespec_Is_valid>: #include bool _Timespec_Is_valid( const struct timespec *time ) { 6120c: 4e56 0000 linkw %fp,#0 61210: 206e 0008 moveal %fp@(8),%a0 if ( !time ) 61214: 4a88 tstl %a0 61216: 6716 beqs 6122e <_Timespec_Is_valid+0x22> return false; if ( time->tv_sec < 0 ) 61218: 4a90 tstl %a0@ 6121a: 6d12 blts 6122e <_Timespec_Is_valid+0x22> return false; if ( time->tv_nsec < 0 ) 6121c: 2028 0004 movel %a0@(4),%d0 61220: 6d0c blts 6122e <_Timespec_Is_valid+0x22> #include #include #include bool _Timespec_Is_valid( 61222: 0c80 3b9a c9ff cmpil #999999999,%d0 61228: 53c0 sls %d0 6122a: 4480 negl %d0 6122c: 6002 bras 61230 <_Timespec_Is_valid+0x24> <== ALWAYS TAKEN 6122e: 4200 clrb %d0 if ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) return false; return true; } 61230: 4e5e unlk %fp 61232: 4e75 rts 00071044 <_Timespec_Less_than>: bool _Timespec_Less_than( const struct timespec *lhs, const struct timespec *rhs ) { 71044: 4e56 0000 linkw %fp,#0 71048: 226e 0008 moveal %fp@(8),%a1 7104c: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec < rhs->tv_sec ) 71050: 2211 movel %a1@,%d1 71052: 2010 movel %a0@,%d0 71054: b081 cmpl %d1,%d0 71056: 6f04 bles 7105c <_Timespec_Less_than+0x18> 71058: 7001 moveq #1,%d0 7105a: 6014 bras 71070 <_Timespec_Less_than+0x2c> <== ALWAYS TAKEN return true; if ( lhs->tv_sec > rhs->tv_sec ) 7105c: b081 cmpl %d1,%d0 7105e: 6c04 bges 71064 <_Timespec_Less_than+0x20> 71060: 4200 clrb %d0 71062: 600c bras 71070 <_Timespec_Less_than+0x2c> <== ALWAYS TAKEN #include #include #include bool _Timespec_Less_than( 71064: 2068 0004 moveal %a0@(4),%a0 71068: b1e9 0004 cmpal %a1@(4),%a0 7106c: 5ec0 sgt %d0 7106e: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec < rhs->tv_nsec ) return true; return false; } 71070: 4e5e unlk %fp 71072: 4e75 rts 000478c8 <_Timespec_Subtract>: void _Timespec_Subtract( const struct timespec *start, const struct timespec *end, struct timespec *result ) { 478c8: 4e56 0000 linkw %fp,#0 478cc: 206e 0008 moveal %fp@(8),%a0 478d0: 2f0a movel %a2,%sp@- 478d2: 226e 000c moveal %fp@(12),%a1 478d6: 246e 0010 moveal %fp@(16),%a2 if (end->tv_nsec < start->tv_nsec) { 478da: 2028 0004 movel %a0@(4),%d0 478de: b0a9 0004 cmpl %a1@(4),%d0 478e2: 6f14 bles 478f8 <_Timespec_Subtract+0x30> result->tv_sec = end->tv_sec - start->tv_sec - 1; 478e4: 2211 movel %a1@,%d1 478e6: 5381 subql #1,%d1 478e8: 9290 subl %a0@,%d1 result->tv_nsec = 478ea: 2029 0004 movel %a1@(4),%d0 478ee: 0680 3b9a ca00 addil #1000000000,%d0 struct timespec *result ) { if (end->tv_nsec < start->tv_nsec) { result->tv_sec = end->tv_sec - start->tv_sec - 1; 478f4: 2481 movel %d1,%a2@ 478f6: 600a bras 47902 <_Timespec_Subtract+0x3a> <== ALWAYS TAKEN result->tv_nsec = (TOD_NANOSECONDS_PER_SECOND - start->tv_nsec) + end->tv_nsec; } else { result->tv_sec = end->tv_sec - start->tv_sec; 478f8: 2011 movel %a1@,%d0 478fa: 9090 subl %a0@,%d0 478fc: 2480 movel %d0,%a2@ result->tv_nsec = end->tv_nsec - start->tv_nsec; 478fe: 2029 0004 movel %a1@(4),%d0 47902: 90a8 0004 subl %a0@(4),%d0 47906: 2540 0004 movel %d0,%a2@(4) } } 4790a: 245f moveal %sp@+,%a2 4790c: 4e5e unlk %fp 4790e: 4e75 rts 00061234 <_Timespec_To_ticks>: */ uint32_t _Timespec_To_ticks( const struct timespec *time ) { 61234: 4e56 fff4 linkw %fp,#-12 61238: 48d7 040c moveml %d2-%d3/%a2,%sp@ 6123c: 246e 0008 moveal %fp@(8),%a2 uint32_t ticks; if ( (time->tv_sec == 0) && (time->tv_nsec == 0) ) 61240: 2412 movel %a2@,%d2 61242: 660a bnes 6124e <_Timespec_To_ticks+0x1a> 61244: 4aaa 0004 tstl %a2@(4) 61248: 6604 bnes 6124e <_Timespec_To_ticks+0x1a> 6124a: 4280 clrl %d0 6124c: 602a bras 61278 <_Timespec_To_ticks+0x44> <== ALWAYS TAKEN return 0; ticks = time->tv_sec * TOD_TICKS_PER_SECOND; 6124e: 4eb9 0006 1330 jsr 61330 ticks += time->tv_nsec / rtems_configuration_get_nanoseconds_per_tick(); 61254: 2239 0006 50c0 movel 650c0 ,%d1 6125a: 263c 0000 03e8 movel #1000,%d3 61260: 4c03 1800 mulsl %d3,%d1 uint32_t ticks; if ( (time->tv_sec == 0) && (time->tv_nsec == 0) ) return 0; ticks = time->tv_sec * TOD_TICKS_PER_SECOND; 61264: 4c02 0800 mulsl %d2,%d0 ticks += time->tv_nsec / rtems_configuration_get_nanoseconds_per_tick(); 61268: 262a 0004 movel %a2@(4),%d3 6126c: 4c41 3003 remul %d1,%d3,%d3 61270: d083 addl %d3,%d0 if (ticks) 61272: 6604 bnes 61278 <_Timespec_To_ticks+0x44> 61274: 103c 0001 moveb #1,%d0 return ticks; return 1; } 61278: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 6127e: 4e5e unlk %fp 61280: 4e75 rts ... 00047a32 <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47a32: 4e56 fff0 linkw %fp,#-16 47a36: 48d7 041c moveml %d2-%d4/%a2,%sp@ 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 ); 47a3a: 4282 clrl %d2 47a3c: 142e 000f moveb %fp@(15),%d2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47a40: 282e 0008 movel %fp@(8),%d4 47a44: 262e 0010 movel %fp@(16),%d3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47a48: 2479 0005 bbca moveal 5bbca <_User_extensions_List+0x8>,%a2 47a4e: 6018 bras 47a68 <_User_extensions_Fatal+0x36> <== 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.fatal != NULL ) 47a50: 206a 0030 moveal %a2@(48),%a0 47a54: 4a88 tstl %a0 47a56: 670c beqs 47a64 <_User_extensions_Fatal+0x32> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 47a58: 2f03 movel %d3,%sp@- 47a5a: 2f02 movel %d2,%sp@- 47a5c: 2f04 movel %d4,%sp@- 47a5e: 4e90 jsr %a0@ 47a60: 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 ) { 47a64: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47a68: b5fc 0005 bbc2 cmpal #375746,%a2 47a6e: 66e0 bnes 47a50 <_User_extensions_Fatal+0x1e> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 47a70: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47a76: 4e5e unlk %fp 47a78: 4e75 rts ... 00047910 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 47910: 4e56 ffe4 linkw %fp,#-28 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47914: 203c 0005 bbc6 movel #375750,%d0 4791a: 23c0 0005 bbc2 movel %d0,5bbc2 <_User_extensions_List> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47920: 203c 0005 bbc2 movel #375746,%d0 47926: 23c0 0005 bbca movel %d0,5bbca <_User_extensions_List+0x8> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4792c: 203c 0005 ba3c movel #375356,%d0 47932: 23c0 0005 ba38 movel %d0,5ba38 <_User_extensions_Switches_list> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47938: 203c 0005 ba38 movel #375352,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4793e: 42b9 0005 bbc6 clrl 5bbc6 <_User_extensions_List+0x4> 47944: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 47948: 2a39 0005 a33a movel 5a33a ,%d5 initial_extensions = Configuration.User_extension_table; 4794e: 2639 0005 a33e movel 5a33e ,%d3 47954: 42b9 0005 ba3c clrl 5ba3c <_User_extensions_Switches_list+0x4> the_chain->last = _Chain_Head(the_chain); 4795a: 23c0 0005 ba40 movel %d0,5ba40 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 47960: 4a83 tstl %d3 47962: 6750 beqs 479b4 <_User_extensions_Handler_initialization+0xa4> extension = (User_extensions_Control *) 47964: 7834 moveq #52,%d4 47966: 4c05 4800 mulsl %d5,%d4 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 4796a: 4282 clrl %d2 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 4796c: 49f9 0004 c200 lea 4c200 ,%a4 _User_extensions_Add_set( extension ); 47972: 47f9 0004 a218 lea 4a218 <_User_extensions_Add_set>,%a3 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 47978: 2f04 movel %d4,%sp@- 4797a: 4eb9 0004 7d8c jsr 47d8c <_Workspace_Allocate_or_fatal_error> 47980: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 47982: 2f04 movel %d4,%sp@- 47984: 42a7 clrl %sp@- 47986: 2f00 movel %d0,%sp@- 47988: 4eb9 0004 c270 jsr 4c270 4798e: 601c bras 479ac <_User_extensions_Handler_initialization+0x9c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 47990: 4878 0020 pea 20 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 47994: 5282 addql #1,%d2 47996: 2f03 movel %d3,%sp@- 47998: 486a 0014 pea %a2@(20) 4799c: 0683 0000 0020 addil #32,%d3 479a2: 4e94 jsr %a4@ _User_extensions_Add_set( extension ); 479a4: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 479a6: 45ea 0034 lea %a2@(52),%a2 479aa: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 479ac: 4fef 0010 lea %sp@(16),%sp 479b0: ba82 cmpl %d2,%d5 479b2: 62dc bhis 47990 <_User_extensions_Handler_initialization+0x80> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 479b4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 479ba: 4e5e unlk %fp 479bc: 4e75 rts ... 000479c0 <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 479c0: 4e56 0000 linkw %fp,#0 479c4: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 479c6: 2479 0005 bbc2 moveal 5bbc2 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 479cc: 2f02 movel %d2,%sp@- 479ce: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 479d2: 6010 bras 479e4 <_User_extensions_Thread_begin+0x24> <== 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 ) 479d4: 206a 0028 moveal %a2@(40),%a0 479d8: 4a88 tstl %a0 479da: 6706 beqs 479e2 <_User_extensions_Thread_begin+0x22> (*the_extension->Callouts.thread_begin)( executing ); 479dc: 2f02 movel %d2,%sp@- 479de: 4e90 jsr %a0@ 479e0: 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 ) { 479e2: 2452 moveal %a2@,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 479e4: b5fc 0005 bbc6 cmpal #375750,%a2 479ea: 66e8 bnes 479d4 <_User_extensions_Thread_begin+0x14> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) (*the_extension->Callouts.thread_begin)( executing ); } } 479ec: 242e fff8 movel %fp@(-8),%d2 479f0: 246e fffc moveal %fp@(-4),%a2 479f4: 4e5e unlk %fp 479f6: 4e75 rts 00047a7c <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 47a7c: 4e56 0000 linkw %fp,#0 47a80: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 47a82: 2479 0005 bbc2 moveal 5bbc2 <_User_extensions_List>,%a2 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 47a88: 2f02 movel %d2,%sp@- 47a8a: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 47a8e: 601a bras 47aaa <_User_extensions_Thread_create+0x2e> <== 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 ) { 47a90: 206a 0014 moveal %a2@(20),%a0 47a94: 4a88 tstl %a0 47a96: 6710 beqs 47aa8 <_User_extensions_Thread_create+0x2c> status = (*the_extension->Callouts.thread_create)( 47a98: 2f02 movel %d2,%sp@- 47a9a: 2f39 0005 baee movel 5baee <_Thread_Executing>,%sp@- 47aa0: 4e90 jsr %a0@ _Thread_Executing, the_thread ); if ( !status ) 47aa2: 508f addql #8,%sp 47aa4: 4a00 tstb %d0 47aa6: 670c beqs 47ab4 <_User_extensions_Thread_create+0x38> 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 ) { 47aa8: 2452 moveal %a2@,%a2 47aaa: b5fc 0005 bbc6 cmpal #375750,%a2 47ab0: 66de bnes 47a90 <_User_extensions_Thread_create+0x14> 47ab2: 7001 moveq #1,%d0 return false; } } return true; } 47ab4: 242e fff8 movel %fp@(-8),%d2 47ab8: 246e fffc moveal %fp@(-4),%a2 47abc: 4e5e unlk %fp 47abe: 4e75 rts 00047ac0 <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 47ac0: 4e56 0000 linkw %fp,#0 47ac4: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47ac6: 2479 0005 bbca moveal 5bbca <_User_extensions_List+0x8>,%a2 #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 47acc: 2f02 movel %d2,%sp@- 47ace: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47ad2: 6018 bras 47aec <_User_extensions_Thread_delete+0x2c> <== 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 ) 47ad4: 206a 0020 moveal %a2@(32),%a0 47ad8: 4a88 tstl %a0 47ada: 670c beqs 47ae8 <_User_extensions_Thread_delete+0x28> (*the_extension->Callouts.thread_delete)( 47adc: 2f02 movel %d2,%sp@- 47ade: 2f39 0005 baee movel 5baee <_Thread_Executing>,%sp@- 47ae4: 4e90 jsr %a0@ 47ae6: 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 ) { 47ae8: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47aec: b5fc 0005 bbc2 cmpal #375746,%a2 47af2: 66e0 bnes 47ad4 <_User_extensions_Thread_delete+0x14> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 47af4: 242e fff8 movel %fp@(-8),%d2 47af8: 246e fffc moveal %fp@(-4),%a2 47afc: 4e5e unlk %fp 47afe: 4e75 rts 000479f8 <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 479f8: 4e56 0000 linkw %fp,#0 479fc: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 479fe: 2479 0005 bbca moveal 5bbca <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 47a04: 2f02 movel %d2,%sp@- 47a06: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47a0a: 6012 bras 47a1e <_User_extensions_Thread_exitted+0x26> <== 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 ) 47a0c: 206a 002c moveal %a2@(44),%a0 47a10: 4a88 tstl %a0 47a12: 6706 beqs 47a1a <_User_extensions_Thread_exitted+0x22> (*the_extension->Callouts.thread_exitted)( executing ); 47a14: 2f02 movel %d2,%sp@- 47a16: 4e90 jsr %a0@ 47a18: 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 ) { 47a1a: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47a1e: b5fc 0005 bbc2 cmpal #375746,%a2 47a24: 66e6 bnes 47a0c <_User_extensions_Thread_exitted+0x14> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 47a26: 242e fff8 movel %fp@(-8),%d2 47a2a: 246e fffc moveal %fp@(-4),%a2 47a2e: 4e5e unlk %fp 47a30: 4e75 rts 0004829c <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 4829c: 4e56 0000 linkw %fp,#0 482a0: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 482a2: 2479 0005 c64a moveal 5c64a <_User_extensions_List>,%a2 #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 482a8: 2f02 movel %d2,%sp@- 482aa: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 482ae: 6016 bras 482c6 <_User_extensions_Thread_restart+0x2a> <== 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 ) 482b0: 206a 001c moveal %a2@(28),%a0 482b4: 4a88 tstl %a0 482b6: 670c beqs 482c4 <_User_extensions_Thread_restart+0x28> (*the_extension->Callouts.thread_restart)( 482b8: 2f02 movel %d2,%sp@- 482ba: 2f39 0005 c576 movel 5c576 <_Thread_Executing>,%sp@- 482c0: 4e90 jsr %a0@ 482c2: 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 ) { 482c4: 2452 moveal %a2@,%a2 482c6: b5fc 0005 c64e cmpal #378446,%a2 482cc: 66e2 bnes 482b0 <_User_extensions_Thread_restart+0x14> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 482ce: 242e fff8 movel %fp@(-8),%d2 482d2: 246e fffc moveal %fp@(-4),%a2 482d6: 4e5e unlk %fp 482d8: 4e75 rts ... 00047b00 <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 47b00: 4e56 0000 linkw %fp,#0 47b04: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47b06: 2479 0005 bbc2 moveal 5bbc2 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 47b0c: 2f02 movel %d2,%sp@- 47b0e: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47b12: 6016 bras 47b2a <_User_extensions_Thread_start+0x2a> <== 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 ) 47b14: 206a 0018 moveal %a2@(24),%a0 47b18: 4a88 tstl %a0 47b1a: 670c beqs 47b28 <_User_extensions_Thread_start+0x28> (*the_extension->Callouts.thread_start)( 47b1c: 2f02 movel %d2,%sp@- 47b1e: 2f39 0005 baee movel 5baee <_Thread_Executing>,%sp@- 47b24: 4e90 jsr %a0@ 47b26: 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 ) { 47b28: 2452 moveal %a2@,%a2 47b2a: b5fc 0005 bbc6 cmpal #375750,%a2 47b30: 66e2 bnes 47b14 <_User_extensions_Thread_start+0x14> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 47b32: 242e fff8 movel %fp@(-8),%d2 47b36: 246e fffc moveal %fp@(-4),%a2 47b3a: 4e5e unlk %fp 47b3c: 4e75 rts ... 00047b40 <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 47b40: 4e56 fff4 linkw %fp,#-12 47b44: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47b48: 262e 0008 movel %fp@(8),%d3 47b4c: 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 ; 47b50: 2479 0005 ba38 moveal 5ba38 <_User_extensions_Switches_list>,%a2 47b56: 600e bras 47b66 <_User_extensions_Thread_switch+0x26> <== 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 ); 47b58: 2f02 movel %d2,%sp@- 47b5a: 2f03 movel %d3,%sp@- 47b5c: 206a 0008 moveal %a2@(8),%a0 47b60: 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 ) { 47b62: 2452 moveal %a2@,%a2 47b64: 508f addql #8,%sp 47b66: b5fc 0005 ba3c cmpal #375356,%a2 47b6c: 66ea bnes 47b58 <_User_extensions_Thread_switch+0x18> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 47b6e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 47b74: 4e5e unlk %fp 47b76: 4e75 rts 000490a4 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 490a4: 327c 0700 moveaw #1792,%a1 490a8: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 490aa: 4e56 ffe8 linkw %fp,#-24 490ae: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 490b2: 266e 0008 moveal %fp@(8),%a3 490b6: 262e 000c movel %fp@(12),%d3 490ba: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 490be: 40c0 movew %sr,%d0 490c0: 8280 orl %d0,%d1 490c2: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 490c4: 244b moveal %a3,%a2 490c6: 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 ) ) { 490c8: b5c8 cmpal %a0,%a2 490ca: 674c beqs 49118 <_Watchdog_Adjust+0x74> switch ( direction ) { 490cc: 4a83 tstl %d3 490ce: 673c beqs 4910c <_Watchdog_Adjust+0x68> 490d0: 7201 moveq #1,%d1 490d2: b283 cmpl %d3,%d1 490d4: 6642 bnes 49118 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 490d6: d5a8 0010 addl %d2,%a0@(16) break; 490da: 603c bras 49118 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 490dc: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 490de: 2628 0010 movel %a0@(16),%d3 490e2: b682 cmpl %d2,%d3 490e4: 6308 blss 490ee <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 490e6: 9682 subl %d2,%d3 490e8: 2143 0010 movel %d3,%a0@(16) break; 490ec: 602a bras 49118 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 490ee: 7201 moveq #1,%d1 490f0: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 490f4: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 490f6: 2f0b movel %a3,%sp@- 490f8: 4e94 jsr %a4@ _ISR_Disable( level ); 490fa: 2204 movel %d4,%d1 490fc: 40c0 movew %sr,%d0 490fe: 8280 orl %d0,%d1 49100: 46c1 movew %d1,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 49102: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 49104: 588f addql #4,%sp 49106: b5d3 cmpal %a3@,%a2 49108: 660a bnes 49114 <_Watchdog_Adjust+0x70> 4910a: 600c bras 49118 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 4910c: 2809 movel %a1,%d4 units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 4910e: 49f9 0004 92bc lea 492bc <_Watchdog_Tickle>,%a4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49114: 4a82 tstl %d2 49116: 66c4 bnes 490dc <_Watchdog_Adjust+0x38> <== NEVER TAKEN } break; } } _ISR_Enable( level ); 49118: 46c0 movew %d0,%sr } 4911a: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49120: 4e5e unlk %fp 49122: 4e75 rts 000548fc <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 548fc: 4e56 ffe4 linkw %fp,#-28 54900: 202e 000c movel %fp@(12),%d0 54904: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 54908: 266e 0008 moveal %fp@(8),%a3 5490c: 246e 0010 moveal %fp@(16),%a2 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { 54910: 4a80 tstl %d0 54912: 6770 beqs 54984 <_Watchdog_Adjust_to_chain+0x88> return; } _ISR_Disable( level ); 54914: 307c 0700 moveaw #1792,%a0 54918: 2208 movel %a0,%d1 5491a: 40c2 movew %sr,%d2 5491c: 8282 orl %d2,%d1 5491e: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 54920: 260b movel %a3,%d3 54922: 280a movel %a2,%d4 while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 54924: 2a08 movel %a0,%d5 54926: 5883 addql #4,%d3 54928: 5884 addql #4,%d4 5492a: 6004 bras 54930 <_Watchdog_Adjust_to_chain+0x34> <== ALWAYS TAKEN } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5492c: 4a80 tstl %d0 5492e: 6752 beqs 54982 <_Watchdog_Adjust_to_chain+0x86> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 54930: 2253 moveal %a3@,%a1 break; } if ( _Chain_Is_empty( header ) ) { 54932: b689 cmpl %a1,%d3 54934: 674c beqs 54982 <_Watchdog_Adjust_to_chain+0x86> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 54936: 2229 0010 movel %a1@(16),%d1 5493a: 2049 moveal %a1,%a0 5493c: b280 cmpl %d0,%d1 5493e: 6308 blss 54948 <_Watchdog_Adjust_to_chain+0x4c> first->delta_interval -= units; 54940: 9280 subl %d0,%d1 54942: 2341 0010 movel %d1,%a1@(16) break; 54946: 603a bras 54982 <_Watchdog_Adjust_to_chain+0x86> <== ALWAYS TAKEN /* * 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; 54948: 9081 subl %d1,%d0 first->delta_interval = 0; 5494a: 42a9 0010 clrl %a1@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 5494e: 2250 moveal %a0@,%a1 previous = the_node->previous; 54950: 2868 0004 moveal %a0@(4),%a4 next->previous = previous; previous->next = next; 54954: 2889 movel %a1,%a4@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 54956: 234c 0004 movel %a4,%a1@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 5495a: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 5495c: 226a 0008 moveal %a2@(8),%a1 the_chain->last = the_node; 54960: 2548 0008 movel %a0,%a2@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 54964: 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; 54968: 2288 movel %a0,%a1@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 5496a: 2205 movel %d5,%d1 5496c: 46c2 movew %d2,%sr 5496e: 8282 orl %d2,%d1 54970: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 54972: 2213 movel %a3@,%d1 54974: 2041 moveal %d1,%a0 if ( _Chain_Is_empty( header ) ) 54976: b681 cmpl %d1,%d3 54978: 67b2 beqs 5492c <_Watchdog_Adjust_to_chain+0x30> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 5497a: 4aa8 0010 tstl %a0@(16) 5497e: 67ce beqs 5494e <_Watchdog_Adjust_to_chain+0x52> 54980: 60aa bras 5492c <_Watchdog_Adjust_to_chain+0x30> <== ALWAYS TAKEN break; } } _ISR_Enable( level ); 54982: 46c2 movew %d2,%sr } 54984: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 54988: 4e5e unlk %fp 5498a: 4e75 rts 00047b78 <_Watchdog_Insert>: Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 47b78: 327c 0700 moveaw #1792,%a1 47b7c: 2009 movel %a1,%d0 void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 47b7e: 4e56 ffec linkw %fp,#-20 47b82: 206e 000c moveal %fp@(12),%a0 47b86: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47b8a: 266e 0008 moveal %fp@(8),%a3 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 47b8e: 2439 0005 bace movel 5bace <_ISR_Nest_level>,%d2 _ISR_Disable( level ); 47b94: 40c1 movew %sr,%d1 47b96: 8081 orl %d1,%d0 47b98: 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 ) { 47b9a: 4aa8 0008 tstl %a0@(8) 47b9e: 6706 beqs 47ba6 <_Watchdog_Insert+0x2e> _ISR_Enable( level ); 47ba0: 46c1 movew %d1,%sr return; 47ba2: 6000 009a braw 47c3e <_Watchdog_Insert+0xc6> <== ALWAYS TAKEN } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 47ba6: 2039 0005 bb70 movel 5bb70 <_Watchdog_Sync_count>,%d0 47bac: 5280 addql #1,%d0 * 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 ); 47bae: 2449 moveal %a1,%a2 _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 47bb0: 23c0 0005 bb70 movel %d0,5bb70 <_Watchdog_Sync_count> if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 47bb6: 7001 moveq #1,%d0 47bb8: 2140 0008 movel %d0,%a0@(8) _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 47bbc: 2028 000c movel %a0@(12),%d0 * cache *header!! * * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; 47bc0: 2253 moveal %a3@,%a1 ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 47bc2: 4a80 tstl %d0 47bc4: 673c beqs 47c02 <_Watchdog_Insert+0x8a> 47bc6: 4a91 tstl %a1@ 47bc8: 6738 beqs 47c02 <_Watchdog_Insert+0x8a> break; if ( delta_interval < after->delta_interval ) { 47bca: 2629 0010 movel %a1@(16),%d3 47bce: b680 cmpl %d0,%d3 47bd0: 6308 blss 47bda <_Watchdog_Insert+0x62> after->delta_interval -= delta_interval; 47bd2: 9680 subl %d0,%d3 47bd4: 2343 0010 movel %d3,%a1@(16) break; 47bd8: 6028 bras 47c02 <_Watchdog_Insert+0x8a> <== ALWAYS TAKEN * 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 ); 47bda: 280a movel %a2,%d4 47bdc: 46c1 movew %d1,%sr 47bde: 8881 orl %d1,%d4 47be0: 46c4 movew %d4,%sr if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 47be2: 9083 subl %d3,%d0 * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 47be4: 7601 moveq #1,%d3 47be6: b6a8 0008 cmpl %a0@(8),%d3 47bea: 663c bnes 47c28 <_Watchdog_Insert+0xb0> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 47bec: 2639 0005 baea movel 5baea <_Watchdog_Sync_level>,%d3 47bf2: b483 cmpl %d3,%d2 47bf4: 6408 bccs 47bfe <_Watchdog_Insert+0x86> _Watchdog_Sync_level = insert_isr_nest_level; 47bf6: 23c2 0005 baea movel %d2,5baea <_Watchdog_Sync_level> goto restart; 47bfc: 60be bras 47bbc <_Watchdog_Insert+0x44> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47bfe: 2251 moveal %a1@,%a1 } } 47c00: 60c0 bras 47bc2 <_Watchdog_Insert+0x4a> <== ALWAYS TAKEN _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 47c02: 2269 0004 moveal %a1@(4),%a1 the_watchdog->start_time = _Watchdog_Ticks_since_boot; 47c06: 2639 0005 bb74 movel 5bb74 <_Watchdog_Ticks_since_boot>,%d3 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 47c0c: 2451 moveal %a1@,%a2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 47c0e: 2149 0004 movel %a1,%a0@(4) before_node = after_node->next; after_node->next = the_node; 47c12: 2288 movel %a0,%a1@ } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 47c14: 2140 0010 movel %d0,%a0@(16) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 47c18: 7002 moveq #2,%d0 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 47c1a: 2143 0014 movel %d3,%a0@(20) the_node->next = before_node; before_node->previous = the_node; 47c1e: 2548 0004 movel %a0,%a2@(4) 47c22: 2140 0008 movel %d0,%a0@(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; 47c26: 208a movel %a2,%a0@ exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 47c28: 23c2 0005 baea movel %d2,5baea <_Watchdog_Sync_level> _Watchdog_Sync_count--; 47c2e: 2039 0005 bb70 movel 5bb70 <_Watchdog_Sync_count>,%d0 47c34: 5380 subql #1,%d0 47c36: 23c0 0005 bb70 movel %d0,5bb70 <_Watchdog_Sync_count> _ISR_Enable( level ); 47c3c: 46c1 movew %d1,%sr } 47c3e: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 47c42: 4e5e unlk %fp 47c44: 4e75 rts ... 00047c94 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47c94: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 47c9a: 4e56 0000 linkw %fp,#0 47c9e: 206e 0008 moveal %fp@(8),%a0 47ca2: 2f0a movel %a2,%sp@- 47ca4: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47ca6: 40c1 movew %sr,%d1 47ca8: 8081 orl %d1,%d0 47caa: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 47cac: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 47cb0: 7401 moveq #1,%d2 47cb2: b480 cmpl %d0,%d2 47cb4: 670c beqs 47cc2 <_Watchdog_Remove+0x2e> 47cb6: 6244 bhis 47cfc <_Watchdog_Remove+0x68> 47cb8: 143c 0003 moveb #3,%d2 47cbc: b480 cmpl %d0,%d2 47cbe: 653c bcss 47cfc <_Watchdog_Remove+0x68> <== ALWAYS TAKEN 47cc0: 6006 bras 47cc8 <_Watchdog_Remove+0x34> <== ALWAYS TAKEN /* * 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; 47cc2: 42a8 0008 clrl %a0@(8) break; 47cc6: 6034 bras 47cfc <_Watchdog_Remove+0x68> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47cc8: 2250 moveal %a0@,%a1 case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 47cca: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 47cce: 4a91 tstl %a1@ 47cd0: 6708 beqs 47cda <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 47cd2: 2428 0010 movel %a0@(16),%d2 47cd6: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 47cda: 2279 0005 bb70 moveal 5bb70 <_Watchdog_Sync_count>,%a1 47ce0: 4a89 tstl %a1 47ce2: 670c beqs 47cf0 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 47ce4: 2279 0005 bace moveal 5bace <_ISR_Nest_level>,%a1 47cea: 23c9 0005 baea movel %a1,5baea <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47cf0: 2250 moveal %a0@,%a1 previous = the_node->previous; 47cf2: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47cf6: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47cf8: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 47cfc: 2279 0005 bb74 moveal 5bb74 <_Watchdog_Ticks_since_boot>,%a1 47d02: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 47d06: 46c1 movew %d1,%sr return( previous_state ); } 47d08: 241f movel %sp@+,%d2 47d0a: 245f moveal %sp@+,%a2 47d0c: 4e5e unlk %fp 47d0e: 4e75 rts 00048ccc <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48ccc: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 48cd2: 4e56 ffec linkw %fp,#-20 48cd6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 48cda: 242e 0008 movel %fp@(8),%d2 48cde: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48ce2: 40c3 movew %sr,%d3 48ce4: 8083 orl %d3,%d0 48ce6: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 48ce8: 2f0b movel %a3,%sp@- 48cea: 49f9 0004 3640 lea 43640 ,%a4 48cf0: 2f02 movel %d2,%sp@- 48cf2: 4879 0005 af40 pea 5af40 48cf8: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 48cfa: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 48cfc: 4fef 000c lea %sp@(12),%sp 48d00: b7ca cmpal %a2,%a3 48d02: 6726 beqs 48d2a <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 48d04: 49f9 0004 8d40 lea 48d40 <_Watchdog_Report>,%a4 48d0a: 2f0a movel %a2,%sp@- 48d0c: 42a7 clrl %sp@- 48d0e: 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 ) 48d10: 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 ; 48d12: 508f addql #8,%sp 48d14: b7ca cmpal %a2,%a3 48d16: 66f2 bnes 48d0a <_Watchdog_Report_chain+0x3e> <== ALWAYS TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 48d18: 2f02 movel %d2,%sp@- 48d1a: 4879 0005 af57 pea 5af57 48d20: 4eb9 0004 3640 jsr 43640 48d26: 508f addql #8,%sp 48d28: 600a bras 48d34 <_Watchdog_Report_chain+0x68> <== ALWAYS TAKEN } else { printk( "Chain is empty\n" ); 48d2a: 4879 0005 af66 pea 5af66 48d30: 4e94 jsr %a4@ 48d32: 588f addql #4,%sp } _ISR_Enable( level ); 48d34: 46c3 movew %d3,%sr } 48d36: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 48d3c: 4e5e unlk %fp 48d3e: 4e75 rts 0004aebc : rtems_name name, rtems_attribute attribute_set, uint32_t maximum_waiters, rtems_id *id ) { 4aebc: 4e56 ffe4 linkw %fp,#-28 4aec0: 202e 0010 movel %fp@(16),%d0 4aec4: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4aec8: 242e 0008 movel %fp@(8),%d2 4aecc: 262e 000c movel %fp@(12),%d3 4aed0: 266e 0014 moveal %fp@(20),%a3 Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4aed4: 4a82 tstl %d2 4aed6: 6606 bnes 4aede 4aed8: 7003 moveq #3,%d0 4aeda: 6000 0088 braw 4af64 <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4aede: 4a8b tstl %a3 4aee0: 6604 bnes 4aee6 4aee2: 7009 moveq #9,%d0 4aee4: 607e bras 4af64 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { 4aee6: 0803 0004 btst #4,%d3 4aeea: 6710 beqs 4aefc the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4aeec: 4a80 tstl %d0 4aeee: 6606 bnes 4aef6 4aef0: 103c 000a moveb #10,%d0 4aef4: 606e bras 4af64 <== ALWAYS TAKEN if ( !id ) return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4aef6: 42ae fff8 clrl %fp@(-8) 4aefa: 6006 bras 4af02 <== ALWAYS TAKEN if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; 4aefc: 7201 moveq #1,%d1 4aefe: 2d41 fff8 movel %d1,%fp@(-8) 4af02: 2239 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d1 4af08: 5281 addql #1,%d1 the_attributes.maximum_count = maximum_waiters; 4af0a: 2d40 fffc movel %d0,%fp@(-4) 4af0e: 23c1 0005 ba34 movel %d1,5ba34 <_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 ); 4af14: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4af1a: 45f9 0004 6c6e lea 46c6e <_Thread_Enable_dispatch>,%a2 4af20: 4eb9 0004 604c jsr 4604c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4af26: 588f addql #4,%sp 4af28: 2840 moveal %d0,%a4 4af2a: 4a80 tstl %d0 4af2c: 6606 bnes 4af34 _Thread_Enable_dispatch(); 4af2e: 4e92 jsr %a2@ 4af30: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4af32: 6030 bras 4af64 <== ALWAYS TAKEN } the_barrier->attribute_set = attribute_set; 4af34: 2943 0010 movel %d3,%a4@(16) _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4af38: 486e fff8 pea %fp@(-8) 4af3c: 486c 0014 pea %a4@(20) 4af40: 4eb9 0004 b380 jsr 4b380 <_CORE_barrier_Initialize> 4af46: 202c 0008 movel %a4@(8),%d0 4af4a: 4281 clrl %d1 4af4c: 2079 0005 bc6e moveal 5bc6e <_Barrier_Information+0x18>,%a0 4af52: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4af54: 2942 000c movel %d2,%a4@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4af58: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) &_Barrier_Information, &the_barrier->Object, (Objects_Name) name ); *id = the_barrier->Object.id; 4af5c: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 4af5e: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 4af60: 508f addql #8,%sp (Objects_Name) name ); *id = the_barrier->Object.id; _Thread_Enable_dispatch(); 4af62: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4af64: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 4af6a: 4e5e unlk %fp 4af6c: 4e75 rts ... 0004af70 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4af70: 4e56 fffc linkw %fp,#-4 4af74: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4af76: 486e fffc pea %fp@(-4) 4af7a: 2f2e 0008 movel %fp@(8),%sp@- 4af7e: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4af84: 4eb9 0004 6498 jsr 46498 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4af8a: 4fef 000c lea %sp@(12),%sp 4af8e: 2440 moveal %d0,%a2 4af90: 4aae fffc tstl %fp@(-4) 4af94: 6704 beqs 4af9a 4af96: 7004 moveq #4,%d0 4af98: 6038 bras 4afd2 <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4af9a: 4878 0002 pea 2 4af9e: 42a7 clrl %sp@- 4afa0: 486a 0014 pea %a2@(20) 4afa4: 4eb9 0004 72cc jsr 472cc <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4afaa: 2f0a movel %a2,%sp@- 4afac: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4afb2: 4eb9 0004 60cc jsr 460cc <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4afb8: 2f0a movel %a2,%sp@- 4afba: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4afc0: 4eb9 0004 6340 jsr 46340 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4afc6: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4afcc: 4fef 001c lea %sp@(28),%sp _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4afd0: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4afd2: 246e fff8 moveal %fp@(-8),%a2 4afd6: 4e5e unlk %fp 4afd8: 4e75 rts ... 0004afdc : rtems_status_code rtems_barrier_release( rtems_id id, uint32_t *released ) { 4afdc: 4e56 fffc linkw %fp,#-4 4afe0: 2f0a movel %a2,%sp@- 4afe2: 246e 000c moveal %fp@(12),%a2 4afe6: 2f02 movel %d2,%sp@- 4afe8: 242e 0008 movel %fp@(8),%d2 Barrier_Control *the_barrier; Objects_Locations location; if ( !released ) 4afec: 4a8a tstl %a2 4afee: 6604 bnes 4aff4 4aff0: 7009 moveq #9,%d0 4aff2: 603e bras 4b032 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4aff4: 486e fffc pea %fp@(-4) 4aff8: 2f02 movel %d2,%sp@- 4affa: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4b000: 4eb9 0004 6498 jsr 46498 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4b006: 4fef 000c lea %sp@(12),%sp 4b00a: 4aae fffc tstl %fp@(-4) 4b00e: 6704 beqs 4b014 4b010: 7004 moveq #4,%d0 4b012: 601e bras 4b032 <== ALWAYS TAKEN case OBJECTS_LOCAL: *released = _CORE_barrier_Release( &the_barrier->Barrier, id, NULL ); 4b014: 42a7 clrl %sp@- 4b016: 2040 moveal %d0,%a0 4b018: 2f02 movel %d2,%sp@- 4b01a: 4868 0014 pea %a0@(20) 4b01e: 4eb9 0004 b3bc jsr 4b3bc <_CORE_barrier_Release> 4b024: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4b026: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4b02c: 4fef 000c lea %sp@(12),%sp the_barrier = _Barrier_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: *released = _CORE_barrier_Release( &the_barrier->Barrier, id, NULL ); _Thread_Enable_dispatch(); 4b030: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b032: 242e fff4 movel %fp@(-12),%d2 4b036: 246e fff8 moveal %fp@(-8),%a2 4b03a: 4e5e unlk %fp 4b03c: 4e75 rts ... 0004b040 : rtems_status_code rtems_barrier_wait( rtems_id id, rtems_interval timeout ) { 4b040: 4e56 fffc linkw %fp,#-4 4b044: 2f02 movel %d2,%sp@- 4b046: 486e fffc pea %fp@(-4) 4b04a: 242e 0008 movel %fp@(8),%d2 4b04e: 2f02 movel %d2,%sp@- 4b050: 4879 0005 bc56 pea 5bc56 <_Barrier_Information> 4b056: 4eb9 0004 6498 jsr 46498 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4b05c: 4fef 000c lea %sp@(12),%sp 4b060: 4aae fffc tstl %fp@(-4) 4b064: 6704 beqs 4b06a 4b066: 7004 moveq #4,%d0 4b068: 6032 bras 4b09c <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Wait( 4b06a: 42a7 clrl %sp@- 4b06c: 2f2e 000c movel %fp@(12),%sp@- 4b070: 2040 moveal %d0,%a0 4b072: 4878 0001 pea 1 4b076: 2f02 movel %d2,%sp@- 4b078: 4868 0014 pea %a0@(20) 4b07c: 4eb9 0004 b3f0 jsr 4b3f0 <_CORE_barrier_Wait> id, true, timeout, NULL ); _Thread_Enable_dispatch(); 4b082: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return _Barrier_Translate_core_barrier_return_code( 4b088: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 4b08e: 2f28 0034 movel %a0@(52),%sp@- 4b092: 4eb9 0004 b998 jsr 4b998 <_Barrier_Translate_core_barrier_return_code> 4b098: 4fef 0018 lea %sp@(24),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b09c: 242e fff8 movel %fp@(-8),%d2 4b0a0: 4e5e unlk %fp 4b0a2: 4e75 rts 00049afc : rtems_status_code rtems_clock_get( rtems_clock_get_options option, void *time_buffer ) { 49afc: 4e56 0000 linkw %fp,#0 49b00: 202e 0008 movel %fp@(8),%d0 49b04: 2f0a movel %a2,%sp@- 49b06: 246e 000c moveal %fp@(12),%a2 if ( !time_buffer ) 49b0a: 4a8a tstl %a2 49b0c: 6604 bnes 49b12 49b0e: 7209 moveq #9,%d1 49b10: 6066 bras 49b78 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) 49b12: 4a80 tstl %d0 49b14: 6610 bnes 49b26 return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 49b16: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 49b1a: 246e fffc moveal %fp@(-4),%a2 49b1e: 4e5e unlk %fp { if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 49b20: 4ef9 0004 9bd4 jmp 49bd4 if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) 49b26: 7201 moveq #1,%d1 49b28: b280 cmpl %d0,%d1 49b2a: 6610 bnes 49b3c return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 49b2c: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 49b30: 246e fffc moveal %fp@(-4),%a2 49b34: 4e5e unlk %fp if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 49b36: 4ef9 0004 9b84 jmp 49b84 if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) { 49b3c: 7202 moveq #2,%d1 49b3e: b280 cmpl %d0,%d1 49b40: 6608 bnes 49b4a rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_since_boot(); 49b42: 4eb9 0004 9bc4 jsr 49bc4 49b48: 600c bras 49b56 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) { 49b4a: 7203 moveq #3,%d1 49b4c: b280 cmpl %d0,%d1 49b4e: 660c bnes 49b5c rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_per_second(); 49b50: 4eb9 0004 9bac jsr 49bac 49b56: 2480 movel %d0,%a2@ 49b58: 4281 clrl %d1 return RTEMS_SUCCESSFUL; 49b5a: 601c bras 49b78 <== ALWAYS TAKEN } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) 49b5c: 7204 moveq #4,%d1 49b5e: b280 cmpl %d0,%d1 49b60: 6706 beqs 49b68 49b62: 123c 000a moveb #10,%d1 49b66: 6010 bras 49b78 <== ALWAYS TAKEN return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 49b68: 2d4a 0008 movel %a2,%fp@(8) return RTEMS_INVALID_NUMBER; } 49b6c: 246e fffc moveal %fp@(-4),%a2 49b70: 4e5e unlk %fp *interval = rtems_clock_get_ticks_per_second(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 49b72: 4ef9 0004 9c88 jmp 49c88 return RTEMS_INVALID_NUMBER; } 49b78: 246e fffc moveal %fp@(-4),%a2 49b7c: 2001 movel %d1,%d0 49b7e: 4e5e unlk %fp 49b80: 4e75 rts ... 000455f0 : #include rtems_status_code rtems_clock_get_seconds_since_epoch( rtems_interval *the_interval ) { 455f0: 4e56 0000 linkw %fp,#0 455f4: 206e 0008 moveal %fp@(8),%a0 if ( !the_interval ) 455f8: 4a88 tstl %a0 455fa: 6604 bnes 45600 455fc: 7009 moveq #9,%d0 455fe: 6014 bras 45614 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 45600: 4a39 0006 58b8 tstb 658b8 <_TOD_Is_set> 45606: 6604 bnes 4560c 45608: 700b moveq #11,%d0 4560a: 6008 bras 45614 <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; *the_interval = _TOD_Seconds_since_epoch(); 4560c: 20b9 0006 5936 movel 65936 <_TOD_Now>,%a0@ 45612: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45614: 4e5e unlk %fp 45616: 4e75 rts 00045640 : #include rtems_status_code rtems_clock_get_tod( rtems_time_of_day *time_buffer ) { 45640: 4e56 ffcc linkw %fp,#-52 45644: 2f0a movel %a2,%sp@- 45646: 246e 0008 moveal %fp@(8),%a2 4564a: 2f02 movel %d2,%sp@- rtems_time_of_day *tmbuf = time_buffer; struct tm time; struct timeval now; if ( !time_buffer ) 4564c: 4a8a tstl %a2 4564e: 6606 bnes 45656 45650: 7009 moveq #9,%d0 45652: 6000 0092 braw 456e6 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 45656: 4a39 0006 58b8 tstb 658b8 <_TOD_Is_set> 4565c: 6606 bnes 45664 4565e: 700b moveq #11,%d0 45660: 6000 0084 braw 456e6 <== ALWAYS TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 45664: 203c 0000 0700 movel #1792,%d0 4566a: 40c2 movew %sr,%d2 4566c: 8082 orl %d2,%d0 4566e: 46c0 movew %d0,%sr _TOD_Get( &now ); 45670: 486e fff0 pea %fp@(-16) 45674: 4eb9 0004 6d48 jsr 46d48 <_TOD_Get> _ISR_Enable(level); 4567a: 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; 4567c: 243c 0000 03e8 movel #1000,%d2 /* Obtain the current time */ _TOD_Get_timeval( &now ); /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); 45682: 486e ffcc pea %fp@(-52) _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 45686: 202e fff4 movel %fp@(-12),%d0 4568a: 486e fff8 pea %fp@(-8) useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 4568e: 2d6e fff0 fff8 movel %fp@(-16),%fp@(-8) time->tv_usec = useconds; 45694: 4c42 0800 remsl %d2,%d0,%d0 45698: 2d40 fffc movel %d0,%fp@(-4) 4569c: 4eb9 0004 d53c jsr 4d53c /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; tmbuf->month = time.tm_mon + 1; 456a2: 206e ffdc moveal %fp@(-36),%a0 456a6: 5288 addql #1,%a0 tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / rtems_configuration_get_microseconds_per_tick(); return RTEMS_SUCCESSFUL; 456a8: 4fef 000c lea %sp@(12),%sp tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / 456ac: 4280 clrl %d0 /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; tmbuf->month = time.tm_mon + 1; 456ae: 2548 0004 movel %a0,%a2@(4) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 456b2: 206e ffe0 moveal %fp@(-32),%a0 456b6: 41e8 076c lea %a0@(1900),%a0 tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; 456ba: 256e ffd8 0008 movel %fp@(-40),%a2@(8) tmbuf->hour = time.tm_hour; 456c0: 256e ffd4 000c movel %fp@(-44),%a2@(12) tmbuf->minute = time.tm_min; 456c6: 256e ffd0 0010 movel %fp@(-48),%a2@(16) tmbuf->second = time.tm_sec; 456cc: 256e ffcc 0014 movel %fp@(-52),%a2@(20) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 456d2: 2488 movel %a0,%a2@ tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / 456d4: 242e fffc movel %fp@(-4),%d2 456d8: 41f9 0005 c3c0 lea 5c3c0 ,%a0 456de: 4c50 2002 remul %a0@,%d2,%d2 456e2: 2542 0018 movel %d2,%a2@(24) rtems_configuration_get_microseconds_per_tick(); return RTEMS_SUCCESSFUL; } 456e6: 242e ffc4 movel %fp@(-60),%d2 456ea: 246e ffc8 moveal %fp@(-56),%a2 456ee: 4e5e unlk %fp 456f0: 4e75 rts ... 00049c88 : #include rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { 49c88: 4e56 ffec linkw %fp,#-20 49c8c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 49c90: 246e 0008 moveal %fp@(8),%a2 if ( !time ) 49c94: 4a8a tstl %a2 49c96: 6604 bnes 49c9c 49c98: 7009 moveq #9,%d0 49c9a: 603e bras 49cda <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 49c9c: 4a39 0009 a7dc tstb 9a7dc <_TOD_Is_set> 49ca2: 6604 bnes 49ca8 49ca4: 700b moveq #11,%d0 49ca6: 6032 bras 49cda <== ALWAYS TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 49ca8: 203c 0000 0700 movel #1792,%d0 49cae: 40c2 movew %sr,%d2 49cb0: 8082 orl %d2,%d0 49cb2: 46c0 movew %d0,%sr _TOD_Get( &now ); 49cb4: 486e fff8 pea %fp@(-8) 49cb8: 4eb9 0004 afec jsr 4afec <_TOD_Get> _ISR_Enable(level); 49cbe: 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; 49cc0: 263c 0000 03e8 movel #1000,%d3 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; 49cc6: 588f addql #4,%sp 49cc8: 4280 clrl %d0 _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 49cca: 222e fffc movel %fp@(-4),%d1 useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 49cce: 4c43 1801 remsl %d3,%d1,%d1 49cd2: 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; 49cd6: 24ae fff8 movel %fp@(-8),%a2@ } 49cda: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 49ce0: 4e5e unlk %fp 49ce2: 4e75 rts 0006228c : * error code - if unsuccessful */ rtems_status_code rtems_clock_get_uptime( struct timespec *uptime ) { 6228c: 4e56 0000 linkw %fp,#0 62290: 202e 0008 movel %fp@(8),%d0 if ( !uptime ) 62294: 6606 bnes 6229c 62296: 103c 0009 moveb #9,%d0 6229a: 600c bras 622a8 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _TOD_Get_uptime_as_timespec( uptime ); 6229c: 2f00 movel %d0,%sp@- 6229e: 4eb9 0006 30f0 jsr 630f0 <_TOD_Get_uptime_as_timespec> return RTEMS_SUCCESSFUL; 622a4: 588f addql #4,%sp ) { if ( !uptime ) return RTEMS_INVALID_ADDRESS; _TOD_Get_uptime_as_timespec( uptime ); 622a6: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 622a8: 4e5e unlk %fp 622aa: 4e75 rts 00045710 : */ rtems_status_code rtems_clock_set( rtems_time_of_day *time_buffer ) { 45710: 4e56 fff8 linkw %fp,#-8 45714: 2f0a movel %a2,%sp@- 45716: 246e 0008 moveal %fp@(8),%a2 4571a: 2f02 movel %d2,%sp@- struct timespec newtime; if ( !time_buffer ) 4571c: 4a8a tstl %a2 4571e: 6604 bnes 45724 45720: 7009 moveq #9,%d0 45722: 605c bras 45780 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { 45724: 2f0a movel %a2,%sp@- 45726: 4eb9 0004 5868 jsr 45868 <_TOD_Validate> 4572c: 588f addql #4,%sp 4572e: 4a00 tstb %d0 45730: 6604 bnes 45736 45732: 7014 moveq #20,%d0 45734: 604a bras 45780 <== ALWAYS TAKEN newtime.tv_sec = _TOD_To_seconds( time_buffer ); 45736: 2f0a movel %a2,%sp@- 45738: 4eb9 0004 57c8 jsr 457c8 <_TOD_To_seconds> newtime.tv_nsec = time_buffer->ticks * 4573e: 242a 0018 movel %a2@(24),%d2 45742: 41f9 0005 c3c0 lea 5c3c0 ,%a0 45748: 4c10 2800 mulsl %a0@,%d2 if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { newtime.tv_sec = _TOD_To_seconds( time_buffer ); 4574c: 2d40 fff8 movel %d0,%fp@(-8) newtime.tv_nsec = time_buffer->ticks * 45750: 203c 0000 03e8 movel #1000,%d0 45756: 4c02 0800 mulsl %d2,%d0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4575a: 2239 0006 58a4 movel 658a4 <_Thread_Dispatch_disable_level>,%d1 45760: 5281 addql #1,%d1 45762: 2d40 fffc movel %d0,%fp@(-4) 45766: 23c1 0006 58a4 movel %d1,658a4 <_Thread_Dispatch_disable_level> rtems_configuration_get_nanoseconds_per_tick(); _Thread_Disable_dispatch(); _TOD_Set( &newtime ); 4576c: 486e fff8 pea %fp@(-8) 45770: 4eb9 0004 6e50 jsr 46e50 <_TOD_Set> _Thread_Enable_dispatch(); 45776: 4eb9 0004 7fa6 jsr 47fa6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4577c: 508f addql #8,%sp newtime.tv_nsec = time_buffer->ticks * rtems_configuration_get_nanoseconds_per_tick(); _Thread_Disable_dispatch(); _TOD_Set( &newtime ); _Thread_Enable_dispatch(); 4577e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } return RTEMS_INVALID_CLOCK; } 45780: 242e fff0 movel %fp@(-16),%d2 45784: 246e fff4 moveal %fp@(-12),%a2 45788: 4e5e unlk %fp 4578a: 4e75 rts 00044920 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 44920: 4e56 0000 linkw %fp,#0 44924: 202e 0008 movel %fp@(8),%d0 if ( !routine ) 44928: 6606 bnes 44930 4492a: 103c 0009 moveb #9,%d0 4492e: 6008 bras 44938 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 44930: 23c0 0005 bbba movel %d0,5bbba <_Watchdog_Nanoseconds_since_tick_handler> 44936: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 44938: 4e5e unlk %fp 4493a: 4e75 rts 00044978 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 44978: 4e56 0000 linkw %fp,#0 4497c: 202e 0008 movel %fp@(8),%d0 44980: 206e 0014 moveal %fp@(20),%a0 RTEMS_API_Control *api; if ( !event_out ) 44984: 4a88 tstl %a0 44986: 6604 bnes 4498c 44988: 7009 moveq #9,%d0 4498a: 6046 bras 449d2 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 4498c: 2279 0005 baee moveal 5baee <_Thread_Executing>,%a1 44992: 2269 0108 moveal %a1@(264),%a1 if ( _Event_sets_Is_empty( event_in ) ) { 44996: 4a80 tstl %d0 44998: 6604 bnes 4499e *event_out = api->pending_events; 4499a: 2091 movel %a1@,%a0@ return RTEMS_SUCCESSFUL; 4499c: 6034 bras 449d2 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4499e: 2239 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d1 449a4: 5281 addql #1,%d1 449a6: 23c1 0005 ba34 movel %d1,5ba34 <_Thread_Dispatch_disable_level> } _Thread_Disable_dispatch(); _Event_Seize( event_in, option_set, ticks, event_out ); 449ac: 2f08 movel %a0,%sp@- 449ae: 2f2e 0010 movel %fp@(16),%sp@- 449b2: 2f2e 000c movel %fp@(12),%sp@- 449b6: 2f00 movel %d0,%sp@- 449b8: 4eb9 0004 49d8 jsr 449d8 <_Event_Seize> _Thread_Enable_dispatch(); 449be: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return( _Thread_Executing->Wait.return_code ); 449c4: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 449ca: 4fef 0010 lea %sp@(16),%sp 449ce: 2028 0034 movel %a0@(52),%d0 } 449d2: 4e5e unlk %fp 449d4: 4e75 rts ... 00044adc : rtems_status_code rtems_event_send( rtems_id id, rtems_event_set event_in ) { 44adc: 4e56 fffc linkw %fp,#-4 44ae0: 2f02 movel %d2,%sp@- register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; the_thread = _Thread_Get( id, &location ); 44ae2: 486e fffc pea %fp@(-4) 44ae6: 2f2e 0008 movel %fp@(8),%sp@- 44aea: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 44af0: 508f addql #8,%sp 44af2: 4aae fffc tstl %fp@(-4) 44af6: 6704 beqs 44afc 44af8: 7004 moveq #4,%d0 44afa: 602c bras 44b28 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 44afc: 2240 moveal %d0,%a1 rtems_event_set *the_event_set ) { ISR_Level level; _ISR_Disable( level ); 44afe: 223c 0000 0700 movel #1792,%d1 44b04: 2069 0108 moveal %a1@(264),%a0 44b08: 40c2 movew %sr,%d2 44b0a: 8282 orl %d2,%d1 44b0c: 46c1 movew %d1,%sr *the_event_set |= the_new_events; 44b0e: 222e 000c movel %fp@(12),%d1 44b12: 8390 orl %d1,%a0@ _ISR_Enable( level ); 44b14: 46c2 movew %d2,%sr _Event_sets_Post( event_in, &api->pending_events ); _Event_Surrender( the_thread ); 44b16: 2f00 movel %d0,%sp@- 44b18: 4eb9 0004 4b30 jsr 44b30 <_Event_Surrender> _Thread_Enable_dispatch(); 44b1e: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 44b24: 588f addql #4,%sp case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_sets_Post( event_in, &api->pending_events ); _Event_Surrender( the_thread ); _Thread_Enable_dispatch(); 44b26: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 44b28: 242e fff8 movel %fp@(-8),%d2 44b2c: 4e5e unlk %fp 44b2e: 4e75 rts 00048dc4 : rtems_status_code rtems_extension_create( rtems_name name, const rtems_extensions_table *extension_table, rtems_id *id ) { 48dc4: 4e56 fff0 linkw %fp,#-16 48dc8: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48dcc: 242e 0008 movel %fp@(8),%d2 48dd0: 286e 0010 moveal %fp@(16),%a4 Extension_Control *the_extension; if ( !id ) 48dd4: 4a8c tstl %a4 48dd6: 6604 bnes 48ddc 48dd8: 7009 moveq #9,%d0 48dda: 6072 bras 48e4e <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 48ddc: 4a82 tstl %d2 48dde: 6604 bnes 48de4 48de0: 7003 moveq #3,%d0 48de2: 606a bras 48e4e <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48de4: 2039 0006 70cc movel 670cc <_Thread_Dispatch_disable_level>,%d0 48dea: 5280 addql #1,%d0 48dec: 23c0 0006 70cc movel %d0,670cc <_Thread_Dispatch_disable_level> #ifndef __EXTENSION_MANAGER_inl #define __EXTENSION_MANAGER_inl RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void ) { return (Extension_Control *) _Objects_Allocate( &_Extension_Information ); 48df2: 4879 0006 7272 pea 67272 <_Extension_Information> 48df8: 47f9 0004 a6ca lea 4a6ca <_Thread_Enable_dispatch>,%a3 48dfe: 4eb9 0004 99ac jsr 499ac <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_extension = _Extension_Allocate(); if ( !the_extension ) { 48e04: 588f addql #4,%sp 48e06: 2440 moveal %d0,%a2 48e08: 4a80 tstl %d0 48e0a: 6606 bnes 48e12 _Thread_Enable_dispatch(); 48e0c: 4e93 jsr %a3@ 48e0e: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 48e10: 603c bras 48e4e <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 48e12: 4878 0020 pea 20 48e16: 2f2e 000c movel %fp@(12),%sp@- 48e1a: 486a 0024 pea %a2@(36) 48e1e: 4eb9 0005 4204 jsr 54204 _User_extensions_Add_set( extension ); 48e24: 486a 0010 pea %a2@(16) 48e28: 4eb9 0004 b39c jsr 4b39c <_User_extensions_Add_set> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48e2e: 202a 0008 movel %a2@(8),%d0 48e32: 4281 clrl %d1 48e34: 2079 0006 728a moveal 6728a <_Extension_Information+0x18>,%a0 48e3a: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 48e3c: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48e40: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Extension_Information, &the_extension->Object, (Objects_Name) name ); *id = the_extension->Object.id; 48e44: 2880 movel %d0,%a4@ _Thread_Enable_dispatch(); 48e46: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 48e48: 4fef 0010 lea %sp@(16),%sp &the_extension->Object, (Objects_Name) name ); *id = the_extension->Object.id; _Thread_Enable_dispatch(); 48e4c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 48e4e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48e54: 4e5e unlk %fp 48e56: 4e75 rts 00048e58 : #include rtems_status_code rtems_extension_delete( rtems_id id ) { 48e58: 4e56 fffc linkw %fp,#-4 48e5c: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get ( Objects_Id id, Objects_Locations *location ) { return (Extension_Control *) 48e5e: 486e fffc pea %fp@(-4) 48e62: 2f2e 0008 movel %fp@(8),%sp@- 48e66: 4879 0006 7272 pea 67272 <_Extension_Information> 48e6c: 4eb9 0004 9df8 jsr 49df8 <_Objects_Get> Extension_Control *the_extension; Objects_Locations location; the_extension = _Extension_Get( id, &location ); switch ( location ) { 48e72: 4fef 000c lea %sp@(12),%sp 48e76: 2440 moveal %d0,%a2 48e78: 4aae fffc tstl %fp@(-4) 48e7c: 6704 beqs 48e82 48e7e: 7004 moveq #4,%d0 48e80: 6032 bras 48eb4 <== ALWAYS TAKEN case OBJECTS_LOCAL: _User_extensions_Remove_set( &the_extension->Extension ); 48e82: 486a 0010 pea %a2@(16) 48e86: 4eb9 0004 b490 jsr 4b490 <_User_extensions_Remove_set> _Objects_Close( &_Extension_Information, &the_extension->Object ); 48e8c: 2f0a movel %a2,%sp@- 48e8e: 4879 0006 7272 pea 67272 <_Extension_Information> 48e94: 4eb9 0004 9a2c jsr 49a2c <_Objects_Close> RTEMS_INLINE_ROUTINE void _Extension_Free ( Extension_Control *the_extension ) { _Objects_Free( &_Extension_Information, &the_extension->Object ); 48e9a: 2f0a movel %a2,%sp@- 48e9c: 4879 0006 7272 pea 67272 <_Extension_Information> 48ea2: 4eb9 0004 9ca0 jsr 49ca0 <_Objects_Free> _Extension_Free( the_extension ); _Thread_Enable_dispatch(); 48ea8: 4eb9 0004 a6ca jsr 4a6ca <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 48eae: 4fef 0014 lea %sp@(20),%sp switch ( location ) { case OBJECTS_LOCAL: _User_extensions_Remove_set( &the_extension->Extension ); _Objects_Close( &_Extension_Information, &the_extension->Object ); _Extension_Free( the_extension ); _Thread_Enable_dispatch(); 48eb2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48eb4: 246e fff8 moveal %fp@(-8),%a2 48eb8: 4e5e unlk %fp 48eba: 4e75 rts 00044cb8 : rtems_status_code rtems_interrupt_catch( rtems_isr_entry new_isr_handler, rtems_vector_number vector, rtems_isr_entry *old_isr_handler ) { 44cb8: 4e56 0000 linkw %fp,#0 44cbc: 222e 0008 movel %fp@(8),%d1 44cc0: 202e 000c movel %fp@(12),%d0 44cc4: 206e 0010 moveal %fp@(16),%a0 if ( !_ISR_Is_vector_number_valid( vector ) ) 44cc8: 0c80 0000 00ff cmpil #255,%d0 44cce: 6304 blss 44cd4 44cd0: 700a moveq #10,%d0 44cd2: 601e bras 44cf2 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) ) 44cd4: 4a81 tstl %d1 44cd6: 6718 beqs 44cf0 return RTEMS_INVALID_ADDRESS; if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) ) 44cd8: 4a88 tstl %a0 44cda: 6714 beqs 44cf0 return RTEMS_INVALID_ADDRESS; _ISR_Install_vector( 44cdc: 2f08 movel %a0,%sp@- 44cde: 2f01 movel %d1,%sp@- 44ce0: 2f00 movel %d0,%sp@- 44ce2: 4eb9 0004 7f4e jsr 47f4e <_CPU_ISR_install_vector> vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler ); return RTEMS_SUCCESSFUL; 44ce8: 4fef 000c lea %sp@(12),%sp return RTEMS_INVALID_ADDRESS; if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) ) return RTEMS_INVALID_ADDRESS; _ISR_Install_vector( 44cec: 4280 clrl %d0 vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler ); return RTEMS_SUCCESSFUL; 44cee: 6002 bras 44cf2 <== ALWAYS TAKEN 44cf0: 7009 moveq #9,%d0 } 44cf2: 4e5e unlk %fp 44cf4: 4e75 rts ... 0004b1c8 : rtems_status_code rtems_io_close( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4b1c8: 4e56 0000 linkw %fp,#0 4b1cc: 202e 0008 movel %fp@(8),%d0 4b1d0: 2f03 movel %d3,%sp@- 4b1d2: 222e 000c movel %fp@(12),%d1 4b1d6: 206e 0010 moveal %fp@(16),%a0 4b1da: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4b1dc: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4b1e2: 6504 bcss 4b1e8 4b1e4: 700a moveq #10,%d0 4b1e6: 6030 bras 4b218 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; 4b1e8: 2600 movel %d0,%d3 4b1ea: 2400 movel %d0,%d2 4b1ec: e78b lsll #3,%d3 4b1ee: eb8a lsll #5,%d2 4b1f0: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4b1f6: 9483 subl %d3,%d2 4b1f8: 2271 2808 moveal %a1@(00000008,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b1fc: 4a89 tstl %a1 4b1fe: 6604 bnes 4b204 4b200: 4280 clrl %d0 4b202: 6014 bras 4b218 <== ALWAYS TAKEN 4b204: 2d48 0010 movel %a0,%fp@(16) 4b208: 2d41 000c movel %d1,%fp@(12) 4b20c: 2d40 0008 movel %d0,%fp@(8) } 4b210: 241f movel %sp@+,%d2 4b212: 261f movel %sp@+,%d3 4b214: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b216: 4ed1 jmp %a1@ } 4b218: 241f movel %sp@+,%d2 4b21a: 261f movel %sp@+,%d3 4b21c: 4e5e unlk %fp 4b21e: 4e75 rts 0004b220 : rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4b220: 4e56 0000 linkw %fp,#0 4b224: 202e 0008 movel %fp@(8),%d0 4b228: 2f03 movel %d3,%sp@- 4b22a: 222e 000c movel %fp@(12),%d1 4b22e: 206e 0010 moveal %fp@(16),%a0 4b232: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4b234: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4b23a: 6504 bcss 4b240 4b23c: 700a moveq #10,%d0 4b23e: 6030 bras 4b270 return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; 4b240: 2600 movel %d0,%d3 4b242: 2400 movel %d0,%d2 4b244: e78b lsll #3,%d3 4b246: eb8a lsll #5,%d2 4b248: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4b24e: 9483 subl %d3,%d2 4b250: 2271 2814 moveal %a1@(00000014,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b254: 4a89 tstl %a1 4b256: 6604 bnes 4b25c 4b258: 4280 clrl %d0 4b25a: 6014 bras 4b270 <== ALWAYS TAKEN 4b25c: 2d48 0010 movel %a0,%fp@(16) 4b260: 2d41 000c movel %d1,%fp@(12) 4b264: 2d40 0008 movel %d0,%fp@(8) } 4b268: 241f movel %sp@+,%d2 4b26a: 261f movel %sp@+,%d3 4b26c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b26e: 4ed1 jmp %a1@ } 4b270: 241f movel %sp@+,%d2 4b272: 261f movel %sp@+,%d3 4b274: 4e5e unlk %fp 4b276: 4e75 rts 00049820 : rtems_status_code rtems_io_initialize( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 49820: 4e56 0000 linkw %fp,#0 49824: 202e 0008 movel %fp@(8),%d0 49828: 2f03 movel %d3,%sp@- 4982a: 222e 000c movel %fp@(12),%d1 4982e: 206e 0010 moveal %fp@(16),%a0 49832: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 49834: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4983a: 6504 bcss 49840 4983c: 700a moveq #10,%d0 4983e: 6030 bras 49870 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].initialization_entry; 49840: 2600 movel %d0,%d3 49842: 2400 movel %d0,%d2 49844: e78b lsll #3,%d3 49846: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4984c: 93c3 subal %d3,%a1 4984e: eb8a lsll #5,%d2 49850: 2271 2800 moveal %a1@(00000000,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 49854: 4a89 tstl %a1 49856: 6604 bnes 4985c 49858: 4280 clrl %d0 4985a: 6014 bras 49870 <== ALWAYS TAKEN 4985c: 2d48 0010 movel %a0,%fp@(16) 49860: 2d41 000c movel %d1,%fp@(12) 49864: 2d40 0008 movel %d0,%fp@(8) } 49868: 241f movel %sp@+,%d2 4986a: 261f movel %sp@+,%d3 4986c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].initialization_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4986e: 4ed1 jmp %a1@ } 49870: 241f movel %sp@+,%d2 49872: 261f movel %sp@+,%d3 49874: 4e5e unlk %fp 49876: 4e75 rts 0004b278 : rtems_status_code rtems_io_open( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4b278: 4e56 0000 linkw %fp,#0 4b27c: 202e 0008 movel %fp@(8),%d0 4b280: 2f03 movel %d3,%sp@- 4b282: 222e 000c movel %fp@(12),%d1 4b286: 206e 0010 moveal %fp@(16),%a0 4b28a: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4b28c: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4b292: 6504 bcss 4b298 4b294: 700a moveq #10,%d0 4b296: 6030 bras 4b2c8 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].open_entry; 4b298: 2600 movel %d0,%d3 4b29a: 2400 movel %d0,%d2 4b29c: e78b lsll #3,%d3 4b29e: eb8a lsll #5,%d2 4b2a0: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4b2a6: 9483 subl %d3,%d2 4b2a8: 2271 2804 moveal %a1@(00000004,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b2ac: 4a89 tstl %a1 4b2ae: 6604 bnes 4b2b4 4b2b0: 4280 clrl %d0 4b2b2: 6014 bras 4b2c8 <== ALWAYS TAKEN 4b2b4: 2d48 0010 movel %a0,%fp@(16) 4b2b8: 2d41 000c movel %d1,%fp@(12) 4b2bc: 2d40 0008 movel %d0,%fp@(8) } 4b2c0: 241f movel %sp@+,%d2 4b2c2: 261f movel %sp@+,%d3 4b2c4: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].open_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b2c6: 4ed1 jmp %a1@ } 4b2c8: 241f movel %sp@+,%d2 4b2ca: 261f movel %sp@+,%d3 4b2cc: 4e5e unlk %fp 4b2ce: 4e75 rts 0004b2d0 : rtems_status_code rtems_io_read( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4b2d0: 4e56 0000 linkw %fp,#0 4b2d4: 202e 0008 movel %fp@(8),%d0 4b2d8: 2f03 movel %d3,%sp@- 4b2da: 222e 000c movel %fp@(12),%d1 4b2de: 206e 0010 moveal %fp@(16),%a0 4b2e2: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4b2e4: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4b2ea: 6504 bcss 4b2f0 4b2ec: 700a moveq #10,%d0 4b2ee: 6030 bras 4b320 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; 4b2f0: 2600 movel %d0,%d3 4b2f2: 2400 movel %d0,%d2 4b2f4: e78b lsll #3,%d3 4b2f6: eb8a lsll #5,%d2 4b2f8: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4b2fe: 9483 subl %d3,%d2 4b300: 2271 280c moveal %a1@(0000000c,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b304: 4a89 tstl %a1 4b306: 6604 bnes 4b30c 4b308: 4280 clrl %d0 4b30a: 6014 bras 4b320 <== ALWAYS TAKEN 4b30c: 2d48 0010 movel %a0,%fp@(16) 4b310: 2d41 000c movel %d1,%fp@(12) 4b314: 2d40 0008 movel %d0,%fp@(8) } 4b318: 241f movel %sp@+,%d2 4b31a: 261f movel %sp@+,%d3 4b31c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b31e: 4ed1 jmp %a1@ } 4b320: 241f movel %sp@+,%d2 4b322: 261f movel %sp@+,%d3 4b324: 4e5e unlk %fp 4b326: 4e75 rts 00046d40 : 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 ) { 46d40: 4e56 0000 linkw %fp,#0 46d44: 206e 000c moveal %fp@(12),%a0 46d48: 2f0a movel %a2,%sp@- 46d4a: 226e 0010 moveal %fp@(16),%a1 46d4e: 2f02 movel %d2,%sp@- 46d50: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46d54: 2039 0006 1072 movel 61072 <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46d5a: 2239 0006 0ec6 movel 60ec6 <_ISR_Nest_level>,%d1 46d60: 6706 beqs 46d68 46d62: 7012 moveq #18,%d0 46d64: 6000 00d6 braw 46e3c return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46d68: 4a89 tstl %a1 46d6a: 6700 00ce beqw 46e3a return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46d6e: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46d70: 4a88 tstl %a0 46d72: 6700 00c6 beqw 46e3a static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46d76: 4a90 tstl %a0@ 46d78: 6600 00ce bnew 46e48 46d7c: 4aa8 0004 tstl %a0@(4) 46d80: 6600 00c6 bnew 46e48 46d84: 6000 00b4 braw 46e3a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46d88: 2039 0006 0e2c movel 60e2c <_Thread_Dispatch_disable_level>,%d0 46d8e: 5280 addql #1,%d0 46d90: 23c0 0006 0e2c movel %d0,60e2c <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46d96: 4a82 tstl %d2 46d98: 662c bnes 46dc6 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46d9a: 2039 0006 1072 movel 61072 <_IO_Number_of_drivers>,%d0 46da0: 2479 0006 1076 moveal 61076 <_IO_Driver_address_table>,%a2 46da6: 6010 bras 46db8 <== 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; 46da8: 4a92 tstl %a2@ 46daa: 6600 00a6 bnew 46e52 46dae: 4aaa 0004 tstl %a2@(4) 46db2: 6600 009e bnew 46e52 46db6: 6004 bras 46dbc <== ALWAYS TAKEN 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 ) { 46db8: b082 cmpl %d2,%d0 46dba: 62ec bhis 46da8 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46dbc: 2282 movel %d2,%a1@ if ( m != n ) 46dbe: b082 cmpl %d2,%d0 46dc0: 6634 bnes 46df6 46dc2: 6000 0098 braw 46e5c <== ALWAYS TAKEN _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46dc6: 2202 movel %d2,%d1 46dc8: 2002 movel %d2,%d0 46dca: e789 lsll #3,%d1 46dcc: eb88 lsll #5,%d0 46dce: 2479 0006 1076 moveal 61076 <_IO_Driver_address_table>,%a2 46dd4: 9081 subl %d1,%d0 46dd6: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46dd8: 4a92 tstl %a2@ 46dda: 660e bnes 46dea 46ddc: 4aaa 0004 tstl %a2@(4) 46de0: 57c0 seq %d0 46de2: 49c0 extbl %d0 46de4: 4480 negl %d0 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { 46de6: 4a00 tstb %d0 46de8: 660a bnes 46df4 _Thread_Enable_dispatch(); 46dea: 4eb9 0004 85ee jsr 485ee <_Thread_Enable_dispatch> 46df0: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 46df2: 6048 bras 46e3c <== ALWAYS TAKEN } *registered_major = major; 46df4: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46df6: 4878 0018 pea 18 46dfa: 2202 movel %d2,%d1 46dfc: 2002 movel %d2,%d0 46dfe: e789 lsll #3,%d1 46e00: eb88 lsll #5,%d0 46e02: 2f08 movel %a0,%sp@- 46e04: 9081 subl %d1,%d0 46e06: d0b9 0006 1076 addl 61076 <_IO_Driver_address_table>,%d0 46e0c: 2f00 movel %d0,%sp@- 46e0e: 4eb9 0005 0c80 jsr 50c80 _Thread_Enable_dispatch(); 46e14: 4eb9 0004 85ee jsr 485ee <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46e1a: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e1e: 4fef 000c lea %sp@(12),%sp 46e22: 2d42 0008 movel %d2,%fp@(8) } 46e26: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e2a: 42ae 0010 clrl %fp@(16) 46e2e: 42ae 000c clrl %fp@(12) } 46e32: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e34: 4ef9 0004 e174 jmp 4e174 46e3a: 7009 moveq #9,%d0 } 46e3c: 242e fff8 movel %fp@(-8),%d2 46e40: 246e fffc moveal %fp@(-4),%a2 46e44: 4e5e unlk %fp 46e46: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46e48: b082 cmpl %d2,%d0 46e4a: 6200 ff3c bhiw 46d88 46e4e: 700a moveq #10,%d0 46e50: 60ea bras 46e3c <== ALWAYS TAKEN 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 ) { 46e52: 5282 addql #1,%d2 46e54: 45ea 0018 lea %a2@(24),%a2 46e58: 6000 ff5e braw 46db8 <== ALWAYS TAKEN if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46e5c: 4eb9 0004 85ee jsr 485ee <_Thread_Enable_dispatch> 46e62: 7005 moveq #5,%d0 return sc; 46e64: 60d6 bras 46e3c <== ALWAYS TAKEN ... 00046e68 : */ rtems_status_code rtems_io_unregister_driver( rtems_device_major_number major ) { 46e68: 4e56 0000 linkw %fp,#0 46e6c: 222e 0008 movel %fp@(8),%d1 if ( rtems_interrupt_is_in_progress() ) 46e70: 2039 0006 0ec6 movel 60ec6 <_ISR_Nest_level>,%d0 46e76: 6704 beqs 46e7c 46e78: 7012 moveq #18,%d0 46e7a: 6042 bras 46ebe <== ALWAYS TAKEN return RTEMS_CALLED_FROM_ISR; if ( major < _IO_Number_of_drivers ) { 46e7c: b2b9 0006 1072 cmpl 61072 <_IO_Number_of_drivers>,%d1 46e82: 6504 bcss 46e88 46e84: 700d moveq #13,%d0 46e86: 6036 bras 46ebe <== ALWAYS TAKEN 46e88: 2039 0006 0e2c movel 60e2c <_Thread_Dispatch_disable_level>,%d0 46e8e: 5280 addql #1,%d0 46e90: 23c0 0006 0e2c movel %d0,60e2c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); memset( 46e96: 2001 movel %d1,%d0 46e98: 4878 0018 pea 18 46e9c: e789 lsll #3,%d1 46e9e: eb88 lsll #5,%d0 46ea0: 42a7 clrl %sp@- 46ea2: 9081 subl %d1,%d0 46ea4: d0b9 0006 1076 addl 61076 <_IO_Driver_address_table>,%d0 46eaa: 2f00 movel %d0,%sp@- 46eac: 4eb9 0005 0cf0 jsr 50cf0 &_IO_Driver_address_table[major], 0, sizeof( rtems_driver_address_table ) ); _Thread_Enable_dispatch(); 46eb2: 4eb9 0004 85ee jsr 485ee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46eb8: 4fef 000c lea %sp@(12),%sp memset( &_IO_Driver_address_table[major], 0, sizeof( rtems_driver_address_table ) ); _Thread_Enable_dispatch(); 46ebc: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } return RTEMS_UNSATISFIED; } 46ebe: 4e5e unlk %fp 46ec0: 4e75 rts ... 0004b328 : rtems_status_code rtems_io_write( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4b328: 4e56 0000 linkw %fp,#0 4b32c: 202e 0008 movel %fp@(8),%d0 4b330: 2f03 movel %d3,%sp@- 4b332: 222e 000c movel %fp@(12),%d1 4b336: 206e 0010 moveal %fp@(16),%a0 4b33a: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4b33c: b0b9 0005 bc4e cmpl 5bc4e <_IO_Number_of_drivers>,%d0 4b342: 6504 bcss 4b348 4b344: 700a moveq #10,%d0 4b346: 6030 bras 4b378 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].write_entry; 4b348: 2600 movel %d0,%d3 4b34a: 2400 movel %d0,%d2 4b34c: e78b lsll #3,%d3 4b34e: eb8a lsll #5,%d2 4b350: 2279 0005 bc52 moveal 5bc52 <_IO_Driver_address_table>,%a1 4b356: 9483 subl %d3,%d2 4b358: 2271 2810 moveal %a1@(00000010,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b35c: 4a89 tstl %a1 4b35e: 6604 bnes 4b364 4b360: 4280 clrl %d0 4b362: 6014 bras 4b378 <== ALWAYS TAKEN 4b364: 2d48 0010 movel %a0,%fp@(16) 4b368: 2d41 000c movel %d1,%fp@(12) 4b36c: 2d40 0008 movel %d0,%fp@(8) } 4b370: 241f movel %sp@+,%d2 4b372: 261f movel %sp@+,%d3 4b374: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].write_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4b376: 4ed1 jmp %a1@ } 4b378: 241f movel %sp@+,%d2 4b37a: 261f movel %sp@+,%d3 4b37c: 4e5e unlk %fp 4b37e: 4e75 rts 000472c8 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 472c8: 4e56 fff0 linkw %fp,#-16 472cc: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 472d0: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 472d4: 4a8c tstl %a4 472d6: 6740 beqs 47318 <== ALWAYS TAKEN 472d8: 45f9 0006 5860 lea 65860 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 472de: 2052 moveal %a2@,%a0 472e0: 4a88 tstl %a0 472e2: 672a beqs 4730e continue; information = _Objects_Information_table[ api_index ][ 1 ]; 472e4: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 472e8: 4a8b tstl %a3 472ea: 6722 beqs 4730e 472ec: 7401 moveq #1,%d2 472ee: 6014 bras 47304 <== ALWAYS TAKEN continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 472f0: 206b 0018 moveal %a3@(24),%a0 472f4: 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++ ) { 472f8: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 472fa: 4a80 tstl %d0 472fc: 6706 beqs 47304 <== ALWAYS TAKEN continue; (*routine)(the_thread); 472fe: 2f00 movel %d0,%sp@- 47300: 4e94 jsr %a4@ 47302: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47304: 4280 clrl %d0 47306: 302b 000e movew %a3@(14),%d0 4730a: b082 cmpl %d2,%d0 4730c: 64e2 bccs 472f0 4730e: 588a addql #4,%a2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47310: b5fc 0006 5870 cmpal #415856,%a2 47316: 66c6 bnes 472de (*routine)(the_thread); } } } 47318: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4731e: 4e5e unlk %fp 47320: 4e75 rts ... 0004e630 : rtems_id id, const void *buffer, size_t size, uint32_t *count ) { 4e630: 4e56 fff0 linkw %fp,#-16 4e634: 48d7 001c moveml %d2-%d4,%sp@ 4e638: 262e 0008 movel %fp@(8),%d3 4e63c: 242e 000c movel %fp@(12),%d2 4e640: 282e 0014 movel %fp@(20),%d4 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status core_status; if ( !buffer ) 4e644: 4a82 tstl %d2 4e646: 6752 beqs 4e69a return RTEMS_INVALID_ADDRESS; if ( !count ) 4e648: 4a84 tstl %d4 4e64a: 674e beqs 4e69a RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4e64c: 486e fffc pea %fp@(-4) 4e650: 2f03 movel %d3,%sp@- 4e652: 4879 0007 3aca pea 73aca <_Message_queue_Information> 4e658: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e65e: 4fef 000c lea %sp@(12),%sp 4e662: 4aae fffc tstl %fp@(-4) 4e666: 6704 beqs 4e66c 4e668: 7004 moveq #4,%d0 4e66a: 6030 bras 4e69c <== ALWAYS TAKEN case OBJECTS_LOCAL: core_status = _CORE_message_queue_Broadcast( 4e66c: 2f04 movel %d4,%sp@- 4e66e: 2040 moveal %d0,%a0 4e670: 42a7 clrl %sp@- 4e672: 2f03 movel %d3,%sp@- 4e674: 2f2e 0010 movel %fp@(16),%sp@- 4e678: 2f02 movel %d2,%sp@- 4e67a: 4868 0014 pea %a0@(20) 4e67e: 4eb9 0005 18d0 jsr 518d0 <_CORE_message_queue_Broadcast> 4e684: 2400 movel %d0,%d2 NULL, #endif count ); _Thread_Enable_dispatch(); 4e686: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return _Message_queue_Translate_core_message_queue_return_code( core_status ); 4e68c: 2f02 movel %d2,%sp@- 4e68e: 4eb9 0004 e9b4 jsr 4e9b4 <_Message_queue_Translate_core_message_queue_return_code> #endif count ); _Thread_Enable_dispatch(); return 4e694: 4fef 001c lea %sp@(28),%sp 4e698: 6002 bras 4e69c <== ALWAYS TAKEN 4e69a: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e69c: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4e6a2: 4e5e unlk %fp 4e6a4: 4e75 rts ... 0004cb24 : uint32_t count, size_t max_message_size, rtems_attribute attribute_set, rtems_id *id ) { 4cb24: 4e56 ffe0 linkw %fp,#-32 4cb28: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4cb2c: 242e 0008 movel %fp@(8),%d2 4cb30: 262e 000c movel %fp@(12),%d3 4cb34: 282e 0010 movel %fp@(16),%d4 4cb38: 2a2e 0014 movel %fp@(20),%d5 4cb3c: 286e 0018 moveal %fp@(24),%a4 CORE_message_queue_Attributes the_msgq_attributes; #if defined(RTEMS_MULTIPROCESSING) bool is_global; #endif if ( !rtems_is_name_valid( name ) ) 4cb40: 4a82 tstl %d2 4cb42: 6606 bnes 4cb4a 4cb44: 7003 moveq #3,%d0 4cb46: 6000 00a4 braw 4cbec <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4cb4a: 4a8c tstl %a4 4cb4c: 6606 bnes 4cb54 4cb4e: 7009 moveq #9,%d0 4cb50: 6000 009a braw 4cbec <== ALWAYS TAKEN if ( (is_global = _Attributes_Is_global( attribute_set ) ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; #endif if ( count == 0 ) 4cb54: 4a83 tstl %d3 4cb56: 6606 bnes 4cb5e 4cb58: 700a moveq #10,%d0 4cb5a: 6000 0090 braw 4cbec <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( max_message_size == 0 ) 4cb5e: 4a84 tstl %d4 4cb60: 6606 bnes 4cb68 4cb62: 7008 moveq #8,%d0 4cb64: 6000 0086 braw 4cbec <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4cb68: 2039 0006 4f68 movel 64f68 <_Thread_Dispatch_disable_level>,%d0 4cb6e: 5280 addql #1,%d0 4cb70: 23c0 0006 4f68 movel %d0,64f68 <_Thread_Dispatch_disable_level> #endif #endif _Thread_Disable_dispatch(); /* protects object pointer */ the_message_queue = _Message_queue_Allocate(); 4cb76: 4eb9 0005 19d8 jsr 519d8 <_Message_queue_Allocate> 4cb7c: 2440 moveal %d0,%a2 if ( !the_message_queue ) { 4cb7e: 4a80 tstl %d0 4cb80: 660a bnes 4cb8c _Thread_Enable_dispatch(); 4cb82: 4eb9 0004 f37e jsr 4f37e <_Thread_Enable_dispatch> 4cb88: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4cb8a: 6060 bras 4cbec <== ALWAYS TAKEN #endif the_message_queue->attribute_set = attribute_set; if (_Attributes_Is_priority( attribute_set ) ) the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; 4cb8c: 204e moveal %fp,%a0 4cb8e: 47f9 0004 f37e lea 4f37e <_Thread_Enable_dispatch>,%a3 4cb94: 44c5 movew %d5,%ccr 4cb96: 56c0 sne %d0 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_message_queue->attribute_set = attribute_set; 4cb98: 2545 0010 movel %d5,%a2@(16) if (_Attributes_Is_priority( attribute_set ) ) the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; 4cb9c: 49c0 extbl %d0 4cb9e: 5280 addql #1,%d0 4cba0: 2100 movel %d0,%a0@- else the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; if ( ! _CORE_message_queue_Initialize( 4cba2: 2f04 movel %d4,%sp@- 4cba4: 2f03 movel %d3,%sp@- 4cba6: 2f08 movel %a0,%sp@- 4cba8: 486a 0014 pea %a2@(20) 4cbac: 4eb9 0004 dc8c jsr 4dc8c <_CORE_message_queue_Initialize> 4cbb2: 4fef 0010 lea %sp@(16),%sp 4cbb6: 4a00 tstb %d0 4cbb8: 6616 bnes 4cbd0 */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 4cbba: 2f0a movel %a2,%sp@- 4cbbc: 4879 0006 513e pea 6513e <_Message_queue_Information> 4cbc2: 4eb9 0004 e950 jsr 4e950 <_Objects_Free> _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); #endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); 4cbc8: 4e93 jsr %a3@ return RTEMS_UNSATISFIED; 4cbca: 508f addql #8,%sp _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); #endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); 4cbcc: 700d moveq #13,%d0 return RTEMS_UNSATISFIED; 4cbce: 601c bras 4cbec <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4cbd0: 202a 0008 movel %a2@(8),%d0 4cbd4: 4281 clrl %d1 4cbd6: 2079 0006 5156 moveal 65156 <_Message_queue_Information+0x18>,%a0 4cbdc: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4cbde: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4cbe2: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Message_queue_Information, &the_message_queue->Object, (Objects_Name) name ); *id = the_message_queue->Object.id; 4cbe6: 2880 movel %d0,%a4@ name, 0 ); #endif _Thread_Enable_dispatch(); 4cbe8: 4e93 jsr %a3@ 4cbea: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4cbec: 4cee 1c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a4 4cbf2: 4e5e unlk %fp 4cbf4: 4e75 rts ... 0004f2a8 : */ rtems_status_code rtems_message_queue_delete( rtems_id id ) { 4f2a8: 4e56 fffc linkw %fp,#-4 4f2ac: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4f2ae: 486e fffc pea %fp@(-4) 4f2b2: 2f2e 0008 movel %fp@(8),%sp@- 4f2b6: 4879 0006 72fa pea 672fa <_Message_queue_Information> 4f2bc: 4eb9 0004 9df8 jsr 49df8 <_Objects_Get> register Message_queue_Control *the_message_queue; Objects_Locations location; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4f2c2: 4fef 000c lea %sp@(12),%sp 4f2c6: 2440 moveal %d0,%a2 4f2c8: 4aae fffc tstl %fp@(-4) 4f2cc: 6704 beqs 4f2d2 4f2ce: 7004 moveq #4,%d0 4f2d0: 6038 bras 4f30a <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, 4f2d2: 2f00 movel %d0,%sp@- 4f2d4: 4879 0006 72fa pea 672fa <_Message_queue_Information> 4f2da: 4eb9 0004 9a2c jsr 49a2c <_Objects_Close> &the_message_queue->Object ); _CORE_message_queue_Close( 4f2e0: 4878 0005 pea 5 4f2e4: 42a7 clrl %sp@- 4f2e6: 486a 0014 pea %a2@(20) 4f2ea: 4eb9 0004 f894 jsr 4f894 <_CORE_message_queue_Close> */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 4f2f0: 2f0a movel %a2,%sp@- 4f2f2: 4879 0006 72fa pea 672fa <_Message_queue_Information> 4f2f8: 4eb9 0004 9ca0 jsr 49ca0 <_Objects_Free> 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 4f2fe: 4eb9 0004 a6ca jsr 4a6ca <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f304: 4fef 001c lea %sp@(28),%sp 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 4f308: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4f30a: 246e fff8 moveal %fp@(-8),%a2 4f30e: 4e5e unlk %fp 4f310: 4e75 rts ... 0004e7e8 : rtems_status_code rtems_message_queue_flush( rtems_id id, uint32_t *count ) { 4e7e8: 4e56 fffc linkw %fp,#-4 4e7ec: 2f0a movel %a2,%sp@- 4e7ee: 246e 000c moveal %fp@(12),%a2 register Message_queue_Control *the_message_queue; Objects_Locations location; if ( !count ) 4e7f2: 4a8a tstl %a2 4e7f4: 6604 bnes 4e7fa 4e7f6: 7009 moveq #9,%d0 4e7f8: 603a bras 4e834 RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4e7fa: 486e fffc pea %fp@(-4) 4e7fe: 2f2e 0008 movel %fp@(8),%sp@- 4e802: 4879 0007 3aca pea 73aca <_Message_queue_Information> 4e808: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e80e: 4fef 000c lea %sp@(12),%sp 4e812: 4aae fffc tstl %fp@(-4) 4e816: 6704 beqs 4e81c 4e818: 7004 moveq #4,%d0 4e81a: 6018 bras 4e834 <== ALWAYS TAKEN case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); 4e81c: 2040 moveal %d0,%a0 4e81e: 4868 0014 pea %a0@(20) 4e822: 4eb9 0005 1980 jsr 51980 <_CORE_message_queue_Flush> 4e828: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4e82a: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4e830: 588f addql #4,%sp the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); _Thread_Enable_dispatch(); 4e832: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e834: 246e fff8 moveal %fp@(-8),%a2 4e838: 4e5e unlk %fp 4e83a: 4e75 rts 0004e83c : rtems_status_code rtems_message_queue_get_number_pending( rtems_id id, uint32_t *count ) { 4e83c: 4e56 fffc linkw %fp,#-4 4e840: 2f0a movel %a2,%sp@- 4e842: 246e 000c moveal %fp@(12),%a2 register Message_queue_Control *the_message_queue; Objects_Locations location; if ( !count ) 4e846: 4a8a tstl %a2 4e848: 6604 bnes 4e84e 4e84a: 7009 moveq #9,%d0 4e84c: 6030 bras 4e87e <== ALWAYS TAKEN 4e84e: 486e fffc pea %fp@(-4) 4e852: 2f2e 0008 movel %fp@(8),%sp@- 4e856: 4879 0007 3aca pea 73aca <_Message_queue_Information> 4e85c: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e862: 4fef 000c lea %sp@(12),%sp 4e866: 4aae fffc tstl %fp@(-4) 4e86a: 6704 beqs 4e870 4e86c: 7004 moveq #4,%d0 4e86e: 600e bras 4e87e <== ALWAYS TAKEN case OBJECTS_LOCAL: *count = the_message_queue->message_queue.number_of_pending_messages; 4e870: 2040 moveal %d0,%a0 4e872: 24a8 005c movel %a0@(92),%a2@ _Thread_Enable_dispatch(); 4e876: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4e87c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e87e: 246e fff8 moveal %fp@(-8),%a2 4e882: 4e5e unlk %fp 4e884: 4e75 rts ... 0004cc24 : void *buffer, size_t *size, rtems_option option_set, rtems_interval timeout ) { 4cc24: 4e56 fff0 linkw %fp,#-16 4cc28: 48d7 001c moveml %d2-%d4,%sp@ 4cc2c: 242e 000c movel %fp@(12),%d2 4cc30: 262e 0010 movel %fp@(16),%d3 register Message_queue_Control *the_message_queue; Objects_Locations location; bool wait; if ( !buffer ) 4cc34: 4a82 tstl %d2 4cc36: 6766 beqs 4cc9e return RTEMS_INVALID_ADDRESS; if ( !size ) 4cc38: 4a83 tstl %d3 4cc3a: 6762 beqs 4cc9e RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4cc3c: 486e fffc pea %fp@(-4) 4cc40: 2f2e 0008 movel %fp@(8),%sp@- 4cc44: 4879 0006 513e pea 6513e <_Message_queue_Information> 4cc4a: 4eb9 0004 eaa8 jsr 4eaa8 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4cc50: 4fef 000c lea %sp@(12),%sp 4cc54: 4aae fffc tstl %fp@(-4) 4cc58: 6704 beqs 4cc5e 4cc5a: 7004 moveq #4,%d0 4cc5c: 6042 bras 4cca0 <== ALWAYS TAKEN if ( _Options_Is_no_wait( option_set ) ) wait = false; else wait = true; _CORE_message_queue_Seize( 4cc5e: 7201 moveq #1,%d1 4cc60: 7801 moveq #1,%d4 4cc62: 2040 moveal %d0,%a0 4cc64: c2ae 0014 andl %fp@(20),%d1 4cc68: 2f2e 0018 movel %fp@(24),%sp@- 4cc6c: b384 eorl %d1,%d4 4cc6e: 2f04 movel %d4,%sp@- 4cc70: 2f03 movel %d3,%sp@- 4cc72: 2f02 movel %d2,%sp@- 4cc74: 2f28 0008 movel %a0@(8),%sp@- 4cc78: 4868 0014 pea %a0@(20) 4cc7c: 4eb9 0004 dd40 jsr 4dd40 <_CORE_message_queue_Seize> buffer, size, wait, timeout ); _Thread_Enable_dispatch(); 4cc82: 4eb9 0004 f37e jsr 4f37e <_Thread_Enable_dispatch> return _Message_queue_Translate_core_message_queue_return_code( 4cc88: 2079 0006 5022 moveal 65022 <_Thread_Executing>,%a0 4cc8e: 2f28 0034 movel %a0@(52),%sp@- 4cc92: 4eb9 0004 cd24 jsr 4cd24 <_Message_queue_Translate_core_message_queue_return_code> 4cc98: 4fef 001c lea %sp@(28),%sp 4cc9c: 6002 bras 4cca0 <== ALWAYS TAKEN 4cc9e: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cca0: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4cca6: 4e5e unlk %fp 4cca8: 4e75 rts ... 0004ccac : rtems_status_code rtems_message_queue_send( rtems_id id, const void *buffer, size_t size ) { 4ccac: 4e56 fffc linkw %fp,#-4 4ccb0: 2f03 movel %d3,%sp@- 4ccb2: 262e 0008 movel %fp@(8),%d3 4ccb6: 2f02 movel %d2,%sp@- 4ccb8: 242e 000c movel %fp@(12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) 4ccbc: 6604 bnes 4ccc2 4ccbe: 7009 moveq #9,%d0 4ccc0: 6056 bras 4cd18 <== ALWAYS TAKEN 4ccc2: 486e fffc pea %fp@(-4) 4ccc6: 2f03 movel %d3,%sp@- 4ccc8: 4879 0006 513e pea 6513e <_Message_queue_Information> 4ccce: 4eb9 0004 eaa8 jsr 4eaa8 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4ccd4: 4fef 000c lea %sp@(12),%sp 4ccd8: 4aae fffc tstl %fp@(-4) 4ccdc: 6704 beqs 4cce2 4ccde: 7004 moveq #4,%d0 4cce0: 6036 bras 4cd18 <== ALWAYS TAKEN CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, bool wait, Watchdog_Interval timeout ) { return _CORE_message_queue_Submit( 4cce2: 42a7 clrl %sp@- 4cce4: 2040 moveal %d0,%a0 4cce6: 42a7 clrl %sp@- 4cce8: 2f3c 7fff ffff movel #2147483647,%sp@- 4ccee: 42a7 clrl %sp@- 4ccf0: 2f03 movel %d3,%sp@- 4ccf2: 2f2e 0010 movel %fp@(16),%sp@- 4ccf6: 2f02 movel %d2,%sp@- 4ccf8: 4868 0014 pea %a0@(20) 4ccfc: 4eb9 0004 de28 jsr 4de28 <_CORE_message_queue_Submit> MESSAGE_QUEUE_MP_HANDLER, false, /* sender does not block */ 0 /* no timeout */ ); _Thread_Enable_dispatch(); 4cd02: 4fef 0020 lea %sp@(32),%sp 4cd06: 2400 movel %d0,%d2 4cd08: 4eb9 0004 f37e jsr 4f37e <_Thread_Enable_dispatch> /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 4cd0e: 2f02 movel %d2,%sp@- 4cd10: 4eb9 0004 cd24 jsr 4cd24 <_Message_queue_Translate_core_message_queue_return_code> 4cd16: 588f addql #4,%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cd18: 242e fff4 movel %fp@(-12),%d2 4cd1c: 262e fff8 movel %fp@(-8),%d3 4cd20: 4e5e unlk %fp 4cd22: 4e75 rts 0004e9cc : rtems_status_code rtems_message_queue_urgent( rtems_id id, const void *buffer, size_t size ) { 4e9cc: 4e56 fffc linkw %fp,#-4 4e9d0: 2f03 movel %d3,%sp@- 4e9d2: 262e 0008 movel %fp@(8),%d3 4e9d6: 2f02 movel %d2,%sp@- 4e9d8: 242e 000c movel %fp@(12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) 4e9dc: 6604 bnes 4e9e2 4e9de: 7009 moveq #9,%d0 4e9e0: 6056 bras 4ea38 <== ALWAYS TAKEN 4e9e2: 486e fffc pea %fp@(-4) 4e9e6: 2f03 movel %d3,%sp@- 4e9e8: 4879 0007 3aca pea 73aca <_Message_queue_Information> 4e9ee: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e9f4: 4fef 000c lea %sp@(12),%sp 4e9f8: 4aae fffc tstl %fp@(-4) 4e9fc: 6704 beqs 4ea02 4e9fe: 7004 moveq #4,%d0 4ea00: 6036 bras 4ea38 <== ALWAYS TAKEN CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, bool wait, Watchdog_Interval timeout ) { return _CORE_message_queue_Submit( 4ea02: 42a7 clrl %sp@- 4ea04: 2040 moveal %d0,%a0 4ea06: 42a7 clrl %sp@- 4ea08: 2f3c 8000 0000 movel #-2147483648,%sp@- 4ea0e: 42a7 clrl %sp@- 4ea10: 2f03 movel %d3,%sp@- 4ea12: 2f2e 0010 movel %fp@(16),%sp@- 4ea16: 2f02 movel %d2,%sp@- 4ea18: 4868 0014 pea %a0@(20) 4ea1c: 4eb9 0005 1b98 jsr 51b98 <_CORE_message_queue_Submit> id, MESSAGE_QUEUE_MP_HANDLER, false, /* sender does not block */ 0 /* no timeout */ ); _Thread_Enable_dispatch(); 4ea22: 4fef 0020 lea %sp@(32),%sp 4ea26: 2400 movel %d0,%d2 4ea28: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 4ea2e: 2f02 movel %d2,%sp@- 4ea30: 4eb9 0004 e9b4 jsr 4e9b4 <_Message_queue_Translate_core_message_queue_return_code> 4ea36: 588f addql #4,%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ea38: 242e fff4 movel %fp@(-12),%d2 4ea3c: 262e fff8 movel %fp@(-8),%d3 4ea40: 4e5e unlk %fp 4ea42: 4e75 rts 000464f8 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 464f8: 4e56 0000 linkw %fp,#0 464fc: 2f0a movel %a2,%sp@- 464fe: 246e 0010 moveal %fp@(16),%a2 46502: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 46504: 4a8a tstl %a2 46506: 6604 bnes 4650c 46508: 7009 moveq #9,%d0 4650a: 6052 bras 4655e <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 4650c: 2f2e 000c movel %fp@(12),%sp@- 46510: 2f2e 0008 movel %fp@(8),%sp@- 46514: 4eb9 0004 7dbc jsr 47dbc <_Objects_Get_information> if ( !obj_info ) 4651a: 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 ); 4651c: 2040 moveal %d0,%a0 if ( !obj_info ) 4651e: 4a80 tstl %d0 46520: 6604 bnes 46526 46522: 700a moveq #10,%d0 46524: 6038 bras 4655e <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 46526: 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; 4652a: 4282 clrl %d2 4652c: 7001 moveq #1,%d0 4652e: 4281 clrl %d1 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 46530: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 46536: 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; 4653a: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 46540: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 46544: 600e bras 46554 <== ALWAYS TAKEN if ( !obj_info->local_table[i] ) 46546: 2268 0018 moveal %a0@(24),%a1 4654a: 4ab1 0c00 tstl %a1@(00000000,%d0:l:4) 4654e: 6602 bnes 46552 unallocated++; 46550: 5281 addql #1,%d1 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++ ) 46552: 5280 addql #1,%d0 46554: b480 cmpl %d0,%d2 46556: 64ee bccs 46546 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 46558: 2541 000e movel %d1,%a2@(14) 4655c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4655e: 242e fff8 movel %fp@(-8),%d2 46562: 246e fffc moveal %fp@(-4),%a2 46566: 4e5e unlk %fp 46568: 4e75 rts ... 0004834c : rtems_status_code rtems_object_get_classic_name( rtems_id id, rtems_name *name ) { 4834c: 4e56 fffc linkw %fp,#-4 48350: 2f0a movel %a2,%sp@- 48352: 246e 000c moveal %fp@(12),%a2 Objects_Name_or_id_lookup_errors status; Objects_Name name_u; if ( !name ) 48356: 4a8a tstl %a2 48358: 6604 bnes 4835e 4835a: 7009 moveq #9,%d0 4835c: 601e bras 4837c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; status = _Objects_Id_to_name( id, &name_u ); 4835e: 486e fffc pea %fp@(-4) 48362: 2f2e 0008 movel %fp@(8),%sp@- 48366: 4eb9 0004 9e58 jsr 49e58 <_Objects_Id_to_name> *name = name_u.name_u32; return _Status_Object_name_errors_to_status[ status ]; 4836c: 508f addql #8,%sp 4836e: 41f9 0006 2c14 lea 62c14 <_Status_Object_name_errors_to_status>,%a0 48374: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !name ) return RTEMS_INVALID_ADDRESS; status = _Objects_Id_to_name( id, &name_u ); *name = name_u.name_u32; 48378: 24ae fffc movel %fp@(-4),%a2@ return _Status_Object_name_errors_to_status[ status ]; } 4837c: 246e fff8 moveal %fp@(-8),%a2 48380: 4e5e unlk %fp 48382: 4e75 rts 000465d4 : */ rtems_status_code rtems_object_set_name( rtems_id id, const char *name ) { 465d4: 4e56 fff0 linkw %fp,#-16 465d8: 48d7 001c moveml %d2-%d4,%sp@ 465dc: 262e 0008 movel %fp@(8),%d3 465e0: 282e 000c movel %fp@(12),%d4 Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 465e4: 6604 bnes 465ea 465e6: 7009 moveq #9,%d0 465e8: 6050 bras 4663a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 465ea: 4a83 tstl %d3 465ec: 660a bnes 465f8 465ee: 2079 0005 e5c6 moveal 5e5c6 <_Thread_Executing>,%a0 465f4: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 465f8: 2f03 movel %d3,%sp@- 465fa: 4eb9 0004 7d90 jsr 47d90 <_Objects_Get_information_id> if ( !information ) 46600: 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 ); 46602: 2400 movel %d0,%d2 if ( !information ) 46604: 6732 beqs 46638 return RTEMS_INVALID_ID; the_object = _Objects_Get( information, tmpId, &location ); 46606: 486e fffc pea %fp@(-4) 4660a: 2f03 movel %d3,%sp@- 4660c: 2f00 movel %d0,%sp@- 4660e: 4eb9 0004 7f34 jsr 47f34 <_Objects_Get> switch ( location ) { 46614: 4fef 000c lea %sp@(12),%sp 46618: 4aae fffc tstl %fp@(-4) 4661c: 661a bnes 46638 case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); 4661e: 2f04 movel %d4,%sp@- 46620: 2f00 movel %d0,%sp@- 46622: 2f02 movel %d2,%sp@- 46624: 4eb9 0004 811c jsr 4811c <_Objects_Set_name> _Thread_Enable_dispatch(); 4662a: 4eb9 0004 87a2 jsr 487a2 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46630: 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(); 46634: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 46636: 6002 bras 4663a <== ALWAYS TAKEN 46638: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4663a: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 46640: 4e5e unlk %fp 46642: 4e75 rts 0004ea44 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 4ea44: 4e56 ffe4 linkw %fp,#-28 4ea48: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4ea4c: 2a2e 0008 movel %fp@(8),%d5 4ea50: 282e 000c movel %fp@(12),%d4 4ea54: 262e 0010 movel %fp@(16),%d3 4ea58: 242e 0014 movel %fp@(20),%d2 4ea5c: 266e 001c moveal %fp@(28),%a3 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 4ea60: 4a85 tstl %d5 4ea62: 6606 bnes 4ea6a 4ea64: 7003 moveq #3,%d0 4ea66: 6000 00b2 braw 4eb1a <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !starting_address ) 4ea6a: 4a84 tstl %d4 4ea6c: 6700 00a6 beqw 4eb14 return RTEMS_INVALID_ADDRESS; if ( !id ) 4ea70: 4a8b tstl %a3 4ea72: 6700 00a0 beqw 4eb14 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 4ea76: 4a83 tstl %d3 4ea78: 6700 009e beqw 4eb18 4ea7c: 4a82 tstl %d2 4ea7e: 6700 0098 beqw 4eb18 4ea82: b483 cmpl %d3,%d2 4ea84: 6200 0092 bhiw 4eb18 4ea88: 7003 moveq #3,%d0 4ea8a: c082 andl %d2,%d0 4ea8c: 6600 008a bnew 4eb18 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 4ea90: 103c 0003 moveb #3,%d0 4ea94: c084 andl %d4,%d0 4ea96: 667c bnes 4eb14 4ea98: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 4ea9e: 5280 addql #1,%d0 4eaa0: 23c0 0007 38e0 movel %d0,738e0 <_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 ); 4eaa6: 4879 0007 3774 pea 73774 <_Partition_Information> 4eaac: 45f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a2 4eab2: 4eb9 0005 2a8c jsr 52a8c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 4eab8: 588f addql #4,%sp 4eaba: 2840 moveal %d0,%a4 4eabc: 4a80 tstl %d0 4eabe: 6606 bnes 4eac6 _Thread_Enable_dispatch(); 4eac0: 4e92 jsr %a2@ 4eac2: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4eac4: 6054 bras 4eb1a <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 4eac6: 2944 0010 movel %d4,%a4@(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, 4eaca: 2003 movel %d3,%d0 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 4eacc: 296e 0018 001c movel %fp@(24),%a4@(28) the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 4ead2: 4c42 0000 remul %d2,%d0,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 4ead6: 2943 0014 movel %d3,%a4@(20) the_partition->buffer_size = buffer_size; 4eada: 2942 0018 movel %d2,%a4@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 4eade: 42ac 0020 clrl %a4@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 4eae2: 2f02 movel %d2,%sp@- 4eae4: 2f00 movel %d0,%sp@- 4eae6: 2f04 movel %d4,%sp@- 4eae8: 486c 0024 pea %a4@(36) 4eaec: 4eb9 0005 1890 jsr 51890 <_Chain_Initialize> 4eaf2: 202c 0008 movel %a4@(8),%d0 4eaf6: 4281 clrl %d1 4eaf8: 2079 0007 378c moveal 7378c <_Partition_Information+0x18>,%a0 4eafe: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4eb00: 2945 000c movel %d5,%a4@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4eb04: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 4eb08: 2680 movel %d0,%a3@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 4eb0a: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 4eb0c: 4fef 0010 lea %sp@(16),%sp name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 4eb10: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4eb12: 6006 bras 4eb1a <== ALWAYS TAKEN 4eb14: 7009 moveq #9,%d0 4eb16: 6002 bras 4eb1a <== ALWAYS TAKEN 4eb18: 7008 moveq #8,%d0 } 4eb1a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4eb20: 4e5e unlk %fp 4eb22: 4e75 rts 0004eb24 : */ rtems_status_code rtems_partition_delete( rtems_id id ) { 4eb24: 4e56 fffc linkw %fp,#-4 4eb28: 2f0b movel %a3,%sp@- 4eb2a: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4eb2c: 486e fffc pea %fp@(-4) 4eb30: 2f2e 0008 movel %fp@(8),%sp@- 4eb34: 4879 0007 3774 pea 73774 <_Partition_Information> 4eb3a: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4eb40: 4fef 000c lea %sp@(12),%sp 4eb44: 2440 moveal %d0,%a2 4eb46: 4aae fffc tstl %fp@(-4) 4eb4a: 6704 beqs 4eb50 4eb4c: 7004 moveq #4,%d0 4eb4e: 6036 bras 4eb86 <== ALWAYS TAKEN 4eb50: 47f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { 4eb56: 4aaa 0020 tstl %a2@(32) 4eb5a: 6626 bnes 4eb82 _Objects_Close( &_Partition_Information, &the_partition->Object ); 4eb5c: 2f00 movel %d0,%sp@- 4eb5e: 4879 0007 3774 pea 73774 <_Partition_Information> 4eb64: 4eb9 0005 2b0c jsr 52b0c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Partition_Free ( Partition_Control *the_partition ) { _Objects_Free( &_Partition_Information, &the_partition->Object ); 4eb6a: 2f0a movel %a2,%sp@- 4eb6c: 4879 0007 3774 pea 73774 <_Partition_Information> 4eb72: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 4eb78: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 4eb7a: 4fef 0010 lea %sp@(16),%sp 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 4eb7e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4eb80: 6004 bras 4eb86 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4eb82: 4e93 jsr %a3@ 4eb84: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4eb86: 246e fff4 moveal %fp@(-12),%a2 4eb8a: 266e fff8 moveal %fp@(-8),%a3 4eb8e: 4e5e unlk %fp 4eb90: 4e75 rts ... 0004eb94 : rtems_status_code rtems_partition_get_buffer( rtems_id id, void **buffer ) { 4eb94: 4e56 fff0 linkw %fp,#-16 4eb98: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4eb9c: 266e 000c moveal %fp@(12),%a3 register Partition_Control *the_partition; Objects_Locations location; void *the_buffer; if ( !buffer ) 4eba0: 4a8b tstl %a3 4eba2: 6604 bnes 4eba8 4eba4: 7009 moveq #9,%d0 4eba6: 604a bras 4ebf2 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4eba8: 486e fffc pea %fp@(-4) 4ebac: 2f2e 0008 movel %fp@(8),%sp@- 4ebb0: 4879 0007 3774 pea 73774 <_Partition_Information> 4ebb6: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ebbc: 4fef 000c lea %sp@(12),%sp 4ebc0: 2440 moveal %d0,%a2 4ebc2: 4aae fffc tstl %fp@(-4) 4ebc6: 6704 beqs 4ebcc 4ebc8: 7004 moveq #4,%d0 4ebca: 6026 bras 4ebf2 <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer ( Partition_Control *the_partition ) { return _Chain_Get( &the_partition->Memory ); 4ebcc: 486a 0024 pea %a2@(36) 4ebd0: 4eb9 0005 185c jsr 5185c <_Chain_Get> case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { 4ebd6: 588f addql #4,%sp 4ebd8: 41f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a0 4ebde: 2400 movel %d0,%d2 4ebe0: 670c beqs 4ebee the_partition->number_of_used_blocks += 1; 4ebe2: 52aa 0020 addql #1,%a2@(32) _Thread_Enable_dispatch(); 4ebe6: 4e90 jsr %a0@ *buffer = the_buffer; 4ebe8: 4280 clrl %d0 4ebea: 2682 movel %d2,%a3@ return RTEMS_SUCCESSFUL; 4ebec: 6004 bras 4ebf2 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4ebee: 4e90 jsr %a0@ 4ebf0: 700d moveq #13,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ebf2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 4ebf8: 4e5e unlk %fp 4ebfa: 4e75 rts 0004ec28 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4ec28: 4e56 fffc linkw %fp,#-4 4ec2c: 2f0a movel %a2,%sp@- 4ec2e: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4ec30: 486e fffc pea %fp@(-4) 4ec34: 2f2e 0008 movel %fp@(8),%sp@- 4ec38: 4879 0007 3774 pea 73774 <_Partition_Information> 4ec3e: 242e 000c movel %fp@(12),%d2 4ec42: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ec48: 4fef 000c lea %sp@(12),%sp 4ec4c: 2440 moveal %d0,%a2 4ec4e: 4aae fffc tstl %fp@(-4) 4ec52: 6704 beqs 4ec58 4ec54: 7004 moveq #4,%d0 4ec56: 603c bras 4ec94 <== ALWAYS TAKEN ) { void *starting; void *ending; starting = the_partition->starting_address; 4ec58: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4ec5c: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4ec60: b082 cmpl %d2,%d0 4ec62: 623c bhis 4eca0 4ec64: d280 addl %d0,%d1 4ec66: b282 cmpl %d2,%d1 4ec68: 6536 bcss 4eca0 <== ALWAYS TAKEN return ( 4ec6a: 2202 movel %d2,%d1 4ec6c: 9280 subl %d0,%d1 4ec6e: 2001 movel %d1,%d0 4ec70: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 4ec76: 4a81 tstl %d1 4ec78: 6626 bnes 4eca0 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4ec7a: 2f02 movel %d2,%sp@- 4ec7c: 486a 0024 pea %a2@(36) 4ec80: 4eb9 0005 1824 jsr 51824 <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4ec86: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4ec8a: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4ec90: 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(); 4ec92: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ec94: 242e fff4 movel %fp@(-12),%d2 4ec98: 246e fff8 moveal %fp@(-8),%a2 4ec9c: 4e5e unlk %fp 4ec9e: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4eca0: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4eca6: 7009 moveq #9,%d0 return RTEMS_INVALID_ADDRESS; 4eca8: 60ea bras 4ec94 <== ALWAYS TAKEN ... 0004e0c4 : void *internal_start, void *external_start, uint32_t length, rtems_id *id ) { 4e0c4: 4e56 ffec linkw %fp,#-20 4e0c8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4e0cc: 282e 0008 movel %fp@(8),%d4 4e0d0: 262e 000c movel %fp@(12),%d3 4e0d4: 242e 0010 movel %fp@(16),%d2 4e0d8: 246e 0018 moveal %fp@(24),%a2 register Dual_ported_memory_Control *the_port; if ( !rtems_is_name_valid( name ) ) 4e0dc: 4a84 tstl %d4 4e0de: 6604 bnes 4e0e4 4e0e0: 7003 moveq #3,%d0 4e0e2: 606e bras 4e152 <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4e0e4: 4a8a tstl %a2 4e0e6: 6768 beqs 4e150 return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( internal_start ) || 4e0e8: 2002 movel %d2,%d0 4e0ea: 7203 moveq #3,%d1 4e0ec: 8083 orl %d3,%d0 4e0ee: c081 andl %d1,%d0 4e0f0: 665e bnes 4e150 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4e0f2: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 4e0f8: 5280 addql #1,%d0 4e0fa: 23c0 0007 38e0 movel %d0,738e0 <_Thread_Dispatch_disable_level> * of free port control blocks. */ RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Allocate ( void ) { return (Dual_ported_memory_Control *) 4e100: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e106: 4eb9 0005 2a8c jsr 52a8c <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_port = _Dual_ported_memory_Allocate(); if ( !the_port ) { 4e10c: 588f addql #4,%sp 4e10e: 43f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a1 4e114: 2040 moveal %d0,%a0 4e116: 4a80 tstl %d0 4e118: 6606 bnes 4e120 _Thread_Enable_dispatch(); 4e11a: 4e91 jsr %a1@ 4e11c: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4e11e: 6032 bras 4e152 <== ALWAYS TAKEN } the_port->internal_base = internal_start; the_port->external_base = external_start; the_port->length = length - 1; 4e120: 222e 0014 movel %fp@(20),%d1 4e124: 5381 subql #1,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4e126: 2028 0008 movel %a0@(8),%d0 4e12a: 2141 0018 movel %d1,%a0@(24) 4e12e: 4281 clrl %d1 4e130: 2679 0007 3754 moveal 73754 <_Dual_ported_memory_Information+0x18>,%a3 4e136: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4e138: 2144 000c movel %d4,%a0@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4e13c: 2788 1c00 movel %a0,%a3@(00000000,%d1:l:4) &_Dual_ported_memory_Information, &the_port->Object, (Objects_Name) name ); *id = the_port->Object.id; 4e140: 2480 movel %d0,%a2@ if ( !the_port ) { _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_port->internal_base = internal_start; 4e142: 2143 0010 movel %d3,%a0@(16) the_port->external_base = external_start; 4e146: 2142 0014 movel %d2,%a0@(20) &the_port->Object, (Objects_Name) name ); *id = the_port->Object.id; _Thread_Enable_dispatch(); 4e14a: 4e91 jsr %a1@ 4e14c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4e14e: 6002 bras 4e152 <== ALWAYS TAKEN 4e150: 7009 moveq #9,%d0 } 4e152: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4e158: 4e5e unlk %fp 4e15a: 4e75 rts 0004e15c : */ rtems_status_code rtems_port_delete( rtems_id id ) { 4e15c: 4e56 fffc linkw %fp,#-4 4e160: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 4e162: 486e fffc pea %fp@(-4) 4e166: 2f2e 0008 movel %fp@(8),%sp@- 4e16a: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e170: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> register Dual_ported_memory_Control *the_port; Objects_Locations location; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e176: 4fef 000c lea %sp@(12),%sp 4e17a: 2400 movel %d0,%d2 4e17c: 4aae fffc tstl %fp@(-4) 4e180: 6704 beqs 4e186 4e182: 7004 moveq #4,%d0 4e184: 6028 bras 4e1ae <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); 4e186: 2f00 movel %d0,%sp@- 4e188: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e18e: 4eb9 0005 2b0c jsr 52b0c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free ( Dual_ported_memory_Control *the_port ) { _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object ); 4e194: 2f02 movel %d2,%sp@- 4e196: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e19c: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> _Dual_ported_memory_Free( the_port ); _Thread_Enable_dispatch(); 4e1a2: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4e1a8: 4fef 0010 lea %sp@(16),%sp switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); _Dual_ported_memory_Free( the_port ); _Thread_Enable_dispatch(); 4e1ac: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e1ae: 242e fff8 movel %fp@(-8),%d2 4e1b2: 4e5e unlk %fp 4e1b4: 4e75 rts ... 0004e1b8 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 4e1b8: 4e56 fffc linkw %fp,#-4 4e1bc: 2f0a movel %a2,%sp@- 4e1be: 246e 0010 moveal %fp@(16),%a2 4e1c2: 2f02 movel %d2,%sp@- 4e1c4: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 4e1c8: 4a8a tstl %a2 4e1ca: 6604 bnes 4e1d0 4e1cc: 7009 moveq #9,%d0 4e1ce: 6042 bras 4e212 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 4e1d0: 486e fffc pea %fp@(-4) 4e1d4: 2f2e 0008 movel %fp@(8),%sp@- 4e1d8: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e1de: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e1e4: 4fef 000c lea %sp@(12),%sp 4e1e8: 2040 moveal %d0,%a0 4e1ea: 4aae fffc tstl %fp@(-4) 4e1ee: 6704 beqs 4e1f4 4e1f0: 7004 moveq #4,%d0 4e1f2: 601e bras 4e212 <== ALWAYS TAKEN case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); 4e1f4: 2002 movel %d2,%d0 4e1f6: 90a8 0014 subl %a0@(20),%d0 if ( ending > the_port->length ) 4e1fa: b0a8 0018 cmpl %a0@(24),%d0 4e1fe: 6304 blss 4e204 *internal = external; 4e200: 2482 movel %d2,%a2@ 4e202: 6006 bras 4e20a <== ALWAYS TAKEN else *internal = _Addresses_Add_offset( the_port->internal_base, 4e204: d0a8 0010 addl %a0@(16),%d0 4e208: 2480 movel %d0,%a2@ ending ); _Thread_Enable_dispatch(); 4e20a: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4e210: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e212: 242e fff4 movel %fp@(-12),%d2 4e216: 246e fff8 moveal %fp@(-8),%a2 4e21a: 4e5e unlk %fp 4e21c: 4e75 rts ... 0004e248 : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 4e248: 4e56 fffc linkw %fp,#-4 4e24c: 2f0a movel %a2,%sp@- 4e24e: 246e 0010 moveal %fp@(16),%a2 4e252: 2f02 movel %d2,%sp@- 4e254: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 4e258: 4a8a tstl %a2 4e25a: 6604 bnes 4e260 4e25c: 7009 moveq #9,%d0 4e25e: 6042 bras 4e2a2 <== ALWAYS TAKEN 4e260: 486e fffc pea %fp@(-4) 4e264: 2f2e 0008 movel %fp@(8),%sp@- 4e268: 4879 0007 373c pea 7373c <_Dual_ported_memory_Information> 4e26e: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e274: 4fef 000c lea %sp@(12),%sp 4e278: 2040 moveal %d0,%a0 4e27a: 4aae fffc tstl %fp@(-4) 4e27e: 6704 beqs 4e284 4e280: 7004 moveq #4,%d0 4e282: 601e bras 4e2a2 <== ALWAYS TAKEN case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); 4e284: 2002 movel %d2,%d0 4e286: 90a8 0010 subl %a0@(16),%d0 if ( ending > the_port->length ) 4e28a: b0a8 0018 cmpl %a0@(24),%d0 4e28e: 6304 blss 4e294 *external = internal; 4e290: 2482 movel %d2,%a2@ 4e292: 6006 bras 4e29a <== ALWAYS TAKEN else *external = _Addresses_Add_offset( the_port->external_base, 4e294: d0a8 0014 addl %a0@(20),%d0 4e298: 2480 movel %d0,%a2@ ending ); _Thread_Enable_dispatch(); 4e29a: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4e2a0: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e2a2: 242e fff4 movel %fp@(-12),%d2 4e2a6: 246e fff8 moveal %fp@(-8),%a2 4e2aa: 4e5e unlk %fp 4e2ac: 4e75 rts ... 0004ecac : */ rtems_status_code rtems_rate_monotonic_cancel( rtems_id id ) { 4ecac: 4e56 fffc linkw %fp,#-4 4ecb0: 2f0b movel %a3,%sp@- 4ecb2: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 4ecb4: 486e fffc pea %fp@(-4) 4ecb8: 2f2e 0008 movel %fp@(8),%sp@- 4ecbc: 4879 0007 37ac pea 737ac <_Rate_monotonic_Information> 4ecc2: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> Rate_monotonic_Control *the_period; Objects_Locations location; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4ecc8: 4fef 000c lea %sp@(12),%sp 4eccc: 2440 moveal %d0,%a2 4ecce: 4aae fffc tstl %fp@(-4) 4ecd2: 6704 beqs 4ecd8 4ecd4: 7004 moveq #4,%d0 4ecd6: 602c bras 4ed04 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 4ecd8: 2039 0007 399a movel 7399a <_Thread_Executing>,%d0 4ecde: 47f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a3 4ece4: b0aa 0040 cmpl %a2@(64),%d0 4ece8: 6706 beqs 4ecf0 _Thread_Enable_dispatch(); 4ecea: 4e93 jsr %a3@ 4ecec: 7017 moveq #23,%d0 return RTEMS_NOT_OWNER_OF_RESOURCE; 4ecee: 6014 bras 4ed04 <== ALWAYS TAKEN } (void) _Watchdog_Remove( &the_period->Timer ); 4ecf0: 486a 0010 pea %a2@(16) 4ecf4: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> the_period->state = RATE_MONOTONIC_INACTIVE; 4ecfa: 42aa 0038 clrl %a2@(56) _Thread_Enable_dispatch(); 4ecfe: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 4ed00: 588f addql #4,%sp _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } (void) _Watchdog_Remove( &the_period->Timer ); the_period->state = RATE_MONOTONIC_INACTIVE; _Thread_Enable_dispatch(); 4ed02: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ed04: 246e fff4 moveal %fp@(-12),%a2 4ed08: 266e fff8 moveal %fp@(-8),%a3 4ed0c: 4e5e unlk %fp 4ed0e: 4e75 rts 000458e8 : rtems_status_code rtems_rate_monotonic_create( rtems_name name, rtems_id *id ) { 458e8: 4e56 fff0 linkw %fp,#-16 458ec: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 458f0: 242e 0008 movel %fp@(8),%d2 458f4: 286e 000c moveal %fp@(12),%a4 Rate_monotonic_Control *the_period; if ( !rtems_is_name_valid( name ) ) 458f8: 6606 bnes 45900 458fa: 7003 moveq #3,%d0 458fc: 6000 009e braw 4599c <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 45900: 4a8c tstl %a4 45902: 6606 bnes 4590a 45904: 7009 moveq #9,%d0 45906: 6000 0094 braw 4599c <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4590a: 2039 0005 d60c movel 5d60c <_Thread_Dispatch_disable_level>,%d0 45910: 5280 addql #1,%d0 45912: 23c0 0005 d60c movel %d0,5d60c <_Thread_Dispatch_disable_level> * This function allocates a period control block from * the inactive chain of free period control blocks. */ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void ) { return (Rate_monotonic_Control *) 45918: 4879 0005 d510 pea 5d510 <_Rate_monotonic_Information> 4591e: 47f9 0004 81ee lea 481ee <_Thread_Enable_dispatch>,%a3 45924: 4eb9 0004 74fc jsr 474fc <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_period = _Rate_monotonic_Allocate(); if ( !the_period ) { 4592a: 588f addql #4,%sp 4592c: 2440 moveal %d0,%a2 4592e: 4a80 tstl %d0 45930: 6606 bnes 45938 _Thread_Enable_dispatch(); 45932: 4e93 jsr %a3@ 45934: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 45936: 6064 bras 4599c <== ALWAYS TAKEN } the_period->owner = _Thread_Executing; 45938: 41f9 0005 d6c6 lea 5d6c6 <_Thread_Executing>,%a0 4593e: 2550 0040 movel %a0@,%a2@(64) the_period->state = RATE_MONOTONIC_INACTIVE; 45942: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45946: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; 4594a: 42aa 002c clrl %a2@(44) the_watchdog->id = id; 4594e: 42aa 0030 clrl %a2@(48) the_watchdog->user_data = user_data; 45952: 42aa 0034 clrl %a2@(52) _Watchdog_Initialize( &the_period->Timer, NULL, 0, NULL ); _Rate_monotonic_Reset_statistics( the_period ); 45956: 4878 0038 pea 38 4595a: 42a7 clrl %sp@- 4595c: 486a 0054 pea %a2@(84) 45960: 4eb9 0004 d8cc jsr 4d8cc #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45966: 202a 0008 movel %a2@(8),%d0 4596a: 4281 clrl %d1 4596c: 2079 0005 d528 moveal 5d528 <_Rate_monotonic_Information+0x18>,%a0 45972: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45974: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45978: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) 4597c: 223c 7fff ffff movel #2147483647,%d1 45982: 2541 005c movel %d1,%a2@(92) 45986: 2541 0060 movel %d1,%a2@(96) 4598a: 2541 0074 movel %d1,%a2@(116) 4598e: 2541 0078 movel %d1,%a2@(120) &_Rate_monotonic_Information, &the_period->Object, (Objects_Name) name ); *id = the_period->Object.id; 45992: 2880 movel %d0,%a4@ _Thread_Enable_dispatch(); 45994: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 45996: 4fef 000c lea %sp@(12),%sp &the_period->Object, (Objects_Name) name ); *id = the_period->Object.id; _Thread_Enable_dispatch(); 4599a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4599c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 459a2: 4e5e unlk %fp 459a4: 4e75 rts ... 0004edd0 : */ rtems_status_code rtems_rate_monotonic_delete( rtems_id id ) { 4edd0: 4e56 fffc linkw %fp,#-4 4edd4: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 4edd6: 486e fffc pea %fp@(-4) 4edda: 2f2e 0008 movel %fp@(8),%sp@- 4edde: 4879 0007 37ac pea 737ac <_Rate_monotonic_Information> 4ede4: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> Rate_monotonic_Control *the_period; Objects_Locations location; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4edea: 4fef 000c lea %sp@(12),%sp 4edee: 2440 moveal %d0,%a2 4edf0: 4aae fffc tstl %fp@(-4) 4edf4: 6704 beqs 4edfa 4edf6: 7004 moveq #4,%d0 4edf8: 6036 bras 4ee30 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); 4edfa: 2f00 movel %d0,%sp@- 4edfc: 4879 0007 37ac pea 737ac <_Rate_monotonic_Information> 4ee02: 4eb9 0005 2b0c jsr 52b0c <_Objects_Close> (void) _Watchdog_Remove( &the_period->Timer ); 4ee08: 486a 0010 pea %a2@(16) 4ee0c: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> the_period->state = RATE_MONOTONIC_INACTIVE; 4ee12: 42aa 0038 clrl %a2@(56) */ RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free ( Rate_monotonic_Control *the_period ) { _Objects_Free( &_Rate_monotonic_Information, &the_period->Object ); 4ee16: 2f0a movel %a2,%sp@- 4ee18: 4879 0007 37ac pea 737ac <_Rate_monotonic_Information> 4ee1e: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> _Rate_monotonic_Free( the_period ); _Thread_Enable_dispatch(); 4ee24: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4ee2a: 4fef 0014 lea %sp@(20),%sp case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); (void) _Watchdog_Remove( &the_period->Timer ); the_period->state = RATE_MONOTONIC_INACTIVE; _Rate_monotonic_Free( the_period ); _Thread_Enable_dispatch(); 4ee2e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ee30: 246e fff8 moveal %fp@(-8),%a2 4ee34: 4e5e unlk %fp 4ee36: 4e75 rts 000704f0 : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 704f0: 4e56 fffc linkw %fp,#-4 704f4: 2f0a movel %a2,%sp@- 704f6: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) 704fa: 4a8a tstl %a2 704fc: 6606 bnes 70504 704fe: 7009 moveq #9,%d0 70500: 6000 0098 braw 7059a <== ALWAYS TAKEN 70504: 486e fffc pea %fp@(-4) 70508: 2f2e 0008 movel %fp@(8),%sp@- 7050c: 4879 0009 abf2 pea 9abf2 <_Rate_monotonic_Information> 70512: 4eb9 0004 ba10 jsr 4ba10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 70518: 4fef 000c lea %sp@(12),%sp 7051c: 2040 moveal %d0,%a0 7051e: 4aae fffc tstl %fp@(-4) 70522: 6704 beqs 70528 70524: 7004 moveq #4,%d0 70526: 6072 bras 7059a case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 70528: 24a8 0054 movel %a0@(84),%a2@ dst->missed_count = src->missed_count; 7052c: 2568 0058 0004 movel %a0@(88),%a2@(4) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); 70532: 2028 005c movel %a0@(92),%d0 70536: 2228 0060 movel %a0@(96),%d1 7053a: 2540 0008 movel %d0,%a2@(8) 7053e: 2541 000c movel %d1,%a2@(12) _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 70542: 2028 0064 movel %a0@(100),%d0 70546: 2228 0068 movel %a0@(104),%d1 7054a: 2540 0010 movel %d0,%a2@(16) 7054e: 2541 0014 movel %d1,%a2@(20) _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 70552: 2028 006c movel %a0@(108),%d0 70556: 2228 0070 movel %a0@(112),%d1 7055a: 2540 0018 movel %d0,%a2@(24) 7055e: 2541 001c movel %d1,%a2@(28) _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 70562: 2028 0074 movel %a0@(116),%d0 70566: 2228 0078 movel %a0@(120),%d1 7056a: 2540 0020 movel %d0,%a2@(32) 7056e: 2541 0024 movel %d1,%a2@(36) _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 70572: 2028 007c movel %a0@(124),%d0 70576: 2228 0080 movel %a0@(128),%d1 7057a: 2540 0028 movel %d0,%a2@(40) 7057e: 2541 002c movel %d1,%a2@(44) _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 70582: 2028 0084 movel %a0@(132),%d0 70586: 2228 0088 movel %a0@(136),%d1 7058a: 2540 0030 movel %d0,%a2@(48) 7058e: 2541 0034 movel %d1,%a2@(52) dst->min_wall_time = src->min_wall_time; dst->max_wall_time = src->max_wall_time; dst->total_wall_time = src->total_wall_time; #endif _Thread_Enable_dispatch(); 70592: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 70598: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7059a: 246e fff8 moveal %fp@(-8),%a2 7059e: 4e5e unlk %fp 705a0: 4e75 rts ... 000705a4 : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 705a4: 4e56 ffec linkw %fp,#-20 705a8: 2f0a movel %a2,%sp@- 705aa: 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 ) 705ae: 4a8a tstl %a2 705b0: 6606 bnes 705b8 705b2: 7009 moveq #9,%d0 705b4: 6000 0094 braw 7064a <== ALWAYS TAKEN 705b8: 486e fffc pea %fp@(-4) 705bc: 2f2e 0008 movel %fp@(8),%sp@- 705c0: 4879 0009 abf2 pea 9abf2 <_Rate_monotonic_Information> 705c6: 4eb9 0004 ba10 jsr 4ba10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 705cc: 4fef 000c lea %sp@(12),%sp 705d0: 2040 moveal %d0,%a0 705d2: 4aae fffc tstl %fp@(-4) 705d6: 6704 beqs 705dc 705d8: 7004 moveq #4,%d0 705da: 606e bras 7064a <== ALWAYS TAKEN case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 705dc: 2268 0040 moveal %a0@(64),%a1 status->state = the_period->state; 705e0: 2028 0038 movel %a0@(56),%d0 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 705e4: 24a9 0008 movel %a1@(8),%a2@ status->state = the_period->state; 705e8: 2540 0004 movel %d0,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 705ec: 6612 bnes 70600 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); _Timespec_Set_to_zero( &status->executed_since_last_period ); 705ee: 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 ); 705f2: 42aa 0008 clrl %a2@(8) 705f6: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 705fa: 42aa 0010 clrl %a2@(16) 705fe: 6042 bras 70642 <== ALWAYS TAKEN /* * Grab the current status. */ valid_status = _Rate_monotonic_Get_status( 70600: 486e fff4 pea %fp@(-12) 70604: 486e ffec pea %fp@(-20) 70608: 2f08 movel %a0,%sp@- 7060a: 4eb9 0007 06cc jsr 706cc <_Rate_monotonic_Get_status> the_period, &since_last_period, &executed ); if (!valid_status) { 70610: 4fef 000c lea %sp@(12),%sp 70614: 4a00 tstb %d0 70616: 660a bnes 70622 _Thread_Enable_dispatch(); 70618: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 7061e: 700b moveq #11,%d0 return RTEMS_NOT_DEFINED; 70620: 6028 bras 7064a <== ALWAYS TAKEN #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 70622: 202e fff4 movel %fp@(-12),%d0 70626: 222e fff8 movel %fp@(-8),%d1 7062a: 2540 0010 movel %d0,%a2@(16) 7062e: 2541 0014 movel %d1,%a2@(20) _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 70632: 202e ffec movel %fp@(-20),%d0 70636: 222e fff0 movel %fp@(-16),%d1 7063a: 2540 0008 movel %d0,%a2@(8) 7063e: 2541 000c movel %d1,%a2@(12) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 70642: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 70648: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7064a: 246e ffe8 moveal %fp@(-24),%a2 7064e: 4e5e unlk %fp 70650: 4e75 rts ... 00070868 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 70868: 4e56 ffec linkw %fp,#-20 7086c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 70870: 486e fffc pea %fp@(-4) 70874: 262e 0008 movel %fp@(8),%d3 70878: 2f03 movel %d3,%sp@- 7087a: 4879 0009 abf2 pea 9abf2 <_Rate_monotonic_Information> 70880: 242e 000c movel %fp@(12),%d2 70884: 4eb9 0004 ba10 jsr 4ba10 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7088a: 4fef 000c lea %sp@(12),%sp 7088e: 2440 moveal %d0,%a2 70890: 4aae fffc tstl %fp@(-4) 70894: 6600 0138 bnew 709ce case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 70898: 2039 0009 a882 movel 9a882 <_Thread_Executing>,%d0 7089e: b0aa 0040 cmpl %a2@(64),%d0 708a2: 670c beqs 708b0 _Thread_Enable_dispatch(); 708a4: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 708aa: 7817 moveq #23,%d4 return RTEMS_NOT_OWNER_OF_RESOURCE; 708ac: 6000 0122 braw 709d0 <== ALWAYS TAKEN } if ( length == RTEMS_PERIOD_STATUS ) { 708b0: 4a82 tstl %d2 708b2: 6622 bnes 708d6 switch ( the_period->state ) { 708b4: 202a 0038 movel %a2@(56),%d0 708b8: 7204 moveq #4,%d1 708ba: b280 cmpl %d0,%d1 708bc: 6404 bccs 708c2 <== NEVER TAKEN 708be: 4284 clrl %d4 <== NOT EXECUTED 708c0: 600a bras 708cc <== NOT EXECUTED 708c2: 41f9 0009 487c lea 9487c ,%a0 708c8: 2830 0c00 movel %a0@(00000000,%d0:l:4),%d4 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 708cc: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> return( return_value ); 708d2: 6000 00fc braw 709d0 <== ALWAYS TAKEN } _ISR_Disable( level ); 708d6: 203c 0000 0700 movel #1792,%d0 708dc: 40c4 movew %sr,%d4 708de: 8084 orl %d4,%d0 708e0: 46c0 movew %d0,%sr switch ( the_period->state ) { 708e2: 202a 0038 movel %a2@(56),%d0 708e6: 7202 moveq #2,%d1 708e8: b280 cmpl %d0,%d1 708ea: 6740 beqs 7092c 708ec: 123c 0004 moveb #4,%d1 708f0: b280 cmpl %d0,%d1 708f2: 6700 00a4 beqw 70998 708f6: 4a80 tstl %d0 708f8: 6600 00d4 bnew 709ce <== ALWAYS TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 708fc: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 708fe: 2f0a movel %a2,%sp@- ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 70900: 4284 clrl %d4 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 70902: 4eb9 0007 0654 jsr 70654 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 70908: 203c 0007 09dc movel #461276,%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 7090e: 7202 moveq #2,%d1 70910: 2540 002c movel %d0,%a2@(44) the_watchdog->id = id; 70914: 2543 0030 movel %d3,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 70918: 2542 001c movel %d2,%a2@(28) 7091c: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 70920: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 70924: 42aa 0034 clrl %a2@(52) 70928: 6000 0084 braw 709ae <== ALWAYS TAKEN case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 7092c: 2f0a movel %a2,%sp@- 7092e: 4eb9 0007 0774 jsr 70774 <_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; 70934: 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; 70938: 7401 moveq #1,%d2 7093a: 2542 0038 movel %d2,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 7093e: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 70940: 2079 0009 a882 moveal 9a882 <_Thread_Executing>,%a0 70946: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7094c: 4878 4000 pea 4000 70950: 2f08 movel %a0,%sp@- 70952: 4eb9 0004 ca9c jsr 4ca9c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 70958: 203c 0000 0700 movel #1792,%d0 7095e: 40c1 movew %sr,%d1 70960: 8081 orl %d1,%d0 70962: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 70964: 143c 0002 moveb #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 70968: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 7096c: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 70970: 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 ) 70972: 7203 moveq #3,%d1 70974: 4fef 000c lea %sp@(12),%sp 70978: b280 cmpl %d0,%d1 7097a: 6612 bnes 7098e _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7097c: 4878 4000 pea 4000 70980: 2f39 0009 a882 movel 9a882 <_Thread_Executing>,%sp@- 70986: 4eb9 0004 beec jsr 4beec <_Thread_Clear_state> 7098c: 508f addql #8,%sp _Thread_Enable_dispatch(); 7098e: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 70994: 4284 clrl %d4 return RTEMS_SUCCESSFUL; 70996: 6038 bras 709d0 <== ALWAYS TAKEN case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 70998: 2f0a movel %a2,%sp@- 7099a: 4eb9 0007 0774 jsr 70774 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 709a0: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 709a2: 7002 moveq #2,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 709a4: 7806 moveq #6,%d4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 709a6: 2542 001c movel %d2,%a2@(28) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 709aa: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; 709ae: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 709b2: 486a 0010 pea %a2@(16) 709b6: 4879 0009 a8a0 pea 9a8a0 <_Watchdog_Ticks_chain> 709bc: 4eb9 0004 d1b0 jsr 4d1b0 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 709c2: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 709c8: 4fef 000c lea %sp@(12),%sp 709cc: 6002 bras 709d0 <== ALWAYS TAKEN 709ce: 7804 moveq #4,%d4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 709d0: 2004 movel %d4,%d0 709d2: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 709d8: 4e5e unlk %fp 709da: 4e75 rts 0006251c : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 6251c: 4e56 ff78 linkw %fp,#-136 62520: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 62524: 242e 0008 movel %fp@(8),%d2 62528: 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 ) 6252c: 4a8a tstl %a2 6252e: 6700 0158 beqw 62688 <== ALWAYS TAKEN return; (*print)( context, "Period information by period\n" ); 62532: 4879 0009 1508 pea 91508 <_TOD_Days_per_month+0x68> #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 62538: 2a0e movel %fp,%d5 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 ); 6253a: 280e movel %fp,%d4 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 ); 6253c: 4bf9 0007 05a4 lea 705a4 ,%a5 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 62542: 5b85 subql #5,%d5 62544: 49f9 0004 a0bc lea 4a0bc ,%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 ); 6254a: 0684 ffff fff2 addil #-14,%d4 62550: 47f9 0006 3abc lea 63abc <_Timespec_Divide_by_integer>,%a3 char name[5]; if ( !print ) return; (*print)( context, "Period information by period\n" ); 62556: 2f02 movel %d2,%sp@- 62558: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 6255a: 4879 0009 1526 pea 91526 <_TOD_Days_per_month+0x86> 62560: 2f02 movel %d2,%sp@- 62562: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 62564: 4879 0009 1548 pea 91548 <_TOD_Days_per_month+0xa8> 6256a: 2f02 movel %d2,%sp@- 6256c: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 6256e: 4879 0009 156b pea 9156b <_TOD_Days_per_month+0xcb> 62574: 2f02 movel %d2,%sp@- 62576: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 62578: 4fef 001c lea %sp@(28),%sp 6257c: 2ebc 0009 15b6 movel #595382,%sp@ 62582: 2f02 movel %d2,%sp@- 62584: 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 ; 62586: 2639 0009 abf8 movel 9abf8 <_Rate_monotonic_Information+0x6>,%d3 6258c: 508f addql #8,%sp 6258e: 6000 00ee braw 6267e <== ALWAYS TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 62592: 486e ffa2 pea %fp@(-94) 62596: 2f03 movel %d3,%sp@- 62598: 4eb9 0007 04f0 jsr 704f0 if ( status != RTEMS_SUCCESSFUL ) 6259e: 508f addql #8,%sp 625a0: 4a80 tstl %d0 625a2: 6600 00d8 bnew 6267c continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 625a6: 486e ffda pea %fp@(-38) 625aa: 2f03 movel %d3,%sp@- 625ac: 4e95 jsr %a5@ #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 625ae: 2f05 movel %d5,%sp@- 625b0: 4878 0005 pea 5 625b4: 2f2e ffda movel %fp@(-38),%sp@- 625b8: 4e94 jsr %a4@ /* * Print part of report line that is not dependent on granularity */ (*print)( context, 625ba: 2f2e ffa6 movel %fp@(-90),%sp@- 625be: 2f2e ffa2 movel %fp@(-94),%sp@- 625c2: 2f05 movel %d5,%sp@- 625c4: 2f03 movel %d3,%sp@- 625c6: 4879 0009 1602 pea 91602 <_TOD_Days_per_month+0x162> 625cc: 2f02 movel %d2,%sp@- 625ce: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 625d0: 202e ffa2 movel %fp@(-94),%d0 625d4: 4fef 002c lea %sp@(44),%sp 625d8: 6610 bnes 625ea (*print)( context, "\n" ); 625da: 4879 0009 2e22 pea 92e22 <__FUNCTION__.5937+0x5d> 625e0: 2f02 movel %d2,%sp@- 625e2: 4e92 jsr %a2@ continue; 625e4: 508f addql #8,%sp 625e6: 6000 0094 braw 6267c <== ALWAYS TAKEN 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 ); 625ea: 2f04 movel %d4,%sp@- (*print)( context, 625ec: 2e3c 0000 03e8 movel #1000,%d7 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 625f2: 2f00 movel %d0,%sp@- 625f4: 486e ffba pea %fp@(-70) 625f8: 4e93 jsr %a3@ (*print)( context, 625fa: 202e fff6 movel %fp@(-10),%d0 625fe: 223c 0000 03e8 movel #1000,%d1 62604: 4c41 0800 remsl %d1,%d0,%d0 62608: 222e ffb6 movel %fp@(-74),%d1 6260c: 2f00 movel %d0,%sp@- 6260e: 2f2e fff2 movel %fp@(-14),%sp@- 62612: 202e ffae movel %fp@(-82),%d0 62616: 4c47 1801 remsl %d7,%d1,%d1 6261a: 4c47 0800 remsl %d7,%d0,%d0 6261e: 2f01 movel %d1,%sp@- 62620: 2f2e ffb2 movel %fp@(-78),%sp@- 62624: 2f00 movel %d0,%sp@- 62626: 2f2e ffaa movel %fp@(-86),%sp@- 6262a: 4879 0009 1619 pea 91619 <_TOD_Days_per_month+0x179> 62630: 2f02 movel %d2,%sp@- 62632: 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); 62634: 4fef 0028 lea %sp@(40),%sp 62638: 2e84 movel %d4,%sp@ 6263a: 2f2e ffa2 movel %fp@(-94),%sp@- 6263e: 486e ffd2 pea %fp@(-46) 62642: 4e93 jsr %a3@ (*print)( context, 62644: 202e fff6 movel %fp@(-10),%d0 62648: 4c47 0800 remsl %d7,%d0,%d0 6264c: 222e ffce movel %fp@(-50),%d1 62650: 2f00 movel %d0,%sp@- 62652: 2f2e fff2 movel %fp@(-14),%sp@- 62656: 4c47 1801 remsl %d7,%d1,%d1 6265a: 202e ffc6 movel %fp@(-58),%d0 6265e: 2f01 movel %d1,%sp@- 62660: 2f2e ffca movel %fp@(-54),%sp@- 62664: 4c47 0800 remsl %d7,%d0,%d0 62668: 2f00 movel %d0,%sp@- 6266a: 2f2e ffc2 movel %fp@(-62),%sp@- 6266e: 4879 0009 1638 pea 91638 <_TOD_Days_per_month+0x198> 62674: 2f02 movel %d2,%sp@- 62676: 4e92 jsr %a2@ 62678: 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 ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 6267c: 5283 addql #1,%d3 /* * 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 ; 6267e: b6b9 0009 abfc cmpl 9abfc <_Rate_monotonic_Information+0xa>,%d3 62684: 6300 ff0c blsw 62592 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 62688: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 6268e: 4e5e unlk %fp 62690: 4e75 rts 000626ac : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 626ac: 4e56 0000 linkw %fp,#0 626b0: 2039 0009 a7c8 movel 9a7c8 <_Thread_Dispatch_disable_level>,%d0 626b6: 5280 addql #1,%d0 626b8: 2f0a movel %a2,%sp@- 626ba: 23c0 0009 a7c8 movel %d0,9a7c8 <_Thread_Dispatch_disable_level> 626c0: 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 ; 626c2: 2439 0009 abf8 movel 9abf8 <_Rate_monotonic_Information+0x6>,%d2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 626c8: 45f9 0006 26f0 lea 626f0 ,%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 ; 626ce: 6008 bras 626d8 <== ALWAYS TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 626d0: 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++ ) { 626d2: 5282 addql #1,%d2 status = rtems_rate_monotonic_reset_statistics( id ); 626d4: 4e92 jsr %a2@ * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 626d6: 588f addql #4,%sp /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 626d8: b4b9 0009 abfc cmpl 9abfc <_Rate_monotonic_Information+0xa>,%d2 626de: 63f0 blss 626d0 /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 626e0: 242e fff8 movel %fp@(-8),%d2 626e4: 246e fffc moveal %fp@(-4),%a2 626e8: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 626ea: 4ef9 0004 c2a6 jmp 4c2a6 <_Thread_Enable_dispatch> 000626f0 : */ rtems_status_code rtems_rate_monotonic_reset_statistics( rtems_id id ) { 626f0: 4e56 fffc linkw %fp,#-4 626f4: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 626f6: 486e fffc pea %fp@(-4) 626fa: 2f2e 0008 movel %fp@(8),%sp@- 626fe: 4879 0009 abf2 pea 9abf2 <_Rate_monotonic_Information> 62704: 4eb9 0004 ba10 jsr 4ba10 <_Objects_Get> Objects_Locations location; Rate_monotonic_Control *the_period; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 6270a: 4fef 000c lea %sp@(12),%sp 6270e: 2440 moveal %d0,%a2 62710: 4aae fffc tstl %fp@(-4) 62714: 6704 beqs 6271a 62716: 7004 moveq #4,%d0 62718: 6032 bras 6274c <== ALWAYS TAKEN case OBJECTS_LOCAL: _Rate_monotonic_Reset_statistics( the_period ); 6271a: 4878 0038 pea 38 6271e: 42a7 clrl %sp@- 62720: 486a 0054 pea %a2@(84) 62724: 4eb9 0007 8028 jsr 78028 6272a: 203c 7fff ffff movel #2147483647,%d0 62730: 2540 0078 movel %d0,%a2@(120) 62734: 2540 005c movel %d0,%a2@(92) 62738: 2540 0060 movel %d0,%a2@(96) 6273c: 2540 0074 movel %d0,%a2@(116) _Thread_Enable_dispatch(); 62740: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 62746: 4fef 000c lea %sp@(12),%sp the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: _Rate_monotonic_Reset_statistics( the_period ); _Thread_Enable_dispatch(); 6274a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6274c: 246e fff8 moveal %fp@(-8),%a2 62750: 4e5e unlk %fp 62752: 4e75 rts 0004f414 : uintptr_t length, uintptr_t page_size, rtems_attribute attribute_set, rtems_id *id ) { 4f414: 4e56 ffe4 linkw %fp,#-28 4f418: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 4f41c: 262e 0008 movel %fp@(8),%d3 4f420: 242e 000c movel %fp@(12),%d2 4f424: 2c2e 0010 movel %fp@(16),%d6 4f428: 2a2e 0014 movel %fp@(20),%d5 4f42c: 282e 0018 movel %fp@(24),%d4 4f430: 266e 001c moveal %fp@(28),%a3 rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 4f434: 4a83 tstl %d3 4f436: 6606 bnes 4f43e 4f438: 7403 moveq #3,%d2 4f43a: 6000 00c8 braw 4f504 <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !starting_address ) 4f43e: 4a82 tstl %d2 4f440: 6700 00c0 beqw 4f502 return RTEMS_INVALID_ADDRESS; if ( !id ) 4f444: 4a8b tstl %a3 4f446: 6700 00ba beqw 4f502 return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) 4f44a: 7003 moveq #3,%d0 4f44c: c082 andl %d2,%d0 4f44e: 6600 00b2 bnew 4f502 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 4f452: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f458: 4eb9 0005 1790 jsr 51790 <_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 ); 4f45e: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f464: 4eb9 0005 2a8c jsr 52a8c <_Objects_Allocate> the_region = _Region_Allocate(); if ( !the_region ) 4f46a: 508f addql #8,%sp 4f46c: 2440 moveal %d0,%a2 4f46e: 4a80 tstl %d0 4f470: 6604 bnes 4f476 4f472: 7405 moveq #5,%d2 4f474: 607c bras 4f4f2 <== ALWAYS TAKEN return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 4f476: 2f05 movel %d5,%sp@- 4f478: 2f06 movel %d6,%sp@- 4f47a: 2f02 movel %d2,%sp@- 4f47c: 486a 0068 pea %a2@(104) 4f480: 4eb9 0005 25a8 jsr 525a8 <_Heap_Initialize> &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 4f486: 4fef 0010 lea %sp@(16),%sp if ( !the_region ) return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 4f48a: 2540 005c movel %d0,%a2@(92) &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 4f48e: 6614 bnes 4f4a4 */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 4f490: 2f0a movel %a2,%sp@- 4f492: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f498: 7408 moveq #8,%d2 4f49a: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> 4f4a0: 508f addql #8,%sp 4f4a2: 604e bras 4f4f2 <== ALWAYS TAKEN return_status = RTEMS_INVALID_SIZE; } else { the_region->starting_address = starting_address; 4f4a4: 2542 0050 movel %d2,%a2@(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( 4f4a8: 2004 movel %d4,%d0 4f4aa: 7201 moveq #1,%d1 4f4ac: e488 lsrl #2,%d0 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 4f4ae: 4282 clrl %d2 } else { the_region->starting_address = starting_address; the_region->length = length; 4f4b0: 2546 0054 movel %d6,%a2@(84) the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 4f4b4: c280 andl %d0,%d1 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 4f4b6: 2545 0058 movel %d5,%a2@(88) the_region->attribute_set = attribute_set; 4f4ba: 2544 0060 movel %d4,%a2@(96) the_region->number_of_used_blocks = 0; 4f4be: 42aa 0064 clrl %a2@(100) _Thread_queue_Initialize( 4f4c2: 4878 0006 pea 6 4f4c6: 4878 0040 pea 40 4f4ca: 2f01 movel %d1,%sp@- 4f4cc: 486a 0010 pea %a2@(16) 4f4d0: 4eb9 0005 3e2c jsr 53e2c <_Thread_queue_Initialize> 4f4d6: 202a 0008 movel %a2@(8),%d0 4f4da: 4281 clrl %d1 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 4f4dc: 4fef 0010 lea %sp@(16),%sp 4f4e0: 3200 movew %d0,%d1 4f4e2: 2079 0007 37fc moveal 737fc <_Region_Information+0x18>,%a0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4f4e8: 2543 000c movel %d3,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4f4ec: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) 4f4f0: 2680 movel %d0,%a3@ return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 4f4f2: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f4f8: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f4fe: 588f addql #4,%sp 4f500: 6002 bras 4f504 <== ALWAYS TAKEN 4f502: 7409 moveq #9,%d2 } 4f504: 2002 movel %d2,%d0 4f506: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 4f50c: 4e5e unlk %fp 4f50e: 4e75 rts 0004f510 : */ rtems_status_code rtems_region_delete( rtems_id id ) { 4f510: 4e56 fffc linkw %fp,#-4 4f514: 2f0a movel %a2,%sp@- 4f516: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; _RTEMS_Lock_allocator(); 4f518: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f51e: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 4f524: 486e fffc pea %fp@(-4) 4f528: 2f2e 0008 movel %fp@(8),%sp@- 4f52c: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f532: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f538: 4fef 0010 lea %sp@(16),%sp 4f53c: 2440 moveal %d0,%a2 4f53e: 4aae fffc tstl %fp@(-4) 4f542: 6704 beqs 4f548 4f544: 7404 moveq #4,%d2 4f546: 602c bras 4f574 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 5 ); if ( the_region->number_of_used_blocks != 0 ) 4f548: 4aaa 0064 tstl %a2@(100) 4f54c: 6704 beqs 4f552 4f54e: 740c moveq #12,%d2 4f550: 6022 bras 4f574 <== ALWAYS TAKEN return_status = RTEMS_RESOURCE_IN_USE; else { _Objects_Close( &_Region_Information, &the_region->Object ); 4f552: 2f00 movel %d0,%sp@- 4f554: 4879 0007 37e4 pea 737e4 <_Region_Information> */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 4f55a: 4282 clrl %d2 4f55c: 4eb9 0005 2b0c jsr 52b0c <_Objects_Close> 4f562: 2f0a movel %a2,%sp@- 4f564: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f56a: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> 4f570: 4fef 0010 lea %sp@(16),%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f574: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f57a: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; } 4f580: 246e fff8 moveal %fp@(-8),%a2 4f584: 2002 movel %d2,%d0 4f586: 242e fff4 movel %fp@(-12),%d2 4f58a: 4e5e unlk %fp 4f58c: 4e75 rts ... 0004f590 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 4f590: 4e56 fff8 linkw %fp,#-8 4f594: 2f0a movel %a2,%sp@- 4f596: 2f02 movel %d2,%sp@- 4f598: 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 ) 4f59c: 6606 bnes 4f5a4 4f59e: 143c 0009 moveb #9,%d2 4f5a2: 6076 bras 4f61a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 4f5a4: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f5aa: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 4f5b0: 486e fff8 pea %fp@(-8) 4f5b4: 2f2e 0008 movel %fp@(8),%sp@- 4f5b8: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f5be: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f5c4: 4fef 0010 lea %sp@(16),%sp 4f5c8: 2440 moveal %d0,%a2 4f5ca: 4aae fff8 tstl %fp@(-8) 4f5ce: 6704 beqs 4f5d4 4f5d0: 7404 moveq #4,%d2 4f5d2: 6038 bras 4f60c <== ALWAYS TAKEN case OBJECTS_LOCAL: heap_status = _Heap_Extend( 4f5d4: 486e fffc pea %fp@(-4) 4f5d8: 2f2e 0010 movel %fp@(16),%sp@- 4f5dc: 2f02 movel %d2,%sp@- 4f5de: 486a 0068 pea %a2@(104) 4f5e2: 4eb9 0005 22ec jsr 522ec <_Heap_Extend> starting_address, length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { 4f5e8: 4fef 0010 lea %sp@(16),%sp 4f5ec: 4a80 tstl %d0 4f5ee: 6610 bnes 4f600 the_region->length += amount_extended; 4f5f0: 202e fffc movel %fp@(-4),%d0 the_region->maximum_segment_size += amount_extended; 4f5f4: d1aa 005c addl %d0,%a2@(92) 4f5f8: 4282 clrl %d2 length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 4f5fa: d1aa 0054 addl %d0,%a2@(84) 4f5fe: 600c bras 4f60c <== ALWAYS TAKEN the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 4f600: 7201 moveq #1,%d1 4f602: b280 cmpl %d0,%d1 4f604: 6704 beqs 4f60a 4f606: 7418 moveq #24,%d2 4f608: 6002 bras 4f60c <== ALWAYS TAKEN 4f60a: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f60c: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f612: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f618: 588f addql #4,%sp } 4f61a: 2002 movel %d2,%d0 4f61c: 242e fff0 movel %fp@(-16),%d2 4f620: 246e fff4 moveal %fp@(-12),%a2 4f624: 4e5e unlk %fp 4f626: 4e75 rts 0004f628 : rtems_status_code rtems_region_get_free_information( rtems_id id, Heap_Information_block *the_info ) { 4f628: 4e56 fffc linkw %fp,#-4 4f62c: 2f0a movel %a2,%sp@- 4f62e: 246e 000c moveal %fp@(12),%a2 4f632: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 4f634: 4a8a tstl %a2 4f636: 6604 bnes 4f63c 4f638: 7409 moveq #9,%d2 4f63a: 605a bras 4f696 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f63c: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f642: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f648: 486e fffc pea %fp@(-4) 4f64c: 2f2e 0008 movel %fp@(8),%sp@- 4f650: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f656: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f65c: 4fef 0010 lea %sp@(16),%sp 4f660: 4aae fffc tstl %fp@(-4) 4f664: 6704 beqs 4f66a 4f666: 7404 moveq #4,%d2 4f668: 601e bras 4f688 <== ALWAYS TAKEN 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 ); 4f66a: 2f0a movel %a2,%sp@- 4f66c: 2040 moveal %d0,%a0 4f66e: 4868 0068 pea %a0@(104) 4f672: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_info->Used.number = 0; 4f674: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 4f678: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 4f67c: 42aa 0010 clrl %a2@(16) _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 4f680: 4eb9 0005 24f8 jsr 524f8 <_Heap_Get_free_information> return_status = RTEMS_SUCCESSFUL; break; 4f686: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f688: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f68e: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f694: 588f addql #4,%sp } 4f696: 2002 movel %d2,%d0 4f698: 242e fff4 movel %fp@(-12),%d2 4f69c: 246e fff8 moveal %fp@(-8),%a2 4f6a0: 4e5e unlk %fp 4f6a2: 4e75 rts 0004f6a4 : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 4f6a4: 4e56 fffc linkw %fp,#-4 4f6a8: 2f02 movel %d2,%sp@- 4f6aa: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 4f6ae: 6606 bnes 4f6b6 4f6b0: 143c 0009 moveb #9,%d2 4f6b4: 604e bras 4f704 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f6b6: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f6bc: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f6c2: 486e fffc pea %fp@(-4) 4f6c6: 2f2e 0008 movel %fp@(8),%sp@- 4f6ca: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f6d0: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f6d6: 4fef 0010 lea %sp@(16),%sp 4f6da: 4aae fffc tstl %fp@(-4) 4f6de: 6704 beqs 4f6e4 4f6e0: 7404 moveq #4,%d2 4f6e2: 6012 bras 4f6f6 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 4f6e4: 2f02 movel %d2,%sp@- 4f6e6: 2040 moveal %d0,%a0 4f6e8: 4868 0068 pea %a0@(104) 4f6ec: 4282 clrl %d2 4f6ee: 4eb9 0005 253c jsr 5253c <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 4f6f4: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f6f6: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f6fc: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f702: 588f addql #4,%sp } 4f704: 2002 movel %d2,%d0 4f706: 242e fff8 movel %fp@(-8),%d2 4f70a: 4e5e unlk %fp 4f70c: 4e75 rts ... 0004f710 : uintptr_t size, rtems_option option_set, rtems_interval timeout, void **segment ) { 4f710: 4e56 ffe8 linkw %fp,#-24 4f714: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4f718: 262e 0008 movel %fp@(8),%d3 4f71c: 242e 000c movel %fp@(12),%d2 4f720: 286e 0018 moveal %fp@(24),%a4 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 4f724: 4a8c tstl %a4 4f726: 6606 bnes 4f72e 4f728: 7409 moveq #9,%d2 4f72a: 6000 00e8 braw 4f814 return RTEMS_INVALID_ADDRESS; *segment = NULL; 4f72e: 4294 clrl %a4@ if ( size == 0 ) 4f730: 4a82 tstl %d2 4f732: 6608 bnes 4f73c 4f734: 143c 0008 moveb #8,%d2 4f738: 6000 00da braw 4f814 return RTEMS_INVALID_SIZE; _RTEMS_Lock_allocator(); 4f73c: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f742: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f748: 486e fffc pea %fp@(-4) 4f74c: 2f03 movel %d3,%sp@- 4f74e: 4879 0007 37e4 pea 737e4 <_Region_Information> executing = _Thread_Executing; 4f754: 2679 0007 399a moveal 7399a <_Thread_Executing>,%a3 4f75a: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f760: 4fef 0010 lea %sp@(16),%sp 4f764: 2440 moveal %d0,%a2 4f766: 4aae fffc tstl %fp@(-4) 4f76a: 6600 0098 bnew 4f804 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 4f76e: b4aa 005c cmpl %a2@(92),%d2 4f772: 6306 blss 4f77a 4f774: 7408 moveq #8,%d2 4f776: 6000 008e braw 4f806 * @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 ); 4f77a: 42a7 clrl %sp@- 4f77c: 42a7 clrl %sp@- 4f77e: 2f02 movel %d2,%sp@- 4f780: 486a 0068 pea %a2@(104) 4f784: 4eb9 0005 2198 jsr 52198 <_Heap_Allocate_aligned_with_boundary> the_segment = _Region_Allocate_segment( the_region, size ); _Region_Debug_Walk( the_region, 2 ); if ( the_segment ) { 4f78a: 4fef 0010 lea %sp@(16),%sp 4f78e: 4a80 tstl %d0 4f790: 670a beqs 4f79c the_region->number_of_used_blocks += 1; 4f792: 52aa 0064 addql #1,%a2@(100) *segment = the_segment; 4f796: 4282 clrl %d2 4f798: 2880 movel %d0,%a4@ 4f79a: 606a bras 4f806 <== ALWAYS TAKEN return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 4f79c: 202e 0010 movel %fp@(16),%d0 4f7a0: 0800 0000 btst #0,%d0 4f7a4: 6704 beqs 4f7aa 4f7a6: 740d moveq #13,%d2 4f7a8: 605c bras 4f806 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4f7aa: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 4f7b0: 5280 addql #1,%d0 4f7b2: 23c0 0007 38e0 movel %d0,738e0 <_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(); 4f7b8: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f7be: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> executing->Wait.queue = &the_region->Wait_queue; 4f7c4: 200a movel %a2,%d0 4f7c6: 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; 4f7cc: 7201 moveq #1,%d1 executing->Wait.id = id; executing->Wait.count = size; 4f7ce: 2742 0024 movel %d2,%a3@(36) 4f7d2: 2541 0040 movel %d1,%a2@(64) * because this thread is going to block. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); executing->Wait.queue = &the_region->Wait_queue; 4f7d6: 2740 0044 movel %d0,%a3@(68) executing->Wait.id = id; 4f7da: 2743 0020 movel %d3,%a3@(32) executing->Wait.count = size; executing->Wait.return_argument = segment; 4f7de: 274c 0028 movel %a4,%a3@(40) _Thread_queue_Enter_critical_section( &the_region->Wait_queue ); _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); 4f7e2: 4879 0005 3ee8 pea 53ee8 <_Thread_queue_Timeout> 4f7e8: 2f2e 0014 movel %fp@(20),%sp@- 4f7ec: 2f00 movel %d0,%sp@- 4f7ee: 4eb9 0005 3bfc jsr 53bfc <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4f7f4: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return (rtems_status_code) executing->Wait.return_code; 4f7fa: 242b 0034 movel %a3@(52),%d2 4f7fe: 4fef 0010 lea %sp@(16),%sp 4f802: 6010 bras 4f814 <== ALWAYS TAKEN 4f804: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f806: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f80c: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f812: 588f addql #4,%sp } 4f814: 2002 movel %d2,%d0 4f816: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 4f81c: 4e5e unlk %fp 4f81e: 4e75 rts 0004f820 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 4f820: 4e56 fffc linkw %fp,#-4 4f824: 2f03 movel %d3,%sp@- 4f826: 262e 0010 movel %fp@(16),%d3 4f82a: 2f02 movel %d2,%sp@- 4f82c: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 4f830: 6766 beqs 4f898 return RTEMS_INVALID_ADDRESS; if ( !size ) 4f832: 4a83 tstl %d3 4f834: 6762 beqs 4f898 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f836: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f83c: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f842: 486e fffc pea %fp@(-4) 4f846: 2f2e 0008 movel %fp@(8),%sp@- 4f84a: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f850: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f856: 222e fffc movel %fp@(-4),%d1 4f85a: 4fef 0010 lea %sp@(16),%sp 4f85e: 670a beqs 4f86a 4f860: 7001 moveq #1,%d0 4f862: b081 cmpl %d1,%d0 4f864: 6620 bnes 4f886 <== ALWAYS TAKEN 4f866: 7404 moveq #4,%d2 4f868: 601e bras 4f888 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 4f86a: 2f03 movel %d3,%sp@- 4f86c: 2040 moveal %d0,%a0 4f86e: 2f02 movel %d2,%sp@- 4f870: 4868 0068 pea %a0@(104) 4f874: 4eb9 0005 2958 jsr 52958 <_Heap_Size_of_alloc_area> 4f87a: 4fef 000c lea %sp@(12),%sp 4f87e: 4a00 tstb %d0 4f880: 6604 bnes 4f886 <== NEVER TAKEN 4f882: 7409 moveq #9,%d2 <== NOT EXECUTED 4f884: 6002 bras 4f888 <== NOT EXECUTED 4f886: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f888: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f88e: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f894: 588f addql #4,%sp 4f896: 6002 bras 4f89a <== ALWAYS TAKEN 4f898: 7409 moveq #9,%d2 } 4f89a: 2002 movel %d2,%d0 4f89c: 242e fff4 movel %fp@(-12),%d2 4f8a0: 262e fff8 movel %fp@(-8),%d3 4f8a4: 4e5e unlk %fp 4f8a6: 4e75 rts 0004f8d4 : rtems_id id, void *segment, uintptr_t size, uintptr_t *old_size ) { 4f8d4: 4e56 ffe8 linkw %fp,#-24 4f8d8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4f8dc: 266e 0014 moveal %fp@(20),%a3 uintptr_t osize; rtems_status_code return_status; Heap_Resize_status status; register Region_Control *the_region; if ( !old_size ) 4f8e0: 4a8b tstl %a3 4f8e2: 6700 008e beqw 4f972 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f8e6: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f8ec: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f8f2: 486e fff8 pea %fp@(-8) 4f8f6: 2f2e 0008 movel %fp@(8),%sp@- 4f8fa: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f900: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f906: 4fef 0010 lea %sp@(16),%sp 4f90a: 2440 moveal %d0,%a2 4f90c: 4aae fff8 tstl %fp@(-8) 4f910: 664e bnes 4f960 case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 7 ); status = _Heap_Resize_block( 4f912: 486e fffc pea %fp@(-4) 4f916: 486e fff4 pea %fp@(-12) 4f91a: 2f2e 0010 movel %fp@(16),%sp@- 4f91e: 2f2e 000c movel %fp@(12),%sp@- 4f922: 486a 0068 pea %a2@(104) 4f926: 4eb9 0005 2880 jsr 52880 <_Heap_Resize_block> segment, (uint32_t) size, &osize, &avail_size ); *old_size = (uint32_t) osize; 4f92c: 26ae fff4 movel %fp@(-12),%a3@ case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 7 ); status = _Heap_Resize_block( 4f930: 2400 movel %d0,%d2 ); *old_size = (uint32_t) osize; _Region_Debug_Walk( the_region, 8 ); if ( status == HEAP_RESIZE_SUCCESSFUL ) 4f932: 4fef 0014 lea %sp@(20),%sp 4f936: 660e bnes 4f946 _Region_Process_queue( the_region ); /* unlocks allocator */ 4f938: 2f0a movel %a2,%sp@- 4f93a: 4eb9 0005 6368 jsr 56368 <_Region_Process_queue> 4f940: 588f addql #4,%sp 4f942: 4280 clrl %d0 4f944: 602e bras 4f974 <== ALWAYS TAKEN else _RTEMS_Unlock_allocator(); 4f946: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f94c: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> if (status == HEAP_RESIZE_SUCCESSFUL) return RTEMS_SUCCESSFUL; if (status == HEAP_RESIZE_UNSATISFIED) 4f952: 588f addql #4,%sp 4f954: 7001 moveq #1,%d0 4f956: b082 cmpl %d2,%d0 4f958: 6618 bnes 4f972 4f95a: 103c 000d moveb #13,%d0 4f95e: 6014 bras 4f974 <== ALWAYS TAKEN default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f960: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f966: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; 4f96c: 588f addql #4,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f96e: 7004 moveq #4,%d0 return return_status; 4f970: 6002 bras 4f974 <== ALWAYS TAKEN 4f972: 7009 moveq #9,%d0 } 4f974: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 4f97a: 4e5e unlk %fp 4f97c: 4e75 rts ... 0004f980 : rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ) { 4f980: 4e56 fffc linkw %fp,#-4 4f984: 2f0a movel %a2,%sp@- 4f986: 2f02 movel %d2,%sp@- uint32_t size; #endif int status; register Region_Control *the_region; _RTEMS_Lock_allocator(); 4f988: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f98e: 4eb9 0005 1790 jsr 51790 <_API_Mutex_Lock> 4f994: 486e fffc pea %fp@(-4) 4f998: 2f2e 0008 movel %fp@(8),%sp@- 4f99c: 4879 0007 37e4 pea 737e4 <_Region_Information> 4f9a2: 4eb9 0005 2ed8 jsr 52ed8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f9a8: 4fef 0010 lea %sp@(16),%sp 4f9ac: 2440 moveal %d0,%a2 4f9ae: 4aae fffc tstl %fp@(-4) 4f9b2: 6704 beqs 4f9b8 4f9b4: 7404 moveq #4,%d2 4f9b6: 6026 bras 4f9de <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _Region_Free_segment ( Region_Control *the_region, void *the_segment ) { return _Heap_Free( &the_region->Memory, the_segment ); 4f9b8: 2f2e 000c movel %fp@(12),%sp@- 4f9bc: 486a 0068 pea %a2@(104) 4f9c0: 4eb9 0005 2388 jsr 52388 <_Heap_Free> #endif status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) 4f9c6: 508f addql #8,%sp 4f9c8: 4a00 tstb %d0 4f9ca: 6710 beqs 4f9dc return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; 4f9cc: 53aa 0064 subql #1,%a2@(100) _Region_Process_queue(the_region); /* unlocks allocator */ 4f9d0: 4282 clrl %d2 4f9d2: 2f0a movel %a2,%sp@- 4f9d4: 4eb9 0005 6368 jsr 56368 <_Region_Process_queue> 4f9da: 600e bras 4f9ea <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; 4f9dc: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f9de: 2f39 0007 3992 movel 73992 <_RTEMS_Allocator_Mutex>,%sp@- 4f9e4: 4eb9 0005 17f0 jsr 517f0 <_API_Mutex_Unlock> return return_status; } 4f9ea: 2002 movel %d2,%d0 return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); return return_status; 4f9ec: 588f addql #4,%sp } 4f9ee: 242e fff4 movel %fp@(-12),%d2 4f9f2: 246e fff8 moveal %fp@(-8),%a2 4f9f6: 4e5e unlk %fp 4f9f8: 4e75 rts ... 00044cf8 : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 44cf8: 4e56 ffd0 linkw %fp,#-48 44cfc: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44d00: 2a2e 0008 movel %fp@(8),%d5 44d04: 262e 000c movel %fp@(12),%d3 44d08: 242e 0010 movel %fp@(16),%d2 44d0c: 266e 0018 moveal %fp@(24),%a3 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 ) ) 44d10: 4a85 tstl %d5 44d12: 6606 bnes 44d1a 44d14: 7003 moveq #3,%d0 44d16: 6000 0172 braw 44e8a <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 44d1a: 4a8b tstl %a3 44d1c: 6606 bnes 44d24 44d1e: 7009 moveq #9,%d0 44d20: 6000 0168 braw 44e8a <== ALWAYS TAKEN * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 44d24: 2002 movel %d2,%d0 44d26: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 44d2c: 671c beqs 44d4a _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 44d2e: 7230 moveq #48,%d1 44d30: 7810 moveq #16,%d4 44d32: c282 andl %d2,%d1 44d34: b881 cmpl %d1,%d4 44d36: 6600 0150 bnew 44e88 44d3a: 44c2 movew %d2,%ccr 44d3c: 6600 014a bnew 44e88 _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 44d40: 0c80 0000 00c0 cmpil #192,%d0 44d46: 6700 0140 beqw 44e88 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 44d4a: 7830 moveq #48,%d4 44d4c: c882 andl %d2,%d4 _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 44d4e: 670e beqs 44d5e 44d50: 7001 moveq #1,%d0 44d52: b083 cmpl %d3,%d0 44d54: 6408 bccs 44d5e 44d56: 103c 000a moveb #10,%d0 44d5a: 6000 012e braw 44e8a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44d5e: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 44d64: 5280 addql #1,%d0 44d66: 23c0 0005 ba34 movel %d0,5ba34 <_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 ); 44d6c: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44d72: 4eb9 0004 604c jsr 4604c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 44d78: 588f addql #4,%sp 44d7a: 2440 moveal %d0,%a2 44d7c: 4a80 tstl %d0 44d7e: 660c bnes 44d8c _Thread_Enable_dispatch(); 44d80: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> 44d86: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 44d88: 6000 0100 braw 44e8a <== ALWAYS TAKEN 44d8c: 7004 moveq #4,%d0 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 44d8e: 2542 0010 movel %d2,%a2@(16) 44d92: c082 andl %d2,%d0 /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 44d94: 4a84 tstl %d4 44d96: 6632 bnes 44dca * 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; 44d98: 4a80 tstl %d0 44d9a: 57c0 seq %d0 * 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( 44d9c: 2f03 movel %d3,%sp@- 44d9e: 486e fff8 pea %fp@(-8) * 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; 44da2: 49c0 extbl %d0 * 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( 44da4: 486a 0014 pea %a2@(20) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 44da8: 5280 addql #1,%d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 44daa: 72ff moveq #-1,%d1 if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 44dac: 2d40 fffc movel %d0,%fp@(-4) */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 44db0: 2d41 fff8 movel %d1,%fp@(-8) 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; 44db4: 42ae ffea clrl %fp@(-22) the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 44db8: 42ae fff4 clrl %fp@(-12) _CORE_semaphore_Initialize( 44dbc: 4eb9 0004 5b7c jsr 45b7c <_CORE_semaphore_Initialize> 44dc2: 4fef 000c lea %sp@(12),%sp 44dc6: 6000 009e braw 44e66 <== ALWAYS TAKEN /* * 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; 44dca: 4a80 tstl %d0 44dcc: 57c0 seq %d0 44dce: 49c0 extbl %d0 44dd0: 5280 addql #1,%d0 44dd2: 2d40 fff0 movel %d0,%fp@(-16) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 44dd6: 7010 moveq #16,%d0 44dd8: b084 cmpl %d4,%d0 44dda: 6640 bnes 44e1c the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 44ddc: 42ae ffea clrl %fp@(-22) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 44de0: 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; 44de2: 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; 44de4: 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; 44dea: 1d41 ffee moveb %d1,%fp@(-18) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 44dee: b8ae fff0 cmpl %fp@(-16),%d4 44df2: 6634 bnes 44e28 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 44df4: 0802 0006 btst #6,%d2 44df8: 6710 beqs 44e0a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 44dfa: 103c 0002 moveb #2,%d0 the_mutex_attr.only_owner_release = true; 44dfe: 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; 44e00: 2d40 fff0 movel %d0,%fp@(-16) the_mutex_attr.only_owner_release = true; 44e04: 1d41 ffee moveb %d1,%fp@(-18) 44e08: 601e bras 44e28 <== ALWAYS TAKEN } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 44e0a: 4a02 tstb %d2 44e0c: 6c1a bges 44e28 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 44e0e: 7803 moveq #3,%d4 the_mutex_attr.only_owner_release = true; 44e10: 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; 44e12: 2d44 fff0 movel %d4,%fp@(-16) the_mutex_attr.only_owner_release = true; 44e16: 1d40 ffee moveb %d0,%fp@(-18) 44e1a: 600c bras 44e28 <== ALWAYS TAKEN } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 44e1c: 7202 moveq #2,%d1 the_mutex_attr.only_owner_release = false; 44e1e: 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; 44e20: 2d41 ffea movel %d1,%fp@(-22) the_mutex_attr.only_owner_release = false; 44e24: 1d44 ffee moveb %d4,%fp@(-18) } mutex_status = _CORE_mutex_Initialize( 44e28: 7001 moveq #1,%d0 44e2a: b083 cmpl %d3,%d0 44e2c: 57c0 seq %d0 44e2e: 49c0 extbl %d0 44e30: 4480 negl %d0 44e32: 2f00 movel %d0,%sp@- 44e34: 486e ffea pea %fp@(-22) 44e38: 486a 0014 pea %a2@(20) 44e3c: 4eb9 0004 58c4 jsr 458c4 <_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 ) { 44e42: 4fef 000c lea %sp@(12),%sp 44e46: 7206 moveq #6,%d1 44e48: b280 cmpl %d0,%d1 44e4a: 661a bnes 44e66 */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 44e4c: 2f0a movel %a2,%sp@- 44e4e: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44e54: 4eb9 0004 6340 jsr 46340 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 44e5a: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 44e60: 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(); 44e62: 7013 moveq #19,%d0 return RTEMS_INVALID_PRIORITY; 44e64: 6024 bras 44e8a <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44e66: 202a 0008 movel %a2@(8),%d0 44e6a: 4281 clrl %d1 44e6c: 2079 0005 b988 moveal 5b988 <_Semaphore_Information+0x18>,%a0 44e72: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 44e74: 2545 000c movel %d5,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44e78: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 44e7c: 2680 movel %d0,%a3@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 44e7e: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> 44e84: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 44e86: 6002 bras 44e8a <== ALWAYS TAKEN 44e88: 700b moveq #11,%d0 } 44e8a: 4cee 0c3c ffd0 moveml %fp@(-48),%d2-%d5/%a2-%a3 44e90: 4e5e unlk %fp 44e92: 4e75 rts 00044e94 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 44e94: 4e56 fffc linkw %fp,#-4 44e98: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 44e9a: 486e fffc pea %fp@(-4) 44e9e: 2f2e 0008 movel %fp@(8),%sp@- 44ea2: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44ea8: 4eb9 0004 6498 jsr 46498 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 44eae: 4fef 000c lea %sp@(12),%sp 44eb2: 2440 moveal %d0,%a2 44eb4: 4aae fffc tstl %fp@(-4) 44eb8: 6704 beqs 44ebe 44eba: 7004 moveq #4,%d0 44ebc: 606a bras 44f28 <== ALWAYS TAKEN 44ebe: 7030 moveq #48,%d0 44ec0: c0aa 0010 andl %a2@(16),%d0 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 44ec4: 6728 beqs 44eee if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 44ec6: 4aaa 0062 tstl %a2@(98) 44eca: 6610 bnes 44edc 44ecc: 7220 moveq #32,%d1 44ece: b280 cmpl %d0,%d1 44ed0: 670a beqs 44edc !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 44ed2: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> 44ed8: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 44eda: 604c bras 44f28 <== ALWAYS TAKEN } _CORE_mutex_Flush( 44edc: 4878 0004 pea 4 44ee0: 42a7 clrl %sp@- 44ee2: 486a 0014 pea %a2@(20) 44ee6: 4eb9 0004 58b8 jsr 458b8 <_CORE_mutex_Flush> 44eec: 6010 bras 44efe <== ALWAYS TAKEN &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 44eee: 4878 0002 pea 2 44ef2: 42a7 clrl %sp@- 44ef4: 486a 0014 pea %a2@(20) 44ef8: 4eb9 0004 5b70 jsr 45b70 <_CORE_semaphore_Flush> SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 44efe: 508f addql #8,%sp 44f00: 2e8a movel %a2,%sp@ 44f02: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44f08: 4eb9 0004 60cc jsr 460cc <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 44f0e: 2f0a movel %a2,%sp@- 44f10: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44f16: 4eb9 0004 6340 jsr 46340 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 44f1c: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 44f22: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 44f26: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 44f28: 246e fff8 moveal %fp@(-8),%a2 44f2c: 4e5e unlk %fp 44f2e: 4e75 rts 0004dd28 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 4dd28: 4e56 fffc linkw %fp,#-4 4dd2c: 2f02 movel %d2,%sp@- 4dd2e: 486e fffc pea %fp@(-4) 4dd32: 2f2e 0008 movel %fp@(8),%sp@- 4dd36: 4879 0006 0d68 pea 60d68 <_Semaphore_Information> 4dd3c: 4eb9 0004 7d88 jsr 47d88 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 4dd42: 4fef 000c lea %sp@(12),%sp 4dd46: 4aae fffc tstl %fp@(-4) 4dd4a: 6704 beqs 4dd50 4dd4c: 7004 moveq #4,%d0 4dd4e: 603c bras 4dd8c <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 4dd50: 7430 moveq #48,%d2 4dd52: 2040 moveal %d0,%a0 4dd54: 2200 movel %d0,%d1 4dd56: 0681 0000 0014 addil #20,%d1 4dd5c: c4a8 0010 andl %a0@(16),%d2 4dd60: 6710 beqs 4dd72 _CORE_mutex_Flush( 4dd62: 4878 0001 pea 1 4dd66: 42a7 clrl %sp@- 4dd68: 2f01 movel %d1,%sp@- 4dd6a: 4eb9 0004 713c jsr 4713c <_CORE_mutex_Flush> 4dd70: 600e bras 4dd80 <== ALWAYS TAKEN &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 4dd72: 4878 0001 pea 1 4dd76: 42a7 clrl %sp@- 4dd78: 2f01 movel %d1,%sp@- 4dd7a: 4eb9 0004 73f4 jsr 473f4 <_CORE_semaphore_Flush> 4dd80: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 4dd84: 4eb9 0004 85ee jsr 485ee <_Thread_Enable_dispatch> 4dd8a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4dd8c: 242e fff8 movel %fp@(-8),%d2 4dd90: 4e5e unlk %fp 4dd92: 4e75 rts 00044f30 : rtems_status_code rtems_semaphore_obtain( rtems_id id, rtems_option option_set, rtems_interval timeout ) { 44f30: 4e56 ffec linkw %fp,#-20 44f34: 48d7 001c moveml %d2-%d4,%sp@ Objects_Id id, Objects_Locations *location, ISR_Level *level ) { return (Semaphore_Control *) 44f38: 486e fff8 pea %fp@(-8) 44f3c: 486e fffc pea %fp@(-4) 44f40: 242e 0008 movel %fp@(8),%d2 44f44: 2f02 movel %d2,%sp@- 44f46: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 44f4c: 282e 000c movel %fp@(12),%d4 44f50: 262e 0010 movel %fp@(16),%d3 44f54: 4eb9 0004 6440 jsr 46440 <_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 ) { 44f5a: 4fef 0010 lea %sp@(16),%sp 44f5e: 2040 moveal %d0,%a0 44f60: 4aae fffc tstl %fp@(-4) 44f64: 6706 beqs 44f6c 44f66: 7004 moveq #4,%d0 44f68: 6000 00c0 braw 4502a <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 44f6c: 7030 moveq #48,%d0 44f6e: c0a8 0010 andl %a0@(16),%d0 44f72: 6732 beqs 44fa6 _CORE_mutex_Seize( 44f74: 2f2e fff8 movel %fp@(-8),%sp@- 44f78: 7001 moveq #1,%d0 44f7a: c880 andl %d0,%d4 44f7c: 2f03 movel %d3,%sp@- 44f7e: b980 eorl %d4,%d0 44f80: 2f00 movel %d0,%sp@- 44f82: 2f02 movel %d2,%sp@- 44f84: 4868 0014 pea %a0@(20) 44f88: 4eb9 0004 59d0 jsr 459d0 <_CORE_mutex_Seize> id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 44f8e: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 44f94: 2f28 0034 movel %a0@(52),%sp@- 44f98: 4eb9 0004 50b8 jsr 450b8 <_Semaphore_Translate_core_mutex_return_code> 44f9e: 4fef 0018 lea %sp@(24),%sp 44fa2: 6000 0086 braw 4502a <== ALWAYS TAKEN { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 44fa6: 2279 0005 baee moveal 5baee <_Thread_Executing>,%a1 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 44fac: 42a9 0034 clrl %a1@(52) if ( the_semaphore->count != 0 ) { 44fb0: 2028 005c movel %a0@(92),%d0 44fb4: 670e beqs 44fc4 the_semaphore->count -= 1; 44fb6: 5380 subql #1,%d0 44fb8: 2140 005c movel %d0,%a0@(92) _ISR_Enable( *level_p ); 44fbc: 202e fff8 movel %fp@(-8),%d0 44fc0: 46c0 movew %d0,%sr 44fc2: 6054 bras 45018 <== ALWAYS TAKEN return; } if ( !wait ) { 44fc4: 0804 0000 btst #0,%d4 44fc8: 670e beqs 44fd8 _ISR_Enable( *level_p ); 44fca: 202e fff8 movel %fp@(-8),%d0 44fce: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 44fd0: 7001 moveq #1,%d0 44fd2: 2340 0034 movel %d0,%a1@(52) 44fd6: 6040 bras 45018 <== ALWAYS TAKEN 44fd8: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 44fde: 5280 addql #1,%d0 44fe0: 23c0 0005 ba34 movel %d0,5ba34 <_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; 44fe6: 7001 moveq #1,%d0 44fe8: 2140 0044 movel %d0,%a0@(68) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 44fec: 41e8 0014 lea %a0@(20),%a0 executing->Wait.id = id; 44ff0: 2342 0020 movel %d2,%a1@(32) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 44ff4: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; _ISR_Enable( *level_p ); 44ff8: 202e fff8 movel %fp@(-8),%d0 44ffc: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 44ffe: 4879 0004 73bc pea 473bc <_Thread_queue_Timeout> 45004: 2f03 movel %d3,%sp@- 45006: 2f08 movel %a0,%sp@- 45008: 4eb9 0004 70d0 jsr 470d0 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4500e: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> 45014: 4fef 000c lea %sp@(12),%sp id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45018: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 4501e: 2f28 0034 movel %a0@(52),%sp@- 45022: 4eb9 0004 50ce jsr 450ce <_Semaphore_Translate_core_semaphore_return_code> 45028: 588f addql #4,%sp break; } return RTEMS_INVALID_ID; } 4502a: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45030: 4e5e unlk %fp 45032: 4e75 rts 00045034 : #endif rtems_status_code rtems_semaphore_release( rtems_id id ) { 45034: 4e56 fff0 linkw %fp,#-16 45038: 48d7 040c moveml %d2-%d3/%a2,%sp@ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 4503c: 486e fffc pea %fp@(-4) 45040: 242e 0008 movel %fp@(8),%d2 45044: 2f02 movel %d2,%sp@- 45046: 4879 0005 b970 pea 5b970 <_Semaphore_Information> 4504c: 4eb9 0004 6498 jsr 46498 <_Objects_Get> Objects_Locations location; CORE_mutex_Status mutex_status; CORE_semaphore_Status semaphore_status; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45052: 4fef 000c lea %sp@(12),%sp 45056: 4aae fffc tstl %fp@(-4) 4505a: 6704 beqs 45060 4505c: 7004 moveq #4,%d0 4505e: 604e bras 450ae <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45060: 7630 moveq #48,%d3 45062: 2040 moveal %d0,%a0 45064: 2200 movel %d0,%d1 45066: 0681 0000 0014 addil #20,%d1 4506c: 45f9 0004 6c6e lea 46c6e <_Thread_Enable_dispatch>,%a2 45072: c6a8 0010 andl %a0@(16),%d3 45076: 671a beqs 45092 mutex_status = _CORE_mutex_Surrender( 45078: 42a7 clrl %sp@- 4507a: 2f02 movel %d2,%sp@- 4507c: 2f01 movel %d1,%sp@- 4507e: 4eb9 0004 5a78 jsr 45a78 <_CORE_mutex_Surrender> 45084: 2400 movel %d0,%d2 &the_semaphore->Core_control.mutex, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); 45086: 4e92 jsr %a2@ return _Semaphore_Translate_core_mutex_return_code( mutex_status ); 45088: 2f02 movel %d2,%sp@- 4508a: 4eb9 0004 50b8 jsr 450b8 <_Semaphore_Translate_core_mutex_return_code> 45090: 6018 bras 450aa <== ALWAYS TAKEN } else { semaphore_status = _CORE_semaphore_Surrender( 45092: 42a7 clrl %sp@- 45094: 2f02 movel %d2,%sp@- 45096: 2f01 movel %d1,%sp@- 45098: 4eb9 0004 5bc4 jsr 45bc4 <_CORE_semaphore_Surrender> 4509e: 2400 movel %d0,%d2 &the_semaphore->Core_control.semaphore, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); 450a0: 4e92 jsr %a2@ return _Semaphore_Translate_core_semaphore_return_code( semaphore_status ); 450a2: 2f02 movel %d2,%sp@- 450a4: 4eb9 0004 50ce jsr 450ce <_Semaphore_Translate_core_semaphore_return_code> &the_semaphore->Core_control.semaphore, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); return 450aa: 4fef 0010 lea %sp@(16),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 450ae: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 450b4: 4e5e unlk %fp 450b6: 4e75 rts 00045558 : void rtems_shutdown_executive( uint32_t result ) { if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 45558: 7004 moveq #4,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 4555a: 4e56 0000 linkw %fp,#0 if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 4555e: b0b9 0005 bbb6 cmpl 5bbb6 <_System_state_Current>,%d0 45564: 6726 beqs 4558c * 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 ); 45566: 2039 0005 ba30 movel 5ba30 <_Thread_BSP_context+0x30>,%d0 4556c: 2239 0005 ba00 movel 5ba00 <_Thread_BSP_context>,%d1 45572: 46c1 movew %d1,%sr 45574: 2e40 moveal %d0,%sp 45576: 4e75 rts 45578: 23c0 0005 ba30 movel %d0,5ba30 <_Thread_BSP_context+0x30> <== NOT EXECUTED 4557e: 7004 moveq #4,%d0 <== NOT EXECUTED 45580: 23c1 0005 ba00 movel %d1,5ba00 <_Thread_BSP_context> <== NOT EXECUTED 45586: 23c0 0005 bbb6 movel %d0,5bbb6 <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_SHUTDOWN ); _Thread_Stop_multitasking(); } } 4558c: 4e5e unlk %fp 4558e: 4e75 rts 00045d94 : rtems_status_code rtems_signal_catch( rtems_asr_entry asr_handler, rtems_mode mode_set ) { 45d94: 4e56 0000 linkw %fp,#0 45d98: 2239 0005 cd4c movel 5cd4c <_Thread_Dispatch_disable_level>,%d1 45d9e: 5281 addql #1,%d1 RTEMS_API_Control *api; ASR_Information *asr; /* XXX normalize mode */ executing = _Thread_Executing; api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ]; 45da0: 2079 0005 ce06 moveal 5ce06 <_Thread_Executing>,%a0 rtems_status_code rtems_signal_catch( rtems_asr_entry asr_handler, rtems_mode mode_set ) { 45da6: 202e 0008 movel %fp@(8),%d0 RTEMS_API_Control *api; ASR_Information *asr; /* XXX normalize mode */ executing = _Thread_Executing; api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ]; 45daa: 2068 0108 moveal %a0@(264),%a0 45dae: 23c1 0005 cd4c movel %d1,5cd4c <_Thread_Dispatch_disable_level> asr = &api->Signal; _Thread_Disable_dispatch(); /* cannot reschedule while */ /* the thread is inconsistent */ if ( !_ASR_Is_null_handler( asr_handler ) ) { 45db4: 4a80 tstl %d0 45db6: 670c beqs 45dc4 asr->mode_set = mode_set; asr->handler = asr_handler; 45db8: 2140 000a movel %d0,%a0@(10) _Thread_Disable_dispatch(); /* cannot reschedule while */ /* the thread is inconsistent */ if ( !_ASR_Is_null_handler( asr_handler ) ) { asr->mode_set = mode_set; 45dbc: 216e 000c 000e movel %fp@(12),%a0@(14) 45dc2: 601a bras 45dde <== ALWAYS TAKEN information->is_enabled = false; information->handler = NULL; information->mode_set = RTEMS_DEFAULT_MODES; information->signals_posted = 0; information->signals_pending = 0; information->nest_level = 0; 45dc4: 42a8 001a clrl %a0@(26) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 45dc8: 4200 clrb %d0 information->handler = NULL; 45dca: 42a8 000a clrl %a0@(10) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 45dce: 1140 0008 moveb %d0,%a0@(8) information->handler = NULL; information->mode_set = RTEMS_DEFAULT_MODES; 45dd2: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 45dd6: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 45dda: 42a8 0016 clrl %a0@(22) asr->handler = asr_handler; } else _ASR_Initialize( asr ); _Thread_Enable_dispatch(); 45dde: 4eb9 0004 7bbe jsr 47bbe <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 45de4: 4280 clrl %d0 45de6: 4e5e unlk %fp 45de8: 4e75 rts ... 0004feb8 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 4feb8: 4e56 fffc linkw %fp,#-4 4febc: 2f03 movel %d3,%sp@- 4febe: 2f02 movel %d2,%sp@- 4fec0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 4fec4: 6606 bnes 4fecc 4fec6: 700a moveq #10,%d0 4fec8: 6000 0084 braw 4ff4e <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 4fecc: 486e fffc pea %fp@(-4) 4fed0: 2f2e 0008 movel %fp@(8),%sp@- 4fed4: 4eb9 0005 37c0 jsr 537c0 <_Thread_Get> switch ( location ) { 4feda: 508f addql #8,%sp 4fedc: 4aae fffc tstl %fp@(-4) 4fee0: 6704 beqs 4fee6 4fee2: 7004 moveq #4,%d0 4fee4: 6068 bras 4ff4e <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 4fee6: 2240 moveal %d0,%a1 4fee8: 2069 0108 moveal %a1@(264),%a0 asr = &api->Signal; 4feec: 4aa8 000a tstl %a0@(10) 4fef0: 6754 beqs 4ff46 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 4fef2: 4a28 0008 tstb %a0@(8) 4fef6: 6732 beqs 4ff2a rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 4fef8: 223c 0000 0700 movel #1792,%d1 4fefe: 40c3 movew %sr,%d3 4ff00: 8283 orl %d3,%d1 4ff02: 46c1 movew %d1,%sr *signal_set |= signals; 4ff04: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 4ff08: 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 ) ) 4ff0a: 2239 0007 397a movel 7397a <_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; 4ff10: 7401 moveq #1,%d2 4ff12: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ff16: 4a81 tstl %d1 4ff18: 6722 beqs 4ff3c 4ff1a: b0b9 0007 399a cmpl 7399a <_Thread_Executing>,%d0 4ff20: 661a bnes 4ff3c <== ALWAYS TAKEN _ISR_Signals_to_thread_executing = true; 4ff22: 13c2 0007 3a24 moveb %d2,73a24 <_ISR_Signals_to_thread_executing> 4ff28: 6012 bras 4ff3c <== ALWAYS TAKEN rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 4ff2a: 203c 0000 0700 movel #1792,%d0 4ff30: 40c1 movew %sr,%d1 4ff32: 8081 orl %d1,%d0 4ff34: 46c0 movew %d0,%sr *signal_set |= signals; 4ff36: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 4ff3a: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 4ff3c: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4ff42: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4ff44: 6008 bras 4ff4e <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4ff46: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 4ff4c: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ff4e: 242e fff4 movel %fp@(-12),%d2 4ff52: 262e fff8 movel %fp@(-8),%d3 4ff56: 4e5e unlk %fp 4ff58: 4e75 rts ... 000450e4 : size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id ) { 450e4: 4e56 ffe4 linkw %fp,#-28 450e8: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 450ec: 266e 0008 moveal %fp@(8),%a3 450f0: 262e 000c movel %fp@(12),%d3 450f4: 242e 0014 movel %fp@(20),%d2 450f8: 282e 0018 movel %fp@(24),%d4 450fc: 286e 001c moveal %fp@(28),%a4 Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 45100: 4a8c tstl %a4 45102: 6606 bnes 4510a 45104: 7009 moveq #9,%d0 45106: 6000 00f6 braw 451fe return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 4510a: 4a8b tstl %a3 4510c: 6606 bnes 45114 4510e: 7003 moveq #3,%d0 45110: 6000 00ec braw 451fe /* * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { 45114: 4a44 tstw %d4 45116: 6d1e blts 45136 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 45118: 4a83 tstl %d3 4511a: 6714 beqs 45130 4511c: 4280 clrl %d0 4511e: 1039 0005 a302 moveb 5a302 ,%d0 45124: b083 cmpl %d3,%d0 45126: 54c0 scc %d0 45128: 49c0 extbl %d0 4512a: 4480 negl %d0 if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) ) 4512c: 4a00 tstb %d0 4512e: 6606 bnes 45136 45130: 7013 moveq #19,%d0 45132: 6000 00ca braw 451fe */ /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 45136: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 4513c: 4eb9 0004 57ec jsr 457ec <_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 ); 45142: 4879 0005 b9a8 pea 5b9a8 <_RTEMS_tasks_Information> 45148: 4eb9 0004 604c jsr 4604c <_Objects_Allocate> * the event of an error. */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { 4514e: 508f addql #8,%sp 45150: 2440 moveal %d0,%a2 45152: 4a80 tstl %d0 45154: 6614 bnes 4516a _RTEMS_Unlock_allocator(); 45156: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 4515c: 4eb9 0004 584c jsr 4584c <_API_Mutex_Unlock> return RTEMS_TOO_MANY; 45162: 588f addql #4,%sp */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 45164: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 45166: 6000 0096 braw 451fe <== ALWAYS TAKEN /* * Initialize the core thread for this task. */ status = _Thread_Initialize( 4516a: 7a07 moveq #7,%d5 4516c: 7009 moveq #9,%d0 4516e: 2202 movel %d2,%d1 45170: e0a9 lsrl %d0,%d1 45172: 2002 movel %d2,%d0 45174: e088 lsrl #8,%d0 45176: 2f0b movel %a3,%sp@- 45178: 47f9 0004 584c lea 4584c <_API_Mutex_Unlock>,%a3 4517e: ca82 andl %d2,%d5 45180: 2f05 movel %d5,%sp@- 45182: 7a01 moveq #1,%d5 45184: 42a7 clrl %sp@- 45186: ca81 andl %d1,%d5 45188: 7201 moveq #1,%d1 4518a: 2f05 movel %d5,%sp@- 4518c: 7a01 moveq #1,%d5 4518e: b380 eorl %d1,%d0 45190: ca80 andl %d0,%d5 45192: 7001 moveq #1,%d0 45194: 2f05 movel %d5,%sp@- 45196: c084 andl %d4,%d0 45198: 2f03 movel %d3,%sp@- 4519a: 2f00 movel %d0,%sp@- 4519c: 2f2e 0010 movel %fp@(16),%sp@- 451a0: 42a7 clrl %sp@- 451a2: 2f0a movel %a2,%sp@- 451a4: 4879 0005 b9a8 pea 5b9a8 <_RTEMS_tasks_Information> 451aa: 4eb9 0004 6d20 jsr 46d20 <_Thread_Initialize> NULL, /* no budget algorithm callout */ _Modes_Get_interrupt_level(initial_modes), (Objects_Name) name ); if ( !status ) { 451b0: 4fef 002c lea %sp@(44),%sp 451b4: 4a00 tstb %d0 451b6: 6624 bnes 451dc */ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( Thread_Control *the_task ) { _Objects_Free( 451b8: 2f2a 0008 movel %a2@(8),%sp@- 451bc: 4eb9 0004 63c4 jsr 463c4 <_Objects_Get_information_id> 451c2: 2f0a movel %a2,%sp@- 451c4: 2f00 movel %d0,%sp@- 451c6: 4eb9 0004 6340 jsr 46340 <_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(); 451cc: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 451d2: 4e93 jsr %a3@ return RTEMS_UNSATISFIED; 451d4: 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(); 451d8: 700d moveq #13,%d0 return RTEMS_UNSATISFIED; 451da: 6022 bras 451fe <== ALWAYS TAKEN } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 451dc: 720a moveq #10,%d1 451de: e2aa lsrl %d1,%d2 451e0: 7a01 moveq #1,%d5 451e2: bb82 eorl %d5,%d2 451e4: 206a 0108 moveal %a2@(264),%a0 451e8: c485 andl %d5,%d2 *id = the_thread->Object.id; 451ea: 28aa 0008 movel %a2@(8),%a4@ } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 451ee: 1142 0008 moveb %d2,%a0@(8) ); } #endif _RTEMS_Unlock_allocator(); 451f2: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 451f8: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 451fa: 588f addql #4,%sp ); } #endif _RTEMS_Unlock_allocator(); 451fc: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 451fe: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 45204: 4e5e unlk %fp 45206: 4e75 rts 00045208 : */ rtems_status_code rtems_task_delete( rtems_id id ) { 45208: 4e56 fff0 linkw %fp,#-16 4520c: 48d7 1c00 moveml %a2-%a4,%sp@ register Thread_Control *the_thread; Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); 45210: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 45216: 47f9 0004 584c lea 4584c <_API_Mutex_Unlock>,%a3 4521c: 4eb9 0004 57ec jsr 457ec <_API_Mutex_Lock> the_thread = _Thread_Get( id, &location ); 45222: 486e fffc pea %fp@(-4) 45226: 2f2e 0008 movel %fp@(8),%sp@- 4522a: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 45230: 4fef 000c lea %sp@(12),%sp Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); the_thread = _Thread_Get( id, &location ); 45234: 2440 moveal %d0,%a2 switch ( location ) { 45236: 4aae fffc tstl %fp@(-4) 4523a: 663c bnes 45278 case OBJECTS_LOCAL: the_information = _Objects_Get_information_id( the_thread->Object.id ); 4523c: 2f2a 0008 movel %a2@(8),%sp@- 45240: 49f9 0004 63c4 lea 463c4 <_Objects_Get_information_id>,%a4 45246: 4e94 jsr %a4@ 0 /* Not used */ ); } #endif _Thread_Close( the_information, the_thread ); 45248: 2f0a movel %a2,%sp@- 4524a: 2f00 movel %d0,%sp@- 4524c: 4eb9 0004 6960 jsr 46960 <_Thread_Close> 45252: 2f2a 0008 movel %a2@(8),%sp@- 45256: 4e94 jsr %a4@ 45258: 2f0a movel %a2,%sp@- 4525a: 2f00 movel %d0,%sp@- 4525c: 4eb9 0004 6340 jsr 46340 <_Objects_Free> _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 45262: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 45268: 4e93 jsr %a3@ _Thread_Enable_dispatch(); 4526a: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45270: 4fef 001c lea %sp@(28),%sp _Thread_Close( the_information, the_thread ); _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); _Thread_Enable_dispatch(); 45274: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 45276: 600c bras 45284 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); 45278: 2f39 0005 bae6 movel 5bae6 <_RTEMS_Allocator_Mutex>,%sp@- 4527e: 4e93 jsr %a3@ return RTEMS_INVALID_ID; 45280: 588f addql #4,%sp case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); 45282: 7004 moveq #4,%d0 return RTEMS_INVALID_ID; } 45284: 4cee 1c00 fff0 moveml %fp@(-16),%a2-%a4 4528a: 4e5e unlk %fp 4528c: 4e75 rts ... 00046890 : rtems_status_code rtems_task_get_note( rtems_id id, uint32_t notepad, uint32_t *note ) { 46890: 4e56 fffc linkw %fp,#-4 46894: 202e 0008 movel %fp@(8),%d0 46898: 2f0a movel %a2,%sp@- 4689a: 246e 0010 moveal %fp@(16),%a2 4689e: 2f02 movel %d2,%sp@- 468a0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 468a4: 4a39 0005 c874 tstb 5c874 468aa: 6604 bnes 468b0 468ac: 7016 moveq #22,%d0 468ae: 605e bras 4690e <== ALWAYS TAKEN return RTEMS_NOT_CONFIGURED; if ( !note ) 468b0: 4a8a tstl %a2 468b2: 6604 bnes 468b8 468b4: 7009 moveq #9,%d0 468b6: 6056 bras 4690e <== ALWAYS TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 468b8: 720f moveq #15,%d1 468ba: b282 cmpl %d2,%d1 468bc: 6404 bccs 468c2 468be: 700a moveq #10,%d0 468c0: 604c bras 4690e <== ALWAYS TAKEN /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 468c2: 4a80 tstl %d0 468c4: 670c beqs 468d2 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 468c6: 2079 0005 e2fe moveal 5e2fe <_Thread_Executing>,%a0 468cc: b0a8 0008 cmpl %a0@(8),%d0 468d0: 6612 bnes 468e4 api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 468d2: 2079 0005 e2fe moveal 5e2fe <_Thread_Executing>,%a0 468d8: 4280 clrl %d0 468da: 2068 0108 moveal %a0@(264),%a0 468de: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ return RTEMS_SUCCESSFUL; 468e2: 602a bras 4690e <== ALWAYS TAKEN } the_thread = _Thread_Get( id, &location ); 468e4: 486e fffc pea %fp@(-4) 468e8: 2f00 movel %d0,%sp@- 468ea: 4eb9 0004 855c jsr 4855c <_Thread_Get> switch ( location ) { 468f0: 508f addql #8,%sp 468f2: 4aae fffc tstl %fp@(-4) 468f6: 6704 beqs 468fc 468f8: 7004 moveq #4,%d0 468fa: 6012 bras 4690e <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 468fc: 2240 moveal %d0,%a1 468fe: 2069 0108 moveal %a1@(264),%a0 46902: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ _Thread_Enable_dispatch(); 46906: 4eb9 0004 8536 jsr 48536 <_Thread_Enable_dispatch> 4690c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4690e: 242e fff4 movel %fp@(-12),%d2 46912: 246e fff8 moveal %fp@(-8),%a2 46916: 4e5e unlk %fp 46918: 4e75 rts ... 00045290 : rtems_status_code rtems_task_ident( rtems_name name, uint32_t node, rtems_id *id ) { 45290: 4e56 0000 linkw %fp,#0 45294: 202e 0008 movel %fp@(8),%d0 45298: 206e 0010 moveal %fp@(16),%a0 Objects_Name_or_id_lookup_errors status; if ( !id ) 4529c: 4a88 tstl %a0 4529e: 6604 bnes 452a4 452a0: 7009 moveq #9,%d0 452a2: 6032 bras 452d6 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( name == OBJECTS_ID_OF_SELF ) { 452a4: 4a80 tstl %d0 452a6: 660c bnes 452b4 *id = _Thread_Executing->Object.id; 452a8: 2279 0005 baee moveal 5baee <_Thread_Executing>,%a1 452ae: 20a9 0008 movel %a1@(8),%a0@ return RTEMS_SUCCESSFUL; 452b2: 6022 bras 452d6 <== ALWAYS TAKEN } status = _Objects_Name_to_id_u32( &_RTEMS_tasks_Information, name, node, id ); 452b4: 2f08 movel %a0,%sp@- 452b6: 2f2e 000c movel %fp@(12),%sp@- 452ba: 2f00 movel %d0,%sp@- 452bc: 4879 0005 b9a8 pea 5b9a8 <_RTEMS_tasks_Information> 452c2: 4eb9 0004 65fc jsr 465fc <_Objects_Name_to_id_u32> return _Status_Object_name_errors_to_status[ status ]; 452c8: 4fef 0010 lea %sp@(16),%sp 452cc: 41f9 0005 93ec lea 593ec <_Status_Object_name_errors_to_status>,%a0 452d2: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 } 452d6: 4e5e unlk %fp 452d8: 4e75 rts ... 00050264 : */ rtems_status_code rtems_task_is_suspended( rtems_id id ) { 50264: 4e56 fffc linkw %fp,#-4 register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 50268: 486e fffc pea %fp@(-4) 5026c: 2f2e 0008 movel %fp@(8),%sp@- 50270: 4eb9 0005 37c0 jsr 537c0 <_Thread_Get> switch ( location ) { 50276: 508f addql #8,%sp 50278: 4aae fffc tstl %fp@(-4) 5027c: 6704 beqs 50282 5027e: 7004 moveq #4,%d0 50280: 601a bras 5029c <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { 50282: 7202 moveq #2,%d1 50284: 2240 moveal %d0,%a1 50286: 41f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a0 5028c: c2a9 0010 andl %a1@(16),%d1 50290: 6606 bnes 50298 _Thread_Enable_dispatch(); 50292: 4e90 jsr %a0@ 50294: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 50296: 6004 bras 5029c <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 50298: 4e90 jsr %a0@ 5029a: 700f moveq #15,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5029c: 4e5e unlk %fp 5029e: 4e75 rts 0004b0a4 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4b0a4: 4e56 ffe4 linkw %fp,#-28 4b0a8: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4b0ac: 262e 0008 movel %fp@(8),%d3 4b0b0: 282e 000c movel %fp@(12),%d4 4b0b4: 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 ) 4b0b8: 4a8c tstl %a4 4b0ba: 6606 bnes 4b0c2 4b0bc: 7009 moveq #9,%d0 4b0be: 6000 00fc braw 4b1bc <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4b0c2: 2479 0005 baee moveal 5baee <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b0c8: 4a2a 0075 tstb %a2@(117) 4b0cc: 57c0 seq %d0 4b0ce: 243c 0000 0100 movel #256,%d2 4b0d4: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4b0d6: 266a 0108 moveal %a2@(264),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b0da: c480 andl %d0,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4b0dc: 4aaa 007a tstl %a2@(122) 4b0e0: 6704 beqs 4b0e6 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4b0e2: 08c2 0009 bset #9,%d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b0e6: 4a2b 0008 tstb %a3@(8) 4b0ea: 57c0 seq %d0 4b0ec: 2a3c 0000 0400 movel #1024,%d5 4b0f2: 49c0 extbl %d0 4b0f4: ca80 andl %d0,%d5 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(); 4b0f6: 4eb9 0004 7f1c jsr 47f1c <_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; 4b0fc: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4b0fe: 8082 orl %d2,%d0 4b100: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4b102: 0804 0008 btst #8,%d4 4b106: 670e beqs 4b116 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4b108: 2003 movel %d3,%d0 4b10a: 7201 moveq #1,%d1 4b10c: e088 lsrl #8,%d0 4b10e: b380 eorl %d1,%d0 4b110: c081 andl %d1,%d0 4b112: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4b116: 0804 0009 btst #9,%d4 4b11a: 671c beqs 4b138 if ( _Modes_Is_timeslice(mode_set) ) { 4b11c: 0803 0009 btst #9,%d3 4b120: 6712 beqs 4b134 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b122: 41f9 0005 b9e4 lea 5b9e4 <_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; 4b128: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b12a: 2550 0076 movel %a0@,%a2@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4b12e: 2540 007a movel %d0,%a2@(122) 4b132: 6004 bras 4b138 <== ALWAYS TAKEN executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4b134: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4b138: 7007 moveq #7,%d0 4b13a: c084 andl %d4,%d0 4b13c: 6712 beqs 4b150 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4b13e: 40c0 movew %sr,%d0 4b140: 7207 moveq #7,%d1 4b142: c283 andl %d3,%d1 4b144: 0280 0000 f8ff andil #63743,%d0 4b14a: e189 lsll #8,%d1 4b14c: 8081 orl %d1,%d0 4b14e: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4b150: 0804 000a btst #10,%d4 4b154: 6744 beqs 4b19a * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4b156: 700a moveq #10,%d0 4b158: e0ab lsrl %d0,%d3 4b15a: 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; 4b15c: 4280 clrl %d0 4b15e: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4b162: b383 eorl %d1,%d3 4b164: c681 andl %d1,%d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b166: b083 cmpl %d3,%d0 4b168: 6730 beqs 4b19a ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4b16a: 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; 4b170: 1743 0008 moveb %d3,%a3@(8) 4b174: 40c1 movew %sr,%d1 4b176: 8081 orl %d1,%d0 4b178: 46c0 movew %d0,%sr _signals = information->signals_pending; 4b17a: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4b17e: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4b184: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4b188: 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; 4b18a: 4aab 0012 tstl %a3@(18) 4b18e: 670a beqs 4b19a 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; 4b190: 7001 moveq #1,%d0 4b192: 7401 moveq #1,%d2 4b194: 1540 0074 moveb %d0,%a2@(116) 4b198: 6002 bras 4b19c <== ALWAYS TAKEN 4b19a: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4b19c: 7203 moveq #3,%d1 4b19e: b2b9 0005 bbb6 cmpl 5bbb6 <_System_state_Current>,%d1 4b1a4: 6614 bnes 4b1ba <== ALWAYS TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4b1a6: 4eb9 0004 b484 jsr 4b484 <_Thread_Evaluate_mode> 4b1ac: 4a00 tstb %d0 4b1ae: 6604 bnes 4b1b4 4b1b0: 4a02 tstb %d2 4b1b2: 6706 beqs 4b1ba _Thread_Dispatch(); 4b1b4: 4eb9 0004 6b1c jsr 46b1c <_Thread_Dispatch> 4b1ba: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4b1bc: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4b1c2: 4e5e unlk %fp 4b1c4: 4e75 rts ... 00045a10 : rtems_status_code rtems_task_restart( rtems_id id, uint32_t argument ) { 45a10: 4e56 fffc linkw %fp,#-4 register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 45a14: 486e fffc pea %fp@(-4) 45a18: 2f2e 0008 movel %fp@(8),%sp@- 45a1c: 4eb9 0004 73a0 jsr 473a0 <_Thread_Get> switch ( location ) { 45a22: 508f addql #8,%sp 45a24: 4aae fffc tstl %fp@(-4) 45a28: 6704 beqs 45a2e 45a2a: 7004 moveq #4,%d0 45a2c: 6026 bras 45a54 case OBJECTS_LOCAL: if ( _Thread_Restart( the_thread, NULL, argument ) ) { 45a2e: 2f2e 000c movel %fp@(12),%sp@- 45a32: 42a7 clrl %sp@- 45a34: 2f00 movel %d0,%sp@- 45a36: 4eb9 0004 7b00 jsr 47b00 <_Thread_Restart> 45a3c: 4fef 000c lea %sp@(12),%sp 45a40: 41f9 0004 737a lea 4737a <_Thread_Enable_dispatch>,%a0 45a46: 4a00 tstb %d0 45a48: 6706 beqs 45a50 <== ALWAYS TAKEN _Thread_Enable_dispatch(); 45a4a: 4e90 jsr %a0@ 45a4c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 45a4e: 6004 bras 45a54 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 45a50: 4e90 jsr %a0@ 45a52: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45a54: 4e5e unlk %fp 45a56: 4e75 rts 00048888 : */ rtems_status_code rtems_task_resume( rtems_id id ) { 48888: 4e56 fffc linkw %fp,#-4 4888c: 2f0a movel %a2,%sp@- register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4888e: 486e fffc pea %fp@(-4) 48892: 2f2e 0008 movel %fp@(8),%sp@- 48896: 4eb9 0004 a3d8 jsr 4a3d8 <_Thread_Get> switch ( location ) { 4889c: 508f addql #8,%sp 4889e: 4aae fffc tstl %fp@(-4) 488a2: 6704 beqs 488a8 488a4: 7004 moveq #4,%d0 488a6: 6028 bras 488d0 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { 488a8: 7202 moveq #2,%d1 488aa: 2040 moveal %d0,%a0 488ac: 45f9 0004 a382 lea 4a382 <_Thread_Enable_dispatch>,%a2 488b2: c2a8 0010 andl %a0@(16),%d1 488b6: 6714 beqs 488cc _Thread_Resume( the_thread, true ); 488b8: 4878 0001 pea 1 488bc: 2f00 movel %d0,%sp@- 488be: 4eb9 0004 ab38 jsr 4ab38 <_Thread_Resume> _Thread_Enable_dispatch(); 488c4: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 488c6: 508f addql #8,%sp switch ( location ) { case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { _Thread_Resume( the_thread, true ); _Thread_Enable_dispatch(); 488c8: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 488ca: 6004 bras 488d0 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 488cc: 4e92 jsr %a2@ 488ce: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 488d0: 246e fff8 moveal %fp@(-8),%a2 488d4: 4e5e unlk %fp 488d6: 4e75 rts 000469fc : rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 469fc: 4e56 fffc linkw %fp,#-4 46a00: 202e 0008 movel %fp@(8),%d0 46a04: 2f03 movel %d3,%sp@- 46a06: 262e 0010 movel %fp@(16),%d3 46a0a: 2f02 movel %d2,%sp@- 46a0c: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 46a10: 4a39 0005 c874 tstb 5c874 46a16: 6604 bnes 46a1c 46a18: 7016 moveq #22,%d0 46a1a: 6056 bras 46a72 <== ALWAYS TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 46a1c: 720f moveq #15,%d1 46a1e: b282 cmpl %d2,%d1 46a20: 6404 bccs 46a26 46a22: 700a moveq #10,%d0 46a24: 604c bras 46a72 <== ALWAYS TAKEN /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 46a26: 4a80 tstl %d0 46a28: 670c beqs 46a36 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 46a2a: 2079 0005 e2fe moveal 5e2fe <_Thread_Executing>,%a0 46a30: b0a8 0008 cmpl %a0@(8),%d0 46a34: 6612 bnes 46a48 api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 46a36: 2079 0005 e2fe moveal 5e2fe <_Thread_Executing>,%a0 46a3c: 4280 clrl %d0 46a3e: 2068 0108 moveal %a0@(264),%a0 46a42: 2183 2c1e movel %d3,%a0@(0000001e,%d2:l:4) return RTEMS_SUCCESSFUL; 46a46: 602a bras 46a72 <== ALWAYS TAKEN } the_thread = _Thread_Get( id, &location ); 46a48: 486e fffc pea %fp@(-4) 46a4c: 2f00 movel %d0,%sp@- 46a4e: 4eb9 0004 855c jsr 4855c <_Thread_Get> switch ( location ) { 46a54: 508f addql #8,%sp 46a56: 4aae fffc tstl %fp@(-4) 46a5a: 6704 beqs 46a60 46a5c: 7004 moveq #4,%d0 46a5e: 6012 bras 46a72 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 46a60: 2240 moveal %d0,%a1 46a62: 2069 0108 moveal %a1@(264),%a0 46a66: 2183 2c1e movel %d3,%a0@(0000001e,%d2:l:4) _Thread_Enable_dispatch(); 46a6a: 4eb9 0004 8536 jsr 48536 <_Thread_Enable_dispatch> 46a70: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46a72: 242e fff4 movel %fp@(-12),%d2 46a76: 262e fff8 movel %fp@(-8),%d3 46a7a: 4e5e unlk %fp 46a7c: 4e75 rts ... 000494a4 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 494a4: 4e56 fffc linkw %fp,#-4 494a8: 2f0a movel %a2,%sp@- 494aa: 246e 0010 moveal %fp@(16),%a2 494ae: 2f02 movel %d2,%sp@- 494b0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 494b4: 6710 beqs 494c6 494b6: 4280 clrl %d0 494b8: 1039 0005 f9d2 moveb 5f9d2 ,%d0 494be: b082 cmpl %d2,%d0 494c0: 6404 bccs 494c6 494c2: 7013 moveq #19,%d0 494c4: 6054 bras 4951a <== ALWAYS TAKEN !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 494c6: 4a8a tstl %a2 494c8: 6604 bnes 494ce 494ca: 7009 moveq #9,%d0 494cc: 604c bras 4951a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494ce: 486e fffc pea %fp@(-4) 494d2: 2f2e 0008 movel %fp@(8),%sp@- 494d6: 4eb9 0004 b13c jsr 4b13c <_Thread_Get> switch ( location ) { 494dc: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494de: 2040 moveal %d0,%a0 switch ( location ) { 494e0: 4aae fffc tstl %fp@(-4) 494e4: 6704 beqs 494ea 494e6: 7004 moveq #4,%d0 494e8: 6030 bras 4951a <== ALWAYS TAKEN case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 494ea: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 494ee: 4a82 tstl %d2 494f0: 6720 beqs 49512 the_thread->real_priority = new_priority; 494f2: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 494f6: 4aa8 001c tstl %a0@(28) 494fa: 6706 beqs 49502 the_thread->current_priority > new_priority ) 494fc: b4a8 0014 cmpl %a0@(20),%d2 49500: 6410 bccs 49512 <== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 49502: 42a7 clrl %sp@- 49504: 2f02 movel %d2,%sp@- 49506: 2f08 movel %a0,%sp@- 49508: 4eb9 0004 abec jsr 4abec <_Thread_Change_priority> 4950e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 49512: 4eb9 0004 b0e6 jsr 4b0e6 <_Thread_Enable_dispatch> 49518: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4951a: 242e fff4 movel %fp@(-12),%d2 4951e: 246e fff8 moveal %fp@(-8),%a2 49522: 4e5e unlk %fp 49524: 4e75 rts ... 00045360 : rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 45360: 4e56 fffc linkw %fp,#-4 45364: 2f02 movel %d2,%sp@- 45366: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) 4536a: 6604 bnes 45370 4536c: 7009 moveq #9,%d0 4536e: 6044 bras 453b4 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 45370: 486e fffc pea %fp@(-4) 45374: 2f2e 0008 movel %fp@(8),%sp@- 45378: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 4537e: 508f addql #8,%sp 45380: 4aae fffc tstl %fp@(-4) 45384: 6704 beqs 4538a 45386: 7004 moveq #4,%d0 45388: 602a bras 453b4 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( _Thread_Start( 4538a: 2f2e 0010 movel %fp@(16),%sp@- 4538e: 42a7 clrl %sp@- 45390: 2f02 movel %d2,%sp@- 45392: 42a7 clrl %sp@- 45394: 2f00 movel %d0,%sp@- 45396: 4eb9 0004 7690 jsr 47690 <_Thread_Start> 4539c: 4fef 0014 lea %sp@(20),%sp 453a0: 41f9 0004 6c6e lea 46c6e <_Thread_Enable_dispatch>,%a0 453a6: 4a00 tstb %d0 453a8: 6706 beqs 453b0 the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); 453aa: 4e90 jsr %a0@ 453ac: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 453ae: 6004 bras 453b4 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 453b0: 4e90 jsr %a0@ 453b2: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 453b4: 242e fff8 movel %fp@(-8),%d2 453b8: 4e5e unlk %fp 453ba: 4e75 rts 000453bc : */ rtems_status_code rtems_task_suspend( rtems_id id ) { 453bc: 4e56 fffc linkw %fp,#-4 453c0: 2f0a movel %a2,%sp@- register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 453c2: 486e fffc pea %fp@(-4) 453c6: 2f2e 0008 movel %fp@(8),%sp@- 453ca: 4eb9 0004 6c94 jsr 46c94 <_Thread_Get> switch ( location ) { 453d0: 508f addql #8,%sp 453d2: 4aae fffc tstl %fp@(-4) 453d6: 6704 beqs 453dc 453d8: 7004 moveq #4,%d0 453da: 6024 bras 45400 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { 453dc: 7202 moveq #2,%d1 453de: 2040 moveal %d0,%a0 453e0: 45f9 0004 6c6e lea 46c6e <_Thread_Enable_dispatch>,%a2 453e6: c2a8 0010 andl %a0@(16),%d1 453ea: 6610 bnes 453fc _Thread_Suspend( the_thread ); 453ec: 2f00 movel %d0,%sp@- 453ee: 4eb9 0004 76e0 jsr 476e0 <_Thread_Suspend> _Thread_Enable_dispatch(); 453f4: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 453f6: 588f addql #4,%sp switch ( location ) { case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { _Thread_Suspend( the_thread ); _Thread_Enable_dispatch(); 453f8: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 453fa: 6004 bras 45400 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 453fc: 4e92 jsr %a2@ 453fe: 700f moveq #15,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45400: 246e fff8 moveal %fp@(-8),%a2 45404: 4e5e unlk %fp 45406: 4e75 rts 00062bc4 : rtems_status_code rtems_task_variable_add( rtems_id tid, void **ptr, void (*dtor)(void *) ) { 62bc4: 4e56 fff0 linkw %fp,#-16 62bc8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 62bcc: 246e 000c moveal %fp@(12),%a2 62bd0: 242e 0010 movel %fp@(16),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *new; if ( !ptr ) 62bd4: 4a8a tstl %a2 62bd6: 6604 bnes 62bdc 62bd8: 7009 moveq #9,%d0 62bda: 6070 bras 62c4c return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 62bdc: 486e fffc pea %fp@(-4) 62be0: 2f2e 0008 movel %fp@(8),%sp@- 62be4: 4eb9 0004 c2cc jsr 4c2cc <_Thread_Get> switch (location) { 62bea: 508f addql #8,%sp rtems_task_variable_t *tvp, *new; if ( !ptr ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 62bec: 2640 moveal %d0,%a3 switch (location) { 62bee: 4aae fffc tstl %fp@(-4) 62bf2: 6704 beqs 62bf8 62bf4: 7004 moveq #4,%d0 62bf6: 6054 bras 62c4c <== ALWAYS TAKEN case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; 62bf8: 206b 0118 moveal %a3@(280),%a0 while (tvp) { 62bfc: 6014 bras 62c12 <== ALWAYS TAKEN if (tvp->ptr == ptr) { 62bfe: b5e8 0004 cmpal %a0@(4),%a2 62c02: 660c bnes 62c10 tvp->dtor = dtor; 62c04: 2142 0010 movel %d2,%a0@(16) _Thread_Enable_dispatch(); 62c08: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 62c0e: 603a bras 62c4a <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 62c10: 2050 moveal %a0@,%a0 case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 62c12: 4a88 tstl %a0 62c14: 66e8 bnes 62bfe } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 62c16: 4878 0014 pea 14 62c1a: 4eb9 0004 d3f8 jsr 4d3f8 <_Workspace_Allocate> _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 62c20: 588f addql #4,%sp 62c22: 43f9 0004 c2a6 lea 4c2a6 <_Thread_Enable_dispatch>,%a1 } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 62c28: 2040 moveal %d0,%a0 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 62c2a: 4a80 tstl %d0 62c2c: 6606 bnes 62c34 _Thread_Enable_dispatch(); 62c2e: 4e91 jsr %a1@ 62c30: 701a moveq #26,%d0 return RTEMS_NO_MEMORY; 62c32: 6018 bras 62c4c <== ALWAYS TAKEN } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 62c34: 20ab 0118 movel %a3@(280),%a0@ _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 62c38: 2152 0008 movel %a2@,%a0@(8) new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; 62c3c: 2740 0118 movel %d0,%a3@(280) if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; new->ptr = ptr; 62c40: 214a 0004 movel %a2,%a0@(4) new->dtor = dtor; 62c44: 2142 0010 movel %d2,%a0@(16) new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; _Thread_Enable_dispatch(); 62c48: 4e91 jsr %a1@ 62c4a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 62c4c: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 62c52: 4e5e unlk %fp 62c54: 4e75 rts ... 00062c58 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 62c58: 4e56 fffc linkw %fp,#-4 62c5c: 2f02 movel %d2,%sp@- 62c5e: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 62c62: 675c beqs 62cc0 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 62c64: 486e fffc pea %fp@(-4) 62c68: 2f2e 0008 movel %fp@(8),%sp@- 62c6c: 4eb9 0004 c2cc jsr 4c2cc <_Thread_Get> switch (location) { 62c72: 508f addql #8,%sp 62c74: 4aae fffc tstl %fp@(-4) 62c78: 6704 beqs 62c7e 62c7a: 7004 moveq #4,%d0 62c7c: 6044 bras 62cc2 <== ALWAYS TAKEN case OBJECTS_LOCAL: tvp = the_thread->task_variables; 62c7e: 2240 moveal %d0,%a1 62c80: 2069 0118 moveal %a1@(280),%a0 62c84: 93c9 subal %a1,%a1 while (tvp) { 62c86: 602e bras 62cb6 <== ALWAYS TAKEN if (tvp->ptr == ptr) { 62c88: b4a8 0004 cmpl %a0@(4),%d2 62c8c: 6624 bnes 62cb2 if (prev) 62c8e: 4a89 tstl %a1 62c90: 6704 beqs 62c96 prev->next = tvp->next; 62c92: 2290 movel %a0@,%a1@ 62c94: 6006 bras 62c9c <== ALWAYS TAKEN else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 62c96: 2240 moveal %d0,%a1 62c98: 2350 0118 movel %a0@,%a1@(280) _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 62c9c: 2f08 movel %a0,%sp@- 62c9e: 2f00 movel %d0,%sp@- 62ca0: 4eb9 0006 2d34 jsr 62d34 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 62ca6: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 62cac: 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(); 62cae: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 62cb0: 6010 bras 62cc2 <== ALWAYS TAKEN } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 62cb2: 2248 moveal %a0,%a1 62cb4: 2050 moveal %a0@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 62cb6: 4a88 tstl %a0 62cb8: 66ce bnes 62c88 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 62cba: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 62cc0: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 62cc2: 242e fff8 movel %fp@(-8),%d2 62cc6: 4e5e unlk %fp 62cc8: 4e75 rts ... 00062ccc : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 62ccc: 4e56 fffc linkw %fp,#-4 62cd0: 2f0a movel %a2,%sp@- 62cd2: 246e 0010 moveal %fp@(16),%a2 62cd6: 2f02 movel %d2,%sp@- 62cd8: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 62cdc: 6746 beqs 62d24 return RTEMS_INVALID_ADDRESS; if ( !result ) 62cde: 4a8a tstl %a2 62ce0: 6742 beqs 62d24 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 62ce2: 486e fffc pea %fp@(-4) 62ce6: 2f2e 0008 movel %fp@(8),%sp@- 62cea: 4eb9 0004 c2cc jsr 4c2cc <_Thread_Get> switch (location) { 62cf0: 508f addql #8,%sp 62cf2: 4aae fffc tstl %fp@(-4) 62cf6: 6704 beqs 62cfc 62cf8: 7004 moveq #4,%d0 62cfa: 602a bras 62d26 <== ALWAYS TAKEN case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 62cfc: 2240 moveal %d0,%a1 62cfe: 2069 0118 moveal %a1@(280),%a0 while (tvp) { 62d02: 6016 bras 62d1a <== ALWAYS TAKEN if (tvp->ptr == ptr) { 62d04: b4a8 0004 cmpl %a0@(4),%d2 62d08: 660e bnes 62d18 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 62d0a: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 62d0e: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> 62d14: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 62d16: 600e bras 62d26 <== ALWAYS TAKEN } tvp = (rtems_task_variable_t *)tvp->next; 62d18: 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) { 62d1a: 4a88 tstl %a0 62d1c: 66e6 bnes 62d04 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 62d1e: 4eb9 0004 c2a6 jsr 4c2a6 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 62d24: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 62d26: 242e fff4 movel %fp@(-12),%d2 62d2a: 246e fff8 moveal %fp@(-8),%a2 62d2e: 4e5e unlk %fp 62d30: 4e75 rts ... 00045408 : */ rtems_status_code rtems_task_wake_after( rtems_interval ticks ) { 45408: 4e56 0000 linkw %fp,#0 4540c: 2039 0005 ba34 movel 5ba34 <_Thread_Dispatch_disable_level>,%d0 45412: 5280 addql #1,%d0 45414: 2f02 movel %d2,%sp@- 45416: 242e 0008 movel %fp@(8),%d2 4541a: 23c0 0005 ba34 movel %d0,5ba34 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( ticks == 0 ) { 45420: 4a82 tstl %d2 45422: 6608 bnes 4542c _Thread_Yield_processor(); 45424: 4eb9 0004 780c jsr 4780c <_Thread_Yield_processor> 4542a: 6048 bras 45474 <== ALWAYS TAKEN } else { _Thread_Set_state( _Thread_Executing, STATES_DELAYING ); 4542c: 4878 0008 pea 8 45430: 2f39 0005 baee movel 5baee <_Thread_Executing>,%sp@- 45436: 4eb9 0004 7464 jsr 47464 <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 4543c: 2079 0005 baee moveal 5baee <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45442: 203c 0004 6ae0 movel #289504,%d0 45448: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); if ( ticks == 0 ) { _Thread_Yield_processor(); } else { _Thread_Set_state( _Thread_Executing, STATES_DELAYING ); _Watchdog_Initialize( 4544c: 2028 0008 movel %a0@(8),%d0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45450: 2142 0054 movel %d2,%a0@(84) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 45454: 2140 0068 movel %d0,%a0@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45458: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4545c: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45460: 4868 0048 pea %a0@(72) 45464: 4879 0005 bb0c pea 5bb0c <_Watchdog_Ticks_chain> 4546a: 4eb9 0004 7b78 jsr 47b78 <_Watchdog_Insert> 45470: 4fef 0010 lea %sp@(16),%sp _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); } _Thread_Enable_dispatch(); 45474: 4eb9 0004 6c6e jsr 46c6e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 4547a: 242e fffc movel %fp@(-4),%d2 4547e: 4280 clrl %d0 45480: 4e5e unlk %fp 45482: 4e75 rts 00045f9c : */ rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 45f9c: 4e56 0000 linkw %fp,#0 45fa0: 2f0a movel %a2,%sp@- 45fa2: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) 45fa6: 4a39 0005 cf90 tstb 5cf90 <_TOD_Is_set> 45fac: 6606 bnes 45fb4 45fae: 700b moveq #11,%d0 45fb0: 6000 009a braw 4604c <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !time_buffer ) 45fb4: 4a8a tstl %a2 45fb6: 6606 bnes 45fbe 45fb8: 7009 moveq #9,%d0 45fba: 6000 0090 braw 4604c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 45fbe: 42aa 0018 clrl %a2@(24) if ( !_TOD_Validate( time_buffer ) ) 45fc2: 2f0a movel %a2,%sp@- 45fc4: 4eb9 0004 5458 jsr 45458 <_TOD_Validate> 45fca: 588f addql #4,%sp 45fcc: 4a00 tstb %d0 45fce: 677a beqs 4604a return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 45fd0: 2f0a movel %a2,%sp@- 45fd2: 4eb9 0004 53b8 jsr 453b8 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 45fd8: 588f addql #4,%sp time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 45fda: 2440 moveal %d0,%a2 if ( seconds <= _TOD_Seconds_since_epoch() ) 45fdc: b0b9 0005 d00e cmpl 5d00e <_TOD_Now>,%d0 45fe2: 6366 blss 4604a 45fe4: 2039 0005 cf7c movel 5cf7c <_Thread_Dispatch_disable_level>,%d0 45fea: 5280 addql #1,%d0 45fec: 23c0 0005 cf7c movel %d0,5cf7c <_Thread_Dispatch_disable_level> return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 45ff2: 4878 0010 pea 10 45ff6: 2f39 0005 d036 movel 5d036 <_Thread_Executing>,%sp@- 45ffc: 4eb9 0004 8098 jsr 48098 <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 46002: 2079 0005 d036 moveal 5d036 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46008: 203c 0004 7714 movel #292628,%d0 4600e: 2140 0064 movel %d0,%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( 46012: 2028 0008 movel %a0@(8),%d0 the_watchdog->id = id; 46016: 2140 0068 movel %d0,%a0@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4601a: 95f9 0005 d00e subal 5d00e <_TOD_Now>,%a2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46020: 42a8 0050 clrl %a0@(80) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46024: 214a 0054 movel %a2,%a0@(84) ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 46028: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4602c: 4868 0048 pea %a0@(72) 46030: 4879 0005 d048 pea 5d048 <_Watchdog_Seconds_chain> 46036: 4eb9 0004 882c jsr 4882c <_Watchdog_Insert> ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4603c: 4eb9 0004 78a2 jsr 478a2 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46042: 4fef 0010 lea %sp@(16),%sp ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 46046: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 46048: 6002 bras 4604c <== ALWAYS TAKEN 4604a: 7014 moveq #20,%d0 } 4604c: 246e fffc moveal %fp@(-4),%a2 46050: 4e5e unlk %fp 46052: 4e75 rts 00050740 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 50740: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50744: 486e fffc pea %fp@(-4) 50748: 2f2e 0008 movel %fp@(8),%sp@- 5074c: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50752: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50758: 4fef 000c lea %sp@(12),%sp 5075c: 4aae fffc tstl %fp@(-4) 50760: 6704 beqs 50766 50762: 7004 moveq #4,%d0 50764: 601e bras 50784 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 50766: 7204 moveq #4,%d1 50768: 2040 moveal %d0,%a0 5076a: b2a8 0038 cmpl %a0@(56),%d1 5076e: 670c beqs 5077c <== ALWAYS TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 50770: 4868 0010 pea %a0@(16) 50774: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> 5077a: 588f addql #4,%sp _Thread_Enable_dispatch(); 5077c: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 50782: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50784: 4e5e unlk %fp 50786: 4e75 rts 00050810 : */ rtems_status_code rtems_timer_delete( rtems_id id ) { 50810: 4e56 fffc linkw %fp,#-4 50814: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50816: 486e fffc pea %fp@(-4) 5081a: 2f2e 0008 movel %fp@(8),%sp@- 5081e: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50824: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5082a: 4fef 000c lea %sp@(12),%sp 5082e: 2440 moveal %d0,%a2 50830: 4aae fffc tstl %fp@(-4) 50834: 6704 beqs 5083a 50836: 7004 moveq #4,%d0 50838: 6032 bras 5086c <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); 5083a: 2f00 movel %d0,%sp@- 5083c: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50842: 4eb9 0005 2b0c jsr 52b0c <_Objects_Close> (void) _Watchdog_Remove( &the_timer->Ticker ); 50848: 486a 0010 pea %a2@(16) 5084c: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> */ RTEMS_INLINE_ROUTINE void _Timer_Free ( Timer_Control *the_timer ) { _Objects_Free( &_Timer_Information, &the_timer->Object ); 50852: 2f0a movel %a2,%sp@- 50854: 4879 0007 3b02 pea 73b02 <_Timer_Information> 5085a: 4eb9 0005 2d80 jsr 52d80 <_Objects_Free> _Timer_Free( the_timer ); _Thread_Enable_dispatch(); 50860: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50866: 4fef 0014 lea %sp@(20),%sp case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); (void) _Watchdog_Remove( &the_timer->Ticker ); _Timer_Free( the_timer ); _Thread_Enable_dispatch(); 5086a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5086c: 246e fff8 moveal %fp@(-8),%a2 50870: 4e5e unlk %fp 50872: 4e75 rts 00050874 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 50874: 4e56 ffe4 linkw %fp,#-28 50878: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 5087c: 282e 0008 movel %fp@(8),%d4 50880: 262e 000c movel %fp@(12),%d3 50884: 2a2e 0010 movel %fp@(16),%d5 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 50888: 4a83 tstl %d3 5088a: 6606 bnes 50892 5088c: 700a moveq #10,%d0 5088e: 6000 008e braw 5091e <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( !routine ) 50892: 4a85 tstl %d5 50894: 6606 bnes 5089c 50896: 7009 moveq #9,%d0 50898: 6000 0084 braw 5091e <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 5089c: 486e fffc pea %fp@(-4) 508a0: 2f04 movel %d4,%sp@- 508a2: 4879 0007 3b02 pea 73b02 <_Timer_Information> 508a8: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 508ae: 4fef 000c lea %sp@(12),%sp 508b2: 2440 moveal %d0,%a2 508b4: 4aae fffc tstl %fp@(-4) 508b8: 6704 beqs 508be 508ba: 7004 moveq #4,%d0 508bc: 6060 bras 5091e <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 508be: 2400 movel %d0,%d2 508c0: 0682 0000 0010 addil #16,%d2 508c6: 2f02 movel %d2,%sp@- 508c8: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> _ISR_Disable( level ); 508ce: 203c 0000 0700 movel #1792,%d0 508d4: 40c1 movew %sr,%d1 508d6: 8081 orl %d1,%d0 508d8: 46c0 movew %d0,%sr 508da: 47f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a3 /* * 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 ) { 508e0: 588f addql #4,%sp 508e2: 4aaa 0018 tstl %a2@(24) 508e6: 6706 beqs 508ee _ISR_Enable( level ); 508e8: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 508ea: 4e93 jsr %a3@ 508ec: 602e bras 5091c <== ALWAYS TAKEN Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 508ee: 2545 002c movel %d5,%a2@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 508f2: 256e 0014 0034 movel %fp@(20),%a2@(52) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 508f8: 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; 508fc: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50900: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); 50904: 46c1 movew %d1,%sr Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 50906: 2543 001c movel %d3,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 5090a: 2f02 movel %d2,%sp@- 5090c: 4879 0007 39b8 pea 739b8 <_Watchdog_Ticks_chain> 50912: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 50918: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 5091a: 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(); 5091c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5091e: 4cee 0c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a3 50924: 4e5e unlk %fp 50926: 4e75 rts 00050928 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 50928: 4e56 ffe8 linkw %fp,#-24 5092c: 48d7 043c moveml %d2-%d5/%a2,%sp@ 50930: 2a2e 0008 movel %fp@(8),%d5 50934: 242e 000c movel %fp@(12),%d2 50938: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; if ( !_TOD_Is_set ) 5093c: 4a39 0007 38f4 tstb 738f4 <_TOD_Is_set> 50942: 6606 bnes 5094a 50944: 700b moveq #11,%d0 50946: 6000 00a2 braw 509ea <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !_TOD_Validate( wall_time ) ) 5094a: 2f02 movel %d2,%sp@- 5094c: 4eb9 0004 e040 jsr 4e040 <_TOD_Validate> 50952: 588f addql #4,%sp 50954: 4a00 tstb %d0 50956: 6700 0090 beqw 509e8 return RTEMS_INVALID_CLOCK; if ( !routine ) 5095a: 4a83 tstl %d3 5095c: 6606 bnes 50964 5095e: 7009 moveq #9,%d0 50960: 6000 0088 braw 509ea <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; seconds = _TOD_To_seconds( wall_time ); 50964: 2f02 movel %d2,%sp@- 50966: 4eb9 0004 dfa0 jsr 4dfa0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5096c: 588f addql #4,%sp return RTEMS_INVALID_CLOCK; if ( !routine ) return RTEMS_INVALID_ADDRESS; seconds = _TOD_To_seconds( wall_time ); 5096e: 2800 movel %d0,%d4 if ( seconds <= _TOD_Seconds_since_epoch() ) 50970: b0b9 0007 3972 cmpl 73972 <_TOD_Now>,%d0 50976: 6370 blss 509e8 50978: 486e fffc pea %fp@(-4) 5097c: 2f05 movel %d5,%sp@- 5097e: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50984: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5098a: 4fef 000c lea %sp@(12),%sp 5098e: 2440 moveal %d0,%a2 50990: 4aae fffc tstl %fp@(-4) 50994: 6704 beqs 5099a 50996: 7004 moveq #4,%d0 50998: 6050 bras 509ea <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 5099a: 2400 movel %d0,%d2 5099c: 0682 0000 0010 addil #16,%d2 509a2: 2f02 movel %d2,%sp@- 509a4: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 509aa: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY; 509b0: 7002 moveq #2,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 509b2: 2545 0030 movel %d5,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 509b6: 98b9 0007 3972 subl 73972 <_TOD_Now>,%d4 509bc: 2540 0038 movel %d0,%a2@(56) 509c0: 2544 001c movel %d4,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 509c4: 2543 002c movel %d3,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 509c8: 42aa 0018 clrl %a2@(24) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 509cc: 2f02 movel %d2,%sp@- 509ce: 4879 0007 39ac pea 739ac <_Watchdog_Seconds_chain> 509d4: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _Watchdog_Insert_seconds( &the_timer->Ticker, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 509da: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 509e0: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _Watchdog_Insert_seconds( &the_timer->Ticker, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 509e4: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 509e6: 6002 bras 509ea <== ALWAYS TAKEN 509e8: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 509ea: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 509f0: 4e5e unlk %fp 509f2: 4e75 rts 000509f4 : rtems_status_code rtems_timer_get_information( rtems_id id, rtems_timer_information *the_info ) { 509f4: 4e56 fffc linkw %fp,#-4 509f8: 2f0a movel %a2,%sp@- 509fa: 246e 000c moveal %fp@(12),%a2 Timer_Control *the_timer; Objects_Locations location; if ( !the_info ) 509fe: 4a8a tstl %a2 50a00: 6604 bnes 50a06 50a02: 7009 moveq #9,%d0 50a04: 6042 bras 50a48 <== ALWAYS TAKEN 50a06: 486e fffc pea %fp@(-4) 50a0a: 2f2e 0008 movel %fp@(8),%sp@- 50a0e: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50a14: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50a1a: 4fef 000c lea %sp@(12),%sp 50a1e: 2040 moveal %d0,%a0 50a20: 4aae fffc tstl %fp@(-4) 50a24: 6704 beqs 50a2a 50a26: 7004 moveq #4,%d0 50a28: 601e bras 50a48 <== ALWAYS TAKEN case OBJECTS_LOCAL: the_info->the_class = the_timer->the_class; 50a2a: 24a8 0038 movel %a0@(56),%a2@ the_info->initial = the_timer->Ticker.initial; 50a2e: 2568 001c 0004 movel %a0@(28),%a2@(4) the_info->start_time = the_timer->Ticker.start_time; 50a34: 2568 0024 0008 movel %a0@(36),%a2@(8) the_info->stop_time = the_timer->Ticker.stop_time; 50a3a: 2568 0028 000c movel %a0@(40),%a2@(12) _Thread_Enable_dispatch(); 50a40: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> 50a46: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50a48: 246e fff8 moveal %fp@(-8),%a2 50a4c: 4e5e unlk %fp 50a4e: 4e75 rts 00050c94 : rtems_status_code rtems_timer_initiate_server( uint32_t priority, uint32_t stack_size, rtems_attribute attribute_set ) { 50c94: 4e56 fffc linkw %fp,#-4 50c98: 202e 0008 movel %fp@(8),%d0 50c9c: 2f03 movel %d3,%sp@- 50c9e: 2f02 movel %d2,%sp@- */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 50ca0: 4a80 tstl %d0 50ca2: 671e beqs 50cc2 50ca4: 4281 clrl %d1 50ca6: 1239 0006 de02 moveb 6de02 ,%d1 50cac: b280 cmpl %d0,%d1 50cae: 54c1 scc %d1 50cb0: 49c1 extbl %d1 50cb2: 4481 negl %d1 * Make sure the requested priority is valid. The if is * 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 ) ) { 50cb4: 4a01 tstb %d1 50cb6: 6704 beqs 50cbc 50cb8: 2400 movel %d0,%d2 50cba: 600e bras 50cca <== ALWAYS TAKEN if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) 50cbc: 72ff moveq #-1,%d1 50cbe: b280 cmpl %d0,%d1 50cc0: 6706 beqs 50cc8 50cc2: 7013 moveq #19,%d0 50cc4: 6000 0146 braw 50e0c <== ALWAYS TAKEN 50cc8: 4282 clrl %d2 50cca: 2039 0007 38e0 movel 738e0 <_Thread_Dispatch_disable_level>,%d0 50cd0: 5280 addql #1,%d0 50cd2: 23c0 0007 38e0 movel %d0,738e0 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 50cd8: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 50cda: 1639 0006 ed38 moveb 6ed38 ,%d3 initialized = true; 50ce0: 13c0 0006 ed38 moveb %d0,6ed38 _Thread_Enable_dispatch(); 50ce6: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> if ( tmpInitialized ) 50cec: 4a03 tstb %d3 50cee: 6706 beqs 50cf6 50cf0: 700e moveq #14,%d0 50cf2: 6000 0118 braw 50e0c * 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( 50cf6: 222e 0010 movel %fp@(16),%d1 50cfa: 486e fffc pea %fp@(-4) 50cfe: 08c1 000f bset #15,%d1 50d02: 2f01 movel %d1,%sp@- 50d04: 4878 0100 pea 100 50d08: 2f2e 000c movel %fp@(12),%sp@- 50d0c: 2f02 movel %d2,%sp@- 50d0e: 2f3c 5449 4d45 movel #1414090053,%sp@- 50d14: 4eb9 0004 ff5c jsr 4ff5c /* 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) { 50d1a: 4fef 0018 lea %sp@(24),%sp 50d1e: 4a80 tstl %d0 50d20: 670c beqs 50d2e initialized = false; 50d22: 4201 clrb %d1 50d24: 13c1 0006 ed38 moveb %d1,6ed38 return status; 50d2a: 6000 00e0 braw 50e0c <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50d2e: 41f9 0006 ed6e lea 6ed6e <_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( 50d34: 4282 clrl %d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 50d36: 223c 0006 ed6a movel #453994,%d1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50d3c: 23c8 0006 ed6a movel %a0,6ed6a <_Timer_server_Default+0x30> &_RTEMS_tasks_Information, _Objects_Get_index(id) 50d42: 202e fffc movel %fp@(-4),%d0 50d46: 41f9 0006 eda6 lea 6eda6 <_Timer_server_Default+0x6c>,%a0 50d4c: 23c8 0006 eda2 movel %a0,6eda2 <_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( 50d52: 2079 0007 386c moveal 7386c <_RTEMS_tasks_Information+0x18>,%a0 50d58: 3400 movew %d0,%d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 50d5a: 23c1 0006 ed72 movel %d1,6ed72 <_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; 50d60: 2239 0007 3a20 movel 73a20 <_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( 50d66: 41f0 2c00 lea %a0@(00000000,%d2:l:4),%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; 50d6a: 23c1 0006 ed76 movel %d1,6ed76 <_Timer_server_Default+0x3c> /* * 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( 50d70: 23d0 0006 ed3a movel %a0@,6ed3a <_Timer_server_Default> 50d76: 41f9 0006 eda2 lea 6eda2 <_Timer_server_Default+0x68>,%a0 _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 50d7c: 4879 0006 ed3a pea 6ed3a <_Timer_server_Default> 50d82: 487a 0158 pea %pc@(50edc <_Timer_server_Body>) /* * 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; 50d86: 223c 0005 10a4 movel #331940,%d1 50d8c: 23c8 0006 edaa movel %a0,6edaa <_Timer_server_Default+0x70> the_watchdog->routine = routine; 50d92: 41f9 0005 35dc lea 535dc <_Thread_Delay_ended>,%a0 50d98: 23c8 0006 ed5e movel %a0,6ed5e <_Timer_server_Default+0x24> 50d9e: 23c8 0006 ed96 movel %a0,6ed96 <_Timer_server_Default+0x5c> ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 50da4: 41f9 0007 3972 lea 73972 <_TOD_Now>,%a0 50daa: 23d0 0006 edae movel %a0@,6edae <_Timer_server_Default+0x74> ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 50db0: 41f9 0006 ed3a lea 6ed3a <_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; 50db6: 23c1 0006 ed3e movel %d1,6ed3e <_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; 50dbc: 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; 50dbe: 42b9 0006 edb2 clrl 6edb2 <_Timer_server_Default+0x78> ts->active = false; 50dc4: 13c1 0006 edb6 moveb %d1,6edb6 <_Timer_server_Default+0x7c> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 50dca: 2f00 movel %d0,%sp@- ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 50dcc: 23c8 0007 3b3a movel %a0,73b3a <_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; 50dd2: 42b9 0006 ed6e clrl 6ed6e <_Timer_server_Default+0x34> 50dd8: 42b9 0006 eda6 clrl 6eda6 <_Timer_server_Default+0x6c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50dde: 42b9 0006 ed4a clrl 6ed4a <_Timer_server_Default+0x10> the_watchdog->routine = routine; the_watchdog->id = id; 50de4: 23c0 0006 ed62 movel %d0,6ed62 <_Timer_server_Default+0x28> the_watchdog->user_data = user_data; 50dea: 42b9 0006 ed66 clrl 6ed66 <_Timer_server_Default+0x2c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50df0: 42b9 0006 ed82 clrl 6ed82 <_Timer_server_Default+0x48> the_watchdog->routine = routine; the_watchdog->id = id; 50df6: 23c0 0006 ed9a movel %d0,6ed9a <_Timer_server_Default+0x60> the_watchdog->user_data = user_data; 50dfc: 42b9 0006 ed9e clrl 6ed9e <_Timer_server_Default+0x64> /* * Start the timer server */ status = rtems_task_start( 50e02: 4eb9 0005 0564 jsr 50564 if (status) { initialized = false; } #endif return status; 50e08: 4fef 000c lea %sp@(12),%sp } 50e0c: 242e fff4 movel %fp@(-12),%d2 50e10: 262e fff8 movel %fp@(-8),%d3 50e14: 4e5e unlk %fp 50e16: 4e75 rts 00050a7c : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 50a7c: 4e56 fff0 linkw %fp,#-16 50a80: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 50a84: 486e fffc pea %fp@(-4) 50a88: 2f2e 0008 movel %fp@(8),%sp@- 50a8c: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50a92: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50a98: 4fef 000c lea %sp@(12),%sp 50a9c: 2440 moveal %d0,%a2 50a9e: 4aae fffc tstl %fp@(-4) 50aa2: 6704 beqs 50aa8 50aa4: 7404 moveq #4,%d2 50aa6: 6054 bras 50afc <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 50aa8: 202a 0038 movel %a2@(56),%d0 50aac: 661e bnes 50acc _Watchdog_Remove( &the_timer->Ticker ); 50aae: 45ea 0010 lea %a2@(16),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 50ab2: 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 ); 50ab4: 2f0a movel %a2,%sp@- 50ab6: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 50abc: 2f0a movel %a2,%sp@- 50abe: 4879 0007 39b8 pea 739b8 <_Watchdog_Ticks_chain> 50ac4: 4eb9 0005 498c jsr 5498c <_Watchdog_Insert> 50aca: 6026 bras 50af2 <== ALWAYS TAKEN } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 50acc: 7201 moveq #1,%d1 50ace: b280 cmpl %d0,%d1 50ad0: 6704 beqs 50ad6 50ad2: 740b moveq #11,%d2 50ad4: 6020 bras 50af6 <== ALWAYS TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 50ad6: 486a 0010 pea %a2@(16) (*timer_server->schedule_operation)( timer_server, the_timer ); 50ada: 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; 50adc: 2679 0007 3b3a moveal 73b3a <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 50ae2: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 50ae8: 2f0a movel %a2,%sp@- 50aea: 2f0b movel %a3,%sp@- 50aec: 206b 0004 moveal %a3@(4),%a0 50af0: 4e90 jsr %a0@ 50af2: 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(); 50af6: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50afc: 2002 movel %d2,%d0 50afe: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 50b04: 4e5e unlk %fp 50b06: 4e75 rts 00050b08 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 50b08: 4e56 ffe4 linkw %fp,#-28 50b0c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 50b10: 262e 0008 movel %fp@(8),%d3 50b14: 242e 000c movel %fp@(12),%d2 50b18: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; 50b1c: 2679 0007 3b3a moveal 73b3a <_Timer_server>,%a3 if ( !timer_server ) 50b22: 4a8b tstl %a3 50b24: 6606 bnes 50b2c 50b26: 700e moveq #14,%d0 50b28: 6000 008e braw 50bb8 <== ALWAYS TAKEN return RTEMS_INCORRECT_STATE; if ( !routine ) 50b2c: 4a84 tstl %d4 50b2e: 6606 bnes 50b36 50b30: 7009 moveq #9,%d0 50b32: 6000 0084 braw 50bb8 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( ticks == 0 ) 50b36: 4a82 tstl %d2 50b38: 6604 bnes 50b3e 50b3a: 700a moveq #10,%d0 50b3c: 607a bras 50bb8 <== ALWAYS TAKEN 50b3e: 486e fffc pea %fp@(-4) 50b42: 2f03 movel %d3,%sp@- 50b44: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50b4a: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_NUMBER; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50b50: 4fef 000c lea %sp@(12),%sp 50b54: 2440 moveal %d0,%a2 50b56: 4aae fffc tstl %fp@(-4) 50b5a: 6704 beqs 50b60 50b5c: 7004 moveq #4,%d0 50b5e: 6058 bras 50bb8 <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 50b60: 486a 0010 pea %a2@(16) 50b64: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> _ISR_Disable( level ); 50b6a: 203c 0000 0700 movel #1792,%d0 50b70: 40c1 movew %sr,%d1 50b72: 8081 orl %d1,%d0 50b74: 46c0 movew %d0,%sr 50b76: 49f9 0005 376a lea 5376a <_Thread_Enable_dispatch>,%a4 /* * 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 ) { 50b7c: 588f addql #4,%sp 50b7e: 4aaa 0018 tstl %a2@(24) 50b82: 6706 beqs 50b8a _ISR_Enable( level ); 50b84: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 50b86: 4e94 jsr %a4@ 50b88: 602c bras 50bb6 <== ALWAYS TAKEN /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL_ON_TASK; 50b8a: 7001 moveq #1,%d0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 50b8c: 256e 0014 0034 movel %fp@(20),%a2@(52) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 50b92: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 50b96: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; 50b9a: 2542 001c movel %d2,%a2@(28) /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL_ON_TASK; 50b9e: 2540 0038 movel %d0,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50ba2: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; _ISR_Enable( level ); 50ba6: 46c1 movew %d1,%sr (*timer_server->schedule_operation)( timer_server, the_timer ); 50ba8: 2f0a movel %a2,%sp@- 50baa: 2f0b movel %a3,%sp@- 50bac: 206b 0004 moveal %a3@(4),%a0 50bb0: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 50bb2: 4e94 jsr %a4@ return RTEMS_SUCCESSFUL; 50bb4: 508f addql #8,%sp the_timer->Ticker.initial = ticks; _ISR_Enable( level ); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 50bb6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50bb8: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 50bbe: 4e5e unlk %fp 50bc0: 4e75 rts ... 00050bc4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 50bc4: 4e56 ffe8 linkw %fp,#-24 50bc8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 50bcc: 282e 0008 movel %fp@(8),%d4 50bd0: 262e 000c movel %fp@(12),%d3 50bd4: 242e 0010 movel %fp@(16),%d2 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 50bd8: 2679 0007 3b3a moveal 73b3a <_Timer_server>,%a3 if ( !timer_server ) 50bde: 4a8b tstl %a3 50be0: 6606 bnes 50be8 50be2: 700e moveq #14,%d0 50be4: 6000 00a4 braw 50c8a return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 50be8: 4a39 0007 38f4 tstb 738f4 <_TOD_Is_set> 50bee: 6606 bnes 50bf6 <== NEVER TAKEN 50bf0: 700b moveq #11,%d0 <== NOT EXECUTED 50bf2: 6000 0096 braw 50c8a <== NOT EXECUTED return RTEMS_NOT_DEFINED; if ( !routine ) 50bf6: 4a82 tstl %d2 50bf8: 6606 bnes 50c00 50bfa: 7009 moveq #9,%d0 50bfc: 6000 008c braw 50c8a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 50c00: 2f03 movel %d3,%sp@- 50c02: 4eb9 0004 e040 jsr 4e040 <_TOD_Validate> 50c08: 588f addql #4,%sp 50c0a: 4a00 tstb %d0 50c0c: 677a beqs 50c88 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 50c0e: 2f03 movel %d3,%sp@- 50c10: 4eb9 0004 dfa0 jsr 4dfa0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 50c16: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 50c18: 2600 movel %d0,%d3 if ( seconds <= _TOD_Seconds_since_epoch() ) 50c1a: b0b9 0007 3972 cmpl 73972 <_TOD_Now>,%d0 50c20: 6366 blss 50c88 50c22: 486e fffc pea %fp@(-4) 50c26: 2f04 movel %d4,%sp@- 50c28: 4879 0007 3b02 pea 73b02 <_Timer_Information> 50c2e: 4eb9 0005 2f10 jsr 52f10 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50c34: 4fef 000c lea %sp@(12),%sp 50c38: 2440 moveal %d0,%a2 50c3a: 4aae fffc tstl %fp@(-4) 50c3e: 6704 beqs 50c44 50c40: 7004 moveq #4,%d0 50c42: 6046 bras 50c8a <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 50c44: 486a 0010 pea %a2@(16) 50c48: 4eb9 0005 4aa8 jsr 54aa8 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 50c4e: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 50c54: 7003 moveq #3,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 50c56: 2544 0030 movel %d4,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 50c5a: 96b9 0007 3972 subl 73972 <_TOD_Now>,%d3 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; 50c60: 2540 0038 movel %d0,%a2@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 50c64: 2543 001c movel %d3,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 50c68: 2542 002c movel %d2,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50c6c: 42aa 0018 clrl %a2@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 50c70: 2f0a movel %a2,%sp@- 50c72: 2f0b movel %a3,%sp@- 50c74: 206b 0004 moveal %a3@(4),%a0 50c78: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 50c7a: 4eb9 0005 376a jsr 5376a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50c80: 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(); 50c84: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 50c86: 6002 bras 50c8a <== ALWAYS TAKEN 50c88: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50c8a: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 50c90: 4e5e unlk %fp 50c92: 4e75 rts 000456ac : */ bool rtems_workspace_allocate( uintptr_t bytes, void **pointer ) { 456ac: 4e56 0000 linkw %fp,#0 456b0: 202e 0008 movel %fp@(8),%d0 456b4: 2f0a movel %a2,%sp@- 456b6: 246e 000c moveal %fp@(12),%a2 void *ptr; /* * check the arguments */ if ( !pointer ) 456ba: 4a8a tstl %a2 456bc: 6724 beqs 456e2 return false; if ( !bytes ) 456be: 4a80 tstl %d0 456c0: 6720 beqs 456e2 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 456c2: 42a7 clrl %sp@- 456c4: 42a7 clrl %sp@- 456c6: 2f00 movel %d0,%sp@- 456c8: 4879 0005 bda6 pea 5bda6 <_Workspace_Area> 456ce: 4eb9 0004 692c jsr 4692c <_Protected_heap_Allocate_aligned_with_boundary> /* * Allocate the memory */ ptr = _Protected_heap_Allocate( &_Workspace_Area, (intptr_t) bytes ); if (!ptr) 456d4: 4fef 0010 lea %sp@(16),%sp 456d8: 4a80 tstl %d0 456da: 6706 beqs 456e2 return false; *pointer = ptr; 456dc: 2480 movel %d0,%a2@ 456de: 7001 moveq #1,%d0 return true; 456e0: 6002 bras 456e4 <== ALWAYS TAKEN 456e2: 4200 clrb %d0 } 456e4: 246e fffc moveal %fp@(-4),%a2 456e8: 4e5e unlk %fp 456ea: 4e75 rts